Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 1 + libs/vkd3d-shader/sm4.h | 1 + libs/vkd3d-shader/spirv.c | 2 ++ libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + tests/d3d12.c | 2 +- 6 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 2beb2ccb..8762094e 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -818,6 +818,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = {VKD3D_SM5_OP_DRCP, VKD3DSIH_DRCP, "d", "d"}, {VKD3D_SM5_OP_DTOI, VKD3DSIH_DTOI, "i", "d"}, {VKD3D_SM5_OP_DTOU, VKD3DSIH_DTOU, "u", "d"}, + {VKD3D_SM5_OP_ITOD, VKD3DSIH_ITOD, "d", "i"}, };
static const enum vkd3d_shader_register_type register_type_table[] = diff --git a/libs/vkd3d-shader/sm4.h b/libs/vkd3d-shader/sm4.h index a88447d1..c04fa02b 100644 --- a/libs/vkd3d-shader/sm4.h +++ b/libs/vkd3d-shader/sm4.h @@ -337,6 +337,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_DRCP = 0xd4, VKD3D_SM5_OP_DTOI = 0xd6, VKD3D_SM5_OP_DTOU = 0xd7, + VKD3D_SM5_OP_ITOD = 0xd8, };
enum vkd3d_sm4_instruction_modifier diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 35cc62fd..26d10838 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -9337,6 +9337,7 @@ static void vkd3d_dxbc_compiler_emit_double_conversion(struct vkd3d_dxbc_compile case VKD3DSIH_FTOD: op = SpvOpFConvert; break; case VKD3DSIH_DTOI: op = SpvOpConvertFToS; break; case VKD3DSIH_DTOU: op = SpvOpConvertFToU; break; + case VKD3DSIH_ITOD: op = SpvOpConvertSToF; break; default: ERR("Unexpected instruction %#x.\n", instruction->handler_idx); return; @@ -9764,6 +9765,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, case VKD3DSIH_DTOI: case VKD3DSIH_DTOU: case VKD3DSIH_FTOD: + case VKD3DSIH_ITOD: vkd3d_dxbc_compiler_emit_double_conversion(compiler, instruction); break; case VKD3DSIH_DCL_HS_MAX_TESSFACTOR: diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 0d5c06b5..0dc18f4e 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -189,6 +189,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_INEG */ "ineg", /* VKD3DSIH_ISHL */ "ishl", /* VKD3DSIH_ISHR */ "ishr", + /* VKD3DSIH_ITOD */ "itod", /* VKD3DSIH_ITOF */ "itof", /* VKD3DSIH_LABEL */ "label", /* VKD3DSIH_LD */ "ld", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index fba3764c..aa04cb45 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -278,6 +278,7 @@ enum vkd3d_shader_opcode VKD3DSIH_INEG, VKD3DSIH_ISHL, VKD3DSIH_ISHR, + VKD3DSIH_ITOD, VKD3DSIH_ITOF, VKD3DSIH_LABEL, VKD3DSIH_LD, diff --git a/tests/d3d12.c b/tests/d3d12.c index 6091d540..b6a773ec 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -10031,7 +10031,7 @@ static void test_shader_instructions(void) {&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, true}, - {&ps_itod, {.u = {{3, INT_MIN}}}, {.d = {3.0, -2147483648.0}}, true, 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_dmul, {.d = {{ 1.5, 3.0}}}, {.d = { 4.5, -4.5}}, true}, {&ps_ddiv, {.d = {{ 2.0, 4.0}}}, {.d = { 0.5, 2.0}}, true},