mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/ir: Lower monolithic switches to selection ladders.
PHI nodes must be fixed up after this pass, because the block references might have become broken. For simplicitly this is not handled yet. The goal for this pass is to make the CFG structurizer simpler, because only conditional and unconditional branches must be supported. Eventually this limitation might be lifted if there is advantage in doing so.
This commit is contained in:
committed by
Alexandre Julliard
parent
b97edee03d
commit
378109051c
Notes:
Alexandre Julliard
2024-01-29 22:50:16 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Conor McCarthy (@cmccarthy) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/598
@@ -7830,8 +7830,9 @@ static void spirv_compiler_emit_branch(struct spirv_compiler *compiler,
|
||||
}
|
||||
|
||||
condition_id = spirv_compiler_emit_load_src(compiler, &src[0], VKD3DSP_WRITEMASK_0);
|
||||
condition_id = spirv_compiler_emit_int_to_bool(compiler,
|
||||
VKD3D_SHADER_CONDITIONAL_OP_NZ, src[0].reg.data_type, 1, condition_id);
|
||||
if (src[0].reg.data_type != VKD3D_DATA_BOOL)
|
||||
condition_id = spirv_compiler_emit_int_to_bool(compiler,
|
||||
VKD3D_SHADER_CONDITIONAL_OP_NZ, src[0].reg.data_type, 1, condition_id);
|
||||
/* Emit the merge immediately before the branch instruction. */
|
||||
if (instruction->src_count >= 4)
|
||||
spirv_compiler_emit_merge(compiler, src[3].reg.idx[0].offset,
|
||||
|
Reference in New Issue
Block a user