slang
slang copied to clipboard
Fixes to Metal Input parameters and Output value input/output semantics
Fixes: #4487 Prepares code for a larger overhaul (#4375).
Note:
- Flattening a struct is the process of making a struct have 0 struct/class members.
Changes:
- Flatten all input(
flattenInputParameters
)/output(part ofwrapReturnValueInStruct
) structs and assign semantics accordingly. - Semantics when legalized have no specific logic other than to: 1. avoid overlapping semantics 2. Prefer assigning explicit semantics specified by a user.
- Added a more dynamic
legalizeSystemValue
system so more than 2 types can be targeted for legalization. This is required to legalizeoutput
. There is still no preference for any converted type, the first valid type will be converted to. - Fixed some issue with incorrect output semantics if not a fragment stage (when there are not any assigned semantics)
- Created
convertSystemValueSemanticNameToEnum
and expanded the existing System-Value Enum system. This allows (sometimes) faster comparisons and helps prepare code for porting intoslang-ir-legalize-varying-params.cpp
(#4375) - Separated
legalizeSystemValueParameters
. This was done to make it easier to runlegalizeSystemValue
1 system-value at a time to simplify logic. This change is optional and can be undone if not preferred. - Wrap everything inside a MetalEntryPointLegalizationContext. This was done since it simplifies a lot of logic and will be required for #4375
- Git diff is quite ugly due to the MetalEntryPointLegalizationContext.
- Changed some tests which had wrong launch arguments and/or invalid test content