-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ShaderProcessor partially updating shader source to support uniform buffers #4402
Conversation
Co-authored-by: Will Eastcott <will@playcanvas.com>
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.
It seems like we're adding an invisible layer of processing to our shader code that will ultimately be difficult for users to debug if and when it goes wrong. I'm a little concerned that we're not really documenting the expectations or limitations of this step and it will ultimately become a magical black-box.
Are you happy with our approach of regex'ing shaders like this and processing the code in this way? Or do you expect we'll be rewrite this using different tools or ...?
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.
Approved with a few comment/formatting comments.
It's hard to know at this stage. Right now my focus is to transpile GLSL shaders so that I can directly execute them on WebGPU device, allowing me to develop the rest of the WebGPU rendering. This is a black box, but a pretty small one, and executes for now only on WebGPU. There is also an option to execute this on WebGl to add support for Uniform Buffers in the future. Even if we went ahead and rewrote all shaders in the WebGPU native shader language, due to the current lack of support of reflection for those, we'd need to do processing there as well and manually assign slots. |
a progress towards #4261
Additional changes:
Note: The shader processing does not currently execute on WebGl, but some shader functionality refactoring is used.