Skip to content

Avoid shader compiler warnings #2271

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

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

douira
Copy link
Collaborator

@douira douira commented Jan 24, 2024

Usually it prints the following warnings to the console:

[18:32:03] [Render thread/WARN] (GlProgram) Program link log for sodium:chunk_shader: WARNING: Output of vertex shader 'v_MaterialAlphaCutoff' not read by fragment shader

[18:32:03] [Render thread/WARN] (GlProgram) Program link log for sodium:chunk_shader: WARNING: Output of vertex shader 'v_MaterialAlphaCutoff' not read by fragment shader

This might not happen on all systems due to differences in drivers, but on macOS it always does this when loading or reloading a world. Not declaring this out variable avoids the shader compiler warning by only adding it if the fragment shader is actually going to read it.

@jellysquid3
Copy link
Member

I noticed this recently when looking at the source, seems like an easy thing to fix.

@jellysquid3 jellysquid3 merged commit ff7464d into CaffeineMC:dev Jan 25, 2024
@douira douira deleted the avoid-shader-compiler-warning branch January 25, 2024 01:45
embeddedt referenced this pull request in FiniteReality/embeddium Jan 28, 2024
Fixes a compiler shader warning on some platforms. And is more hygienic.
IMS212 pushed a commit to IMS212/sodium-fabric that referenced this pull request Aug 6, 2024
…eineMC#2271)

Fixes a compiler shader warning on some platforms. And is more hygienic.
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

Successfully merging this pull request may close these issues.

2 participants