-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add validation tests for Multi-Draw Indirect #3962
base: main
Are you sure you want to change the base?
Conversation
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.
Apart from the stylistic nitpick, LGTM.
u.expandWithParams(() => { | ||
return [ | ||
// In bounds | ||
{ bufferSize: 4, indirectOffset: 0, _valid: true }, |
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.
nit: Could we combine these test cases with the ones below as a variable? If I didn't miss anything these cases seem similar with small differences, and combining them would be cleaner/more readable.
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.
+1, if possible store this array as a variable and use it twice. A pattern we use elsewhere to make this work is instead of having bufferSize
as a parameter, have something like bufferExtraSize
which has negative, zero, and positive cases (4 + (-1) = 3
for indirect, 5 + (-1) = 4
for indexed indirect)
And if there are any cases that are specific to one or the other then you can do:
const kIndirectOffsetOOBCommonCases = [
/* ... */
] as const;
/* ... */
.combineWithParams([
...kIndirectOffsetOOBCommonCases,
/* any additional cases which are not common between the two */
])
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've hopefully addressed your feedback in latest patch. Please have a look!
FYI @beaufortfrancois , I'm working on #3970 to add more rendering tests. Should we incrementally add rendering tests to this branch or should submit all of the rendering tests at once? |
I'll let @kainino0x weigh in as I don't have strong preferences. |
src/webgpu/api/validation/encoding/cmds/render/indirect_multi_draw.spec.ts
Outdated
Show resolved
Hide resolved
src/webgpu/api/validation/encoding/cmds/render/indirect_multi_draw.spec.ts
Outdated
Show resolved
Hide resolved
u.expandWithParams(() => { | ||
return [ | ||
// In bounds | ||
{ bufferSize: 4, indirectOffset: 0, _valid: true }, |
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.
+1, if possible store this array as a variable and use it twice. A pattern we use elsewhere to make this work is instead of having bufferSize
as a parameter, have something like bufferExtraSize
which has negative, zero, and positive cases (4 + (-1) = 3
for indirect, 5 + (-1) = 4
for indexed indirect)
And if there are any cases that are specific to one or the other then you can do:
const kIndirectOffsetOOBCommonCases = [
/* ... */
] as const;
/* ... */
.combineWithParams([
...kIndirectOffsetOOBCommonCases,
/* any additional cases which are not common between the two */
])
IMO land tests as soon as they're landable. It's easy enough to modify tests after they land. |
This PR adds validation tests for the experimental Multi-Draw Indirect feature that can be tested in Chrome Canary behind the "Unsafe WebGPU support" flag at
chrome://flag#enable-unsafe-webgpu
Issue: #3961
Requirements for PR author:
.unimplemented()
./** documented */
and new helper files are found inhelper_index.txt
.Requirements for reviewer sign-off:
When landing this PR, be sure to make any necessary issue status updates.