From d55ffbaa8d2c2b9d35658c59826192b41019b2b8 Mon Sep 17 00:00:00 2001 From: Adam Bialogonski Date: Tue, 7 Mar 2023 17:00:19 +0000 Subject: [PATCH] Resetting the index buffer binding cache after binding VAO (seems like an NVIDIA bug causing crash) Change-Id: Ieb46fff4a9a41c3cdeda6e3ec04cef409938a18a --- dali/internal/graphics/gles-impl/gles-context.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dali/internal/graphics/gles-impl/gles-context.cpp b/dali/internal/graphics/gles-impl/gles-context.cpp index 1723e5a..c6f0728 100644 --- a/dali/internal/graphics/gles-impl/gles-context.cpp +++ b/dali/internal/graphics/gles-impl/gles-context.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,6 +74,9 @@ struct Context::Impl { mProgramVAOCurrentState = attributeIter->second; gl.BindVertexArray(attributeIter->second); + + // Binding VAO seems to reset the index buffer binding so the cache must be reset + mGlStateCache.mBoundElementArrayBufferId = 0; } return; } @@ -82,6 +85,10 @@ struct Context::Impl uint32_t vao; gl.GenVertexArrays(1, &vao); gl.BindVertexArray(vao); + + // Binding VAO seems to reset the index buffer binding so the cache must be reset + mGlStateCache.mBoundElementArrayBufferId = 0; + mProgramVAOMap[program][hash] = vao; for(const auto& attr : vertexInputState.attributes) { -- 2.7.4