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
)
Adds a maximum limit upto a dependent limit.
Example: You want to test
maxStorageBuffersPerShaderStage
in fragment stage so you needmaxStorageBuffersInFragmentStage
set as well. But, you don't know exactly what value will be used formaxStorageBuffersPerShaderStage
since that is defined by an enum likeunderDefault
.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 thanmaxStorageBuffersPerShaderStage
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 )