vkd3d-shader/hlsl: Allow to force alignment on some semantic vars.

This is required to properly optimize signatures, because these
semantics must be alligned while being packed:
- Array elements.
- The first fields of structs.
- Major vectors of a matrix.

For now this has no effect since semantics are allocated with reg_size
4, but will have effect when optimizing interstage signatures.
This commit is contained in:
Francisco Casas
2024-10-18 18:31:38 -03:00
committed by Henri Verbeet
parent 7fd6c29ee8
commit d562b03c43
Notes: Henri Verbeet 2024-10-22 20:54:15 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1193
2 changed files with 44 additions and 23 deletions

View File

@@ -516,6 +516,9 @@ struct hlsl_ir_var
/* Whether the shader performs dereferences with non-constant offsets in the variable. */
bool indexable;
/* Whether this is a semantic variable that was split from an array, or is the first
* element of a struct, and thus needs to be aligned when packed in the signature. */
bool force_align;
uint32_t is_input_semantic : 1;
uint32_t is_output_semantic : 1;