mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Write the else block only if it isn't empty.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
dbd7e18364
commit
0f16b8ec78
@ -1446,11 +1446,14 @@ static void write_sm4_if(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buf
|
||||
|
||||
write_sm4_block(ctx, buffer, &iff->then_instrs);
|
||||
|
||||
instr.opcode = VKD3D_SM4_OP_ELSE;
|
||||
instr.src_count = 0;
|
||||
write_sm4_instruction(buffer, &instr);
|
||||
if (!list_empty(&iff->else_instrs.instrs))
|
||||
{
|
||||
instr.opcode = VKD3D_SM4_OP_ELSE;
|
||||
instr.src_count = 0;
|
||||
write_sm4_instruction(buffer, &instr);
|
||||
|
||||
write_sm4_block(ctx, buffer, &iff->else_instrs);
|
||||
write_sm4_block(ctx, buffer, &iff->else_instrs);
|
||||
}
|
||||
|
||||
instr.opcode = VKD3D_SM4_OP_ENDIF;
|
||||
write_sm4_instruction(buffer, &instr);
|
||||
|
Loading…
Reference in New Issue
Block a user