diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 0ece32dd1..54378b7a5 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -4536,6 +4536,9 @@ static enum vkd3d_shader_opcode map_binary_op(uint64_t code, const struct sm6_ty is_valid = is_int && !is_bool; break; case BINOP_UDIV: + op = VSIR_OP_UDIV_SIMPLE; + is_valid = is_int && !is_bool; + break; case BINOP_UREM: op = VSIR_OP_UDIV; is_valid = is_int && !is_bool; @@ -4611,6 +4614,7 @@ static void sm6_parser_emit_binop(struct sm6_parser *sm6, const struct dxil_reco case VSIR_OP_USHR: case VSIR_OP_IDIV: case VSIR_OP_UDIV: + case VSIR_OP_UDIV_SIMPLE: case VSIR_OP_IREM: silence_warning = !(flags & ~PEB_EXACT); break; diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 21633b656..55e150a3f 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -332,6 +332,7 @@ const char *vsir_opcode_get_name(enum vkd3d_shader_opcode op, const char *error) [VSIR_OP_TEXREG2RGB ] = "texreg2rgb", [VSIR_OP_UBFE ] = "ubfe", [VSIR_OP_UDIV ] = "udiv", + [VSIR_OP_UDIV_SIMPLE ] = "udiv_simple", [VSIR_OP_UGE ] = "uge", [VSIR_OP_ULT ] = "ult", [VSIR_OP_UMAX ] = "umax", @@ -7927,6 +7928,7 @@ static bool vsir_src_is_masked(enum vkd3d_shader_opcode opcode, unsigned int src case VSIR_OP_TAN: case VSIR_OP_UBFE: case VSIR_OP_UDIV: + case VSIR_OP_UDIV_SIMPLE: case VSIR_OP_UGE: case VSIR_OP_ULT: case VSIR_OP_UMAX: diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 767f5d1e3..1abf55fba 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7548,6 +7548,7 @@ static SpvOp spirv_compiler_map_alu_instruction(const struct vkd3d_shader_instru {VSIR_OP_MUL, SpvOpFMul}, {VSIR_OP_NOT, SpvOpNot}, {VSIR_OP_OR, SpvOpBitwiseOr}, + {VSIR_OP_UDIV_SIMPLE, SpvOpUDiv}, {VSIR_OP_USHR, SpvOpShiftRightLogical}, {VSIR_OP_UTOD, SpvOpConvertUToF}, {VSIR_OP_UTOF, SpvOpConvertUToF}, @@ -7673,6 +7674,7 @@ static enum vkd3d_result spirv_compiler_emit_alu_instruction(struct spirv_compil { case VSIR_OP_IDIV: case VSIR_OP_IREM: + case VSIR_OP_UDIV_SIMPLE: check_zero = true; break; @@ -10692,6 +10694,7 @@ static int spirv_compiler_handle_instruction(struct spirv_compiler *compiler, case VSIR_OP_MUL: case VSIR_OP_NOT: case VSIR_OP_OR: + case VSIR_OP_UDIV_SIMPLE: case VSIR_OP_USHR: case VSIR_OP_UTOD: case VSIR_OP_UTOF: diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index ccad9d558..41a30751d 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -580,6 +580,7 @@ enum vkd3d_shader_opcode VSIR_OP_TEXREG2RGB, VSIR_OP_UBFE, VSIR_OP_UDIV, + VSIR_OP_UDIV_SIMPLE, VSIR_OP_UGE, VSIR_OP_ULT, VSIR_OP_UMAX,