From ff7464d2f9ee0b959b6f8a5f20deaf2ffb6396aa Mon Sep 17 00:00:00 2001 From: douira Date: Thu, 25 Jan 2024 02:44:39 +0100 Subject: [PATCH] Do not write to `v_MaterialAlphaCutoff` in opaque render passes (#2271) Fixes a compiler shader warning on some platforms. And is more hygienic. --- .../assets/sodium/shaders/blocks/block_layer_opaque.vsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/assets/sodium/shaders/blocks/block_layer_opaque.vsh b/src/main/resources/assets/sodium/shaders/blocks/block_layer_opaque.vsh index ca73a73e4d..db2513be15 100644 --- a/src/main/resources/assets/sodium/shaders/blocks/block_layer_opaque.vsh +++ b/src/main/resources/assets/sodium/shaders/blocks/block_layer_opaque.vsh @@ -9,7 +9,9 @@ out vec4 v_Color; out vec2 v_TexCoord; out float v_MaterialMipBias; +#ifdef USE_FRAGMENT_DISCARD out float v_MaterialAlphaCutoff; +#endif #ifdef USE_FOG out float v_FragDistance; @@ -52,5 +54,7 @@ void main() { v_TexCoord = _vert_tex_diffuse_coord; v_MaterialMipBias = _material_mip_bias(_material_params); +#ifdef USE_FRAGMENT_DISCARD v_MaterialAlphaCutoff = _material_alpha_cutoff(_material_params); +#endif }