From a9eca729bc2b043c98e495909f36fd7338649550 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Wed, 3 Jul 2019 17:56:42 +0300 Subject: [PATCH] wined3d: Fixup 2D sampler when sampling 3D texture for PS models 2 and 3. Signed-off-by: Paul Gofman Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 d786f68a239..f2c6ee42dc0 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 d856feabcb4..c23305988b4 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; }