-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conversation
pkg.pr.new packages
benchmark commit |
apps/typegpu-docs/src/content/examples/simulation/stable-fluid/index.ts
Outdated
Show resolved
Hide resolved
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.
Nice!
We need to sort out the vertex in and fragment out locations before merging though
).toStrictEqual({ | ||
a: d.location(5, d.vec4f), | ||
b: d.location(1, d.vec4f), | ||
c: d.location(6, d.vec4f), |
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.
Probably same for vertex in, however our types don't even allow decorated schemas.
baz2: d.location(5, d.f32), | ||
baz3: d.u32, | ||
}, | ||
})`{}`.$name('vertexMain'); |
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.
Do we try to generate valid wgsl in these tests? If so, we should always include builtin position in the vertex out and return something in the body
console.warn( | ||
`Mismatched custom location for key: ${key}, using location set on vertex output: ${ | ||
locations[key] | ||
}`, |
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'd include the mismatched location as well.
`Mismatched location between vertexFn output (${locations[key]}) and fragmentFn input (${customLocation}) for key ${key}, using the location set on vertex output.`
Maybe we could also include the names of the vertexFn and fragmentFn?
if (typeof implementation === 'string') { | ||
if (!isEntry) { | ||
addArgTypesToExternals( | ||
implementation, | ||
argTypes, | ||
(externals) => externalsToApply.push(externals), | ||
); | ||
addReturnTypeToExternals( | ||
implementation, | ||
returnType, | ||
(externals) => externalsToApply.push(externals), | ||
); | ||
} | ||
} | ||
|
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.
We could probably do this check in tgpuFn.ts, if we already move the else
branch to entry functions
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 work!
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.
Y E A H
closes #885
closes #1375