Paul Gofman : wined3d: Fixup 2D sampler when sampling 3D texture for PS models 2 and 3.

Alexandre Julliard julliard at winehq.org
Fri Jul 5 14:49:19 CDT 2019


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

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Wed Jul  3 17:56:42 2019 +0300

wined3d: Fixup 2D sampler when sampling 3D texture for PS models 2 and 3.

Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 d786f68..f2c6ee4 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -25939,7 +25939,6 @@ static void test_mismatched_sample_types(void)
         IDirect3DPixelShader9 **pixel_shader;
         D3DCOLOR expected_colour;
         D3DCOLOR expected_broken;
-        BOOL todo;
         D3DCOLOR expected_broken2;
     }
     tests[] =
@@ -25947,7 +25946,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();
@@ -26044,7 +26043,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 d856fea..c233059 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -4032,6 +4032,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;
         }




More information about the wine-cvs mailing list