hadronized / luminance-rs

Type-safe, type-level and stateless Rust graphics framework
https://phaazon.github.io/learn-luminance/
Other
1.09k stars 59 forks source link

Why GL_ARB_separate_shader_objects? #593

Open KeyboardDanni opened 2 years ago

KeyboardDanni commented 2 years ago

I noticed that in the injected shader header, the GL_ARB_separate_shader_objects extension is being marked as required:

https://github.com/phaazon/luminance-rs/blob/0401251ad8ea8dbed788e2448f78b9574ef98321/luminance-gl/src/gl33/shader.rs#L258

My understanding is that if you want to use different vertex and fragment shaders together, you would need to create a new Program object anyway. So far I'm not aware of any part of the API that has these separate. Using GL_ARB_separate_shader_objects means that I'm not going to be able to target GLES, which does not have this extension (it has GL_EXT_separate_shader_objects but it's only supported by 8% of device configurations according to gpuinfo.org). It's technically not in core in OpenGL 3.3 either.

Is this something that can be removed?

ColonelThirtyTwo commented 1 year ago

The GLES backend doesn't need GL_EXT_separate_shader_objects - it adds a different header that does not require any extensions. That said, I'm not sure why separate shader objects is needed for plain OpenGL either.