mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 19:20:08 +01:00
i965/vec4: unit test for copy propagation and writemask
This unit test demonstrates a subtle bug fixed by
4ddf51db6a.
Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
6c2d815d64
commit
88b887faa9
1 changed files with 30 additions and 0 deletions
|
|
@ -154,3 +154,33 @@ TEST_F(copy_propagation_test, test_swizzle_swizzle)
|
|||
SWIZZLE_X,
|
||||
SWIZZLE_Y));
|
||||
}
|
||||
|
||||
TEST_F(copy_propagation_test, test_swizzle_writemask)
|
||||
{
|
||||
dst_reg a = dst_reg(v, glsl_type::vec4_type);
|
||||
dst_reg b = dst_reg(v, glsl_type::vec4_type);
|
||||
dst_reg c = dst_reg(v, glsl_type::vec4_type);
|
||||
|
||||
v->emit(v->MOV(b, swizzle(src_reg(a), BRW_SWIZZLE4(SWIZZLE_X,
|
||||
SWIZZLE_Y,
|
||||
SWIZZLE_X,
|
||||
SWIZZLE_Z))));
|
||||
|
||||
v->emit(v->MOV(writemask(a, WRITEMASK_XYZ), src_reg(1.0f)));
|
||||
|
||||
vec4_instruction *test_mov =
|
||||
v->MOV(c, swizzle(src_reg(b), BRW_SWIZZLE4(SWIZZLE_W,
|
||||
SWIZZLE_W,
|
||||
SWIZZLE_W,
|
||||
SWIZZLE_W)));
|
||||
v->emit(test_mov);
|
||||
|
||||
copy_propagation(v);
|
||||
|
||||
/* should not copy propagate */
|
||||
EXPECT_EQ(test_mov->src[0].reg, b.reg);
|
||||
EXPECT_EQ(test_mov->src[0].swizzle, BRW_SWIZZLE4(SWIZZLE_W,
|
||||
SWIZZLE_W,
|
||||
SWIZZLE_W,
|
||||
SWIZZLE_W));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue