-
-
Notifications
You must be signed in to change notification settings - Fork 15
Add target attribute #63
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
base: main
Are you sure you want to change the base?
Conversation
this sounds nice, but I have troubles to see some real-life scenarios where it would be useful as is, since most NZSL code should be portable, do you have any example? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
- Coverage 76.78% 76.49% -0.29%
==========================================
Files 159 159
Lines 21835 21931 +96
Branches 6745 6790 +45
==========================================
+ Hits 16765 16777 +12
- Misses 4977 5061 +84
Partials 93 93
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
I've been thinking of supporting interop features similar to slang's (specifically this section). |
Sounds good to prepare the glsl/spir-v assembly feature. Style question: should it stay a separate attribute or be merged with the cond attribute? Like [cond(target(spirv))]
{
// SPIR-V specific
} Also, how to handle SPIR-V for OpenGL (with OpenGL 4.5) and SPIR-V for Vulkan? |
The
I am also thinking about this too. [cond(target(spirv) && ???)]
{
// GL SPIR-V specific
} Where |
It's more complicated than that, If we decide to add a One other option is to not add a
I don't think this is possible, So we should probably split the GLSL/SPIR-V targets from the GL/GL ES/Vulkan environment, we also could add a way to test if an extension is present, etc. |
This pull request introduces a new attribute for
ScopedStatement
calledtarget
. Target attribute allows programmer to write target (and optionally, it's version) specific shader code. Here is how it looks: