From c148557cabf1fb9127b00b248479de2eb1d1d477 Mon Sep 17 00:00:00 2001 From: Cupnfish Date: Sat, 2 Jul 2022 15:39:42 +0800 Subject: update `wgpu` to `0.13` --- wgpu/src/shader/image.wgsl | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'wgpu/src/shader/image.wgsl') diff --git a/wgpu/src/shader/image.wgsl b/wgpu/src/shader/image.wgsl index ff304422..bb1c6b9d 100644 --- a/wgpu/src/shader/image.wgsl +++ b/wgpu/src/shader/image.wgsl @@ -2,26 +2,26 @@ struct Globals { transform: mat4x4; }; -[[group(0), binding(0)]] var globals: Globals; -[[group(0), binding(1)]] var u_sampler: sampler; -[[group(1), binding(0)]] var u_texture: texture_2d_array; +@group(0) @binding(0) var globals: Globals; +@group(0) @binding(1) var u_sampler: sampler; +@group(1) @binding(0) var u_texture: texture_2d_array; struct VertexInput { - [[location(0)]] v_pos: vec2; - [[location(1)]] pos: vec2; - [[location(2)]] scale: vec2; - [[location(3)]] atlas_pos: vec2; - [[location(4)]] atlas_scale: vec2; - [[location(5)]] layer: i32; + @location(0) v_pos: vec2, + @location(1) pos: vec2, + @location(2) scale: vec2, + @location(3) atlas_pos: vec2, + @location(4) atlas_scale: vec2, + @location(5) layer: i32, }; struct VertexOutput { - [[builtin(position)]] position: vec4; - [[location(0)]] uv: vec2; - [[location(1)]] layer: f32; // this should be an i32, but naga currently reads that as requiring interpolation. + @builtin(position) position: vec4, + @location(0) uv: vec2, + @location(1) layer: f32, // this should be an i32, but naga currently reads that as requiring interpolation. }; -[[stage(vertex)]] +@vertex fn vs_main(input: VertexInput) -> VertexOutput { var out: VertexOutput; @@ -40,7 +40,7 @@ fn vs_main(input: VertexInput) -> VertexOutput { return out; } -[[stage(fragment)]] -fn fs_main(input: VertexOutput) -> [[location(0)]] vec4 { +@fragment +fn fs_main(input: VertexOutput) -> @location(0) vec4 { return textureSample(u_texture, u_sampler, input.uv, i32(input.layer)); } -- cgit