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/roots.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ Every `root.create*` function creates a typed resource.
43
43
44
44
| Function | Description |
45
45
| --- | --- |
46
-
| <divclassName="w-max">`root.createBuffer`</div> | Creates a typed buffer with a given data-type and, optionally, an initial value. More information in [the next chapter](/TypeGPU/fundamentals/buffers). |
46
+
| <divclassName="w-max">`root.createBuffer`</div> | Creates a typed buffer with a given data-type and, optionally, an initial value. More information in [the Buffers chapter](/TypeGPU/fundamentals/buffers). |
Copy file name to clipboardExpand all lines: apps/typegpu-docs/src/content/docs/fundamentals/tgsl.mdx
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,8 @@ Keep in mind that you cannot execute entry-point functions in JavaScript.
115
115
116
116
***TGSL limitations** --
117
117
For a function to be valid TGSL, it must consist only of supported JS syntax (again, see [tinyest-for-wgsl repository](https://github.com/software-mansion/TypeGPU/blob/release/packages/tinyest-for-wgsl/src/parsers.ts)), possibly including references to bound buffers, constant variables defined outside the function, other TGSL functions etc.
118
-
This means that, for example, `console.log()` calls will not work on the GPU.
118
+
This means that, for example, `Math.sqrt(n)` calls will not work on the GPU.
119
+
One exception to this is `console.log()`, about which you can read more [here](/TypeGPU/fundamentals/utils/#consolelog).
119
120
120
121
***Differences between JS on the CPU and GPU** --
121
122
TGSL is developed to work on the GPU the same as on the CPU as much as possible,
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.
215
+
216
+
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.
217
+
If that's an issue, you may specify the size manually when creating the `root` object.
0 commit comments