Skip to content

Missing limits in GPULimits #1343

@Kangz

Description

@Kangz

WebGPU has a small amount of limits defined in the spec and we should add a LOT more to be complete. As a first pass I took a look at the VkPhysicalDeviceLimits Vulkan limits descriptor to see what we're obviously missing. After filtering for limits WebGPU already has, or that are inapplicable, we have the following missing limits. (all member names below are the name of members in VkPhysicalDeviceLimits)

  • Additional binding model limits
    • per-GPUBindGroupLayout limits in the number of resources. We can decide that they are not applicable after looking at the guarantees in Vulkan. maxDescriptorSetSamplers , maxDescriptorSetSamplers, maxDescriptorSetUniformBuffersDynamic, maxDescriptorSetStorageBuffers, maxDescriptorSetStorageBuffersDynamic, maxDescriptorSetSampledImages, maxDescriptorSetStorageImages
    • per-stage limit on the number of resources: maxPerStageResources. We can decide it is not applicable.
  • minUniformBufferOffsetAlignment, minStorageBufferOffsetAlignment
  • Limits for fragment outputs / render targets
    • maxFramebufferWidth, maxFramebufferHeight. We can decide to not have it and use maxTextureDimension2D instead.
    • maxColorAttachments - currently hardcoded at 8, needs a limit
    • framebufferColorSampleCounts, framebufferDepthSampleCounts, framebufferStencilSampleCounts, framebufferNoAttachmentsSampleCounts depending on what we decide for multisampling limits.
    • maxFragmentOutputAttachments, maxFragmentDualSrcAttachments, maxFragmentCombinedOutputResources if we want to have them, or just use maxColorAttachments or not.
  • maxVertexOutputComponents and maxFragmentInputComponents
  • maxComputeSharedMemorySize, maxComputeWorkGroupCount, maxComputeWorkGroupInvocations, maxComputeWorkGroupSize
  • minTexelOffset, maxTexelOffset, minTexelGatherOffset, maxTexelGatherOffset which define the valid range for the compile-time constant offset for some texture WGSL functions.
  • maxClipDistances, maxCullDistances, maxCombinedClipAndCullDistances if we have the equivalent of gl_ClipPlane and friends in WGSL.
  • maxVertexInputAttributeOffset if it is not just maxVertexInputBufferStride
  • maxDrawIndexedIndexValue - not needed
  • maxDrawIndirectCount
  • Information about the system if we want to expose it:
    • subPixelPrecisionBits, subTexelPrecisionBits, viewportSubPixelBits, mipmapPrecisionBits
    • maxSamplerLodBias that clamps the sum of the sampler's lod bias and the bias set in the shader.
    • strictLines which describes wether parallelogram lines or Bresenham lines are used.
    • standardSampleLocations which we might require in WebGPU.
  • More multisampled limits depending one the multisample limits discussion
    • sampledImageColorSampleCounts, sampledImageIntegerSampleCounts, sampledImageDepthSampleCounts, sampledImageStencilSampleCounts, storageImageSampleCounts
    • maxSampleMaskWords

I think we also want a limit that's WebGPU-specific:

  • maxBufferTextureCopyRowPitchAlignment that encodes the 256 constraint we have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions