Skip to content

Commit b8e9292

Browse files
committed
Replace for loop with while in shader
1 parent 5617da6 commit b8e9292

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_pbr/src/render/parallax_mapping.wgsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ fn parallaxed_uv(
4141
var current_layer_height = 0.0;
4242
var current_height = sample_depth_map(uv);
4343

44-
let int_max_layer_count = i32(max_layer_count);
45-
for (var i: i32 = 0; i <= int_max_layer_count; i++) {
44+
// This at most runs layer_count times
45+
while true {
4646
if (current_height <= current_layer_height) {
4747
break;
4848
}

0 commit comments

Comments
 (0)