Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- That's fine for me, but you could have added if "src_count = 0" thing just before the "if" that writes the "else" (confusing, isn't it?), and it would have covered both branches.
Giovanni.
Il 07/04/22 19:56, Francisco Casas ha scritto:
Signed-off-by: Francisco Casas fcasas@codeweavers.com
libs/vkd3d-shader/hlsl_sm4.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c index 872118c1..6a2b52cb 100644 --- a/libs/vkd3d-shader/hlsl_sm4.c +++ b/libs/vkd3d-shader/hlsl_sm4.c @@ -1854,28 +1854,29 @@ static void write_sm4_expr(struct hlsl_ctx *ctx, static void write_sm4_if(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer, const struct hlsl_ir_if *iff) { struct sm4_instruction instr = { .opcode = VKD3D_SM4_OP_IF | VKD3D_SM4_CONDITIONAL_NZ, .src_count = 1, };
assert(iff->condition.node->data_type->dimx == 1); sm4_src_from_node(&instr.srcs[0], iff->condition.node, VKD3DSP_WRITEMASK_ALL); write_sm4_instruction(buffer, &instr); write_sm4_block(ctx, buffer, &iff->then_instrs); 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); } instr.opcode = VKD3D_SM4_OP_ENDIF;
- instr.src_count = 0; write_sm4_instruction(buffer, &instr); }