Merge pull request #2222 from aitor-lunarg/main
Allow vertex buffer binding when they are used disregarding implicit buffer index
This commit is contained in:
commit
75fb9493a6
@ -430,6 +430,8 @@ protected:
|
|||||||
uint32_t _tessCtlPatchOutputBufferIndex = 0;
|
uint32_t _tessCtlPatchOutputBufferIndex = 0;
|
||||||
uint32_t _tessCtlLevelBufferIndex = 0;
|
uint32_t _tessCtlLevelBufferIndex = 0;
|
||||||
|
|
||||||
|
static constexpr uint32_t kMVKMaxVertexInputBindingBufferCount = 31u; // Taken from Metal Feature Set Table. Highest value out of all present GPUs
|
||||||
|
bool _isVertexInputBindingUsed[kMVKMaxVertexInputBindingBufferCount] = { false };
|
||||||
bool _primitiveRestartEnable = true;
|
bool _primitiveRestartEnable = true;
|
||||||
bool _hasRasterInfo = false;
|
bool _hasRasterInfo = false;
|
||||||
bool _needsVertexSwizzleBuffer = false;
|
bool _needsVertexSwizzleBuffer = false;
|
||||||
|
@ -1415,6 +1415,7 @@ bool MVKGraphicsPipeline::addVertexInputToPipeline(T* inputDesc,
|
|||||||
|
|
||||||
maxBinding = max(pVKVB->binding, maxBinding);
|
maxBinding = max(pVKVB->binding, maxBinding);
|
||||||
uint32_t vbIdx = getMetalBufferIndexForVertexAttributeBinding(pVKVB->binding);
|
uint32_t vbIdx = getMetalBufferIndexForVertexAttributeBinding(pVKVB->binding);
|
||||||
|
_isVertexInputBindingUsed[vbIdx] = true;
|
||||||
auto vbDesc = inputDesc.layouts[vbIdx];
|
auto vbDesc = inputDesc.layouts[vbIdx];
|
||||||
if (isVtxStrideStatic && pVKVB->stride == 0) {
|
if (isVtxStrideStatic && pVKVB->stride == 0) {
|
||||||
// Stride can't be 0, it will be set later to attributes' maximum offset + size
|
// Stride can't be 0, it will be set later to attributes' maximum offset + size
|
||||||
@ -1842,7 +1843,7 @@ void MVKGraphicsPipeline::initReservedVertexAttributeBufferCount(const VkGraphic
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool MVKGraphicsPipeline::isValidVertexBufferIndex(MVKShaderStage stage, uint32_t mtlBufferIndex) {
|
bool MVKGraphicsPipeline::isValidVertexBufferIndex(MVKShaderStage stage, uint32_t mtlBufferIndex) {
|
||||||
return mtlBufferIndex < _descriptorBufferCounts.stages[stage] || mtlBufferIndex > getImplicitBufferIndex(stage, 0);
|
return _isVertexInputBindingUsed[mtlBufferIndex] || mtlBufferIndex < _descriptorBufferCounts.stages[stage] || mtlBufferIndex > getImplicitBufferIndex(stage, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initializes the vertex attributes in a shader conversion configuration.
|
// Initializes the vertex attributes in a shader conversion configuration.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user