Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIR-V SV_InstanceId support in pixel shader #4368

Commits on Jun 12, 2024

  1. solve issue by making 'non SV for SPIRV' system semantics, no longer …

    …an SV once diagnosed by slang
    
    Problem:
    1. SV_InstanceID (HLSL) is allowed as an output semantic with HLSL, it is also allowed for input into pixel shader. We need to account for multiple entry points in 1 file using both of these scenarios at once.
    2. SPIRV does not allow `SV_InstanceID` as a builtin, `SV_InstanceID` must be passed as a regular `flat` `Input` from vertex shader.
    
    Solution: Slang needs to treat these SV objects as non built-in's. As a result:
    1. Slang needs to allocate for vertex output and fragment Input binding slots for all SV_InstanceID uses (if the target is SPIRV). This allows Slang to prepare an open slot to bind these SV objects to.
    2. Slang needs to not emit built in modifier for these not actual built in variables (under the specific circumstances described).
    
    note: `VarLayout` was made not `HOISTABLE` since I don't believe it needs to be `HOISTABLE`.
    * The code can be made to work even if `VarLayout` is `HOISTABLE`.
    ArielG-NV committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    fef8f00 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    673f64e View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2024

  1. fix compile warnings

    ArielG-NV committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    6c69fed View commit details
    Browse the repository at this point in the history
  2. address review comments and reimplement operand removal

    1. remove an operand by selectively copying operands
    2. test to ensure `Flat` is in the test shaders
    * we do not need to manually add `Flat` in the code since this is done for us in emit-spirv. This is the behavior since `uint` on a fragment `Input` must be `Flat`, else it is a VK validation error.
    ArielG-NV committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    5492caa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    313e8ec View commit details
    Browse the repository at this point in the history
  4. address review

    remove clone logic
    ArielG-NV committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    25f0b92 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e87b2df View commit details
    Browse the repository at this point in the history
  6. address review

    remove unused function
    reserve instead of setCount with ShortList
    ArielG-NV committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    1cb22e4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a38ec4a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3b6493b View commit details
    Browse the repository at this point in the history