diff --git a/README.md b/README.md index 85f3c51..dd5f39a 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ const material = new Material({ projectionMatrix: mat4x4, modelViewMatrix: mat4x4, }; - @binding(0) @group(0) var uniforms: Uniforms; + @group(0) @binding(0) var uniforms: Uniforms; @vertex fn main(@location(0) position: vec3) -> @builtin(position) vec4 { @@ -427,7 +427,7 @@ const material = new Material({ projectionMatrix: mat4x4, modelViewMatrix: mat4x4, }; - @binding(0) @group(0) var uniforms: Uniforms; + @group(0) @binding(0) var uniforms: Uniforms; @vertex fn main(@location(0) position: vec3) -> @builtin(position) vec4 { @@ -472,14 +472,14 @@ var data: array>; struct Uniforms { time: f32, }; -@binding(1) @group(0) var uniforms: Uniforms; +@group(0) @binding(1) var uniforms: Uniforms; // Texture bindings -@binding(2) @group(0) var sample: sampler; -@binding(3) @group(0) var color: texture_2d; +@group(0) @binding(2) var sample: sampler; +@group(0) @binding(3) var color: texture_2d; -@binding(4) @group(0) var sample_2: sampler; -@binding(5) @group(0) var color_2: texture_2d; +@group(0) @binding(4) var sample_2: sampler; +@group(0) @binding(5) var color_2: texture_2d; ``` ### Blending @@ -685,7 +685,7 @@ const material = new Material({ modelViewMatrix: mat4x4, instanceMatrix: array, 2>, }; - @binding(0) @group(0) var uniforms: Uniforms; + @group(0) @binding(0) var uniforms: Uniforms; @vertex fn main( diff --git a/examples/webgpu-compute.ts b/examples/webgpu-compute.ts index c997ff8..f47b35b 100644 --- a/examples/webgpu-compute.ts +++ b/examples/webgpu-compute.ts @@ -58,7 +58,7 @@ mesh.material = new Material({ struct Uniforms { time: f32, }; - @binding(0) @group(0) var uniforms: Uniforms; + @group(0) @binding(0) var uniforms: Uniforms; @fragment fn main(@location(0) uv: vec2) -> @location(0) vec4 { diff --git a/examples/webgpu-cube.ts b/examples/webgpu-cube.ts index 826b366..8df0c0d 100644 --- a/examples/webgpu-cube.ts +++ b/examples/webgpu-cube.ts @@ -57,7 +57,7 @@ const material = new Material({ normalMatrix: mat4x4, color: vec3, }; - @binding(0) @group(0) var uniforms: Uniforms; + @group(0) @binding(0) var uniforms: Uniforms; struct VertexIn { @location(0) position: vec3, diff --git a/examples/webgpu-fullscreen.ts b/examples/webgpu-fullscreen.ts index 54803ae..a29e7a0 100644 --- a/examples/webgpu-fullscreen.ts +++ b/examples/webgpu-fullscreen.ts @@ -18,7 +18,7 @@ const material = new Material({ struct Uniforms { time: f32, }; - @binding(0) @group(0) var uniforms: Uniforms; + @group(0) @binding(0) var uniforms: Uniforms; struct VertexIn { @location(0) position: vec3, @@ -41,8 +41,8 @@ const material = new Material({ } `, fragment: /* wgsl */ ` - @binding(1) @group(0) var sample: sampler; - @binding(2) @group(0) var color: texture_2d; + @group(0) @binding(1) var sample: sampler; + @group(0) @binding(2) var color: texture_2d; struct FragmentIn { @location(0) color: vec4, diff --git a/examples/webgpu-mrt.ts b/examples/webgpu-mrt.ts index 6b2a0a7..e9a7ba2 100644 --- a/examples/webgpu-mrt.ts +++ b/examples/webgpu-mrt.ts @@ -84,17 +84,17 @@ const composite = new Mesh( } `, fragment: /* wgsl */ ` - @binding(0) @group(0) var sampler0: sampler; - @binding(1) @group(0) var texture0: texture_2d; + @group(0) @binding(0) var sampler0: sampler; + @group(0) @binding(1) var texture0: texture_2d; - @binding(2) @group(0) var sampler1: sampler; - @binding(3) @group(0) var texture1: texture_2d; + @group(0) @binding(2) var sampler1: sampler; + @group(0) @binding(3) var texture1: texture_2d; - @binding(4) @group(0) var sampler2: sampler; - @binding(5) @group(0) var texture2: texture_2d; + @group(0) @binding(4) var sampler2: sampler; + @group(0) @binding(5) var texture2: texture_2d; - @binding(6) @group(0) var sampler3: sampler; - @binding(7) @group(0) var texture3: texture_2d; + @group(0) @binding(6) var sampler3: sampler; + @group(0) @binding(7) var texture3: texture_2d; struct FragmentIn { @location(0) uv: vec2, diff --git a/examples/webgpu-transparency.ts b/examples/webgpu-transparency.ts index a39d2be..25b6a3c 100644 --- a/examples/webgpu-transparency.ts +++ b/examples/webgpu-transparency.ts @@ -46,7 +46,7 @@ const material = new Material({ projectionMatrix: mat4x4, modelViewMatrix: mat4x4, }; - @binding(0) @group(0) var uniforms: Uniforms; + @group(0) @binding(0) var uniforms: Uniforms; struct VertexIn { @location(0) position: vec3,