From 1632b8e7a419ebf256c4a356a58d505ef918f2fe Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 23 Feb 2022 20:21:40 -0600 Subject: [PATCH] wined3d: Use WINED3D_LOCATION_CLEARED for the initial location of textures. Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/texture.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 00146cf32d1..13c26692f77 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -3918,16 +3918,6 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc if (wined3d_texture_use_pbo(texture, d3d_info)) texture->resource.map_binding = WINED3D_LOCATION_BUFFER; - if (desc->resource_type != WINED3D_RTYPE_TEXTURE_3D - || !wined3d_texture_use_pbo(texture, d3d_info)) - { - if (!wined3d_resource_prepare_sysmem(&texture->resource)) - { - wined3d_texture_cleanup_sync(texture); - return E_OUTOFMEMORY; - } - } - sub_count = level_count * layer_count; if (sub_count / layer_count != level_count) { @@ -3956,12 +3946,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc struct wined3d_texture_sub_resource *sub_resource; sub_resource = &texture->sub_resources[i]; - sub_resource->locations = WINED3D_LOCATION_DISCARDED; - if (desc->resource_type != WINED3D_RTYPE_TEXTURE_3D) - { - wined3d_texture_validate_location(texture, i, WINED3D_LOCATION_SYSMEM); - wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_SYSMEM); - } + sub_resource->locations = WINED3D_LOCATION_CLEARED; if (FAILED(hr = device_parent->ops->texture_sub_resource_created(device_parent, desc->resource_type, texture, i, &sub_resource->parent, &sub_resource->parent_ops)))