DXIL handles are used to represent descriptors. Currently they are
translated to registers of the appropriate type (depending on the
descriptor type) and three indices. The first two indices are used
to represent the descriptor itself (through its signature and array
index), and are filled when the handle itself is created. The last
index is used with constant buffers to address the data inside the
buffer itself, and it goes unused with other descriptor types.
As currently implemented, however, registers for descriptors other
than constant buffers are still created with three indices, even if
the last one is useless and set to -1. In the interest of creating
more sensible VSIR code, this is now removed: DXIL handles are
created with just two indices; a third one is added when accessing
constant buffers, and nothing is changed for other descriptor types.
We need users of a value to be freed before the value itself is.
Due to copy propagation or use of the pre-allocated error instruction,
static_initializers can contain values that will be used in function blocks.
Historically the SPIR-V backend was only fed by the TPF parser,
which only generates _sat destination modifiers. Now it is fed
by the D3DBC parser too (among others), so it mustn't assert on
other modifiers.
Modifier _pp can be trivially ignored. Modifier _centroid would
probably require some handling, but I'm not immediately sure of
what should happen and it doesn't look like a very urgent thing
anyway, so I'm degrading the assertion to FIXME().
The idea is to keep at the beginning of the files the sections that
contain general introduction to vkd3d and how it works, which are
likely the first things a reader needs. Then the sections going into
more specific and verbose topics, which are probably to be read only
when looking some specific piece of information.
Object data is used for strings, textures, and shaders. Samplers are handled separately.
The section is a contigious stream of <id><size><object-data>, size field is used
to advance to the next <id> position.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>