-
Notifications
You must be signed in to change notification settings - Fork 62
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
GL_IMAGE_SAMPLER_NAME_NOT_FOUND_IN_SHADER: image-sampler name not found in shader #163
Comments
Hmm, that means the GLSL compilers like to remove resource bindings that are not actually used in the shader code. Can you paste the GLSL code passed into sokol-gfx? It's in the sokol-shdc output file as comment above the 'shader code arrays', e.g.: I'm actually not sure if this situation should be logged as an error by sokol-gfx, it's at best a warning. It shouldn't be completely silent though, because sometimes it is actually something that needs to be fixed. |
You're absolutely right! Since I wasn't done with my shader, I found that I could force the compiler to not omit my variables if I set my
That way, I didn't get compile errors. But that must have still lead it to be excluded by GLSL, but not MSL. Understandable, it was a lazy hack to get things moving without having to comment in and out every other change. May I suggest adding a hint about this in the error message? Since the program technically works like it should even when this error is logged, I think it should be a warning with a hint what could be wrong (i.e. unused sampler)! |
Yeah, I'll keep the issue open until I get around to improving the error message. |
When using multiple samplers in a fragment shader, the program runs fine, but I get errors in my terminal:
Here's my uniforms in my shader (for deferred rendering in a fullscreen quad):
Here's my shader pipeline (in Odin):
Here's the generated code form shdc (Odin):
This error only shows up from the
_sg_gl_create_shader
function in the form of an error, but the program runs fine after that and I can read from the texture using the samplers correctly.No error shows up on Metal on my MacOS.
I can't find many examples with multiple samplers so I could be doing something wrong here, please let me know!
The text was updated successfully, but these errors were encountered: