From c2ce15b62366967da7b4e139930a415dd8896e36 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Thu, 13 Jun 2024 12:23:50 -0500 Subject: [PATCH] vkd3d-shader/spirv: Respect VKD3D_SHADER_CONDITIONAL_OP_Z when discard has a bool argument. --- libs/vkd3d-shader/spirv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 92130ff3..215a64a9 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -8152,6 +8152,8 @@ static void spirv_compiler_emit_discard(struct spirv_compiler *compiler, if (src->reg.data_type != VKD3D_DATA_BOOL) condition_id = spirv_compiler_emit_int_to_bool(compiler, instruction->flags, src->reg.data_type, 1, condition_id); + else if (instruction->flags & VKD3D_SHADER_CONDITIONAL_OP_Z) + condition_id = vkd3d_spirv_build_op_logical_not(builder, vkd3d_spirv_get_op_type_bool(builder), condition_id); void_id = vkd3d_spirv_get_op_type_void(builder); vkd3d_spirv_build_op_function_call(builder, void_id, spirv_compiler_get_discard_function_id(compiler), &condition_id, 1);