-
Notifications
You must be signed in to change notification settings - Fork 344
Description
See #693 (comment):
consider adding a maxBuffersPlusVertexBuffersForVertexStage limit later as needed
@kainino0x says that they pessmize, by reporting values for limits such that maxSampledTexturesPerShaderStage + maxSamplersPerShaderStage + maxStorageBuffersPerShaderStage + maxStorageTexturesPerShaderStage + maxUniformBuffersPerShaderStage + maxVertexBuffers < 31. However, this is pretty severe - we probably wouldn't want to pessimize this way.
We plan to use argument buffers (rather than flattening all resources to direct shader arguments) so we would probably want something like a new limit equal to the sum of maxBindGroups + maxVertexBuffers. That way, we can say "maxBindGroups has to be less than 31, and maxVertexBuffers has to be 31, and the sum of them also has to be less then 31."
There is precedent for this: WebGPU has limits for maxComputeWorkgroupSizeX, maxComputeWorkgroupSizeY, and maxComputeWorkgroupSizeZ, but there is also a limit for maxComputeInvocationsPerWorkgroup which is the product of all 3.
We would probably also need a limit about the number of each kind of resource that can live within a bind group. Such a limit would correspond to the "Maximum number of *** inside an argument buffer" rows in the Metal feature set tables.