[PATCH 2/5] wined3d: Use WINED3D_LOCATION_CLEARED for the initial location of textures.

Zebediah Figura zfigura at codeweavers.com
Sun Feb 20 23:22:22 CST 2022


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/ddraw/tests/ddraw1.c |  4 ++--
 dlls/ddraw/tests/ddraw2.c |  4 ++--
 dlls/ddraw/tests/ddraw4.c |  4 ++--
 dlls/ddraw/tests/ddraw7.c |  4 ++--
 dlls/wined3d/texture.c    | 17 +----------------
 5 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index e0393a3a591..30fadeb7a88 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -10101,9 +10101,9 @@ static void test_yv12_overlay(void)
         base = desc.lpSurface;
         ok(base[0] == 0x10, "Got unexpected Y data 0x%02x.\n", base[0]);
         base += desc.dwHeight * U1(desc).lPitch;
-        todo_wine ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
+        ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
         base += desc.dwHeight / 4 * U1(desc).lPitch;
-        todo_wine ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
+        ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
 
         hr = IDirectDrawSurface_Unlock(dst_surface, NULL);
         ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 03f1d488673..96da40ac838 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -10934,9 +10934,9 @@ static void test_yv12_overlay(void)
         base = desc.lpSurface;
         ok(base[0] == 0x10, "Got unexpected Y data 0x%02x.\n", base[0]);
         base += desc.dwHeight * U1(desc).lPitch;
-        todo_wine ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
+        ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
         base += desc.dwHeight / 4 * U1(desc).lPitch;
-        todo_wine ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
+        ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
 
         hr = IDirectDrawSurface_Unlock(dst_surface, NULL);
         ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 858d39e6f8e..d9f0f43130c 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -12893,9 +12893,9 @@ static void test_yv12_overlay(void)
         base = desc.lpSurface;
         ok(base[0] == 0x10, "Got unexpected Y data 0x%02x.\n", base[0]);
         base += desc.dwHeight * U1(desc).lPitch;
-        todo_wine ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
+        ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
         base += desc.dwHeight / 4 * U1(desc).lPitch;
-        todo_wine ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
+        ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
 
         hr = IDirectDrawSurface4_Unlock(dst_surface, NULL);
         ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index d448bd76c01..d510a8e4ee7 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -12885,9 +12885,9 @@ static void test_yv12_overlay(void)
         base = desc.lpSurface;
         ok(base[0] == 0x10, "Got unexpected Y data 0x%02x.\n", base[0]);
         base += desc.dwHeight * U1(desc).lPitch;
-        todo_wine ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
+        ok(base[0] == 0x20, "Got unexpected V data 0x%02x.\n", base[0]);
         base += desc.dwHeight / 4 * U1(desc).lPitch;
-        todo_wine ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
+        ok(base[0] == 0x30, "Got unexpected U data 0x%02x.\n", base[0]);
 
         hr = IDirectDrawSurface7_Unlock(dst_surface, NULL);
         ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 64cc7c8c3eb..7703de6c4ef 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -3888,16 +3888,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)
     {
@@ -3926,12 +3916,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)))
-- 
2.34.1




More information about the wine-devel mailing list