Fix SVACE errors in various files
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles-impl / gles-graphics-pipeline.cpp
index 8cc9491..a927fad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -45,7 +45,6 @@ struct PipelineImpl::PipelineState
   DepthStencilState  depthStencilState;
   ProgramState       programState;
   ViewportState      viewportState;
-  FramebufferState   framebufferState;
   RasterizationState rasterizationState;
   VertexInputState   vertexInputState;
   InputAssemblyState inputAssemblyState;
@@ -65,10 +64,8 @@ PipelineImpl::PipelineImpl(const Graphics::PipelineCreateInfo& createInfo, Graph
   CopyStateIfSet(createInfo.vertexInputState, mPipelineState->vertexInputState, &mCreateInfo.vertexInputState);
   CopyStateIfSet(createInfo.rasterizationState, mPipelineState->rasterizationState, &mCreateInfo.rasterizationState);
   CopyStateIfSet(createInfo.programState, mPipelineState->programState, &mCreateInfo.programState);
-  CopyStateIfSet(createInfo.framebufferState, mPipelineState->framebufferState, &mCreateInfo.framebufferState);
   CopyStateIfSet(createInfo.colorBlendState, mPipelineState->colorBlendState, &mCreateInfo.colorBlendState);
   CopyStateIfSet(createInfo.depthStencilState, mPipelineState->depthStencilState, &mCreateInfo.depthStencilState);
-  CopyStateIfSet(createInfo.programState, mPipelineState->programState, &mCreateInfo.programState);
   CopyStateIfSet(createInfo.viewportState, mPipelineState->viewportState, &mCreateInfo.viewportState);
 
   // This program doesn't need custom deleter
@@ -92,11 +89,12 @@ auto& PipelineImpl::GetController() const
   return mController;
 }
 
-void PipelineImpl::Bind(GLES::PipelineImpl* prevPipeline)
+void PipelineImpl::Bind(const uint32_t glProgram) const
 {
-  auto& gl        = *GetController().GetGL();
-  auto  glProgram = static_cast<const GLES::Program*>(GetCreateInfo().programState->program)->GetImplementation()->GetGlProgram();
-  gl.UseProgram(glProgram);
+  if(auto gl = GetController().GetGL())
+  {
+    gl->UseProgram(glProgram);
+  }
 }
 
 void PipelineImpl::Retain()