Improve the error message of missing vertex buffers

It now shows at least one vertex buffer that wasn't set, which helped
debug another issue.

Bug: dawn:563
Change-Id: Ifd40611bc10b049780cb1239aeee3186a26bc0c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112020
Reviewed-by: Brandon Jones <bajones@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2022-12-01 12:23:07 +00:00 committed by Dawn LUCI CQ
parent f62aec2dc8
commit 145643a542
1 changed files with 10 additions and 3 deletions

View File

@ -300,9 +300,16 @@ MaybeError CommandBufferStateTracker::CheckMissingAspects(ValidationAspects aspe
return DAWN_VALIDATION_ERROR("Index buffer is invalid.");
}
// TODO(dawn:563): Indicate which slots were not set.
DAWN_INVALID_IF(aspects[VALIDATION_ASPECT_VERTEX_BUFFERS],
"Vertex buffer slots required by %s were not set.", GetRenderPipeline());
if (aspects[VALIDATION_ASPECT_VERTEX_BUFFERS]) {
const ityp::bitset<VertexBufferSlot, kMaxVertexBuffers> missingVertexBuffers =
GetRenderPipeline()->GetVertexBufferSlotsUsed() & ~mVertexBufferSlotsUsed;
ASSERT(missingVertexBuffers.any());
VertexBufferSlot firstMissing = ityp::Sub(GetHighestBitIndexPlusOne(missingVertexBuffers),
VertexBufferSlot(uint8_t(1)));
return DAWN_VALIDATION_ERROR("Vertex buffer slot %u required by %s was not set.",
uint8_t(firstMissing), GetRenderPipeline());
}
if (DAWN_UNLIKELY(aspects[VALIDATION_ASPECT_BIND_GROUPS])) {
for (BindGroupIndex i : IterateBitSet(mLastPipelineLayout->GetBindGroupLayoutsMask())) {