-
Notifications
You must be signed in to change notification settings - Fork 335
Add an explainer for GPULimits #482
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
In shaders there are several texture types for each dimensionality depending on their component type. It can be either float, uint or sint, with maybe in the future depth/stencil if WebGPU allows reading such textures. The component type of a GPUTextureView's format must match the component type of its binding in the shader module. This is for several reasons: - Vulkan requires the following: "The Sampled Type of an OpTypeImage declaration must match the numeric format of the corresponding resource in type and signedness, as shown in the SPIR-V Sampled Type column of the Interpretation of Numeric Format table, or the values obtained by reading or sampling from this image are undefined." - It is also required in OpenGL for the texture units to be complete, a uint or sint texture unit used with a non-nearest sampler is incomplete and returns black texels. Similar constraints must exist in other APIs. To encode this compatibility constraint, a new member is added to GPUBindGroupLayoutBinding that is a new enum GPUTextureComponentType that give the component type of the texture.
This is the most common case and avoids having an optional dictionary member with no default value (but that still requires a value for texture bindings).
Part of #483 |
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.
Looks great. Thank you for keeping this well tracked - the issue links are helpful!
design/Limits.md
Outdated
|
||
Limit | API Doc | gpuweb issue/PR | ||
--- | --- | --- | ||
`maxBindGroups = 4;` | [Vulkan](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#limits-minmax) `maxBoundDescriptorSets` | |
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.
unfortunate that Vulkan spec is so heavy
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 thought it would at least redirect to the specific section. :(
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.
It does for me, if I don't touch it while it's loading.
How about the LunarG chunked version?
https://vulkan.lunarg.com/doc/view/latest/linux/chunked_spec/chap36.html#limits-minmax
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.
design/Limits.md
Outdated
Limit | API Doc | gpuweb issue/PR | ||
--- | --- | --- | ||
`maxBindGroups = 4;` | [Vulkan](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#limits-minmax) `maxBoundDescriptorSets` | | ||
`maxDynamicUniformBuffersPerPipelineLayout = 8;` | [Vulkan](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#limits-minmax) `maxDescriptorSetUniformBuffersDynamic` | [#406](https://github.com/gpuweb/gpuweb/issues/406) |
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.
Also, a bit strange to see all of the links pointing to Vulkan
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.
Makes sense considering Vulkan's lower-end Android hardware support. But the theory is that future limits won't be decided by Vulkan
Co-Authored-By: Kai Ninomiya <[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.
please link to the chunked spec as @kainino0x suggested!
In the future, we'll need to get a good sense on what the internal needs are for the implementations, which could affect the exposed limits.
This explainer will track the rationale behind each WebGPU limit. All queryable restrictions should have a corresponding reason in this doc.
Edit: Rendered