From ac8518fe761804af9535b1d9699d72a970d67e6e Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 9 Oct 2023 16:06:01 -0700 Subject: [PATCH] VAO Cache: improved error message about missing vertex buffers --- Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp b/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp index c72f26e7d..7bfbf9bf1 100644 --- a/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp @@ -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"); @@ -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.");