slang icon indicating copy to clipboard operation
slang copied to clipboard

Fixes to Metal Input parameters and Output value input/output semantics

Open ArielG-NV opened this issue 7 months ago • 0 comments

Fixes: #4487 Prepares code for a larger overhaul (#4375).

Note:

  1. Flattening a struct is the process of making a struct have 0 struct/class members.

Changes:

  1. Flatten all input(flattenInputParameters)/output(part of wrapReturnValueInStruct) structs and assign semantics accordingly.
  2. Semantics when legalized have no specific logic other than to: 1. avoid overlapping semantics 2. Prefer assigning explicit semantics specified by a user.
  3. Added a more dynamic legalizeSystemValue system so more than 2 types can be targeted for legalization. This is required to legalize output. There is still no preference for any converted type, the first valid type will be converted to.
  4. Fixed some issue with incorrect output semantics if not a fragment stage (when there are not any assigned semantics)
  5. Created convertSystemValueSemanticNameToEnum and expanded the existing System-Value Enum system. This allows (sometimes) faster comparisons and helps prepare code for porting into slang-ir-legalize-varying-params.cpp (#4375)
  6. Separated legalizeSystemValueParameters. This was done to make it easier to run legalizeSystemValue 1 system-value at a time to simplify logic. This change is optional and can be undone if not preferred.
  7. 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.
  8. Changed some tests which had wrong launch arguments and/or invalid test content

ArielG-NV avatar Jul 03 '24 14:07 ArielG-NV