Allow actor without loaded textures to continue rendering. 64/254364/1 graphics-backend-pre-release-2
authorDavid Steele <david.steele@samsung.com>
Mon, 1 Mar 2021 15:49:53 +0000 (15:49 +0000)
committerDavid Steele <david.steele@samsung.com>
Mon, 1 Mar 2021 15:50:00 +0000 (15:50 +0000)
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

dali/internal/render/renderers/render-renderer.cpp

index e6c6df2..4570797 100644 (file)
@@ -488,16 +488,15 @@ void Renderer::SetUniformFromProperty(BufferIndex bufferIndex, Program& program,
 bool Renderer::BindTextures(Program& program, Graphics::CommandBuffer& commandBuffer, Vector<Graphics::Texture*>& boundTextures)
 {
   uint32_t textureUnit = 0;
-  bool     result      = true;
 
   GLint                          uniformLocation(-1);
   std::vector<Render::Sampler*>& samplers(mRenderDataProvider->GetSamplers());
   std::vector<Render::Texture*>& textures(mRenderDataProvider->GetTextures());
 
   std::vector<Graphics::TextureBinding> textureBindings;
-  for(uint32_t i = 0; i < static_cast<uint32_t>(textures.size()) && result; ++i) // not expecting more than uint32_t of textures
+  for(uint32_t i = 0; i < static_cast<uint32_t>(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),