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

Handle PS uint inputs #104

Closed
nbentyNV opened this issue Jul 15, 2017 · 1 comment
Closed

Handle PS uint inputs #104

nbentyNV opened this issue Jul 15, 2017 · 1 comment

Comments

@nbentyNV
Copy link
Collaborator

We have the following declaration in SceneEditorCommon.slang.h: uint drawID : DRAW_ID;

HLSL implicitly assigns nointerpolation qualifier to it, but GLSL requires that the user define it with the flat qualifier.
I tried adding nointerpolation, but Slang didn't replace it with flat.

The simple solution for now would be to just replace nointerpolation with flat, but the long-term solution would be for Slang to detect uint outputs and assign the required qualifiers

@tangent-vector-personal

Spitting out nointerpolation as flat should be easy in principle. There might be an additional bug here where my "lowering" logic isn't propagating interpolation qualifiers from struct fields over to the global variables I generate in GLSL.

Doing something based on types should be easy enough too. I will try to implement both when I fix this.

tangent-vector added a commit to tangent-vector/slang that referenced this issue Jul 17, 2017
Fixes shader-slang#104

- Map HLSL `nointerpolation` to GLSL `flat`

- When lowering a `struct` type varying input/output, look for interpolation modifiers along the "chain" from the leaf field up to the original shader input variable (and take the first one found)
  - Not sure if this is strictly needed, but it seems like a reasonable policy

- Add `flat` to varying input of integer type, with no other interpolation modifier
  - Note: I do *not* do anything to ignore a manually imposed interpolation modifier that might be incorrect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants