#include <dali/integration-api/debug.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/integration-api/gl-defines.h>
+#include <dali/integration-api/graphics-sync-abstraction.h>
+#include <dali/internal/graphics/gles-impl/egl-sync-object.h>
#include <dali/internal/graphics/gles-impl/gles-graphics-command-buffer.h>
#include <dali/internal/graphics/gles-impl/gles-graphics-pipeline.h>
+#include <dali/internal/graphics/gles-impl/gles-graphics-program.h>
#include <dali/internal/graphics/gles-impl/gles-graphics-render-pass.h>
#include <dali/internal/graphics/gles-impl/gles-graphics-render-target.h>
#include <dali/internal/graphics/gles-impl/gles-graphics-shader.h>
#include <dali/internal/graphics/gles-impl/gles-graphics-texture.h>
#include <dali/internal/graphics/gles-impl/gles-graphics-types.h>
+#include <dali/internal/graphics/gles-impl/gles-sync-object.h>
#include <dali/internal/graphics/gles-impl/gles3-graphics-memory.h>
+#include <dali/internal/graphics/gles/egl-sync-implementation.h>
#include <dali/public-api/common/dali-common.h>
-#include "gles-graphics-program.h"
// Uncomment the following define to turn on frame dumping
//#define ENABLE_COMMAND_BUFFER_FRAME_DUMP 1
mCurrentContext = mContext.get();
}
-void EglGraphicsController::Initialize(Integration::GlSyncAbstraction& glSyncAbstraction,
+void EglGraphicsController::Initialize(Integration::GraphicsSyncAbstraction& syncImplementation,
Integration::GlContextHelperAbstraction& glContextHelperAbstraction,
Internal::Adaptor::GraphicsInterface& graphicsInterface)
{
DALI_LOG_RELEASE_INFO("Initializing New Graphics Controller #2\n");
- mGlSyncAbstraction = &glSyncAbstraction;
+ auto* syncImplPtr = static_cast<Internal::Adaptor::EglSyncImplementation*>(&syncImplementation);
+
+ mEglSyncImplementation = syncImplPtr;
mGlContextHelperAbstraction = &glContextHelperAbstraction;
mGraphics = &graphicsInterface;
}
return *mGlAbstraction;
}
-Integration::GlSyncAbstraction& EglGraphicsController::GetGlSyncAbstraction()
-{
- DALI_ASSERT_DEBUG(mGlSyncAbstraction && "Graphics controller not initialized");
- return *mGlSyncAbstraction;
-}
-
Integration::GlContextHelperAbstraction& EglGraphicsController::GetGlContextHelperAbstraction()
{
DALI_ASSERT_DEBUG(mGlContextHelperAbstraction && "Graphics controller not initialized");
return *mGlContextHelperAbstraction;
}
+Internal::Adaptor::EglSyncImplementation& EglGraphicsController::GetEglSyncImplementation()
+{
+ DALI_ASSERT_DEBUG(mEglSyncImplementation && "Sync implementation not initialized");
+ return *mEglSyncImplementation;
+}
+
Graphics::UniquePtr<CommandBuffer> EglGraphicsController::CreateCommandBuffer(
const CommandBufferCreateInfo& commandBufferCreateInfo,
Graphics::UniquePtr<CommandBuffer>&& oldCommandBuffer)
return NewObject<GLES::RenderTarget>(renderTargetCreateInfo, *this, std::move(oldRenderTarget));
}
+Graphics::UniquePtr<SyncObject> EglGraphicsController::CreateSyncObject(const SyncObjectCreateInfo& syncObjectCreateInfo,
+ UniquePtr<SyncObject>&& oldSyncObject)
+{
+ if(GetGLESVersion() < GLES::GLESVersion::GLES_30)
+ {
+ return NewObject<EGL::SyncObject>(syncObjectCreateInfo, *this, std::move(oldSyncObject));
+ }
+ else
+ {
+ return NewObject<GLES::SyncObject>(syncObjectCreateInfo, *this, std::move(oldSyncObject));
+ }
+}
+
const Graphics::Reflection& EglGraphicsController::GetProgramReflection(const Graphics::Program& program)
{
return static_cast<const Graphics::GLES::Program*>(&program)->GetReflection();
void EglGraphicsController::ActivateResourceContext()
{
mCurrentContext = mContext.get();
+ mCurrentContext->GlContextCreated();
}
void EglGraphicsController::ActivateSurfaceContext(Dali::RenderSurfaceInterface* surface)
if(iter != mSurfaceContexts.end())
{
mCurrentContext = iter->second.get();
+ mCurrentContext->GlContextCreated();
}
}
}
ProcessDiscardQueue<GLES::Framebuffer>(mDiscardFramebufferQueue);
// Process pipelines
- ProcessDiscardQueue<GLES::Pipeline>(mDiscardPipelineQueue);
+ ProcessDiscardQueue(mDiscardPipelineQueue);
// Process programs
ProcessDiscardQueue<GLES::Program>(mDiscardProgramQueue);
}
case GLES::CommandType::SET_SCISSOR_TEST:
{
- if(cmd.scissorTest.enable)
- {
- mGlAbstraction->Enable(GL_SCISSOR_TEST);
- }
- else
- {
- mGlAbstraction->Disable(GL_SCISSOR_TEST);
- }
+ mCurrentContext->SetScissorTestEnabled(cmd.scissorTest.enable);
break;
}
case GLES::CommandType::SET_VIEWPORT: // @todo Consider correcting for orientation here?
case GLES::CommandType::END_RENDERPASS:
{
mCurrentContext->EndRenderPass();
+
+ auto syncObject = const_cast<GLES::SyncObject*>(static_cast<const GLES::SyncObject*>(cmd.endRenderPass.syncObject));
+ if(syncObject)
+ {
+ syncObject->InitializeResource();
+ }
break;
}
case GLES::CommandType::PRESENT_RENDER_TARGET:
}
mGlAbstraction->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
- mGlAbstraction->BindTexture(bindTarget, texture->GetGLTexture());
+ mCurrentContext->BindTexture(bindTarget, texture->GetTextureTypeId(), texture->GetGLTexture());
if(!isSubImage)
{
{
auto* texture = mTextureMipmapGenerationRequests.front();
- mGlAbstraction->BindTexture(texture->GetGlTarget(), texture->GetGLTexture());
- mGlAbstraction->GenerateMipmap(texture->GetGlTarget());
+ mCurrentContext->BindTexture(texture->GetGlTarget(), texture->GetTextureTypeId(), texture->GetGLTexture());
+ mCurrentContext->GenerateMipmap(texture->GetGlTarget());
mTextureMipmapGenerationRequests.pop();
}