From 336fac6395d60571e1aa58db670e6c76d94d6b1d Mon Sep 17 00:00:00 2001 From: IceSentry Date: Tue, 7 Feb 2023 12:18:27 -0500 Subject: [PATCH] fix ifdef --- assets/shaders/show_prepass.wgsl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/shaders/show_prepass.wgsl b/assets/shaders/show_prepass.wgsl index 837b3c04add115..562546e487c6cb 100644 --- a/assets/shaders/show_prepass.wgsl +++ b/assets/shaders/show_prepass.wgsl @@ -16,28 +16,28 @@ var show_prepass_sampler: sampler; @fragment fn fragment( @builtin(position) frag_coord: vec4, - #ifndef WEBGL +#ifndef WEBGL @builtin(sample_index) sample_index: u32, - #endif// WEBGL +#endif // WEBGL #import bevy_pbr::mesh_vertex_output ) -> @location(0) vec4 { if settings.show_depth == 1.0 { - #ifdef WEBGL +#ifdef WEBGL // prepass_depth() uses textureLoad which doesn't work in WebGL for depth textures. // Instead we need to use a sampler let dims = textureDimensions(depth_prepass_texture); let uv = frag_coord.xy / vec2(dims); let depth = textureSample(depth_prepass_texture, show_prepass_sampler, uv); - #else +#else let depth = prepass_depth(frag_coord, sample_index); - #endif // WEBGL +#endif // WEBGL return vec4(depth, depth, depth, 1.0); } else if settings.show_normals == 1.0 { - #ifdef WEBGL +#ifdef WEBGL let normal = prepass_normal(frag_coord, 0u); - #else // WEBGL +#else // WEBGL let normal = prepass_normal(frag_coord, sample_index); - #endif // WEBGL +#endif // WEBGL return vec4(normal, 1.0); }