Skip to content

Commit c488b70

Browse files
authored
Fix pbr shader breaking on missing UVs (bevyengine#8412)
# Objective Fix bevyengine#8409 Since `in` doesn't have a `uv` field when `VERTEX_UVS` is not defined, it shouldn't be accessed outside of related `#ifdef`s
1 parent 396c271 commit c488b70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_pbr/src/render/pbr.wgsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ struct FragmentInput {
2323
fn fragment(in: FragmentInput) -> @location(0) vec4<f32> {
2424
let is_orthographic = view.projection[3].w == 1.0;
2525
let V = calculate_view(in.world_position, is_orthographic);
26-
var uv = in.uv;
2726
#ifdef VERTEX_UVS
27+
var uv = in.uv;
2828
#ifdef VERTEX_TANGENTS
2929
if ((material.flags & STANDARD_MATERIAL_FLAGS_DEPTH_MAP_BIT) != 0u) {
3030
let N = in.world_normal;

0 commit comments

Comments
 (0)