Skip to content

Commit

Permalink
VAO Cache: improved error message about missing vertex buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Oct 9, 2023
1 parent 961ec5b commit ac8518f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 Diligent Graphics LLC
* Copyright 2019-2023 Diligent Graphics LLC
* Copyright 2015-2019 Egor Yusov
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -160,7 +160,9 @@ VAOCache::VAOHashKey::VAOHashKey(const VAOAttribs& Attribs) :
const auto& LayoutElem = LayoutElements[i];
const auto BufferSlot = LayoutElem.BufferSlot;
VERIFY_EXPR(BufferSlot < MAX_BUFFER_SLOTS);
DEV_CHECK_ERR(BufferSlot < Attribs.NumVertexStreams, "Input layout requires at least ", BufferSlot + 1, " buffer(s), but only ", Attribs.NumVertexStreams, " are bound.");
DEV_CHECK_ERR(BufferSlot < Attribs.NumVertexStreams, "Input layout requires at least ", BufferSlot + 1,
" buffer", (BufferSlot > 0 ? "s" : ""), ", but only ", Attribs.NumVertexStreams, ' ',
(Attribs.NumVertexStreams == 1 ? "is" : "are"), " bound.");

const auto& SrcStream = Attribs.VertexStreams[BufferSlot];
DEV_CHECK_ERR(SrcStream.pBuffer, "VAO requires buffer at slot ", BufferSlot, ", but none is bound in the context.");
Expand Down

0 comments on commit ac8518f

Please sign in to comment.