vkd3d-shader/ir: Introduce VSIR_OP_UDIV_SIMPLE.

It is meant to compute the unsigned integer division, without
computing the modulo at the same time.
This commit is contained in:
Giovanni Mascellani
2025-06-20 18:39:07 +02:00
committed by Henri Verbeet
parent ada09d003d
commit 78e0f8412d
Notes: Henri Verbeet 2025-06-25 17:09:38 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1603
4 changed files with 10 additions and 0 deletions

View File

@@ -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: