Skip to content

Commit

Permalink
shaders: use import for View struct definition
Browse files Browse the repository at this point in the history
The View struct definition had significantly deviated from the local
copy in tilemap[-atlas].wgsl even before Bevy 0.8 and only ever worked
because nothing except for the first field was accessed. Use an #import
to ensure that we always get the correct defintion from Bevy itself.
  • Loading branch information
neocturne committed Aug 1, 2022
1 parent db0861a commit 8d7fcbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/render/shaders/tilemap-atlas.wgsl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
struct View {
view_proj: mat4x4<f32>,
projection: mat4x4<f32>,
world_position: vec3<f32>,
};
#import bevy_sprite::mesh2d_view_types

@group(0) @binding(0)
var<uniform> view: View;

Expand Down
7 changes: 2 additions & 5 deletions src/render/shaders/tilemap.wgsl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
struct View {
view_proj: mat4x4<f32>,
projection: mat4x4<f32>,
world_position: vec3<f32>,
};
#import bevy_sprite::mesh2d_view_types

@group(0) @binding(0)
var<uniform> view: View;

Expand Down

0 comments on commit 8d7fcbb

Please sign in to comment.