vkd3d-shader/spirv: Respect VKD3D_SHADER_CONDITIONAL_OP_Z when discard has a bool argument.

This commit is contained in:
Elizabeth Figura 2024-06-13 12:23:50 -05:00 committed by Henri Verbeet
parent 9e59e57cb3
commit c2ce15b623
Notes: Henri Verbeet 2024-07-11 17:16:48 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/870

View File

@ -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);