[Shaders] Adds TypeName generic to use type parameters in SDSL#1400
Draft
tebjan wants to merge 1 commit into
Draft
[Shaders] Adds TypeName generic to use type parameters in SDSL#1400tebjan wants to merge 1 commit into
tebjan wants to merge 1 commit into
Conversation
tebjan
marked this pull request as draft
April 7, 2022 08:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Details
Adds
TypeNamegeneric parameter to SDSL to instantiate shaders with type parameters.Description
This will allow writing shaders like in a high-level programming language with generic types.
Silly Example:
Ping @xen2 and @xoofx before I write more code, the SDSL AST files look a bit machine-generated. Did you use some kind of tool to generate the definitions? If yes, does it still exist? Any other input/thoughts are welcome too.
Related Issue
vvvv/VL.StandardLibs#242
Motivation and Context
We generate a lot of little shaders to patch shaders in our visual programming language. For that, we wrote the type permutations by hand at the moment. If we can programmatically instantiate shaders with type parameters at runtime, there need to be significantly fewer shaders to be written.
Also, having generic types in a shader language is badass.
Types of changes
Checklist