tests: Add test for round_{ni,pi} instructions.

This commit is contained in:
Józef Kucia 2017-07-20 17:40:45 +02:00
parent 0f9fa96ff1
commit c9d9763190

View File

@ -4358,6 +4358,28 @@ static void test_shader_instructions(void)
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e,
};
static const D3D12_SHADER_BYTECODE ps_ftoi = {ps_ftoi_code, sizeof(ps_ftoi_code)};
static const DWORD ps_round_code[] =
{
#if 0
float src0;
void main(out float4 dst : SV_Target)
{
dst.x = floor(src0);
dst.y = ceil(src0);
dst.zw = (float2)0;
}
#endif
0x43425844, 0x19abb9a8, 0xf5db0887, 0xc9e611d4, 0xe881c7d2, 0x00000001, 0x000000f4, 0x00000003,
0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000007c, 0x00000050, 0x0000001f,
0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000,
0x06000041, 0x00102012, 0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x06000042, 0x00102022,
0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x08000036, 0x001020c2, 0x00000000, 0x00004002,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e,
};
static const D3D12_SHADER_BYTECODE ps_round = {ps_round_code, sizeof(ps_round_code)};
static const DWORD ps_bfi_code[] =
{
#if 0
@ -4857,6 +4879,14 @@ static void test_shader_instructions(void)
{&ps_ftoi, {{ INFINITY}}, {.i = {INT_MAX, INT_MIN}}},
{&ps_ftoi, {{ -1.0f}}, {.i = { -1, 1}}},
{&ps_ftoi, {{ 1.0f}}, {.i = { 1, -1}}},
{&ps_round, {{ -0.5f}}, {{ -1.0f, 0.0f}}},
{&ps_round, {{ -0.0f}}, {{ -0.0f, -0.0f}}},
{&ps_round, {{ 0.0f}}, {{ 0.0f, 0.0f}}},
{&ps_round, {{ 0.5f}}, {{ 0.0f, 1.0f}}},
{&ps_round, {{ 3.0f}}, {{ 3.0f, 3.0f}}},
{&ps_round, {{ INFINITY}}, {{ INFINITY, INFINITY}}},
{&ps_round, {{-INFINITY}}, {{-INFINITY, -INFINITY}}},
};
static const struct