X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fgraphics%2Fgles-impl%2Fegl-graphics-controller.h;h=a8edd34be6df51613402f0ffde37583557fa4088;hb=5522a0d106aca1e80fdda71d7fdda58017510eb5;hp=2491aba33419db15038ed5b90ff2ca2c99faa1a1;hpb=6bcda120e55d2fbd3420fcf2abda28fb9f5e40f7;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/graphics/gles-impl/egl-graphics-controller.h b/dali/internal/graphics/gles-impl/egl-graphics-controller.h index 2491aba..a8edd34 100644 --- a/dali/internal/graphics/gles-impl/egl-graphics-controller.h +++ b/dali/internal/graphics/gles-impl/egl-graphics-controller.h @@ -2,7 +2,7 @@ #define DALI_EGL_GRAPHICS_CONTROLLER_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include namespace Dali @@ -51,6 +53,8 @@ namespace GLES { class CommandBuffer; class PipelineCache; +class SyncPool; +class TextureDependencyChecker; } // namespace GLES /** @@ -62,9 +66,9 @@ class EglGraphicsController : public Graphics::Controller { public: /** - * @brief Deault constructor + * @brief Constructor */ - EglGraphicsController() = default; + EglGraphicsController(); /** * @brief Destructor @@ -90,6 +94,13 @@ public: Internal::Adaptor::EglSyncImplementation& GetEglSyncImplementation(); /** + * Mark the start of the frame. + * + * Note, this is used for logging & debugging, so is not part of the main Graphics API. + */ + void FrameStart(); + + /** * @copydoc Dali::Graphics::SubmitCommandBuffers() */ void SubmitCommandBuffers(const SubmitInfo& submitInfo) override; @@ -102,9 +113,7 @@ public: /** * @copydoc Dali::Graphics::WaitIdle() */ - void WaitIdle() override - { - } + void WaitIdle() override; /** * @copydoc Dali::Graphics::Pause() @@ -126,13 +135,7 @@ public: void Shutdown() override { mIsShuttingDown = true; - } - /** - * @copydoc Dali::Graphics::Destroy() - */ - void Destroy() override - { // Final flush Flush(); @@ -151,6 +154,13 @@ public: } /** + * @copydoc Dali::Graphics::Destroy() + */ + void Destroy() override + { + } + + /** * @copydoc Dali::Graphics::UpdateTextures() */ void UpdateTextures(const std::vector& updateInfoList, @@ -293,17 +303,11 @@ public: /** * @copydoc Dali::Graphics::GetTextureProperties() */ - const TextureProperties& GetTextureProperties(const Texture& texture) override - { - // for compiler not to moan - static TextureProperties dummy{}; - return dummy; - } + TextureProperties GetTextureProperties(const Texture& texture) override; /** * @copydoc Dali::Graphics::Controller::GetPipelineReflection() */ - [[nodiscard]] const Reflection& GetProgramReflection(const Graphics::Program& program) override; /** @@ -392,6 +396,30 @@ public: } /** + * @brief Pushes RenderPass to the discard queue + * + * Function is called from the UniquePtr custom deleter. + * + * @param[in] program Pointer to the RenderPass + */ + void DiscardResource(GLES::RenderPass* renderPass) + { + mDiscardRenderPassQueue.push(renderPass); + } + + /** + * @brief Pushes RenderTarget to the discard queue + * + * Function is called from the UniquePtr custom deleter. + * + * @param[in] program Pointer to the RenderTarget + */ + void DiscardResource(GLES::RenderTarget* renderTarget) + { + mDiscardRenderTargetQueue.push(renderTarget); + } + + /** * @brief Pushes Shader to the discard queue * * Function is called from the UniquePtr custom deleter. @@ -697,6 +725,11 @@ public: void ResolvePresentRenderTarget(GLES::RenderTarget* renderTarget); /** + * Invoked after all rendering has finished. Used to clean up sync resources + */ + void PostRender(); + + /** * Creates a GLES context for the given render surface * * @param[in] surface The surface whose GLES context to be created. @@ -732,6 +765,26 @@ public: return mCurrentContext; } + /** + * @brief Returns EGL shared context + * + * @return valid EGL shared context + */ + void* GetSharedContext() const + { + return mSharedContext; + } + + GLES::SyncPool& GetSyncPool() + { + return mSyncPool; + } + + std::size_t GetCapacity() const + { + return mCapacity; + } + private: Integration::GlAbstraction* mGlAbstraction{nullptr}; Integration::GlContextHelperAbstraction* mGlContextHelperAbstraction{nullptr}; @@ -747,6 +800,8 @@ private: std::queue mDiscardProgramQueue; ///< Discard queue for program resource std::queue mDiscardPipelineQueue; ///< Discard queue of pipelines + std::queue mDiscardRenderPassQueue; ///< Discard queue for renderpass resource + std::queue mDiscardRenderTargetQueue; ///< Discard queue for rendertarget resource std::queue mDiscardShaderQueue; ///< Discard queue of shaders std::queue mDiscardSamplerQueue; ///< Discard queue of samplers std::queue mDiscardCommandBufferQueue; ///< Discard queue of command buffers @@ -772,12 +827,17 @@ private: bool mIsShuttingDown{false}; ///< Indicates whether the controller is shutting down - // todo: to be removed after renderpass - const Graphics::Framebuffer* currentFramebuffer{nullptr}; + std::queue mPresentationCommandBuffers{}; ///< Queue of reusable command buffers used by presentation engine + + void* mSharedContext{nullptr}; ///< Shared EGL context + + GLES::TextureDependencyChecker mTextureDependencyChecker; // Checks if FBO textures need syncing + GLES::SyncPool mSyncPool; + std::size_t mCapacity{0u}; ///< Memory Usage (of command buffers) }; } // namespace Graphics } // namespace Dali -#endif //DALI_EGL_GRAPHICS_CONTROLLER_H +#endif // DALI_EGL_GRAPHICS_CONTROLLER_H