diff --git a/tests/d3d12.c b/tests/d3d12.c index 65fcfcb2..0e059e56 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -3873,6 +3873,24 @@ static void test_shader_instructions(void) 0x001020f2, 0x00000000, 0x00004002, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x0100003e, }; static const D3D12_SHADER_BYTECODE ps_if_return = {ps_if_return_code, sizeof(ps_if_return_code)}; + static const DWORD ps_sat_code[] = + { +#if 0 + float4 src; + + void main(out float4 dst : SV_Target) + { + dst = clamp(src, 0, 1); + } +#endif + 0x43425844, 0x50af2f8b, 0xaadad7cd, 0x77815f01, 0x612ec066, 0x00000001, 0x000000bc, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000044, 0x00000050, 0x00000011, + 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x06002036, 0x001020f2, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x0100003e, + }; + static const D3D12_SHADER_BYTECODE ps_sat = {ps_sat_code, sizeof(ps_sat_code)}; static const DWORD ps_ftou_code[] = { #if 0 @@ -4142,6 +4160,10 @@ static void test_shader_instructions(void) {&ps_if_return, {{5.0f, 4.0f, 0.0f, 5.0f}}, {{1.0f, 1.0f, 1.0f, 0.0f}}}, {&ps_if_return, {{ NAN, NAN, NAN, NAN}}, {{1.0f, 1.0f, 1.0f, 1.0f}}}, + {&ps_sat, {{ 0.0f, 1.0f, 2.0f, 3.0f}}, {{0.0f, 1.0f, 1.0f, 1.0f}}}, + {&ps_sat, {{-0.0f, -1.0f, -2.0f, -3.0f}}, {{0.0f, 0.0f, 0.0f, 0.0f}}}, + {&ps_sat, {{ NAN, -NAN, INFINITY, -INFINITY}}, {{0.0f, 0.0f, 1.0f, 0.0f}}}, + {&ps_ftou, {{ -NAN}}, {.u = { 0, 0 }}}, {&ps_ftou, {{ NAN}}, {.u = { 0, 0 }}}, {&ps_ftou, {{-INFINITY}}, {.u = { 0, ~0u}}},