[Vulkan] Render target resolving

This commit is contained in:
Triang3l
2022-06-20 22:29:07 +03:00
parent c6ec6d8239
commit 0dc480721f
3 changed files with 1287 additions and 5 deletions

View File

@@ -289,10 +289,11 @@ bool VulkanCommandProcessor::SetupContext() {
return false;
}
// Requires the transient descriptor set layouts.
// TODO(Triang3l): Get the actual draw resolution scale when the texture cache
// supports resolution scaling.
render_target_cache_ = std::make_unique<VulkanRenderTargetCache>(
*register_file_, *memory_, &trace_writer_, 1, 1, *this);
*register_file_, *memory_, trace_writer_, 1, 1, *this);
if (!render_target_cache_->Initialize()) {
XELOGE("Failed to initialize the render target cache");
return false;
@@ -1884,6 +1885,14 @@ bool VulkanCommandProcessor::IssueCopy() {
return false;
}
uint32_t written_address, written_length;
if (!render_target_cache_->Resolve(*memory_, *shared_memory_, *texture_cache_,
written_address, written_length)) {
return false;
}
// TODO(Triang3l): CPU readback.
return true;
}
@@ -1893,6 +1902,7 @@ void VulkanCommandProcessor::InitializeTrace() {
if (!BeginSubmission(true)) {
return;
}
// TODO(Triang3l): Write the EDRAM.
bool shared_memory_submitted =
shared_memory_->InitializeTraceSubmitDownloads();
if (!shared_memory_submitted) {