Their was some error if rendererAdded, but render instruction is empty.
If then, we don't swap the presented buffer. So latest rendered scene
don't cleared.
To fix this issue, let we acquire next frame if previous scene had some render
instructions to scene, but not now.
Also (for gles case) if we call eglSetDamageRegionKHR, we should call eglSwapBuffer.
If not, 0x3002 error occured.
Change-Id: Icf55be6fe92ab98def0e631b0205939c16a8f4e6
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
{
for(auto&& scene : mScenes)
{
+ std::vector<Rect<int>> damagedRects;
+
+ mCore->PreRenderScene(scene, mScenePreRenderStatus, damagedRects);
mCore->RenderScene(mRenderStatus, scene, true /*render the off-screen buffers*/);
mCore->RenderScene(mRenderStatus, scene, false /*render the surface*/);
}
DoUpdate(intervalMilliseconds, location);
mCore->PreRender(mRenderStatus, false /*do not force clear*/);
- mCore->PreRender(mScene, damagedRects);
+ mCore->PreRenderScene(mScene, mScenePreRenderStatus, damagedRects);
return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
}
std::vector<Rect<int>> damagedRects;
Rect<int> clippingRect{};
- mCore->PreRender(scene, damagedRects);
+ mCore->PreRenderScene(scene, mScenePreRenderStatus, damagedRects);
mCore->RenderScene(mRenderStatus, scene, true /*render the off-screen buffers*/);
for(auto&& iter : damagedRects)
{
bool TestApplication::RenderOnly()
{
+ std::vector<Rect<int>> damagedRects;
+
// Update Time values
mCore->PreRender(mRenderStatus, false /*do not force clear*/);
+ mCore->PreRenderScene(mScene, mScenePreRenderStatus, damagedRects);
mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
mCore->PostRender();
#define DALI_TEST_APPLICATION_H
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
// INTERNAL INCLUDES
#include <dali/integration-api/resource-policies.h>
+#include <dali/integration-api/scene-pre-render-status.h>
#include <dali/integration-api/scene.h>
#include <dali/integration-api/trace.h>
TestGraphicsController mGraphicsController;
TestRenderSurface* mRenderSurface;
- Integration::UpdateStatus mStatus;
- Integration::RenderStatus mRenderStatus;
+ Integration::UpdateStatus mStatus;
+ Integration::RenderStatus mRenderStatus;
+ Integration::ScenePreRenderStatus mScenePreRenderStatus;
Integration::Core* mCore;
Dali::Integration::Scene mScene;
mRenderStatus.SetNeedsUpdate(false);
mRenderStatus.SetNeedsPostRender(false);
+ std::vector<Rect<int>> damagedRects;
+
mCore->PreRender(mRenderStatus, false /*do not force clear*/);
+ mCore->PreRenderScene(mScene, mScenePreRenderStatus, damagedRects);
mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
mCore->PostRender();
DoUpdate(intervalMilliseconds, location);
mCore->PreRender(mRenderStatus, false /*do not force clear*/);
- mCore->PreRender(mScene, damagedRects);
+ mCore->PreRenderScene(mScene, mScenePreRenderStatus, damagedRects);
return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
}
bool TestGraphicsApplication::RenderOnly()
{
+ std::vector<Rect<int>> damagedRects;
+
// Update Time values
mCore->PreRender(mRenderStatus, false /*do not force clear*/);
+ mCore->PreRenderScene(mScene, mScenePreRenderStatus, damagedRects);
mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
mCore->PostRender();
// INTERNAL INCLUDES
#include <dali/integration-api/core.h>
#include <dali/integration-api/resource-policies.h>
+#include <dali/integration-api/scene-pre-render-status.h>
#include <dali/integration-api/scene.h>
#include <dali/integration-api/trace.h>
Graphics::UniquePtr<Graphics::RenderTarget> mRenderTarget{nullptr};
Dali::DisplayConnection* mDisplayConnection{nullptr};
- Integration::UpdateStatus mStatus;
- Integration::RenderStatus mRenderStatus;
+ Integration::UpdateStatus mStatus;
+ Integration::RenderStatus mRenderStatus;
+ Integration::ScenePreRenderStatus mScenePreRenderStatus;
Integration::Core* mCore;
Dali::Integration::Scene mScene;
mRenderStatus.SetNeedsUpdate(false);
mRenderStatus.SetNeedsPostRender(false);
+ std::vector<Rect<int>> damagedRects;
+
mCore->PreRender(mRenderStatus, false /*do not force clear*/);
+ mCore->PreRenderScene(mScene, mScenePreRenderStatus, damagedRects);
mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
mCore->PostRender();
DoUpdate(intervalMilliseconds, location);
mCore->PreRender(mRenderStatus, false /*do not force clear*/);
- mCore->PreRender(mScene, damagedRects);
+ mCore->PreRenderScene(mScene, mScenePreRenderStatus, damagedRects);
return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
}
bool TestGraphicsApplication::RenderOnly()
{
+ std::vector<Rect<int>> damagedRects;
+
// Update Time values
mCore->PreRender(mRenderStatus, false /*do not force clear*/);
+ mCore->PreRenderScene(mScene, mScenePreRenderStatus, damagedRects);
mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
mCore->PostRender();
// INTERNAL INCLUDES
#include <dali/integration-api/core.h>
#include <dali/integration-api/resource-policies.h>
+#include <dali/integration-api/scene-pre-render-status.h>
#include <dali/integration-api/scene.h>
#include <dali/integration-api/trace.h>
Graphics::VulkanGraphics mGraphics; // Use real vulkan graphics
Dali::DisplayConnection* mDisplayConnection{nullptr};
- Integration::UpdateStatus mStatus;
- Integration::RenderStatus mRenderStatus;
+ Integration::UpdateStatus mStatus;
+ Integration::RenderStatus mRenderStatus;
+ Integration::ScenePreRenderStatus mScenePreRenderStatus;
Integration::Core* mCore;
Dali::Integration::Scene mScene;
// EXTERNAL INCLUDES
#include <dali/integration-api/platform-abstraction.h>
+#include <dali/integration-api/scene-pre-render-status.h>
#include <dali/integration-api/shader-integ.h>
#include <dali/public-api/common/dali-common.h>
#include <errno.h>
if(scene && windowSurface)
{
TRACE_UPDATE_RENDER_SCOPE("DALI_RENDER_SCENE");
- Integration::RenderStatus windowRenderStatus;
+ Integration::RenderStatus windowRenderStatus;
+ Integration::ScenePreRenderStatus scenePreRenderStatus;
const uint32_t sceneSurfaceResized = scene.GetSurfaceRectChangedCount();
mDamagedRects.clear();
// Collect damage rects
- bool willRender = mCore.PreRender(scene, mDamagedRects); // willRender is set if there are any render instructions with renderables
- bool fullSwap = windowSurface->GetFullSwapNextFrame(); // true on Resize|set bg color
+ mCore.PreRenderScene(scene, scenePreRenderStatus, mDamagedRects);
+
+ const bool willRenderToScene = scenePreRenderStatus.HasRenderInstructionToScene(); // willRenderToScene is set if there are any render instructions with renderables.
+ const bool hadRenderedToScene = scenePreRenderStatus.HadRenderInstructionToScene(); // and hadRenderedToScene is set if previous frame was.
+
+ // Need to present if previous frame had rendered to scene.
+ bool presentRequired = hadRenderedToScene || willRenderToScene;
Rect<int> clippingRect; // Empty for fbo rendering
// Ensure surface can be drawn to; merge damaged areas for previous frames
windowSurface->PreRender(sceneSurfaceResized > 0u, mDamagedRects, clippingRect);
- if(mEnvironmentOptions.PartialUpdateRequired() && clippingRect.IsEmpty())
+
+ if(graphics.GetPartialUpdateRequired() == Integration::PartialUpdateAvailable::TRUE && clippingRect.IsEmpty())
{
DALI_LOG_INFO(gLogFilter, Debug::General, "PartialUpdate and no clip\n");
DALI_LOG_DEBUG_INFO("ClippingRect was empty. Skip rendering\n");
- willRender = false;
+ presentRequired = false;
}
- LOG_RENDER_SCENE("RenderThread: core.PreRender():%s fullSwap:%s\n",
- willRender ? "T" : "F",
+ const bool fullSwap = windowSurface->GetFullSwapNextFrame(); // true on Resize|set bg color
+
+ LOG_RENDER_SCENE("RenderThread: HadRender:%s WillRender:%s presentRequired:%s fullSwap:%s\n",
+ hadRenderedToScene ? "T" : "F",
+ willRenderToScene ? "T" : "F",
+ presentRequired ? "T" : "F",
fullSwap ? "T" : "F");
- if(willRender || fullSwap)
+ // Forcibly present to surface if fullSwap enabled.
+ if(fullSwap)
+ {
+ presentRequired |= fullSwap;
+ }
+
+ if(presentRequired)
{
graphics.AcquireNextImage(windowSurface);
}
mCore.RenderScene(windowRenderStatus, scene, true);
bool didRender = false;
- if(willRender)
+ if(presentRequired)
{
LOG_RENDER_SCENE("RenderThread: core.RenderScene() Render the surface\n");
didRender = graphics.DidPresent();
LOG_RENDER_SCENE("RenderThread: Surface%s presented\n", didRender ? "" : " NOT");
- }
- // If we weren't going to draw, but need to clear; OR
- // we were going to draw but didn't, we have acquired the image, and must present.
- if((!willRender && fullSwap) || (willRender && !didRender))
- {
- mCore.ClearScene(scene);
+ // If we were going to draw but didn't, we have acquired the image, and must present.
+ if(!didRender)
+ {
+ mCore.ClearScene(scene);
+ }
}
// If surface is resized, the surface resized count is decreased.