vkd3d-shader/tpf: Compile HLSL to tpf through vsir, part 2.
As a reminder, the idea is to translate all the hlsl_ir_node
instructions to a vsir_instruction
in a vsir_program
, so that tpf_compile
no longer needs hlsl_ir constructs such as a hlsl_ir_function_decl
.
Until all the nodes are translated, the hlsl_ir_function_decl.body
block will still be in charge of determining the instruction order, so, like for the hlsl->vsir->d3dbc translation, the hlsl_ir_vsir_instruction_ref
instruction type is introduced as a temporary way to have an hlsl_ir instruction refer to a vsir_instruction
.
Since hull and domain shader support, currently being introduced by @shaunren, require access to both the entry_func
and the ctx->patch_constant_func
there are now two hlsl_ir_blocks that will have hlsl_ir_vsir_instruction_ref
pointing to the instructions added to the vsir_program
. Eventually the vsir_program
will merge the instructions for both these blocks and add the right markers such as HS_FORK_PHASE.
In this series I write the DCL_TEMP_COUNT and DCL_INDEXABLE_TEMP as vsir instructions and move the temp allocation back to hlsl_codegen.c, which I think is required to complete the hlsl->vsir->tpf
translation, since allocation should be solved for a well formed vsir_program.
PD: I will focus on translating hlsl_ir_node
instructions not related to hull and domain shaders now to avoid conflicts.