You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/typegpu-docs/src/content/docs/fundamentals/utils.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,6 +143,8 @@ compute.dispatch();
143
143
// "[GPU] Call number 2"
144
144
```
145
145
146
+
Currently supported data types for logging include scalars, vectors, matrices, structs, and fixed-size arrays.
147
+
146
148
Under the hood, TypeGPU translates `console.log` to a series of serializing functions that write the logged arguments to a buffer that is read and deserialized after every draw/dispatch call.
147
149
148
150
The buffer is of fixed size, which may limit the total amount of information that can be logged; if the buffer overflows, additional logs are dropped.
@@ -193,8 +195,6 @@ There are some limitations (some of which we intend to alleviate in the future):
193
195
-`console.log` only works when used in TGSL, when calling or resolving a TypeGPU pipeline.
194
196
Otherwise, for example when using `tgpu.resolve` on a WGSL template, logs are ignored.
195
197
-`console.log` only works in fragment and compute shaders.
196
-
This is due to [WebGPU limitation](https://www.w3.org/TR/WGSL/#address-space) that does not allow modifying buffers during the vertex shader stage.
197
-
- TypeGPU needs to handle every logged data type individually.
198
-
Currently, we only support scalar, vector and matrix types.
198
+
This is due to a [WebGPU limitation](https://www.w3.org/TR/WGSL/#address-space) that does not allow modifying buffers during the vertex shader stage.
199
199
-`console.log` currently does not support template literals and string substitutions.
200
200
- Other `console` methods like `clear` or `warn` are not yet supported.
0 commit comments