Let we allow to ignore vsync waiting if user don't want, by environment.
Change-Id: I22d15594a145c32e633816f5f2c7560bd47d7934
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
mDefaultHalfFrameNanoseconds(0u),
mUpdateRequestCount(0u),
mRunning(FALSE),
+ mVsyncRender(TRUE),
mThreadId(0),
mThreadMode(threadMode),
mUpdateRenderRunCount(0),
currentSurface->SetThreadSynchronization(*this);
}
+ mVsyncRender = environmentOptions.VsyncRenderRequired();
+
mSleepTrigger = TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &CombinedUpdateRenderController::ProcessSleepRequest), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
}
TRACE_UPDATE_RENDER_END("DALI_UPDATE_RENDER");
// Render to FBO is intended to measure fps above 60 so sleep is not wanted.
- if(0u == renderToFboInterval)
+ if(mVsyncRender && 0u == renderToFboInterval)
{
TRACE_UPDATE_RENDER_SCOPE("DALI_UPDATE_RENDER_SLEEP");
// Sleep until at least the the default frame duration has elapsed. This will return immediately if the specified end-time has already passed.
#define DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
/*
- * Copyright (c) 2023 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.
uint32_t mUpdateRequestCount; ///< Count of update-requests we have received to ensure we do not go to sleep too early.
uint32_t mRunning; ///< Read and set on the event-thread only to state whether we are running.
+ uint32_t mVsyncRender; ///< Whether vsync render required or not.
int32_t mThreadId; ///< UpdateRender thread id
ThreadMode mThreadMode; ///< Whether the thread runs continuously or runs when it is requested.
/*
- * Copyright (c) 2022 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.
const bool DEFAULT_DEPTH_BUFFER_REQUIRED_SETTING = true;
const bool DEFAULT_STENCIL_BUFFER_REQUIRED_SETTING = true;
const bool DEFAULT_PARTIAL_UPDATE_REQUIRED_SETTING = true;
+const bool DEFAULT_VSYNC_RENDER_REQUIRED_SETTING = true;
unsigned int GetEnvironmentVariable(const char* variable, unsigned int defaultValue)
{
mGlesCallAccumulate(false),
mDepthBufferRequired(DEFAULT_DEPTH_BUFFER_REQUIRED_SETTING),
mStencilBufferRequired(DEFAULT_STENCIL_BUFFER_REQUIRED_SETTING),
- mPartialUpdateRequired(DEFAULT_PARTIAL_UPDATE_REQUIRED_SETTING)
+ mPartialUpdateRequired(DEFAULT_PARTIAL_UPDATE_REQUIRED_SETTING),
+ mVsyncRenderRequired(DEFAULT_VSYNC_RENDER_REQUIRED_SETTING)
{
ParseEnvironmentOptions();
}
return mPartialUpdateRequired;
}
+bool EnvironmentOptions::VsyncRenderRequired() const
+{
+ return mVsyncRenderRequired;
+}
+
void EnvironmentOptions::ParseEnvironmentOptions()
{
// get logging options
SetFromEnvironmentVariable<int>(DALI_ENV_DISABLE_STENCIL_BUFFER, DisableIfNonZero(mStencilBufferRequired));
SetFromEnvironmentVariable<int>(DALI_ENV_DISABLE_PARTIAL_UPDATE, DisableIfNonZero(mPartialUpdateRequired));
+
+ SetFromEnvironmentVariable<int>(DALI_ENV_DISABLE_VSYNC_RENDER, DisableIfNonZero(mVsyncRenderRequired));
}
} // namespace Adaptor
#define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H
/*
- * Copyright (c) 2023 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.
*/
bool PartialUpdateRequired() const;
+ /**
+ * @return Whether the vsync render is required.
+ */
+ bool VsyncRenderRequired() const;
+
/// Deleted copy constructor.
EnvironmentOptions(const EnvironmentOptions&) = delete;
bool mDepthBufferRequired; ///< Whether the depth buffer is required
bool mStencilBufferRequired; ///< Whether the stencil buffer is required
bool mPartialUpdateRequired; ///< Whether the partial update is required
+ bool mVsyncRenderRequired; ///< Whether the vsync render is required
std::unique_ptr<TraceManager> mTraceManager; ///< TraceManager
};
#define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_VARIABLES_H
/*
- * Copyright (c) 2023 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.
#define DALI_ENV_ENABLE_UI_THREAD "DALI_ENABLE_UI_THREAD"
+#define DALI_ENV_DISABLE_VSYNC_RENDER "DALI_DISABLE_VSYNC_RENDER"
+
// Debug relative environments
#define DALI_ENV_CURLOPT_VERBOSE_MODE "DALI_CURLOPT_VERBOSE_MODE"