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 | 12 ++++++------ 6 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 2b30dd4a..2beb2ccb 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -817,6 +817,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = {VKD3D_SM5_OP_DFMA, VKD3DSIH_DFMA, "d", "ddd"}, {VKD3D_SM5_OP_DRCP, VKD3DSIH_DRCP, "d", "d"}, {VKD3D_SM5_OP_DTOI, VKD3DSIH_DTOI, "i", "d"}, + {VKD3D_SM5_OP_DTOU, VKD3DSIH_DTOU, "u", "d"}, };
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 4aefa990..a88447d1 100644 --- a/libs/vkd3d-shader/sm4.h +++ b/libs/vkd3d-shader/sm4.h @@ -336,6 +336,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_DFMA = 0xd3, VKD3D_SM5_OP_DRCP = 0xd4, VKD3D_SM5_OP_DTOI = 0xd6, + VKD3D_SM5_OP_DTOU = 0xd7, };
enum vkd3d_sm4_instruction_modifier diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index a15735f5..35cc62fd 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -9336,6 +9336,7 @@ static void vkd3d_dxbc_compiler_emit_double_conversion(struct vkd3d_dxbc_compile case VKD3DSIH_DTOF: case VKD3DSIH_FTOD: op = SpvOpFConvert; break; case VKD3DSIH_DTOI: op = SpvOpConvertFToS; break; + case VKD3DSIH_DTOU: op = SpvOpConvertFToU; break; default: ERR("Unexpected instruction %#x.\n", instruction->handler_idx); return; @@ -9761,6 +9762,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, break; case VKD3DSIH_DTOF: case VKD3DSIH_DTOI: + case VKD3DSIH_DTOU: case VKD3DSIH_FTOD: vkd3d_dxbc_compiler_emit_double_conversion(compiler, instruction); break; diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 5c28e00a..0d5c06b5 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -130,6 +130,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_DSY_FINE */ "deriv_rty_fine", /* VKD3DSIH_DTOF */ "dtof", /* VKD3DSIH_DTOI */ "dtoi", + /* VKD3DSIH_DTOU */ "dtou", /* VKD3DSIH_ELSE */ "else", /* VKD3DSIH_EMIT */ "emit", /* VKD3DSIH_EMIT_STREAM */ "emit_stream", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 7f2db6d1..fba3764c 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -219,6 +219,7 @@ enum vkd3d_shader_opcode VKD3DSIH_DSY_FINE, VKD3DSIH_DTOF, VKD3DSIH_DTOI, + VKD3DSIH_DTOU, VKD3DSIH_ELSE, VKD3DSIH_EMIT, VKD3DSIH_EMIT_STREAM, diff --git a/tests/d3d12.c b/tests/d3d12.c index d68ab75e..6091d540 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -10022,12 +10022,12 @@ static void test_shader_instructions(void) {&ps_dge, {.d = {{1.5, 1.0}}}, {{0xffffffff}}, 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}, - {&ps_dtou, {.d = {{ INFINITY}}}, {{~0u, 0 }}, true, true}, - {&ps_dtou, {.d = {{ -1.0}}}, {{ 0, 1 }}, true, true}, - {&ps_dtou, {.d = {{ 1.0}}}, {{ 1, 0 }}, true, true}, + {&ps_dtou, {.d = {{ -NAN}}}, {{ 0, 0 }}, true}, + {&ps_dtou, {.d = {{ NAN}}}, {{ 0, 0 }}, true}, + {&ps_dtou, {.d = {{-INFINITY}}}, {{ 0, ~0u}}, true}, + {&ps_dtou, {.d = {{ INFINITY}}}, {{~0u, 0 }}, 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, true},