Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- tests/d3d12.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index f90526c7..8afeaa3a 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -9245,6 +9245,52 @@ static void test_shader_instructions(void) 0x00000000, 0x0100003e, 0x30494653, 0x00000008, 0x00000001, 0x00000000, }; static struct named_shader ps_dne = {"dne", ps_dne_code, sizeof(ps_dne_code)}; + static const DWORD ps_dge_code[] = + { +#if 0 + double2 src0; + + void main(out uint4 dst : SV_Target) + { + dst = (uint4)0; + if (src0.x >= src0.y) + dst.x = 0xffffffff; + } +#endif + 0x43425844, 0xad9e15a9, 0x80ed9af5, 0x039e7dbd, 0xac8b1634, 0x00000001, 0x00000118, 0x00000004, + 0x00000030, 0x00000040, 0x00000074, 0x00000108, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000008c, 0x00000050, + 0x00000023, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000001, 0x090000c4, 0x00100012, 0x00000000, 0x00208446, 0x00000000, + 0x00000000, 0x00208ee6, 0x00000000, 0x00000000, 0x05000036, 0x00102012, 0x00000000, 0x0010000a, + 0x00000000, 0x08000036, 0x001020e2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x0100003e, 0x30494653, 0x00000008, 0x00000001, 0x00000000, + }; + static struct named_shader ps_dge = {"dge", ps_dge_code, sizeof(ps_dge_code)}; + static const DWORD ps_dlt_code[] = + { +#if 0 + double2 src0; + + void main(out uint4 dst : SV_Target) + { + dst = (uint4)0; + if (src0.x < src0.y) + dst.x = 0xffffffff; + } +#endif + 0x43425844, 0xc42b9ef5, 0xd24453bd, 0xc6bc7933, 0x1ba2cbcd, 0x00000001, 0x00000118, 0x00000004, + 0x00000030, 0x00000040, 0x00000074, 0x00000108, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000008c, 0x00000050, + 0x00000023, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000001, 0x090000c5, 0x00100012, 0x00000000, 0x00208446, 0x00000000, + 0x00000000, 0x00208ee6, 0x00000000, 0x00000000, 0x05000036, 0x00102012, 0x00000000, 0x0010000a, + 0x00000000, 0x08000036, 0x001020e2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x0100003e, 0x30494653, 0x00000008, 0x00000001, 0x00000000, + }; + static struct named_shader ps_dlt = {"dlt", ps_dlt_code, sizeof(ps_dlt_code)}; static const DWORD ps_dtou_code[] = { #if 0 @@ -9891,6 +9937,11 @@ static void test_shader_instructions(void) {&ps_deq, {.d = {{1.0, 0.0}}}, {{0x00000000}}, true}, {&ps_dne, {.d = {{0.0, 0.0}}}, {{0x00000000}}, true, true}, {&ps_dne, {.d = {{1.0, 0.0}}}, {{0xffffffff}}, true, true}, + {&ps_dge, {.d = {{0.0, 1.0}}}, {{0x00000000}}, true, true}, + {&ps_dge, {.d = {{1.0, 1.0}}}, {{0xffffffff}}, true, true}, + {&ps_dge, {.d = {{1.5, 1.0}}}, {{0xffffffff}}, true, true}, + {&ps_dlt, {.d = {{0.0, 1.0}}}, {{0xffffffff}}, true, true}, + {&ps_dlt, {.d = {{1.0, 1.0}}}, {{0x00000000}}, true, true}, {&ps_dtou, {.d = {{ -NAN}}}, {{ 0, 0 }}, true, true}, {&ps_dtou, {.d = {{ NAN}}}, {{ 0, 0 }}, true, true}, {&ps_dtou, {.d = {{-INFINITY}}}, {{ 0, ~0u}}, true, true},
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 2 ++ libs/vkd3d-shader/spirv.c | 2 ++ libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + tests/d3d12.c | 6 +++--- 5 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 26911255..afeebb23 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -312,6 +312,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_SYNC = 0xbe, VKD3D_SM5_OP_DADD = 0xbf, VKD3D_SM5_OP_DEQ = 0xc3, + VKD3D_SM5_OP_DGE = 0xc4, VKD3D_SM5_OP_DMOV = 0xc7, VKD3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, VKD3D_SM5_OP_EVAL_CENTROID = 0xcd, @@ -1254,6 +1255,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = shader_sm5_read_sync}, {VKD3D_SM5_OP_DADD, VKD3DSIH_DADD, "d", "dd"}, {VKD3D_SM5_OP_DEQ, VKD3DSIH_DEQ, "u", "dd"}, + {VKD3D_SM5_OP_DGE, VKD3DSIH_DGE, "u", "dd"}, {VKD3D_SM5_OP_DMOV, VKD3DSIH_DMOV, "d", "d"}, {VKD3D_SM5_OP_EVAL_SAMPLE_INDEX, VKD3DSIH_EVAL_SAMPLE_INDEX, "f", "fi"}, {VKD3D_SM5_OP_EVAL_CENTROID, VKD3DSIH_EVAL_CENTROID, "f", "f"}, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index a1f061c6..eb63e820 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7355,6 +7355,7 @@ static void vkd3d_dxbc_compiler_emit_comparison_instruction(struct vkd3d_dxbc_co { case VKD3DSIH_DEQ: case VKD3DSIH_EQ: op = SpvOpFOrdEqual; break; + case VKD3DSIH_DGE: case VKD3DSIH_GE: op = SpvOpFOrdGreaterThanEqual; break; case VKD3DSIH_IEQ: op = SpvOpIEqual; break; case VKD3DSIH_IGE: op = SpvOpSGreaterThanEqual; break; @@ -9571,6 +9572,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, vkd3d_dxbc_compiler_emit_udiv(compiler, instruction); break; case VKD3DSIH_DEQ: + case VKD3DSIH_DGE: case VKD3DSIH_EQ: case VKD3DSIH_GE: case VKD3DSIH_IEQ: diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 592befe1..ee4ebb10 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -105,6 +105,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_DEFB */ "defb", /* VKD3DSIH_DEFI */ "defi", /* VKD3DSIH_DEQ */ "deq", + /* VKD3DSIH_DGE */ "dge", /* VKD3DSIH_DIV */ "div", /* VKD3DSIH_DMOV */ "dmov", /* VKD3DSIH_DP2 */ "dp2", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 23f2b232..14d2d745 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -194,6 +194,7 @@ enum vkd3d_shader_opcode VKD3DSIH_DEFB, VKD3DSIH_DEFI, VKD3DSIH_DEQ, + VKD3DSIH_DGE, VKD3DSIH_DIV, VKD3DSIH_DMOV, VKD3DSIH_DP2, diff --git a/tests/d3d12.c b/tests/d3d12.c index 8afeaa3a..515364c5 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -9937,9 +9937,9 @@ static void test_shader_instructions(void) {&ps_deq, {.d = {{1.0, 0.0}}}, {{0x00000000}}, true}, {&ps_dne, {.d = {{0.0, 0.0}}}, {{0x00000000}}, true, true}, {&ps_dne, {.d = {{1.0, 0.0}}}, {{0xffffffff}}, true, true}, - {&ps_dge, {.d = {{0.0, 1.0}}}, {{0x00000000}}, true, true}, - {&ps_dge, {.d = {{1.0, 1.0}}}, {{0xffffffff}}, true, true}, - {&ps_dge, {.d = {{1.5, 1.0}}}, {{0xffffffff}}, true, true}, + {&ps_dge, {.d = {{0.0, 1.0}}}, {{0x00000000}}, true}, + {&ps_dge, {.d = {{1.0, 1.0}}}, {{0xffffffff}}, true}, + {&ps_dge, {.d = {{1.5, 1.0}}}, {{0xffffffff}}, true}, {&ps_dlt, {.d = {{0.0, 1.0}}}, {{0xffffffff}}, true, true}, {&ps_dlt, {.d = {{1.0, 1.0}}}, {{0x00000000}}, true, true}, {&ps_dtou, {.d = {{ -NAN}}}, {{ 0, 0 }}, true, true},
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 2 ++ libs/vkd3d-shader/spirv.c | 2 ++ libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + tests/d3d12.c | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index afeebb23..f557f83e 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -313,6 +313,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_DADD = 0xbf, VKD3D_SM5_OP_DEQ = 0xc3, VKD3D_SM5_OP_DGE = 0xc4, + VKD3D_SM5_OP_DLT = 0xc5, VKD3D_SM5_OP_DMOV = 0xc7, VKD3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, VKD3D_SM5_OP_EVAL_CENTROID = 0xcd, @@ -1256,6 +1257,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = {VKD3D_SM5_OP_DADD, VKD3DSIH_DADD, "d", "dd"}, {VKD3D_SM5_OP_DEQ, VKD3DSIH_DEQ, "u", "dd"}, {VKD3D_SM5_OP_DGE, VKD3DSIH_DGE, "u", "dd"}, + {VKD3D_SM5_OP_DLT, VKD3DSIH_DLT, "u", "dd"}, {VKD3D_SM5_OP_DMOV, VKD3DSIH_DMOV, "d", "d"}, {VKD3D_SM5_OP_EVAL_SAMPLE_INDEX, VKD3DSIH_EVAL_SAMPLE_INDEX, "f", "fi"}, {VKD3D_SM5_OP_EVAL_CENTROID, VKD3DSIH_EVAL_CENTROID, "f", "f"}, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index eb63e820..bb9e2bf5 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7361,6 +7361,7 @@ static void vkd3d_dxbc_compiler_emit_comparison_instruction(struct vkd3d_dxbc_co case VKD3DSIH_IGE: op = SpvOpSGreaterThanEqual; break; case VKD3DSIH_ILT: op = SpvOpSLessThan; break; case VKD3DSIH_INE: op = SpvOpINotEqual; break; + case VKD3DSIH_DLT: case VKD3DSIH_LT: op = SpvOpFOrdLessThan; break; case VKD3DSIH_NE: op = SpvOpFUnordNotEqual; break; case VKD3DSIH_UGE: op = SpvOpUGreaterThanEqual; break; @@ -9573,6 +9574,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, break; case VKD3DSIH_DEQ: case VKD3DSIH_DGE: + case VKD3DSIH_DLT: case VKD3DSIH_EQ: case VKD3DSIH_GE: case VKD3DSIH_IEQ: diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index ee4ebb10..b35748bc 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -107,6 +107,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_DEQ */ "deq", /* VKD3DSIH_DGE */ "dge", /* VKD3DSIH_DIV */ "div", + /* VKD3DSIH_DLT */ "dlt", /* VKD3DSIH_DMOV */ "dmov", /* VKD3DSIH_DP2 */ "dp2", /* VKD3DSIH_DP2ADD */ "dp2add", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 14d2d745..2ce70dbf 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -196,6 +196,7 @@ enum vkd3d_shader_opcode VKD3DSIH_DEQ, VKD3DSIH_DGE, VKD3DSIH_DIV, + VKD3DSIH_DLT, VKD3DSIH_DMOV, VKD3DSIH_DP2, VKD3DSIH_DP2ADD, diff --git a/tests/d3d12.c b/tests/d3d12.c index 515364c5..1419225d 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -9940,8 +9940,8 @@ static void test_shader_instructions(void) {&ps_dge, {.d = {{0.0, 1.0}}}, {{0x00000000}}, true}, {&ps_dge, {.d = {{1.0, 1.0}}}, {{0xffffffff}}, true}, {&ps_dge, {.d = {{1.5, 1.0}}}, {{0xffffffff}}, true}, - {&ps_dlt, {.d = {{0.0, 1.0}}}, {{0xffffffff}}, true, true}, - {&ps_dlt, {.d = {{1.0, 1.0}}}, {{0x00000000}}, true, true}, + {&ps_dlt, {.d = {{0.0, 1.0}}}, {{0xffffffff}}, true}, + {&ps_dlt, {.d = {{1.0, 1.0}}}, {{0x00000000}}, true}, {&ps_dtou, {.d = {{ -NAN}}}, {{ 0, 0 }}, true, true}, {&ps_dtou, {.d = {{ NAN}}}, {{ 0, 0 }}, true, true}, {&ps_dtou, {.d = {{-INFINITY}}}, {{ 0, ~0u}}, true, true},
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 2 ++ libs/vkd3d-shader/spirv.c | 2 ++ libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + tests/d3d12.c | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index f557f83e..dd18b6f1 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -314,6 +314,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_DEQ = 0xc3, VKD3D_SM5_OP_DGE = 0xc4, VKD3D_SM5_OP_DLT = 0xc5, + VKD3D_SM5_OP_DNE = 0xc6, VKD3D_SM5_OP_DMOV = 0xc7, VKD3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, VKD3D_SM5_OP_EVAL_CENTROID = 0xcd, @@ -1258,6 +1259,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = {VKD3D_SM5_OP_DEQ, VKD3DSIH_DEQ, "u", "dd"}, {VKD3D_SM5_OP_DGE, VKD3DSIH_DGE, "u", "dd"}, {VKD3D_SM5_OP_DLT, VKD3DSIH_DLT, "u", "dd"}, + {VKD3D_SM5_OP_DNE, VKD3DSIH_DNE, "u", "dd"}, {VKD3D_SM5_OP_DMOV, VKD3DSIH_DMOV, "d", "d"}, {VKD3D_SM5_OP_EVAL_SAMPLE_INDEX, VKD3DSIH_EVAL_SAMPLE_INDEX, "f", "fi"}, {VKD3D_SM5_OP_EVAL_CENTROID, VKD3DSIH_EVAL_CENTROID, "f", "f"}, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index bb9e2bf5..3a1f1969 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7363,6 +7363,7 @@ static void vkd3d_dxbc_compiler_emit_comparison_instruction(struct vkd3d_dxbc_co case VKD3DSIH_INE: op = SpvOpINotEqual; break; case VKD3DSIH_DLT: case VKD3DSIH_LT: op = SpvOpFOrdLessThan; break; + case VKD3DSIH_DNE: case VKD3DSIH_NE: op = SpvOpFUnordNotEqual; break; case VKD3DSIH_UGE: op = SpvOpUGreaterThanEqual; break; case VKD3DSIH_ULT: op = SpvOpULessThan; break; @@ -9575,6 +9576,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, case VKD3DSIH_DEQ: case VKD3DSIH_DGE: case VKD3DSIH_DLT: + case VKD3DSIH_DNE: case VKD3DSIH_EQ: case VKD3DSIH_GE: case VKD3DSIH_IEQ: diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index b35748bc..d9306d6b 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -109,6 +109,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_DIV */ "div", /* VKD3DSIH_DLT */ "dlt", /* VKD3DSIH_DMOV */ "dmov", + /* VKD3DSIH_DNE */ "dne", /* VKD3DSIH_DP2 */ "dp2", /* VKD3DSIH_DP2ADD */ "dp2add", /* VKD3DSIH_DP3 */ "dp3", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 2ce70dbf..76704d5a 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -198,6 +198,7 @@ enum vkd3d_shader_opcode VKD3DSIH_DIV, VKD3DSIH_DLT, VKD3DSIH_DMOV, + VKD3DSIH_DNE, VKD3DSIH_DP2, VKD3DSIH_DP2ADD, VKD3DSIH_DP3, diff --git a/tests/d3d12.c b/tests/d3d12.c index 1419225d..e7585177 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -9935,8 +9935,8 @@ static void test_shader_instructions(void) {&ps_dmodifier, {.d = {{-1.5, 0.0}}}, {.d = {1.5f, 1.5f}}, true}, {&ps_deq, {.d = {{0.0, 0.0}}}, {{0xffffffff}}, true}, {&ps_deq, {.d = {{1.0, 0.0}}}, {{0x00000000}}, true}, - {&ps_dne, {.d = {{0.0, 0.0}}}, {{0x00000000}}, true, true}, - {&ps_dne, {.d = {{1.0, 0.0}}}, {{0xffffffff}}, true, true}, + {&ps_dne, {.d = {{0.0, 0.0}}}, {{0x00000000}}, true}, + {&ps_dne, {.d = {{1.0, 0.0}}}, {{0xffffffff}}, true}, {&ps_dge, {.d = {{0.0, 1.0}}}, {{0x00000000}}, true}, {&ps_dge, {.d = {{1.0, 1.0}}}, {{0xffffffff}}, true}, {&ps_dge, {.d = {{1.5, 1.0}}}, {{0xffffffff}}, true},
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com