Merge pull request #2126 from aitor-lunarg/fix-va-translate
Fix translation of fully remapped multi vertex attribute bindings
This commit is contained in:
commit
c4f90e84b2
@ -206,6 +206,7 @@ struct MVKTranslatedVertexBinding {
|
||||
uint16_t binding;
|
||||
uint16_t translationBinding;
|
||||
uint32_t translationOffset;
|
||||
uint32_t mappedAttributeCount;
|
||||
};
|
||||
|
||||
/** Describes a vertex buffer binding whose divisor is zero. */
|
||||
|
@ -1491,7 +1491,7 @@ bool MVKGraphicsPipeline::addVertexInputToPipeline(T* inputDesc,
|
||||
vbXltdDesc.stride = vbDesc.stride;
|
||||
vbXltdDesc.stepFunction = vbDesc.stepFunction;
|
||||
vbXltdDesc.stepRate = vbDesc.stepRate;
|
||||
xldtVACnt++;
|
||||
xldtVACnt += xltdBind.mappedAttributeCount;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1533,13 +1533,14 @@ uint32_t MVKGraphicsPipeline::getTranslatedVertexBinding(uint32_t binding, uint3
|
||||
// See if a translated binding already exists (for example if more than one VA needs the same translation).
|
||||
for (auto& xltdBind : _translatedVertexBindings) {
|
||||
if (xltdBind.binding == binding && xltdBind.translationOffset == translationOffset) {
|
||||
xltdBind.mappedAttributeCount++;
|
||||
return xltdBind.translationBinding;
|
||||
}
|
||||
}
|
||||
|
||||
// Get next available binding point and add a translation binding description for it
|
||||
uint16_t xltdBindPt = (uint16_t)(maxBinding + _translatedVertexBindings.size() + 1);
|
||||
_translatedVertexBindings.push_back( {.binding = (uint16_t)binding, .translationBinding = xltdBindPt, .translationOffset = translationOffset} );
|
||||
_translatedVertexBindings.push_back( {.binding = (uint16_t)binding, .translationBinding = xltdBindPt, .translationOffset = translationOffset, .mappedAttributeCount = 1u} );
|
||||
|
||||
return xltdBindPt;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user