On Tue, 16 Jun 2020 at 18:09, Paul Gofman <pgofman(a)codeweavers.com> wrote:
+ if (update_memory_only) + { + for (i = 0; i < sub_resource_count; ++i) + if (!texture->sub_resources[i].user_memory) + break; + + if (i == sub_resource_count) + wined3d_resource_free_sysmem(&texture->resource); + } + else + { + wined3d_resource_free_sysmem(&texture->resource); + }
if (!update_memory_only) { - sub_resource = &texture->sub_resources[0]; + sub_resource = &texture->sub_resources[sub_resource_idx];
It's fairly minor, but these blocks could be merged, right? On the other hand, it also seems tempting to simplify the code by simply always using the "update_memory_only" path here.