Skip to content

Commit 6dfd2fe

Browse files
Update WGSL shader module code (GoogleChrome#9428)
* Update WGSL shader module code * Update index.md
1 parent 27486b4 commit 6dfd2fe

File tree

1 file changed

+3
-3
lines changed
  • src/site/content/en/blog/gpu-compute

1 file changed

+3
-3
lines changed

src/site/content/en/blog/gpu-compute/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ subhead: |
66
authors:
77
- beaufortfrancois
88
date: 2019-08-28
9-
updated: 2022-08-03
9+
updated: 2023-01-19
1010
hero: image/vvhSqZboQoZZN9wBvoXq72wzGAf1/AwjccGqafT2OOWqLGdDX.jpeg
1111
thumbnail: image/vvhSqZboQoZZN9wBvoXq72wzGAf1/AwjccGqafT2OOWqLGdDX.jpeg
1212
description: |
@@ -377,7 +377,7 @@ the same index defined in bind group layouts and bind groups declared above.
377377
const shaderModule = device.createShaderModule({
378378
code: `
379379
struct Matrix {
380-
size : vec2<f32>,
380+
size : vec2f,
381381
numbers: array<f32>,
382382
}
383383
@@ -386,7 +386,7 @@ const shaderModule = device.createShaderModule({
386386
@group(0) @binding(2) var<storage, read_write> resultMatrix : Matrix;
387387
388388
@compute @workgroup_size(8, 8)
389-
fn main(@builtin(global_invocation_id) global_id : vec3<u32>) {
389+
fn main(@builtin(global_invocation_id) global_id : vec3u) {
390390
// Guard against out-of-bounds work group sizes
391391
if (global_id.x >= u32(firstMatrix.size.x) || global_id.y >= u32(secondMatrix.size.y)) {
392392
return;

0 commit comments

Comments
 (0)