Skip to content
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

Feature Request: Allow shader code to override version #2977

Open
cykoder opened this issue Nov 25, 2022 · 2 comments
Open

Feature Request: Allow shader code to override version #2977

cykoder opened this issue Nov 25, 2022 · 2 comments

Comments

@cykoder
Copy link
Contributor

cykoder commented Nov 25, 2022

I have my pipeline setup well so that I only need to invoke shaderc from a single source (like the example shader Makefiles). Works great, but for only a few shaders I require a higher shader version. Setting the standard GLSL #version 430 or whatever doesnt work and produces errors when trying to compile.

I don't see that shaderc checks for existing version definitions, could it? I'm not sure how to best address defining the versions across different compilation targets. Perhaps it'd require something like:

#version_glsl 430
#version_hlsl xyz
...etc

(but i find this ugly)

Thoughts/concerns? I am happy to try contribute this feature if a decision can be made on above

@SnapperTT
Copy link
Contributor

SnapperTT commented Nov 26, 2022

Shaderc does not check the source for shader versions, the shader version is set when you invoke shaderc

Eg: shaderc -platform linux -p 120 compiles a GLSL 120 shader.

The best way to have diverging shader versions would be to have diverging shaderc invocations in your makefile

@cykoder
Copy link
Contributor Author

cykoder commented Nov 28, 2022

Shaderc does not check the source for shader versions, the shader version is set when you invoke shaderc

This I am aware of, thats the feature request. While its easy to say just diverge in the makefile its a bit of a pain to setup for just one or two shaders. Atleast the way I have it atm, on make the shaders are compiled from directory structure like:
engine/shaders/xyz1, engine/shaders/xyz2, engine/shaders/xyz3

if xyz2 uses a diff version, exlcuding it and invoking shaderc again is a bit painful. especially when its only GLSL/OpenGL that needs updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants