Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/dxil.c:
- {
const struct sm6_block *block = function->blocks[i];
if (!sm6_parser_require_space(sm6, block->instruction_count + !i + 3))
{
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_OUT_OF_MEMORY,
"Out of memory emitting shader instructions.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
if (function->block_count > 1)
{
if (!i)
sm6_parser_emit_branch(sm6, block->synthetic_id);
sm6_parser_emit_label(sm6, block->synthetic_id);
}
sm6_block_emit_instructions(block, sm6);
I guess this could be even inlined here, it's very short and it fits nicely into what `sm6_function_emit_blocks()` is doing.