From ce92a2868df09ff2c501b5e091115c72691522cd Mon Sep 17 00:00:00 2001 From: seungho baek Date: Fri, 16 Jun 2023 17:40:18 +0900 Subject: [PATCH] Fix to do not try to bind texture when there is no active texture in shader code Change-Id: Ibd690b68015869f485b3458dc80b81486d3eca8e Signed-off-by: seungho baek --- dali/internal/graphics/gles-impl/gles-context.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dali/internal/graphics/gles-impl/gles-context.cpp b/dali/internal/graphics/gles-impl/gles-context.cpp index a073193..369af21 100644 --- a/dali/internal/graphics/gles-impl/gles-context.cpp +++ b/dali/internal/graphics/gles-impl/gles-context.cpp @@ -323,6 +323,12 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES:: // elements. This avoids having to sort the bindings. for(const auto& binding : mImpl->mCurrentTextureBindings) { + if(currentSampler >= samplers.size()) + { + // Don't bind more textures than there are active samplers. + break; + } + auto texture = const_cast(static_cast(binding.texture)); // Texture may not have been initialized yet...(tbm_surface timing issue?) @@ -349,11 +355,6 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES:: currentElement = 0; } } - if(currentSampler >= samplers.size()) - { - // Don't bind more textures than there are active samplers. - break; - } } const auto& pipelineState = mImpl->mNewPipeline ? mImpl->mNewPipeline->GetCreateInfo() : mImpl->mCurrentPipeline->GetCreateInfo(); -- 2.7.4