diff options
author | 2022-07-03 17:35:31 +0200 | |
---|---|---|
committer | 2022-07-03 17:35:31 +0200 | |
commit | 66eb6263003c1bbedd1fd14d6b12f172d20a6211 (patch) | |
tree | 46253081865e677d7199fd036f0fed309f531ea7 /wgpu/src/shader/image.wgsl | |
parent | e6e3eff8762e9e8350f00b340348dc2261dd0053 (diff) | |
parent | 9adc20922d16b990eede1f6c5f059e68efe15d0e (diff) | |
download | iced-66eb6263003c1bbedd1fd14d6b12f172d20a6211.tar.gz iced-66eb6263003c1bbedd1fd14d6b12f172d20a6211.tar.bz2 iced-66eb6263003c1bbedd1fd14d6b12f172d20a6211.zip |
Merge pull request #1378 from Cupnfish/wgpu-0.13
update `wgpu` to `0.13`
Diffstat (limited to 'wgpu/src/shader/image.wgsl')
-rw-r--r-- | wgpu/src/shader/image.wgsl | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/wgpu/src/shader/image.wgsl b/wgpu/src/shader/image.wgsl index ff304422..5e22cdf4 100644 --- a/wgpu/src/shader/image.wgsl +++ b/wgpu/src/shader/image.wgsl @@ -1,27 +1,27 @@ struct Globals { - transform: mat4x4<f32>; -}; + transform: mat4x4<f32>, +} -[[group(0), binding(0)]] var<uniform> globals: Globals; -[[group(0), binding(1)]] var u_sampler: sampler; -[[group(1), binding(0)]] var u_texture: texture_2d_array<f32>; +@group(0) @binding(0) var<uniform> globals: Globals; +@group(0) @binding(1) var u_sampler: sampler; +@group(1) @binding(0) var u_texture: texture_2d_array<f32>; struct VertexInput { - [[location(0)]] v_pos: vec2<f32>; - [[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) v_pos: vec2<f32>, + @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, +} struct VertexOutput { - [[builtin(position)]] position: vec4<f32>; - [[location(0)]] uv: vec2<f32>; - [[location(1)]] layer: f32; // this should be an i32, but naga currently reads that as requiring interpolation. -}; + @builtin(position) position: vec4<f32>, + @location(0) uv: vec2<f32>, + @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<f32> { +@fragment +fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> { return textureSample(u_texture, u_sampler, input.uv, i32(input.layer)); } |