From 195dfd3a09bc917135deeb4a4450638ae47997d1 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 7 Mar 2019 09:02:28 -0800 Subject: Improved buffer stride management in PSO --- Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp b/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp index fece99b3..b9d2237b 100644 --- a/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/VAOCache.cpp @@ -90,7 +90,6 @@ const GLObjectWrappers::GLVertexArrayObj& VAOCache::GetVAO( IPipelineState *pPSO const auto &InputLayout = pPSOGL->GetDesc().GraphicsPipeline.InputLayout; const LayoutElement *LayoutElems = InputLayout.LayoutElements; Uint32 NumElems = InputLayout.NumElements; - const Uint32 *Strides = pPSOGL->GetBufferStrides(); // Construct the key VAOCacheKey Key(pPSO, pIndexBuffer); @@ -115,7 +114,7 @@ const GLObjectWrappers::GLVertexArrayObj& VAOCache::GetVAO( IPipelineState *pPSO Key.NumUsedSlots = MaxUsedSlot; auto &CurrStream = VertexStreams[BuffSlot]; - auto Stride = Strides[BuffSlot]; + auto Stride = pPSOGL->GetBufferStride(BuffSlot); auto &pCurrBuf = VertexBuffers[BuffSlot]; auto &CurrStreamKey = Key.Streams[BuffSlot]; if (pCurrBuf == nullptr) @@ -179,7 +178,7 @@ const GLObjectWrappers::GLVertexArrayObj& VAOCache::GetVAO( IPipelineState *pPSO // Get buffer through the strong reference. Note that we are not // using pointers stored in the key for safety auto &CurrStream = VertexStreams[BuffSlot]; - auto Stride = Strides[BuffSlot]; + auto Stride = pPSOGL->GetBufferStride(BuffSlot); auto *pBuff = VertexBuffers[BuffSlot]; VERIFY( pBuff != nullptr, "Vertex buffer is null" ); const BufferGLImpl *pBufferOGL = static_cast( pBuff ); -- cgit v1.2.3