tests: Add visual test for ushr instruction.

This commit is contained in:
Józef Kucia 2017-06-29 09:02:50 +02:00
parent 4e22eeec05
commit cd2e14ba22

View File

@ -3971,6 +3971,26 @@ static void test_shader_instructions(void)
0x00000001, 0x0100003e,
};
static const D3D12_SHADER_BYTECODE ps_ishr = {ps_ishr_code, sizeof(ps_ishr_code)};
static const DWORD ps_ushr_code[] =
{
#if 0
uint4 src0;
uint4 src1;
void main(out uint4 dst : SV_Target)
{
dst = src0 >> src1;
}
#endif
0x43425844, 0x00f49f17, 0xe7933d92, 0xf527d4e6, 0x1fe1c216, 0x00000001, 0x000000c8, 0x00000003,
0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000050, 0x00000050, 0x00000014,
0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x03000065, 0x001020f2, 0x00000000,
0x09000055, 0x001020f2, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x00208e46, 0x00000000,
0x00000001, 0x0100003e,
};
static const D3D12_SHADER_BYTECODE ps_ushr = {ps_ushr_code, sizeof(ps_ushr_code)};
static const struct
{
const D3D12_SHADER_BYTECODE *ps;
@ -4131,6 +4151,17 @@ static void test_shader_instructions(void)
{{0x00000000, 0x00000000, 0x00000000, 0x00000000}}},
{&ps_ishr, {{0x80000000, 0x80000000, 0x80000000, 0x80000000}, { 31, 7, 15, 11}},
{{0xffffffff, 0xff000000, 0xffff0000, 0xfff00000}}},
{&ps_ushr, {{0x00000000, 0x00000000, 0x00000000, 0x00000000}, {~0x1fu, 0, 32, 64}},
{{0x00000000, 0x00000000, 0x00000000, 0x00000000}}},
{&ps_ushr, {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}, {~0x1fu, 0, 32, 64}},
{{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}}},
{&ps_ushr, {{0xfefefefe, 0x0fefefef, 0x0f0f0f0f, 0x12345678}, {~0x1fu, 0, 32, 64}},
{{0xfefefefe, 0x0fefefef, 0x0f0f0f0f, 0x12345678}}},
{&ps_ushr, {{0x00000000, 0x00000000, 0x00000000, 0x00000000}, { 31, 7, 15, 11}},
{{0x00000000, 0x00000000, 0x00000000, 0x00000000}}},
{&ps_ushr, {{0x80000000, 0x80000000, 0x80000000, 0x80000000}, { 31, 7, 15, 11}},
{{0x00000001, 0x01000000, 0x00010000, 0x00100000}}},
};
assert(sizeof(tests->input) == sizeof(uint_tests->input));