diff --git a/crates/bevy_core_pipeline/src/auto_exposure/auto_exposure.wgsl b/crates/bevy_core_pipeline/src/auto_exposure/auto_exposure.wgsl index c85c753d1a..a4eca41477 100644 --- a/crates/bevy_core_pipeline/src/auto_exposure/auto_exposure.wgsl +++ b/crates/bevy_core_pipeline/src/auto_exposure/auto_exposure.wgsl @@ -95,10 +95,12 @@ fn compute_histogram( @builtin(local_invocation_index) local_invocation_index: u32 ) { // Clear the workgroup shared histogram - histogram_shared[local_invocation_index] = 0u; + if local_invocation_index < 64 { + histogram_shared[local_invocation_index] = 0u; + } // Wait for all workgroup threads to clear the shared histogram - storageBarrier(); + workgroupBarrier(); let dim = vec2(textureDimensions(tex_color)); let uv = vec2(global_invocation_id.xy) / vec2(dim);