Skip to content

vkd3d-shader/dxil: Refactor DXIL instruction handler parameters, part 1.

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

Handling forward-referenced DXIL GEP instructions will require two passes over the DXIL instructions. Ideally we would introduce a vsir access chain instruction for GEP, but the structuriser may create graphs where the GEP no longer dominates all instructions which consume its result. Resolving this with a SPIR-V variable or phi requires the VariablePointers capability, which is not implemented in RADV.

A second pass is simpler and more robust if we use the same instruction opcode switch statement or handler table as in the first pass, because then we don't need to know which instructions consume a GEP result. In either case it is helpful to make all handlers use identical function parameters. Also, the second pass must insert instructions into the output array, and the current scheme cannot reasonably handle this, so struct function_emission_state must be used to handle instruction allocation.

This MR makes the parameter list identical for a subset of the instructions.

Edited by Conor McCarthy

Merge request reports

Loading