Skip to content

vkd3d-shader/dxil: Get rid of struct sm6_block.

Conor McCarthy requested to merge cmccarthy/vkd3d:sm6_block into master

Emission of code into individual block instruction arrays was done to enable construction of a control flow graph. A graph is constructed from the flat instruction array in a later pass, so blocks are not needed. Removing struct sm6_block involves moving emission of branch, switch, ret and phi from a later pass into the main instruction parser.

It is possible to emit instructions directly into the array in struct vsir_program instead of from sm6_function_emit_instructions(), but since the patch constant function occurs first in DXIL hull shaders, this would reverse the current order of functions in the flat array. That may be acceptable, but it is left for a later patch in case any issues arise.

Emitting phi instructions during parsing means forward-referenced incoming values are handled in the same way used for other instructions. Handling them in a later pass meant that all values were defined when phis were emitted. This change is not expected to cause any issues for the reason stated in the comment added by that commit.

There are 7 commit here, but one adds an error call and another moves code to a helper.

EDIT: Added another commit to move validation of relative indices. I think it's a good idea to avoid leaving the code in a half-converted state, but can do that if necessary.

Edited by Conor McCarthy

Merge request reports

Loading