-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Shader Processor: process imported shader #3290
Conversation
b40aee7
to
4a6999b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we actually need to loop here / reprocess the same lines over and over. Once a line has been processed, it should never needs to be re-processed. I think we could make this more efficient by just recursively running the shader processor on import text prior to appending it to the final output.
It's to have the possibility of nested imports. It's probably not necessary to loop over everything until nothing changed, but It was funnier to write that way and I don't think it should take too long to process text... |
d98872c
to
71447f9
Compare
no more |
Awesome. Thats exactly what I was thinking of :) |
bors r+ |
# Objective - I want to be able to use `#ifdef` and other processor directives in an imported shader ## Solution - Process imported shader strings Co-authored-by: François <[email protected]>
# Objective - 3d examples fail to run in webgl2 because of unsupported texture formats or texture too large ## Solution - switch to supported formats if a feature is enabled. I choose a feature instead of a build target to not conflict with a potential webgpu support Very inspired by superdump@6813b2e, and need #3290 to work. I named the feature `webgl2`, but it's only needed if one want to use PBR in webgl2. Examples using only 2D already work. Co-authored-by: François <[email protected]>
Objective
#ifdef
and other processor directives in an imported shaderSolution