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.
This commit is contained in:
PixelyIon 2022-04-14 17:20:05 +05:30
parent 41a6afed01
commit a1c06e0401

View File

@ -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;
}