From: seungho baek Date: Fri, 16 Jun 2023 08:40:18 +0000 (+0900) Subject: Fix to do not try to bind texture when there is no active texture in shader code X-Git-Tag: dali_2.2.32~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F58%2F294358%2F1;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git 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 --- 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();