From 90cbe25d1edf4f5d1234280f4994641ba096e6e1 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 7 Oct 2025 00:33:27 +0200 Subject: [PATCH] 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. --- libs/vkd3d-shader/spirv.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 51165105b..b563459f4 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7676,8 +7676,6 @@ static enum vkd3d_result spirv_compiler_emit_alu_instruction(struct spirv_compil * so we have an explicit check. */ switch (instruction->opcode) { - case VSIR_OP_IDIV: - case VSIR_OP_IREM: case VSIR_OP_UDIV_SIMPLE: case VSIR_OP_UREM: check_zero = true;