On Sun, 14 Jun 2020 at 22:47, Paul Gofman pgofman@codeweavers.com wrote:
+static inline unsigned int wined3d_texture_get_map_binding(const struct wined3d_texture *texture,
unsigned int sub_resource_idx)
+{
- return texture->resource.map_binding == WINED3D_LOCATION_USER_MEMORY ?
(texture->sub_resources[sub_resource_idx].user_memory ? WINED3D_LOCATION_USER_MEMORY
: WINED3D_LOCATION_SYSMEM) : texture->resource.map_binding;
+}
I don't particularly like this. Perhaps in the end it can't be avoided, but superficially it seems like it may be nicer to just merge WINED3D_LOCATION_USER_MEMORY into WINED3D_LOCATION_SYSMEM instead, and then check sub_resource->user_memory in wined3d_texture_get_memory() instead.