From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- tests/d3d12.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index e61fd3b972c3..dfc3da7bdec0 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -5677,6 +5677,76 @@ static void test_shader_instructions(void) 0x0000d000, 0x001020c2, 0x00000000, 0x00208406, 0x00000000, 0x00000000, 0x0100003e, }; static const D3D12_SHADER_BYTECODE ps_sincos = {ps_sincos_code, sizeof(ps_sincos_code)}; + static const DWORD ps_indexable_temp_code[] = + { +#if 0 + float index; + + float4 main() : SV_Target + { + float4 colors[] = + { + float4(1.0f, 0.0f, 0.0f, 1.0f), + float4(0.0f, 1.0f, 0.0f, 1.0f), + float4(0.0f, 0.0f, 1.0f, 1.0f), + }; + return colors[index]; + } +#endif + 0x43425844, 0x82c65bbb, 0x5b713473, 0xa16ebe60, 0xdcc329be, 0x00000001, 0x00000170, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x000000f8, 0x00000050, 0x0000003e, + 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x02000068, 0x00000001, 0x04000069, 0x00000000, 0x00000003, 0x00000004, 0x09000036, 0x00203072, + 0x00000000, 0x00000000, 0x00004002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x09000036, + 0x00203072, 0x00000000, 0x00000001, 0x00004002, 0x00000000, 0x3f800000, 0x00000000, 0x00000000, + 0x09000036, 0x00203072, 0x00000000, 0x00000002, 0x00004002, 0x00000000, 0x00000000, 0x3f800000, + 0x00000000, 0x0600001c, 0x00100012, 0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x07000036, + 0x00102072, 0x00000000, 0x04203246, 0x00000000, 0x0010000a, 0x00000000, 0x05000036, 0x00102082, + 0x00000000, 0x00004001, 0x3f800000, 0x0100003e, + }; + static const D3D12_SHADER_BYTECODE ps_indexable_temp = {ps_indexable_temp_code, sizeof(ps_indexable_temp_code)}; + static const DWORD ps_indexable_temp2_code[] = + { +#if 0 + float index; + + float4 main() : SV_Target + { + uint remap[] = {0, 1, 2, 2, 1, 0, 1, 1, 2, 2}; + float4 colors[] = + { + float4(1.0f, 0.0f, 0.0f, 1.0f), + float4(0.0f, 1.0f, 0.0f, 1.0f), + float4(0.0f, 0.0f, 1.0f, 1.0f), + }; + return colors[remap[index]]; + } +#endif + 0x43425844, 0xcacc5b8f, 0x19bb905e, 0x6af8eae1, 0x80654684, 0x00000001, 0x0000028c, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000214, 0x00000050, 0x00000085, + 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x02000068, 0x00000001, 0x04000069, 0x00000000, 0x0000000a, 0x00000004, 0x04000069, 0x00000001, + 0x00000003, 0x00000004, 0x06000036, 0x00203012, 0x00000000, 0x00000000, 0x00004001, 0x00000000, + 0x06000036, 0x00203012, 0x00000000, 0x00000001, 0x00004001, 0x00000001, 0x06000036, 0x00203012, + 0x00000000, 0x00000002, 0x00004001, 0x00000002, 0x06000036, 0x00203012, 0x00000000, 0x00000003, + 0x00004001, 0x00000002, 0x06000036, 0x00203012, 0x00000000, 0x00000004, 0x00004001, 0x00000001, + 0x06000036, 0x00203012, 0x00000000, 0x00000005, 0x00004001, 0x00000000, 0x06000036, 0x00203012, + 0x00000000, 0x00000006, 0x00004001, 0x00000001, 0x06000036, 0x00203012, 0x00000000, 0x00000007, + 0x00004001, 0x00000001, 0x06000036, 0x00203012, 0x00000000, 0x00000008, 0x00004001, 0x00000002, + 0x06000036, 0x00203012, 0x00000000, 0x00000009, 0x00004001, 0x00000002, 0x09000036, 0x00203072, + 0x00000001, 0x00000000, 0x00004002, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x09000036, + 0x00203072, 0x00000001, 0x00000001, 0x00004002, 0x00000000, 0x3f800000, 0x00000000, 0x00000000, + 0x09000036, 0x00203072, 0x00000001, 0x00000002, 0x00004002, 0x00000000, 0x00000000, 0x3f800000, + 0x00000000, 0x0600001c, 0x00100012, 0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x07000036, + 0x00100012, 0x00000000, 0x0420300a, 0x00000000, 0x0010000a, 0x00000000, 0x07000036, 0x00102072, + 0x00000000, 0x04203246, 0x00000001, 0x0010000a, 0x00000000, 0x05000036, 0x00102082, 0x00000000, + 0x00004001, 0x3f800000, 0x0100003e, + }; + static const D3D12_SHADER_BYTECODE ps_indexable_temp2 = {ps_indexable_temp2_code, sizeof(ps_indexable_temp2_code)}; static const DWORD ps_bfi_code[] = { #if 0 @@ -6509,6 +6579,21 @@ static void test_shader_instructions(void)
{&ps_sincos, {{ 0.0f, -0.0f, 0.0f, -0.0f}}, {{ 0.0f, -0.0f, 1.0f, 1.0f}}}, {&ps_sincos, {{ 0.0f, -0.0f, M_PI, -M_PI}}, {{ 0.0f, -0.0f, 1.0f, 1.0f}}}, + + {&ps_indexable_temp, {{0.0f}}, {{1.0f, 0.0f, 0.0f, 1.0f}}}, + {&ps_indexable_temp, {{1.0f}}, {{0.0f, 1.0f, 0.0f, 1.0f}}}, + {&ps_indexable_temp, {{2.0f}}, {{0.0f, 0.0f, 1.0f, 1.0f}}}, + + {&ps_indexable_temp2, {{0.0f}}, {{1.0f, 0.0f, 0.0f, 1.0f}}}, + {&ps_indexable_temp2, {{1.0f}}, {{0.0f, 1.0f, 0.0f, 1.0f}}}, + {&ps_indexable_temp2, {{2.0f}}, {{0.0f, 0.0f, 1.0f, 1.0f}}}, + {&ps_indexable_temp2, {{3.0f}}, {{0.0f, 0.0f, 1.0f, 1.0f}}}, + {&ps_indexable_temp2, {{4.0f}}, {{0.0f, 1.0f, 0.0f, 1.0f}}}, + {&ps_indexable_temp2, {{5.0f}}, {{1.0f, 0.0f, 0.0f, 1.0f}}}, + {&ps_indexable_temp2, {{6.0f}}, {{0.0f, 1.0f, 0.0f, 1.0f}}}, + {&ps_indexable_temp2, {{7.0f}}, {{0.0f, 1.0f, 0.0f, 1.0f}}}, + {&ps_indexable_temp2, {{8.0f}}, {{0.0f, 0.0f, 1.0f, 1.0f}}}, + {&ps_indexable_temp2, {{9.0f}}, {{0.0f, 0.0f, 1.0f, 1.0f}}}, };
static const struct