From 25784ed7172ff6b587e20f315f8ed52ee99cbe5d Mon Sep 17 00:00:00 2001 From: Iwo Plaza Date: Wed, 27 Nov 2024 15:12:15 +0100 Subject: [PATCH] Fix docs build --- .../examples/simple/increment-tgsl/index.ts | 2 +- .../examples/simulation/boids-next/index.ts | 2 +- .../fluid-double-buffering/index.ts | 39 ------------------- 3 files changed, 2 insertions(+), 41 deletions(-) diff --git a/apps/typegpu-docs/src/content/examples/simple/increment-tgsl/index.ts b/apps/typegpu-docs/src/content/examples/simple/increment-tgsl/index.ts index 572b3aaa..995d186b 100644 --- a/apps/typegpu-docs/src/content/examples/simple/increment-tgsl/index.ts +++ b/apps/typegpu-docs/src/content/examples/simple/increment-tgsl/index.ts @@ -12,7 +12,7 @@ const counterBuffer = root.createBuffer(vec2f, vec2f(0, 1)).$usage('storage'); const counter = asMutable(counterBuffer); const increment = tgpu - .computeFn([1]) + .computeFn([], { workgroupSize: [1] }) .does(() => { const tmp = counter.value.x; counter.value.x = counter.value.y; diff --git a/apps/typegpu-docs/src/content/examples/simulation/boids-next/index.ts b/apps/typegpu-docs/src/content/examples/simulation/boids-next/index.ts index cda9ea3d..38d2e9f0 100644 --- a/apps/typegpu-docs/src/content/examples/simulation/boids-next/index.ts +++ b/apps/typegpu-docs/src/content/examples/simulation/boids-next/index.ts @@ -214,7 +214,7 @@ const computeBindGroupLayout = tgpu const { currentTrianglePos, nextTrianglePos } = computeBindGroupLayout.bound; const mainCompute = tgpu - .computeFn([1]) + .computeFn([], { workgroupSize: [1] }) .does(/* wgsl */ `(@builtin(global_invocation_id) gid: vec3u) { let index = gid.x; var instanceInfo = currentTrianglePos[index]; diff --git a/apps/typegpu-docs/src/content/examples/simulation/fluid-double-buffering/index.ts b/apps/typegpu-docs/src/content/examples/simulation/fluid-double-buffering/index.ts index 71267551..186e86f7 100644 --- a/apps/typegpu-docs/src/content/examples/simulation/fluid-double-buffering/index.ts +++ b/apps/typegpu-docs/src/content/examples/simulation/fluid-double-buffering/index.ts @@ -473,45 +473,6 @@ const mainCompute = tgpu outputGridSlot, }); -const mainFragment = wgsl.fn` - (x: i32, y: i32) -> vec4f { - let index = ${coordsToIndex}(x, y); - let cell = ${inputGridSlot}[index]; - let velocity = cell.xy; - let density = max(0., cell.z); - - let obstacle_color = vec4f(0.1, 0.1, 0.1, 1.); - - let background = vec4f(0.9, 0.9, 0.9, 1.); - let first_color = vec4f(0.2, 0.6, 1., 1.); - let second_color = vec4f(0.2, 0.3, 0.6, 1.); - let third_color = vec4f(0.1, 0.2, 0.4, 1.); - - let first_threshold = 2.; - let second_threshold = 10.; - let third_threshold = 20.; - - if (${isInsideObstacle}(x, y)) { - return obstacle_color; - } - - if (density <= 0.) { - return background; - } - - if (density <= first_threshold) { - let t = 1 - pow(1 - density / first_threshold, 2.); - return mix(background, first_color, t); - } - - if (density <= second_threshold) { - return mix(first_color, second_color, (density - first_threshold) / (second_threshold - first_threshold)); - } - - return mix(second_color, third_color, min((density - second_threshold) / third_threshold, 1.)); - } -`.$name('main_fragment'); - const OBSTACLE_BOX = 0; const OBSTACLE_LEFT_WALL = 1;