Skip to content

feat: Match up vertex and fragment locations in render pipeline #1377

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

mhawryluk
Copy link
Contributor

closes #885
closes #1375

Copy link

github-actions bot commented Jun 18, 2025

pkg.pr.new

packages

pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@1377
pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@929a343c431e39c2e8b860e2bfe133628c51b834

benchmark
view benchmark

commit
view commit

@mhawryluk mhawryluk changed the title feat: Match-up vertex output and fragment location indices in render pipeline feat: Match up vertex and fragment location indices in render pipeline Jun 18, 2025
@mhawryluk mhawryluk marked this pull request as ready for review June 23, 2025 10:28
@mhawryluk mhawryluk changed the title feat: Match up vertex and fragment location indices in render pipeline feat: Match up vertex and fragment locations in render pipeline Jun 23, 2025
@@ -147,7 +147,7 @@ function createRenderPipeline(
fragmentFn: TgpuFragmentFn<{ uv: d.Vec2f }, d.Vec4f>,
) {
return root['~unstable']
.withVertex(renderFn, renderFn.shell.attributes)
.withVertex(renderFn, [renderFn.shell.in])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vertex attributes from a vertex layout should be passed in here, which in this case is just {} (no attributes). The original code was also erroneous.

Suggested change
.withVertex(renderFn, [renderFn.shell.in])
.withVertex(renderFn, {})

@mhawryluk mhawryluk requested a review from iwoplaza June 23, 2025 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow pipelines to be passed as externals to tgpu.resolve Match-up vertex output and fragment input location indices when generating WGSL
2 participants