tests/d3d12: Make the dtof test a bit more interesting.

This commit is contained in:
Elizabeth Figura 2024-12-17 12:54:45 -06:00 committed by Henri Verbeet
parent efe686105d
commit dd450c526f
Notes: Henri Verbeet 2024-12-18 17:39:38 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1317

View File

@ -10239,70 +10239,66 @@ static void test_shader_instructions(void)
static const DWORD ps_dtou_code[] = static const DWORD ps_dtou_code[] =
{ {
#if 0 #if 0
double src0; double2 src0, src1;
void main(out uint4 dst : SV_Target) void main(out uint4 dst : SV_Target)
{ {
dst = uint4(src0, -src0, 0, 0); dst.xz = src0.yx;
dst.yw = -src1;
} }
#endif #endif
0x43425844, 0x6ca74abd, 0xe970e02d, 0xa65b35db, 0xd2f58586, 0x00000001, 0x00000128, 0x00000004, 0x43425844, 0xfaba33b8, 0x1e15cf47, 0xcd89f03c, 0xdf2aef62, 0x00000001, 0x000000ec, 0x00000004,
0x00000030, 0x00000040, 0x00000074, 0x00000118, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x00000030, 0x00000040, 0x00000074, 0x000000dc, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000009c, 0x00000050, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000060, 0x00000050,
0x00000027, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000018, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x03000065, 0x001020f2,
0x00000000, 0x02000068, 0x00000001, 0x060000d7, 0x00100012, 0x00000000, 0x00208446, 0x00000000, 0x00000000, 0x060000d7, 0x00102052, 0x00000000, 0x002084e6, 0x00000000, 0x00000000, 0x070000d7,
0x00000000, 0x070000d7, 0x00100022, 0x00000000, 0x80208446, 0x00000041, 0x00000000, 0x00000000, 0x001020a2, 0x00000000, 0x80208e46, 0x00000041, 0x00000000, 0x00000001, 0x0100003e, 0x30494653,
0x05000036, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x08000036, 0x001020c2, 0x00000000, 0x00000008, 0x00000021, 0x00000000,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, 0x30494653, 0x00000008,
0x00000021, 0x00000000,
}; };
static struct named_shader ps_dtou = {"dtou", ps_dtou_code, sizeof(ps_dtou_code)}; static struct named_shader ps_dtou = {"dtou", ps_dtou_code, sizeof(ps_dtou_code)};
static const DWORD ps_dtoi_code[] = static const DWORD ps_dtoi_code[] =
{ {
#if 0 #if 0
double src0; double2 src0, src1;
void main(out uint4 dst : SV_Target) void main(out uint4 dst : SV_Target)
{ {
dst = int4(src0, -src0, 0, 0); dst.xz = int2(src0.yx);
dst.yw = int2(-src1);
} }
#endif #endif
0x43425844, 0x38d82727, 0x8666b36c, 0x91954b7e, 0xf376163a, 0x00000001, 0x00000128, 0x00000004, 0x43425844, 0xbc0fca8f, 0x063a975f, 0x4699eeed, 0xa39c6d2c, 0x00000001, 0x000000ec, 0x00000004,
0x00000030, 0x00000040, 0x00000074, 0x00000118, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x00000030, 0x00000040, 0x00000074, 0x000000dc, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000009c, 0x00000050, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000060, 0x00000050,
0x00000027, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000018, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x03000065, 0x001020f2,
0x00000000, 0x02000068, 0x00000001, 0x060000d6, 0x00100012, 0x00000000, 0x00208446, 0x00000000, 0x00000000, 0x060000d6, 0x00102052, 0x00000000, 0x002084e6, 0x00000000, 0x00000000, 0x070000d6,
0x00000000, 0x070000d6, 0x00100022, 0x00000000, 0x80208446, 0x00000041, 0x00000000, 0x00000000, 0x001020a2, 0x00000000, 0x80208e46, 0x00000041, 0x00000000, 0x00000001, 0x0100003e, 0x30494653,
0x05000036, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x08000036, 0x001020c2, 0x00000000, 0x00000008, 0x00000021, 0x00000000,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, 0x30494653, 0x00000008,
0x00000021, 0x00000000,
}; };
static const struct named_shader ps_dtoi = {"dtoi", ps_dtoi_code, sizeof(ps_dtoi_code)}; static const struct named_shader ps_dtoi = {"dtoi", ps_dtoi_code, sizeof(ps_dtoi_code)};
static const DWORD ps_dtof_code[] = static const DWORD ps_dtof_code[] =
{ {
#if 0 #if 0
double src0; double2 src0, src1;
void main(out uint4 dst : SV_Target) void main(out uint4 dst : SV_Target)
{ {
float2 f = float2(src0, -src0); float4 f;
dst.x = asuint(f.x); f.xz = src0.yx;
dst.y = asuint(f.y); f.yw = -src1;
dst.zw = 0; dst = asuint(f);
} }
#endif #endif
0x43425844, 0xa920927f, 0xac06725f, 0x310edf68, 0xec6ab7cd, 0x00000001, 0x00000128, 0x00000004, 0x43425844, 0xc72c8b4d, 0x455c6951, 0xd193c640, 0x4dce07a4, 0x00000001, 0x000000ec, 0x00000004,
0x00000030, 0x00000040, 0x00000074, 0x00000118, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x00000030, 0x00000040, 0x00000074, 0x000000dc, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000009c, 0x00000050, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000060, 0x00000050,
0x00000027, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000018, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x03000065, 0x001020f2,
0x00000000, 0x02000068, 0x00000001, 0x060000c9, 0x00100012, 0x00000000, 0x00208446, 0x00000000, 0x00000000, 0x060000c9, 0x00102052, 0x00000000, 0x002084e6, 0x00000000, 0x00000000, 0x070000c9,
0x00000000, 0x070000c9, 0x00100022, 0x00000000, 0x80208446, 0x00000041, 0x00000000, 0x00000000, 0x001020a2, 0x00000000, 0x80208e46, 0x00000041, 0x00000000, 0x00000001, 0x0100003e, 0x30494653,
0x05000036, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x08000036, 0x001020c2, 0x00000000, 0x00000008, 0x00000001, 0x00000000,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, 0x30494653, 0x00000008,
0x00000001, 0x00000000,
}; };
static const struct named_shader ps_dtof = {"dtof", ps_dtof_code, sizeof(ps_dtof_code)}; static const struct named_shader ps_dtof = {"dtof", ps_dtof_code, sizeof(ps_dtof_code)};
static const DWORD ps_utod_code[] = static const DWORD ps_utod_code[] =
@ -10950,14 +10946,10 @@ static void test_shader_instructions(void)
{&ps_dge, {.d = {{1.5, 1.0}}}, {{0xffffffff}}, true}, {&ps_dge, {.d = {{1.5, 1.0}}}, {{0xffffffff}}, true},
{&ps_dlt, {.d = {{0.0, 1.0}}}, {{0xffffffff}}, true}, {&ps_dlt, {.d = {{0.0, 1.0}}}, {{0xffffffff}}, true},
{&ps_dlt, {.d = {{1.0, 1.0}}}, {{0x00000000}}, true}, {&ps_dlt, {.d = {{1.0, 1.0}}}, {{0x00000000}}, true},
{&ps_dtou, {.d = {{ -NAN}}}, {{ 0, 0 }}, true, false, false, true}, {&ps_dtou, {.d = {{INFINITY, -INFINITY}, {1.0, -1.0}}}, {{0, 0, UINT_MAX, 1}}, true},
{&ps_dtou, {.d = {{ NAN}}}, {{ 0, 0 }}, true, false, false, true}, {&ps_dtou, {.d = {{NAN, -NAN}, {1.0, -1.0}}}, {{0, 0, 0, 1}}, true, .todo_on_nvidia = true},
{&ps_dtou, {.d = {{-INFINITY}}}, {{ 0, ~0u}}, true}, {&ps_dtoi, {.d = {{INFINITY, -INFINITY}, {1.0, -1.0}}}, {.i = {INT_MIN, -1, INT_MAX, 1}}, true},
{&ps_dtou, {.d = {{ INFINITY}}}, {{~0u, 0 }}, true}, {&ps_dtof, {.d = {{1.5, (1.0/3.0)}, {1e40, -0.0}}}, {.f = {(1.0f/3.0f), -INFINITY, 1.5f, 0.0f}}, true},
{&ps_dtou, {.d = {{ -1.0}}}, {{ 0, 1 }}, true},
{&ps_dtou, {.d = {{ 1.0}}}, {{ 1, 0 }}, true},
{&ps_dtoi, {.d = {{ 1.0}}}, {.i = {1, -1}}, true},
{&ps_dtof, {.d = {{ 1.5}}}, {.f = {1.5f, -1.5f}}, true},
{&ps_utod, {.u = {{3, 0xffffffff}}}, {.d = {3.0, 4294967295.0}}, true}, {&ps_utod, {.u = {{3, 0xffffffff}}}, {.d = {3.0, 4294967295.0}}, true},
{&ps_itod, {.u = {{3, INT_MIN}}}, {.d = {3.0, -2147483648.0}}, true}, {&ps_itod, {.u = {{3, INT_MIN}}}, {.d = {3.0, -2147483648.0}}, true},
{&ps_ftod, {.f = {{-2.5f, -2.5f}}}, {.d = {-2.5, 2.5}}, true}, {&ps_ftod, {.f = {{-2.5f, -2.5f}}}, {.d = {-2.5, 2.5}}, true},