Commit 375d40e9 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d11/tests: Add basic test for SM5 f16tof32 and f32tof16 instructions.

parent 00ccd6fd
......@@ -10665,6 +10665,41 @@ static void test_uint_shader_instructions(void)
0x8020800a, 0x00000041, 0x00000000, 0x00000000, 0x08000036, 0x001020c2, 0x00000000, 0x00004002,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e,
};
static const DWORD ps_f16tof32_code[] =
{
#if 0
uint4 hf;
uint4 main() : SV_Target
{
return f16tof32(hf);
}
#endif
0x43425844, 0xc1816e6e, 0x27562d96, 0x56980fa2, 0x421e6640, 0x00000001, 0x000000d8, 0x00000003,
0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000060, 0x00000050, 0x00000018,
0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000,
0x02000068, 0x00000001, 0x06000083, 0x001000f2, 0x00000000, 0x00208e46, 0x00000000, 0x00000000,
0x0500001c, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x0100003e,
};
static const DWORD ps_f32tof16_code[] =
{
#if 0
float4 f;
uint4 main() : SV_Target
{
return f32tof16(f);
}
#endif
0x43425844, 0x523a765c, 0x1a5be3a9, 0xaed69c80, 0xd26fe296, 0x00000001, 0x000000bc, 0x00000003,
0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000044, 0x00000050, 0x00000011,
0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000,
0x06000082, 0x001020f2, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x0100003e,
};
static const DWORD ps_not_code[] =
{
#if 0
......@@ -10689,6 +10724,8 @@ static void test_uint_shader_instructions(void)
static const struct shader ps_bfi = {ps_bfi_code, sizeof(ps_bfi_code), D3D_FEATURE_LEVEL_11_0};
static const struct shader ps_bfrev = {ps_bfrev_code, sizeof(ps_bfrev_code), D3D_FEATURE_LEVEL_11_0};
static const struct shader ps_ftou = {ps_ftou_code, sizeof(ps_ftou_code), D3D_FEATURE_LEVEL_10_0};
static const struct shader ps_f16tof32 = {ps_f16tof32_code, sizeof(ps_f16tof32_code), D3D_FEATURE_LEVEL_11_0};
static const struct shader ps_f32tof16 = {ps_f32tof16_code, sizeof(ps_f32tof16_code), D3D_FEATURE_LEVEL_11_0};
static const struct shader ps_not = {ps_not_code, sizeof(ps_not_code), D3D_FEATURE_LEVEL_10_0};
static const struct
{
......@@ -10699,21 +10736,31 @@ static void test_uint_shader_instructions(void)
}
tests[] =
{
{&ps_bfi, { 0, 0, 0, 0}, {1, 2, 3, 0}, TRUE},
{&ps_bfi, { 1, 1, 1, 1}, {5, 6, 7, 4}, TRUE},
{&ps_bfi, { 2, 3, 4, 5}, {9, 14, 19, 20}, TRUE},
{&ps_bfi, {~0u, ~0u, ~0u, ~0u}, {0xfffffffd, 0xfffffffe, 0xffffffff, 0xfffffffc}, TRUE},
{&ps_bfi, { 0, 0, 0, 0}, {1, 2, 3, 0}, TRUE},
{&ps_bfi, { 1, 1, 1, 1}, {5, 6, 7, 4}, TRUE},
{&ps_bfi, { 2, 3, 4, 5}, {9, 14, 19, 20}, TRUE},
{&ps_bfi, {~0u, ~0u, ~0u, ~0u}, {0xfffffffd, 0xfffffffe, 0xffffffff, 0xfffffffc}, TRUE},
{&ps_bfrev, {0x12345678}, {0x1e6a2c48, 0x12345678, 0x1e6a0000, 0x2c480000}, TRUE},
{&ps_bfrev, {0xffff0000}, {0x0000ffff, 0xffff0000, 0x00000000, 0xffff0000}, TRUE},
{&ps_bfrev, {0xffffffff}, {0xffffffff, 0xffffffff, 0xffff0000, 0xffff0000}, TRUE},
{&ps_ftou, {BITS_NNAN}, { 0, 0}},
{&ps_ftou, {BITS_NAN}, { 0, 0}},
{&ps_ftou, {BITS_NINF}, { 0, ~0u}},
{&ps_ftou, {BITS_INF}, {~0u, 0}},
{&ps_ftou, {BITS_N1_0}, { 0, 1}},
{&ps_ftou, {BITS_1_0}, { 1, 0}},
{&ps_not, {0x00000000, 0xffffffff}, {0xffffffff, 0x00000000, 0x00000000, 0xffffffff}},
{&ps_not, {0xf0f0f0f0, 0x0f0f0f0f}, {0x0f0f0f0f, 0xf0f0f0f0, 0xf0f0f0f0, 0x0f0f0f0f}},
{&ps_ftou, {BITS_NNAN}, { 0, 0}},
{&ps_ftou, {BITS_NAN}, { 0, 0}},
{&ps_ftou, {BITS_NINF}, { 0, ~0u}},
{&ps_ftou, {BITS_INF}, {~0u, 0}},
{&ps_ftou, {BITS_N1_0}, { 0, 1}},
{&ps_ftou, {BITS_1_0}, { 1, 0}},
{&ps_f16tof32, {0x00000000, 0x00003c00, 0x00005640, 0x00005bd0}, {0, 1, 100, 250}},
{&ps_f16tof32, {0x00010000, 0x00013c00, 0x00015640, 0x00015bd0}, {0, 1, 100, 250}},
{&ps_f16tof32, {0x000f0000, 0x000f3c00, 0x000f5640, 0x000f5bd0}, {0, 1, 100, 250}},
{&ps_f16tof32, {0xffff0000, 0xffff3c00, 0xffff5640, 0xffff5bd0}, {0, 1, 100, 250}},
{&ps_f32tof16, {0, BITS_1_0, BITS_N1_0, 0x44268000}, {0, 0x3c00, 0xbc00, 0x6134}},
{&ps_not, {0x00000000, 0xffffffff}, {0xffffffff, 0x00000000, 0x00000000, 0xffffffff}},
{&ps_not, {0xf0f0f0f0, 0x0f0f0f0f}, {0x0f0f0f0f, 0xf0f0f0f0, 0xf0f0f0f0, 0x0f0f0f0f}},
};
if (!init_test_context(&test_context, NULL))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment