-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make unstruct resolvable and introduce root.unwrap(TgpuVertexLayout)
#781
base: main
Are you sure you want to change the base?
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
I experimented with this: export type HasAllPropsWithLocations<T> = T extends TgpuVertexLayout<infer U>
? HasAllPropsWithLocations<U>
: T extends WgslStruct | Unstruct
? {
[K in keyof T['propTypes']]: HasAllPropsWithLocations<
T['propTypes'][K]
>;
}[keyof T['propTypes']] extends false
? false
: true
: T extends { elementType: unknown }
? HasAllPropsWithLocations<T['elementType']>
: HasCustomLocation<T> extends false
? false
: true; but keep running into |
apps/typegpu-docs/src/content/docs/fundamentals/vertex-layouts.mdx
Outdated
Show resolved
Hide resolved
apps/typegpu-docs/src/content/docs/fundamentals/vertex-layouts.mdx
Outdated
Show resolved
Hide resolved
apps/typegpu-docs/src/content/examples/simulation/boids/index.ts
Outdated
Show resolved
Hide resolved
trianglePos: { uniform: d.arrayOf(TriangleInfoStruct, triangleAmount) }, | ||
colorPalette: { uniform: d.vec3f }, | ||
}); | ||
const vertexLayout = tgpu['~unstable'].vertexLayout((n) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do we do about [~unstable]
in published examples. I'd say we either
- make vertexLayout stable, docs public and release 0.3.3 right after merging this PR
- make boids experimental
- do nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm kinda a fan of option 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do option 1 🚀
I have changed the target to a next
branch, which we will accumulate any new features and docs about them until 0.4.0
apps/typegpu-docs/src/content/examples/simulation/game-of-life/index.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Marcin Hawryluk <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Co-authored-by: Iwo Plaza <[email protected]>
closes #747