Comments (3)
We've discussed this over slack, and it seems like Slang is going to have to help solve this issue. There are a few pieces to the puzzle here:
-
struct
types are already allowed as varying input/output by GLSL/glslang, for everything except vertex shader input and fragment output. If that alone is the ask, then nothing is actually needed from Slang. -
struct
types as VS input seem to be required, to handleVS_IN
(which is defined in the same place asVS_OUT
, so that seems to be part of the request (can you confirm, Nir?) -
The other thing I think is hidden in this ask (and this was subtle enough I almost missed it) is the ability for a struct like
VS_OUT
to declare "system-value semantic" inputs/outputs, and to translate a GLSL shader that uses that type to use the appropriategl_*
built-in variables, just like we would do when that type is used as a parameter to the entry point.
That last issue forces Slang to scalarize a struct
being used as varying input/output even when it might not seem to be required by GLSL/glslang. If we don't scalarize things, and switch an SV_Position
output over to gl_Position
, then we will be declaring something very different from what the user meant.
This is a big, messy feature, but it seems tied in to a bunch of places where Slang is already doing a bad job with GLSL style global-scope varying input/output, so it probably makes sense to try to bite this off.
Nir, can you confirm that your expectation is for Slang to auto-magically handle the system-value semantic fields inside VS_OUT
when it is used for a global-scope in
or out
variable?
from slang.
This basics of this should be implemented in #118.
I'm going to keep this open a bit longer to confirm that the changes actually work in the context of Falcor (instead of just for my Slang test case).
from slang.
Okay, "customer" feedback tells me this is working well enough in simple cases, so I'll close it for now and we can open new issues when things break in more involved cases.
from slang.
Related Issues (20)
- Consider supporting #pragma pack_matrix() HOT 1
- Capability System: Profile and look into performance with larger systems
- Metal: support integer type texture
- Fix memory leak in slang.dll HOT 2
- Create the breakdown profiling of slang HOT 2
- AD Cleanup: Use a temporary accumulation inst such as `IRAccumulate` instead of explicitly loading, adding and storing differential values in reverse mode HOT 1
- Implement metrics tracking for GitHub engagement
- Document the existing auto-diff type system, semantic checking and AST synthesis methods
- Return ptr of new Object out of Slang DLL HOT 5
- Stage the CTS cases known failure for now. HOT 1
- Fix CTS tests failures.
- Breakdown the runtime cost of Slang backend passes.
- constexpr doesn't work as expected when used on a function HOT 3
- Design documentation for DXIL linking of shader-modules
- Pointer example on User Guide doesn't work HOT 5
- Incorrect inlining of generic initializers HOT 1
- Throw an error when using `[[vk::binding]]` on global shader parameters
- Wrong matrix operations in Metal? HOT 6
- How to import modules :) HOT 1
- support for opengl HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slang.