Zebediah Figura : wined3d: Use WINED3D_LOCATION_CLEARED for the initial location of textures.

Alexandre Julliard julliard at winehq.org
Thu Feb 24 15:33:40 CST 2022


Module: wine
Branch: master
Commit: 1632b8e7a419ebf256c4a356a58d505ef918f2fe
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1632b8e7a419ebf256c4a356a58d505ef918f2fe

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Feb 23 20:21:40 2022 -0600

wined3d: Use WINED3D_LOCATION_CLEARED for the initial location of textures.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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)))




More information about the wine-cvs mailing list