void Core::ContextDestroyed()
{
+ mRenderManager->ContextDestroyed();
}
void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly)
delete mImpl;
}
+void RenderManager::ContextDestroyed()
+{
+ mImpl->uniformBufferManager->ContextDestroyed();
+}
+
RenderQueue& RenderManager::GetRenderQueue()
{
return mImpl->renderQueue;
#define DALI_INTERNAL_SCENE_GRAPH_RENDER_MANAGER_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.
~RenderManager();
/**
+ * The graphics context is being shutdown. Clean down any outstanding graphics resources.
+ */
+ void ContextDestroyed();
+
+ /**
* Retrieve the RenderQueue. Messages should only be added to this from the update-thread.
* @return The render queue.
*/
/*
- * 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.
UniformBufferManager::~UniformBufferManager() = default;
+void UniformBufferManager::ContextDestroyed()
+{
+ mUBOMap.clear();
+ mCurrentUBOSet = nullptr;
+ mCurrentScene = nullptr;
+}
+
void UniformBufferManager::SetCurrentSceneRenderInfo(SceneGraph::Scene* scene, bool offscreen)
{
mCurrentSceneOffscreen = offscreen;
#define DALI_INTERNAL_UNIFORM_BUFFER_MANAGER_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.
~UniformBufferManager();
+ void ContextDestroyed();
+
Graphics::UniquePtr<UniformBufferView> CreateUniformBufferView(uint32_t size, bool emulated = true);
/**
/*
- * 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.
mEmulated(emulated)
{
mBufferList.resize(emulated ? 1 : INTERNAL_UBO_BUFFER_COUNT);
+ for(size_t i = 0; i < mBufferList.size(); ++i)
+ {
+ mBufferList[i].graphicsBuffer = nullptr;
+ mBufferList[i].graphicsMemory = nullptr;
+ }
}
void UniformBufferV2::ReSpecify(uint32_t sizeInBytes)
// Swap buffers for GPU UBOs
auto s = mBufferList.size();
mCurrentGraphicsBufferIndex = ((mCurrentGraphicsBufferIndex + 1) % s);
+ DALI_ASSERT_DEBUG(mCurrentGraphicsBufferIndex < mBufferList.size());
}
}
#define DALI_INTERNAL_UNIFORM_BUFFER_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.
struct GfxBuffer
{
- Graphics::UniquePtr<Graphics::Buffer> graphicsBuffer;
- Graphics::UniquePtr<Graphics::Memory> graphicsMemory;
- uint32_t capacity;
- uint32_t currentOffset;
+ Graphics::UniquePtr<Graphics::Buffer> graphicsBuffer{nullptr};
+ Graphics::UniquePtr<Graphics::Memory> graphicsMemory{nullptr};
+ uint32_t capacity{0};
+ uint32_t currentOffset{0};
};
// List of buffers, in case of CPU one buffer will be sufficient
std::vector<GfxBuffer> mBufferList;
void* mMappedPtr{nullptr};
uint32_t mCurrentGraphicsBufferIndex{0u};
- bool mEmulated;
+ bool mEmulated{false};
};
} // namespace Dali::Internal::Render
#endif //DALI_INTERNAL_UNIFORM_BUFFER_H