From: David Steele Date: Mon, 1 Mar 2021 15:49:53 +0000 (+0000) Subject: Allow actor without loaded textures to continue rendering. X-Git-Tag: graphics-backend-pre-release-2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54718f4d7f85b259de5b8cef6e299e4424718858;p=platform%2Fcore%2Fuifw%2Fdali-core.git Allow actor without loaded textures to continue rendering. If an actor has a texture that hasn't yet had data set on it, allow the actor to continue rendering. (Previously, only stopped rendering if the glBind failed, e.g. for NativeImage, but that is not done in Renderer any more). Change-Id: I0d9084ab1eb0fcf396679774ae2982df48f9ae10 --- diff --git a/dali/internal/render/renderers/render-renderer.cpp b/dali/internal/render/renderers/render-renderer.cpp index e6c6df244..457079774 100644 --- a/dali/internal/render/renderers/render-renderer.cpp +++ b/dali/internal/render/renderers/render-renderer.cpp @@ -488,16 +488,15 @@ void Renderer::SetUniformFromProperty(BufferIndex bufferIndex, Program& program, bool Renderer::BindTextures(Program& program, Graphics::CommandBuffer& commandBuffer, Vector& boundTextures) { uint32_t textureUnit = 0; - bool result = true; GLint uniformLocation(-1); std::vector& samplers(mRenderDataProvider->GetSamplers()); std::vector& textures(mRenderDataProvider->GetTextures()); std::vector textureBindings; - for(uint32_t i = 0; i < static_cast(textures.size()) && result; ++i) // not expecting more than uint32_t of textures + for(uint32_t i = 0; i < static_cast(textures.size()); ++i) // not expecting more than uint32_t of textures { - if(textures[i]) + if(textures[i] && textures[i]->GetGraphicsObject()) { if(program.GetSamplerUniformLocation(i, uniformLocation)) { @@ -523,7 +522,8 @@ bool Renderer::BindTextures(Program& program, Graphics::CommandBuffer& commandBu commandBuffer.BindTextures(textureBindings); } - return result; + // @todo remove check from caller. + return true; } void Renderer::SetFaceCullingMode(FaceCullingMode::Type mode) @@ -761,8 +761,8 @@ void Renderer::Render(Context& conte auto createInfo = Graphics::ProgramCreateInfo(); createInfo.SetShaderState(shaderStates); - auto graphicsProgram = mGraphicsController->CreateProgram(createInfo, nullptr); - Program* program = Program::New(*mProgramCache, + auto graphicsProgram = mGraphicsController->CreateProgram(createInfo, nullptr); + Program* program = Program::New(*mProgramCache, shaderData, *mGraphicsController, std::move(graphicsProgram),