diff --git a/src/shader_recompiler/frontend/control_flow_graph.cpp b/src/shader_recompiler/frontend/control_flow_graph.cpp index 8c3122b28..1fb129f6c 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.cpp +++ b/src/shader_recompiler/frontend/control_flow_graph.cpp @@ -80,6 +80,7 @@ void CFG::EmitLabels() { if (inst.IsUnconditionalBranch()) { const u32 target = inst.BranchTarget(pc); AddLabel(target); + AddLabel(pc + inst.length); } else if (inst.IsConditionalBranch()) { const u32 true_label = inst.BranchTarget(pc); const u32 false_label = pc + inst.length; diff --git a/src/video_core/amdgpu/liverpool.cpp b/src/video_core/amdgpu/liverpool.cpp index 2ad64747f..820903ab7 100644 --- a/src/video_core/amdgpu/liverpool.cpp +++ b/src/video_core/amdgpu/liverpool.cpp @@ -569,36 +569,22 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span dcb, std::spansrc_sel == DmaDataSrc::Data && dma_data->dst_sel == DmaDataDst::Gds) { - LOG_CRITICAL(Render_Vulkan, "DmaData Data ({}) -> Gds {:#x}, {} bytes", - dma_data->data, dma_data->dst_addr_lo, dma_data->NumBytes()); rasterizer->InlineData(dma_data->dst_addr_lo, &dma_data->data, sizeof(u32), true); } else if (dma_data->src_sel == DmaDataSrc::Memory && dma_data->dst_sel == DmaDataDst::Gds) { - LOG_CRITICAL(Render_Vulkan, "DmaData Memory {:#x} -> Gds {:#x}, {} bytes", - dma_data->SrcAddress(), dma_data->dst_addr_lo, - dma_data->NumBytes()); rasterizer->CopyBuffer(dma_data->dst_addr_lo, dma_data->SrcAddress(), dma_data->NumBytes(), true, false); } else if (dma_data->src_sel == DmaDataSrc::Data && dma_data->dst_sel == DmaDataDst::Memory) { - LOG_CRITICAL(Render_Vulkan, "DmaData Data ({}) -> Memory {:#x}, {} bytes", - dma_data->data, dma_data->DstAddress(), - dma_data->NumBytes()); rasterizer->InlineData(dma_data->DstAddress(), &dma_data->data, sizeof(u32), false); } else if (dma_data->src_sel == DmaDataSrc::Gds && dma_data->dst_sel == DmaDataDst::Memory) { - LOG_CRITICAL(Render_Vulkan, "DmaData Gds {:#x} -> Memory {:#x}, {} bytes", - dma_data->src_addr_lo, dma_data->DstAddress(), - dma_data->NumBytes()); rasterizer->CopyBuffer(dma_data->DstAddress(), dma_data->src_addr_lo, dma_data->NumBytes(), false, true); } else if (dma_data->src_sel == DmaDataSrc::Memory && dma_data->dst_sel == DmaDataDst::Memory) { - LOG_CRITICAL(Render_Vulkan, "DmaData Memory {:#x} -> Memory {:#x}, {} bytes", - dma_data->SrcAddress(), - dma_data->DstAddress(), dma_data->NumBytes()); rasterizer->CopyBuffer(dma_data->DstAddress(), dma_data->SrcAddress(), dma_data->NumBytes(), false, false); @@ -742,35 +728,21 @@ Liverpool::Task Liverpool::ProcessCompute(std::span acb, int vqid) { break; } if (dma_data->src_sel == DmaDataSrc::Data && dma_data->dst_sel == DmaDataDst::Gds) { - LOG_CRITICAL(Render_Vulkan, "DmaData Data ({}) -> Gds {:#x}, {} bytes", - dma_data->data, dma_data->dst_addr_lo, dma_data->NumBytes()); rasterizer->InlineData(dma_data->dst_addr_lo, &dma_data->data, sizeof(u32), true); } else if (dma_data->src_sel == DmaDataSrc::Memory && dma_data->dst_sel == DmaDataDst::Gds) { - LOG_CRITICAL(Render_Vulkan, "DmaData Memory {:#x} -> Gds {:#x}, {} bytes", - dma_data->SrcAddress(), dma_data->dst_addr_lo, - dma_data->NumBytes()); rasterizer->CopyBuffer(dma_data->dst_addr_lo, dma_data->SrcAddress(), dma_data->NumBytes(), true, false); } else if (dma_data->src_sel == DmaDataSrc::Data && dma_data->dst_sel == DmaDataDst::Memory) { - LOG_CRITICAL(Render_Vulkan, "DmaData Data ({}) -> Memory {:#x}, {} bytes", - dma_data->data, dma_data->DstAddress(), - dma_data->NumBytes()); rasterizer->InlineData(dma_data->DstAddress(), &dma_data->data, sizeof(u32), false); } else if (dma_data->src_sel == DmaDataSrc::Gds && dma_data->dst_sel == DmaDataDst::Memory) { - LOG_CRITICAL(Render_Vulkan, "DmaData Gds {:#x} -> Memory {:#x}, {} bytes", - dma_data->src_addr_lo, dma_data->DstAddress(), - dma_data->NumBytes()); rasterizer->CopyBuffer(dma_data->DstAddress(), dma_data->src_addr_lo, dma_data->NumBytes(), false, true); } else if (dma_data->src_sel == DmaDataSrc::Memory && dma_data->dst_sel == DmaDataDst::Memory) { - LOG_CRITICAL(Render_Vulkan, "DmaData Memory {:#x} -> Memory {:#x}, {} bytes", - dma_data->SrcAddress(), dma_data->DstAddress(), - dma_data->NumBytes()); rasterizer->CopyBuffer(dma_data->DstAddress(), dma_data->SrcAddress(), dma_data->NumBytes(), false, false); } else { diff --git a/src/video_core/buffer_cache/buffer_cache.cpp b/src/video_core/buffer_cache/buffer_cache.cpp index 2941a45cc..de801d9bf 100644 --- a/src/video_core/buffer_cache/buffer_cache.cpp +++ b/src/video_core/buffer_cache/buffer_cache.cpp @@ -336,12 +336,13 @@ void BufferCache::InlineData(VAddr address, const void* value, u32 num_bytes, bo void BufferCache::CopyBuffer(VAddr dst, VAddr src, u32 num_bytes, bool dst_gds, bool src_gds) { if (!dst_gds && !IsRegionRegistered(dst, num_bytes)) { - if (src_gds || IsRegionRegistered(src, num_bytes)) { - LOG_CRITICAL(Render_Vulkan, "readback is not implemented"); + if (!src_gds && !IsRegionRegistered(src, num_bytes)) { + // Both buffers were not transferred to GPU yet. Can safely copy in host memory. + memcpy(std::bit_cast(dst), std::bit_cast(src), num_bytes); return; } - memcpy(std::bit_cast(dst), std::bit_cast(src), num_bytes); - return; + // Without a readback there's nothing we can do with this + // Fallback to creating dst buffer on GPU to at least have this data there } if (!src_gds && !IsRegionRegistered(src, num_bytes)) { InlineData(dst, std::bit_cast(src), num_bytes, dst_gds); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index eac38afc5..9e9b40ca5 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -263,6 +263,7 @@ void Rasterizer::DrawIndirect(bool is_indexed, VAddr arg_address, u32 offset, u3 } auto state = PrepareRenderState(pipeline->GetMrtMask()); + if (!BindResources(pipeline)) { return; } @@ -353,9 +354,6 @@ void Rasterizer::DispatchIndirect(VAddr address, u32 offset, u32 size) { return; } - LOG_CRITICAL(Render_Vulkan, "DispatchIndirect addr = {:#x}", - std::bit_cast(address + offset)); - scheduler.EndRendering(); const auto [buffer, base] = buffer_cache.ObtainBuffer(address + offset, size, false);