-
Notifications
You must be signed in to change notification settings - Fork 60
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
Implement compute shaders support, make fragment shader non-mandatory #1154
Conversation
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 compute shaders are a totally separate workflow from the existing draw shaders, which would ideally be a separate class. Like instead of just GLShader you have one class with fragment shader, vertex shader, and vertex attribs; and another with just compute shader.
I considered that, the reason I made it part of GLShader is that they can still make use of the way uniforms are set, vertex/fragment includes, same paths for loading/compiling shaders including shader binaries, as well as GLHeaders. Maybe both classes should be derived from GLShader which would just provide the aforementioned functionality. |
A really easy way to make things a bit clearer could be to have two constructors for GLShader, one for each use case. Instead of having a constructor that allows all 3 shader types at once. |
So something like
and
? |
I guess there's nothing that distinguishes the constructors very well so maybe it would be easier to go ahead and define the subclasses even if all the functionality is in the base class. Like
|
Yeah, I ran into some issues with GLShader constructors earlier too, since the wrong one was being selected with some types being converted. |
e49181b
to
655fee2
Compare
This should be evaluated later because #1105 and some further PRs add more GLShader constructors. |
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.
LGTM.
Don't forget to squash the |
Adds some code to allow using compute shaders. Shaders can now have either of vertex, fragment, or compute shaders enabled/disabled.
3f8d932
to
689923e
Compare
Yep, done. |
Requires #1124.
Cherry-picked from #1137 to split a large pr up a bit.
Adds some code to allow using compute shaders. Shaders can now have either of vertex, fragment, or compute shaders enabled/disabled.