From 41dec5bd203ff5b1574a33a17d5f7358ae1beea2 Mon Sep 17 00:00:00 2001
From: Jim Eckerlein <jim.eckerlein@icloud.com>
Date: Sun, 24 Sep 2023 15:26:10 +0200
Subject: Reassign attribute locations for image shader

---
 wgpu/src/image.rs          |  9 +++++++--
 wgpu/src/shader/image.wgsl | 10 +++++-----
 2 files changed, 12 insertions(+), 7 deletions(-)

(limited to 'wgpu/src')

diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs
index 384138a2..36c1e228 100644
--- a/wgpu/src/image.rs
+++ b/wgpu/src/image.rs
@@ -218,11 +218,16 @@ impl Pipeline {
                         array_stride: mem::size_of::<Instance>() as u64,
                         step_mode: wgpu::VertexStepMode::Instance,
                         attributes: &wgpu::vertex_attr_array!(
+                            // Position
+                            0 => Float32x2,
+                            // Scale
                             1 => Float32x2,
+                            // Atlas position
                             2 => Float32x2,
+                            // Atlas scale
                             3 => Float32x2,
-                            4 => Float32x2,
-                            5 => Sint32,
+                            // Layer
+                            4 => Sint32,
                         ),
                     }],
                 },
diff --git a/wgpu/src/shader/image.wgsl b/wgpu/src/shader/image.wgsl
index 0c8b3bdb..7b2e5238 100644
--- a/wgpu/src/shader/image.wgsl
+++ b/wgpu/src/shader/image.wgsl
@@ -8,11 +8,11 @@ struct Globals {
 
 struct VertexInput {
     @builtin(vertex_index) vertex_index: u32,
-    @location(1) pos: vec2<f32>,
-    @location(2) scale: vec2<f32>,
-    @location(3) atlas_pos: vec2<f32>,
-    @location(4) atlas_scale: vec2<f32>,
-    @location(5) layer: i32,
+    @location(0) pos: vec2<f32>,
+    @location(1) scale: vec2<f32>,
+    @location(2) atlas_pos: vec2<f32>,
+    @location(3) atlas_scale: vec2<f32>,
+    @location(4) layer: i32,
 }
 
 struct VertexOutput {
-- 
cgit