Skip to content

Commit 3e3a975

Browse files
committed
support AVAILABLE_STORAGE_BUFFER_BINDINGS >= 3
1 parent d5b9cfd commit 3e3a975

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

crates/bevy_pbr/src/render/clustered_forward.wgsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn fragment_cluster_index(frag_coord: vec2<f32>, view_z: f32, is_orthographic: b
2929
// this must match CLUSTER_COUNT_SIZE in light.rs
3030
let CLUSTER_COUNT_SIZE = 9u;
3131
fn unpack_offset_and_counts(cluster_index: u32) -> vec3<u32> {
32-
#if AVAILABLE_STORAGE_BUFFER_BINDINGS == 3
32+
#if AVAILABLE_STORAGE_BUFFER_BINDINGS >= 3
3333
return cluster_offsets_and_counts.data[cluster_index].xyz;
3434
#else
3535
let offset_and_counts = cluster_offsets_and_counts.data[cluster_index >> 2u][cluster_index & ((1u << 2u) - 1u)];
@@ -44,7 +44,7 @@ fn unpack_offset_and_counts(cluster_index: u32) -> vec3<u32> {
4444
}
4545

4646
fn get_light_id(index: u32) -> u32 {
47-
#if AVAILABLE_STORAGE_BUFFER_BINDINGS == 3
47+
#if AVAILABLE_STORAGE_BUFFER_BINDINGS >= 3
4848
return cluster_light_index_lists.data[index];
4949
#else
5050
// The index is correct but in cluster_light_index_lists we pack 4 u8s into a u32

crates/bevy_pbr/src/render/mesh_view_bindings.wgsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var directional_shadow_textures: texture_depth_2d_array;
2525
@group(0) @binding(5)
2626
var directional_shadow_textures_sampler: sampler_comparison;
2727

28-
#if AVAILABLE_STORAGE_BUFFER_BINDINGS == 3
28+
#if AVAILABLE_STORAGE_BUFFER_BINDINGS >= 3
2929
@group(0) @binding(6)
3030
var<storage> point_lights: PointLights;
3131
@group(0) @binding(7)

crates/bevy_pbr/src/render/mesh_view_types.wgsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct Lights {
6161
spot_light_shadowmap_offset: i32,
6262
};
6363

64-
#if AVAILABLE_STORAGE_BUFFER_BINDINGS == 3
64+
#if AVAILABLE_STORAGE_BUFFER_BINDINGS >= 3
6565
struct PointLights {
6666
data: array<PointLight>,
6767
};

0 commit comments

Comments
 (0)