wined3d: Do not perform texture alpha blending for BUMPENV textures.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-01-04 13:26:03 +01:00 committed by Alexandre Julliard
parent 4c3586ca7a
commit 574bce1b2b
4 changed files with 10 additions and 56 deletions

View File

@ -8650,7 +8650,6 @@ static void test_texture_blending(void)
const struct test
{
BOOL todo;
DWORD tex_op_caps;
D3DCOLOR expected_color;
struct texture_stage stage[8];
@ -8658,7 +8657,6 @@ static void test_texture_blending(void)
tests[] =
{
{
FALSE,
D3DTEXOPCAPS_DISABLE,
0x80ffff02,
{
@ -8671,7 +8669,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1,
0x80ffff02,
{
@ -8687,7 +8684,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1,
0x80ffff02,
{
@ -8704,7 +8700,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1,
0x80ffff02,
{
@ -8721,7 +8716,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1,
0x00000000,
{
@ -8739,7 +8733,6 @@ static void test_texture_blending(void)
},
{
TRUE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x80ff0000,
{
@ -8768,7 +8761,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x80ff0000,
{
@ -8796,7 +8788,6 @@ static void test_texture_blending(void)
},
},
{
TRUE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x80ff0000,
{
@ -8826,7 +8817,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x00ff0000,
{
@ -8858,7 +8848,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x80ff0000,
{
@ -8891,7 +8880,6 @@ static void test_texture_blending(void)
},
{
TRUE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE
| D3DTEXOPCAPS_ADD,
0x80ff0000,
@ -8925,7 +8913,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE
| D3DTEXOPCAPS_MODULATE2X,
0x80ffff00,
@ -8959,7 +8946,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP,
0x80ffff02,
{
@ -9131,16 +9117,8 @@ static void test_texture_blending(void)
get_rt_readback(backbuffer, &rb);
color = get_readback_color(&rb, 320, 240);
if (current_test->todo)
{
todo_wine ok(color_match(color, current_test->expected_color, 1),
"Test %u: Got color 0x%08x, expected 0x%08x.\n", i, color, current_test->expected_color);
}
else
{
ok(color_match(color, current_test->expected_color, 1),
"Test %u: Got color 0x%08x, expected 0x%08x.\n", i, color, current_test->expected_color);
}
ok(color_match(color, current_test->expected_color, 1),
"Test %u: Got color 0x%08x, expected 0x%08x.\n", i, color, current_test->expected_color);
release_surface_readback(&rb);
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Test %u: Present failed, hr %#x.\n", i, hr);

View File

@ -20678,7 +20678,6 @@ static void test_texture_blending(void)
const struct test
{
BOOL todo;
DWORD tex_op_caps;
D3DCOLOR expected_color;
struct texture_stage stage[8];
@ -20686,7 +20685,6 @@ static void test_texture_blending(void)
tests[] =
{
{
FALSE,
D3DTEXOPCAPS_DISABLE,
0x80ffff02,
{
@ -20699,7 +20697,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1,
0x80ffff02,
{
@ -20715,7 +20712,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1,
0x80ffff02,
{
@ -20732,7 +20728,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1,
0x80ffff02,
{
@ -20749,7 +20744,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1,
0x00000000,
{
@ -20766,7 +20760,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_SUBTRACT,
0x80f0f000,
{
@ -20792,7 +20785,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_SUBTRACT,
0x71f0f000,
{
@ -20824,7 +20816,6 @@ static void test_texture_blending(void)
},
{
TRUE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x80ff0000,
{
@ -20853,7 +20844,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x80ff0000,
{
@ -20881,7 +20871,6 @@ static void test_texture_blending(void)
},
},
{
TRUE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x80ff0000,
{
@ -20911,7 +20900,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x00ff0000,
{
@ -20943,7 +20931,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE,
0x80ff0000,
{
@ -20976,7 +20963,6 @@ static void test_texture_blending(void)
},
{
TRUE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE
| D3DTEXOPCAPS_ADD,
0x80ff0000,
@ -21011,7 +20997,6 @@ static void test_texture_blending(void)
},
},
{
TRUE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE
| D3DTEXOPCAPS_MODULATE2X,
0x80ff0000,
@ -21046,7 +21031,6 @@ static void test_texture_blending(void)
},
},
{
TRUE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_MODULATE
| D3DTEXOPCAPS_MODULATE2X,
0x80ffff00,
@ -21083,7 +21067,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP,
0x01234567,
{
@ -21137,7 +21120,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP,
0x00234567,
{
@ -21188,7 +21170,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP,
0x01234567,
{
@ -21242,7 +21223,6 @@ static void test_texture_blending(void)
},
},
{
FALSE,
D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_BUMPENVMAP,
0x01234567,
{
@ -21424,16 +21404,8 @@ static void test_texture_blending(void)
get_rt_readback(backbuffer, &rb);
color = get_readback_color(&rb, 320, 240);
if (current_test->todo)
{
todo_wine ok(color_match(color, current_test->expected_color, 1),
"Test %u: Got color 0x%08x, expected 0x%08x.\n", i, color, current_test->expected_color);
}
else
{
ok(color_match(color, current_test->expected_color, 1),
"Test %u: Got color 0x%08x, expected 0x%08x.\n", i, color, current_test->expected_color);
}
ok(color_match(color, current_test->expected_color, 1),
"Test %u: Got color 0x%08x, expected 0x%08x.\n", i, color, current_test->expected_color);
release_surface_readback(&rb);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Test %u: Present failed, hr %#x.\n", i, hr);

View File

@ -6551,7 +6551,10 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con
gen_ffp_instr(&buffer, stage, TRUE, TRUE, settings->op[stage].dst,
settings->op[stage].cop, settings->op[stage].carg0,
settings->op[stage].carg1, settings->op[stage].carg2);
} else {
}
else if (settings->op[stage].cop != WINED3D_TOP_BUMPENVMAP
&& settings->op[stage].cop != WINED3D_TOP_BUMPENVMAP_LUMINANCE)
{
gen_ffp_instr(&buffer, stage, TRUE, FALSE, settings->op[stage].dst,
settings->op[stage].cop, settings->op[stage].carg0,
settings->op[stage].carg1, settings->op[stage].carg2);

View File

@ -6653,7 +6653,8 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
settings->op[stage].cop, settings->op[stage].carg0,
settings->op[stage].carg1, settings->op[stage].carg2);
}
else
else if (settings->op[stage].cop != WINED3D_TOP_BUMPENVMAP
&& settings->op[stage].cop != WINED3D_TOP_BUMPENVMAP_LUMINANCE)
{
shader_glsl_ffp_fragment_op(buffer, stage, TRUE, FALSE, settings->op[stage].dst,
settings->op[stage].cop, settings->op[stage].carg0,