• Adds a maximum limit upto a dependent limit.

    Example: You want to test maxStorageBuffersPerShaderStage in fragment stage so you need maxStorageBuffersInFragmentStage set as well. But, you don't know exactly what value will be used for maxStorageBuffersPerShaderStage since that is defined by an enum like underDefault.

    So, you want maxStorageBuffersInFragmentStage to be set as high as possible. You can't just set it to it's maximum value (adapter.limits.maxStorageBuffersInFragmentStage) because if it's greater than maxStorageBuffersPerShaderStage you'll get an error.

    So, use this function

    const limits: LimitsRequest = {}; addMaximumLimitUpToDependentLimit( adapter, limits, limit: 'maxStorageBuffersInFragmentStage', // the limit we want to add dependentLimitName: 'maxStorageBuffersPerShaderStage', // what the previous limit is dependent on dependentLimitTest: 'underDefault', // the enum used to decide the dependent limit )

    Parameters

    • adapter: GPUAdapter
    • limits: LimitsRequest
    • limit: "maxTextureDimension1D" | "maxTextureDimension2D" | "maxTextureDimension3D" | "maxTextureArrayLayers" | "maxBindGroups" | "maxBindGroupsPlusVertexBuffers" | "maxBindingsPerBindGroup" | "maxDynamicUniformBuffersPerPipelineLayout" | "maxDynamicStorageBuffersPerPipelineLayout" | "maxSampledTexturesPerShaderStage" | "maxSamplersPerShaderStage" | "maxStorageBuffersPerShaderStage" | "maxStorageTexturesPerShaderStage" | "maxUniformBuffersPerShaderStage" | "maxUniformBufferBindingSize" | "maxStorageBufferBindingSize" | "minUniformBufferOffsetAlignment" | "minStorageBufferOffsetAlignment" | "maxVertexBuffers" | "maxBufferSize" | "maxVertexAttributes" | "maxVertexBufferArrayStride" | "maxInterStageShaderVariables" | "maxColorAttachments" | "maxColorAttachmentBytesPerSample" | "maxComputeWorkgroupStorageSize" | "maxComputeInvocationsPerWorkgroup" | "maxComputeWorkgroupSizeX" | "maxComputeWorkgroupSizeY" | "maxComputeWorkgroupSizeZ" | "maxComputeWorkgroupsPerDimension" | "maxStorageBuffersInFragmentStage" | "maxStorageTexturesInFragmentStage" | "maxStorageBuffersInVertexStage" | "maxStorageTexturesInVertexStage"
    • dependentLimitName: "maxTextureDimension1D" | "maxTextureDimension2D" | "maxTextureDimension3D" | "maxTextureArrayLayers" | "maxBindGroups" | "maxBindGroupsPlusVertexBuffers" | "maxBindingsPerBindGroup" | "maxDynamicUniformBuffersPerPipelineLayout" | "maxDynamicStorageBuffersPerPipelineLayout" | "maxSampledTexturesPerShaderStage" | "maxSamplersPerShaderStage" | "maxStorageBuffersPerShaderStage" | "maxStorageTexturesPerShaderStage" | "maxUniformBuffersPerShaderStage" | "maxUniformBufferBindingSize" | "maxStorageBufferBindingSize" | "minUniformBufferOffsetAlignment" | "minStorageBufferOffsetAlignment" | "maxVertexBuffers" | "maxBufferSize" | "maxVertexAttributes" | "maxVertexBufferArrayStride" | "maxInterStageShaderVariables" | "maxColorAttachments" | "maxColorAttachmentBytesPerSample" | "maxComputeWorkgroupStorageSize" | "maxComputeInvocationsPerWorkgroup" | "maxComputeWorkgroupSizeX" | "maxComputeWorkgroupSizeY" | "maxComputeWorkgroupSizeZ" | "maxComputeWorkgroupsPerDimension" | "maxStorageBuffersInFragmentStage" | "maxStorageTexturesInFragmentStage" | "maxStorageBuffersInVertexStage" | "maxStorageTexturesInVertexStage"
    • dependentLimitTest: "atDefault" | "underDefault" | "betweenDefaultAndMaximum" | "atMaximum" | "overMaximum"

    Returns void

Generated using TypeDoc