Replies: 4 comments 1 reply
|
This sounds like an awesome change! I think I would prefer a build failure if you mark something |
|
We're workshopping a way to mark unrolling explicitly, where you'd at most get a warning in dev-mode if the generated code gets too big, but would get unrolled anyway. The other way would work as well, where we would never unroll a loop for you unless you explicitly mark it for unrolling. |
|
I like this idea, if somebody wants to unroll a regular for, they can just transform it into a What happens when somebody passes in an array but does not unroll it? Will it get copied in every spot it is accessed in, or will it be assigned to a variable? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Idea: if the user does a
for ofloop on a compile-time known iterable, and wraps it withtgpu.unroll, we could unroll the loop.Constraints:
Unrolling an iterated array
Generated WGSL:
Conditional unroll
Iterating over struct fields
Generated WGSL:
All reactions