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)
I think we also want a limit that's WebGPU-specific:
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
VkPhysicalDeviceLimitsVulkan 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 inVkPhysicalDeviceLimits)GPUBindGroupLayoutlimits 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,maxDescriptorSetStorageImagesmaxPerStageResources. We can decide it is not applicable.minUniformBufferOffsetAlignment,minStorageBufferOffsetAlignmentmaxFramebufferWidth,maxFramebufferHeight. We can decide to not have it and usemaxTextureDimension2Dinstead.maxColorAttachments- currently hardcoded at 8, needs a limitframebufferColorSampleCounts,framebufferDepthSampleCounts,framebufferStencilSampleCounts,framebufferNoAttachmentsSampleCountsdepending on what we decide for multisampling limits.maxFragmentOutputAttachments,maxFragmentDualSrcAttachments,maxFragmentCombinedOutputResourcesif we want to have them, or just usemaxColorAttachmentsor not.maxVertexOutputComponentsandmaxFragmentInputComponentsmaxComputeSharedMemorySize,maxComputeWorkGroupCount,maxComputeWorkGroupInvocations,maxComputeWorkGroupSizeminTexelOffset,maxTexelOffset,minTexelGatherOffset,maxTexelGatherOffsetwhich define the valid range for the compile-time constant offset for some texture WGSL functions.maxClipDistances,maxCullDistances,maxCombinedClipAndCullDistancesif we have the equivalent ofgl_ClipPlaneand friends in WGSL.maxVertexInputAttributeOffsetif it is not justmaxVertexInputBufferStridemaxDrawIndexedIndexValue- not neededmaxDrawIndirectCountsubPixelPrecisionBits,subTexelPrecisionBits,viewportSubPixelBits,mipmapPrecisionBitsmaxSamplerLodBiasthat clamps the sum of the sampler's lod bias and the bias set in the shader.strictLineswhich describes wether parallelogram lines or Bresenham lines are used.standardSampleLocationswhich we might require in WebGPU.sampledImageColorSampleCounts,sampledImageIntegerSampleCounts,sampledImageDepthSampleCounts,sampledImageStencilSampleCounts,storageImageSampleCountsmaxSampleMaskWordsI think we also want a limit that's WebGPU-specific:
maxBufferTextureCopyRowPitchAlignmentthat encodes the 256 constraint we have.