Skip to content
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

Compat: createBGL, createPipelineLayout, etc... #4121

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

greggman
Copy link
Contributor

Refactor createBindGroupLayout, createPipelineLayout, vertex_state,correctness, and requestDevice tests for 0 storage buffers/textures in vertex/fragment stage.

Note: I needed to add maxStorage(Buffers/Textures)In(Fragment/Vertex)Stage to capability_info.ts. That had cascading effects which is why so many files are changed.

For one, since these new limits are marked as optional, any place that uses limits has to check it's not undefined or least add a ! to tell TS to stop complaining. I'm kind of wondering if we should change them to be required. They'll be required in the spec eventually, or at least that's the plan. In any case, this adds them.

Another issue was the existing structure of kPerStageBindingLimits in capability_info.ts. I refactored that to have per stage limits and added getBindingLimitsForBindingType where you pass in the type you're using and the visibility and returns the limit for those stages.

I also moved getDefaultLimit/s from GPUTestBase to LimitTestImpl as it seems like only the limits test should care about the default. All other tests should use what's on the device.

Copy link
Contributor

@shrekshao shrekshao left a comment

Choose a reason for hiding this comment

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

LGTM

Refactor createBindGroupLayout, createPipelineLayout,
vertex_state,correctness, and requestDevice tests for
0 storage buffers/textures in vertex/fragment stage.

Note: I needed to add `maxStorage(Buffers/Textures)In(Fragment/Vertex)Stage`
to `capability_info.ts`. That had cascading effects which is why
so many files are changed.

For one, since these new limits are marked as optional, any place that uses
limits has to check it's not undefined or least add a `!` to tell TS
to stop complaining. I'm kind of wondering if we should change them
to be required. They'll be required in the spec eventually, or at least
that's the plan. In any case, this adds them.

Another issue was the existing structure of `kPerStageBindingLimits` in
`capability_info.ts`. I refactored that to have per stage limits and
added `getBindingLimitsForBindingType` where you pass in the type you're
using and the visibility and returns the limit for those stages.

I also moved `getDefaultLimit/s` from GPUTestBase to LimitTestImpl as
it seems like only the limits test should care about the default.
All other tests should use what's on the device.
@greggman greggman enabled auto-merge (squash) January 3, 2025 21:44
@greggman greggman merged commit 20a9042 into gpuweb:main Jan 3, 2025
1 check passed
@greggman greggman deleted the cbgl-cpl-c-rq branch January 3, 2025 22:05
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.

2 participants