Metal: Remap vertex buffers when using Tint

Otherwise bindings with non-zero groups get through to the Tint MSL
backend and break assumptions.

Bug: tint:104, dawn:571
Change-Id: I8d95ba142a386ff0d992ffe5f88a7acf93057ce1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54960
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
James Price 2021-06-17 08:08:58 +00:00 committed by Dawn LUCI CQ
parent 5b6c1ebce7
commit dcb82432fb

View File

@ -112,9 +112,14 @@ namespace dawn_native { namespace metal {
for (VertexBufferSlot slot : for (VertexBufferSlot slot :
IterateBitSet(renderPipeline->GetVertexBufferSlotsUsed())) { IterateBitSet(renderPipeline->GetVertexBufferSlotsUsed())) {
uint32_t metalIndex = renderPipeline->GetMtlVertexBufferIndex(slot); uint32_t metalIndex = renderPipeline->GetMtlVertexBufferIndex(slot);
DAWN_UNUSED(metalIndex);
// TODO(crbug.com/tint/104): Tell Tint to map (kPullingBufferBindingSet, slot) to // Tell Tint to map (kPullingBufferBindingSet, slot) to this MSL buffer index.
// this MSL buffer index. BindingPoint srcBindingPoint{static_cast<uint32_t>(kPullingBufferBindingSet),
static_cast<uint8_t>(slot)};
BindingPoint dstBindingPoint{0, metalIndex};
if (srcBindingPoint != dstBindingPoint) {
bindingPoints.emplace(srcBindingPoint, dstBindingPoint);
}
} }
} }
if (GetDevice()->IsRobustnessEnabled()) { if (GetDevice()->IsRobustnessEnabled()) {