diff --git a/src/dawn/native/CommandBufferStateTracker.cpp b/src/dawn/native/CommandBufferStateTracker.cpp index ebf00ad65c..6677398ef2 100644 --- a/src/dawn/native/CommandBufferStateTracker.cpp +++ b/src/dawn/native/CommandBufferStateTracker.cpp @@ -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 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())) {