[PATCH 4/4] wined3d: Fixup 2D sampler when sampling 3D texture for PS models 2 and 3.

Paul Gofman gofmanp at gmail.com
Wed Jul 3 09:56:42 CDT 2019


Signed-off-by: Paul Gofman <gofmanp at gmail.com>
---
 dlls/d3d9/tests/visual.c | 5 ++---
 dlls/wined3d/shader.c    | 3 +++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 747750f81c..4af6146cf9 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -26359,7 +26359,6 @@ static void test_mismatched_sample_types(void)
         IDirect3DPixelShader9 **pixel_shader;
         D3DCOLOR expected_colour;
         D3DCOLOR expected_broken;
-        BOOL todo;
         D3DCOLOR expected_broken2;
     }
     tests[] =
@@ -26367,7 +26366,7 @@ static void test_mismatched_sample_types(void)
         {"2d_2d", (IDirect3DBaseTexture9 **)&tex_2d, &ps_2d, 0x00707070},
         {"3d_3d", (IDirect3DBaseTexture9 **)&volume, &ps_3d, 0x00303030},
         {"2d_3d", (IDirect3DBaseTexture9 **)&tex_2d, &ps_3d, 0x00707070, 0x00b2cce5},
-        {"3d_2d", (IDirect3DBaseTexture9 **)&volume, &ps_2d, 0x00303030, 0x00b2cce5, TRUE, 0x00202020},
+        {"3d_2d", (IDirect3DBaseTexture9 **)&volume, &ps_2d, 0x00303030, 0x00b2cce5, 0x00202020},
     };
 
     window = create_window();
@@ -26464,7 +26463,7 @@ static void test_mismatched_sample_types(void)
 
         colour = getPixelColor(device, 320, 240);
 
-        todo_wine_if(tests[i].todo) ok(color_match(colour, tests[i].expected_colour, 1)
+        ok(color_match(colour, tests[i].expected_colour, 1)
                 || broken(tests[i].expected_broken && color_match(colour, tests[i].expected_broken, 1))
                 || broken(tests[i].expected_broken2 && color_match(colour, tests[i].expected_broken2, 1)),
                 "test %s, expected 0x%08x, got 0x%08x.\n",
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 4561eb95ff..7c040ef7c8 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -4052,6 +4052,9 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
                         && resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_3D
                         && !(texture->resource.usage & WINED3DUSAGE_LEGACY_CUBEMAP))
                     tex_type = WINED3D_SHADER_TEX_2D;
+                else if (texture->resource.type == WINED3D_RTYPE_TEXTURE_3D
+                        && resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2D)
+                    tex_type = WINED3D_SHADER_TEX_3D;
             }
             args->tex_types |= tex_type << i * WINED3D_PSARGS_TEXTYPE_SHIFT;
         }
-- 
2.21.0




More information about the wine-devel mailing list