vkd3d-shader/spirv: Support bool source in spirv_compiler_emit_discard().

This commit is contained in:
Conor McCarthy 2024-03-20 14:53:15 +10:00 committed by Alexandre Julliard
parent 6b6e4bc212
commit 8d947ce868
Notes: Alexandre Julliard 2024-03-27 23:08:24 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/736

View File

@ -8007,8 +8007,9 @@ static void spirv_compiler_emit_discard(struct spirv_compiler *compiler,
* a mismatch between the VSIR structure and the SPIR-V one, which would cause problems if * a mismatch between the VSIR structure and the SPIR-V one, which would cause problems if
* structurisation is necessary. Therefore we emit it as a function call. */ * structurisation is necessary. Therefore we emit it as a function call. */
condition_id = spirv_compiler_emit_load_src(compiler, src, VKD3DSP_WRITEMASK_0); condition_id = spirv_compiler_emit_load_src(compiler, src, VKD3DSP_WRITEMASK_0);
condition_id = spirv_compiler_emit_int_to_bool(compiler, if (src->reg.data_type != VKD3D_DATA_BOOL)
instruction->flags, src->reg.data_type, 1, condition_id); condition_id = spirv_compiler_emit_int_to_bool(compiler,
instruction->flags, src->reg.data_type, 1, condition_id);
void_id = vkd3d_spirv_get_op_type_void(builder); 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), vkd3d_spirv_build_op_function_call(builder, void_id, spirv_compiler_get_discard_function_id(compiler),
&condition_id, 1); &condition_id, 1);