mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
GPU: Install the draw engines' invalidation callback from BeginFrame
The draw engine is created on the loader thread while the UI thread may already be rendering and invoking the callback. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
759b494b6a
commit
bc581349fd
4 files changed
+19
-4
No files matched your search
@@ -89,7 +89,6 @@ void DrawEngineVulkan::InitDeviceObjects() {
|
||||
res = vkCreateSampler(device, &samp, nullptr, &nullSampler_);
|
||||
_dbg_assert_(VK_SUCCESS == res);
|
||||
|
||||
draw_->SetInvalidationCallback(std::bind(&DrawEngineVulkan::Invalidate, this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
DrawEngineVulkan::~DrawEngineVulkan() {
|
||||
@@ -106,6 +105,7 @@ void DrawEngineVulkan::DestroyDeviceObjects() {
|
||||
VulkanRenderManager *renderManager = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
|
||||
draw_->SetInvalidationCallback(InvalidationCallback());
|
||||
invalidationCallbackInstalled_ = false;
|
||||
|
||||
pushUBO_ = nullptr;
|
||||
|
||||
@@ -143,6 +143,10 @@ void DrawEngineVulkan::DeviceRestore(Draw::DrawContext *draw) {
|
||||
|
||||
void DrawEngineVulkan::BeginFrame() {
|
||||
DrawEngineCommon::BeginFrame();
|
||||
if (!invalidationCallbackInstalled_) {
|
||||
draw_->SetInvalidationCallback(std::bind(&DrawEngineVulkan::Invalidate, this, std::placeholders::_1));
|
||||
invalidationCallbackInstalled_ = true;
|
||||
}
|
||||
|
||||
lastPipeline_ = nullptr;
|
||||
|
||||
|
||||
Reference in new issue
Block a user