From d49cdd7eba9c805ca75c9bb611966e86cb3f5c8c Mon Sep 17 00:00:00 2001 From: Iwo Plaza Date: Tue, 24 Jun 2025 11:25:10 +0200 Subject: [PATCH] docs: Debugging --- .../content/docs/fundamentals/debugging.mdx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 apps/typegpu-docs/src/content/docs/fundamentals/debugging.mdx diff --git a/apps/typegpu-docs/src/content/docs/fundamentals/debugging.mdx b/apps/typegpu-docs/src/content/docs/fundamentals/debugging.mdx new file mode 100644 index 000000000..6a1cd3641 --- /dev/null +++ b/apps/typegpu-docs/src/content/docs/fundamentals/debugging.mdx @@ -0,0 +1,23 @@ +--- +title: Debugging +--- + +```ts twoslash +import tgpu from 'typegpu'; +import * as d from 'typegpu/data'; + +const root = await tgpu.init(); + +const debugMutable = root['~unstable'].createMutable(d.f32); + +const foo = tgpu['~unstable'].fn([])(() => { + // Complex shader logic + debugMutable.value = 123; + // More complex shader logic... +}); + +// Invoking the shader, using it in a pipeline, etc. +// ... + +console.log('Debug value:', await debugMutable.buffer.read()); +``` \ No newline at end of file