vkd3d-shader/spirv: Do not handle division by zero for VSIR_OP_IDIV or VSIR_OP_IREM.

These correspond to the DXIL SDiv and SRem instructions, for which division by
zero is undefined. Division by zero is also undefined for DXIL UDiv and URem;
addressing those is slightly more involved.
This commit is contained in:
Henri Verbeet
2025-10-07 00:33:27 +02:00
parent dd55b15865
commit 90cbe25d1e
Notes: Henri Verbeet 2025-10-13 19:32:21 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1775

View File

@@ -7676,8 +7676,6 @@ static enum vkd3d_result spirv_compiler_emit_alu_instruction(struct spirv_compil
* so we have an explicit check. */ * so we have an explicit check. */
switch (instruction->opcode) switch (instruction->opcode)
{ {
case VSIR_OP_IDIV:
case VSIR_OP_IREM:
case VSIR_OP_UDIV_SIMPLE: case VSIR_OP_UDIV_SIMPLE:
case VSIR_OP_UREM: case VSIR_OP_UREM:
check_zero = true; check_zero = true;