On Wed Nov 8 16:16:36 2023 +0000, Henri Verbeet wrote:
Perhaps alternatively, we could also consider storing SSA value types as an array in the vkd3d_shader_desc structure, somewhat similar to the approach taken for block names.
In DXIL it's when a source operand has an higher value index than the current value. In VSIR it means the instruction which writes the SSA id is at a higher array index than one which reads it as source. In SPIR-V we emit an instruction with an undefined source operand id and define it as a result id later.
A complication with SPIR-V is the helper functions for building instructions have no support for using a passed result id declared earlier. It's far simpler to set the forward-declared id with OpCopyObject than modify all the helpers.
Yes we could store a type array in vkd3d_shader_desc. It would essentially be a reduced version of the value array.