From a1c06e040177903ed8c3f371c353e1d988b48b4e Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Thu, 14 Apr 2022 17:20:05 +0530 Subject: [PATCH] Mark GPU resources as dirty before GPU usage We didn't call `MarkGpuDirty` on textures/buffers prior to GPU usage, this would cause them to not be R/W protected when they should be and provide outdated copies if there were any read accesses from the CPU (which are not possible at the moment since we assume all accesses are writes at the moment). This has now been fixed by calling it after synchronizing the resource. --- .../main/cpp/skyline/gpu/interconnect/command_executor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp index 2b9c8fad..4a406578 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp @@ -142,11 +142,14 @@ namespace skyline::gpu::interconnect { .flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit, }); - for (auto texture : syncTextures) + for (auto texture : syncTextures) { texture->SynchronizeHostWithBuffer(commandBuffer, cycle, true); + texture->MarkGpuDirty(); + } for (const auto& delegate : syncBuffers) { delegate->buffer->SynchronizeHostWithCycle(cycle, true); + delegate->buffer->MarkGpuDirty(); delegate->usageCallback = nullptr; }