diff --git a/src/core/libraries/gnmdriver/gnmdriver.cpp b/src/core/libraries/gnmdriver/gnmdriver.cpp index 18035e6c..255f990f 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.cpp +++ b/src/core/libraries/gnmdriver/gnmdriver.cpp @@ -2768,7 +2768,7 @@ void RegisterlibSceGnmDriver(Core::Loader::SymbolsResolver* sym) { } if (Config::copyGPUCmdBuffers()) { - liverpool->reserveCopyBufferSpace(); + liverpool->ReserveCopyBufferSpace(); } Platform::IrqC::Instance()->Register(Platform::InterruptId::GpuIdle, ResetSubmissionLock, diff --git a/src/video_core/amdgpu/liverpool.cpp b/src/video_core/amdgpu/liverpool.cpp index a4eae8e7..8c09ad27 100644 --- a/src/video_core/amdgpu/liverpool.cpp +++ b/src/video_core/amdgpu/liverpool.cpp @@ -165,12 +165,12 @@ Liverpool::Task Liverpool::ProcessCeUpdate(std::span ccb) { const auto* indirect_buffer = reinterpret_cast(header); auto task = ProcessCeUpdate({indirect_buffer->Address(), indirect_buffer->ib_size}); + task.handle.resume(); while (!task.handle.done()) { - task.handle.resume(); - TracyFiberLeave; co_yield {}; TracyFiberEnter(ccb_task_name); + task.handle.resume(); }; break; } @@ -187,6 +187,7 @@ Liverpool::Task Liverpool::ProcessCeUpdate(std::span ccb) { Liverpool::Task Liverpool::ProcessGraphics(std::span dcb, std::span ccb) { TracyFiberEnter(dcb_task_name); + regs.cs_program = mapped_queues[GfxQueueId].cs_state; cblock.Reset(); @@ -583,6 +584,8 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span dcb, std::spansrc_sel == DmaDataSrc::Gds && dma_data->dst_sel == DmaDataDst::Memory) { // LOG_WARNING(Render_Vulkan, "GDS memory read"); + const u32 data = rasterizer->ReadDataFromGds(dma_data->src_addr_lo); + std::memcpy(dma_data->DstAddress(), &data, sizeof(data)); } else if (dma_data->src_sel == DmaDataSrc::Memory && dma_data->dst_sel == DmaDataDst::Memory) { rasterizer->InlineData(dma_data->DstAddress(), @@ -662,11 +665,13 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span dcb, std::span acb, int vqid) { TracyFiberEnter(acb_task_name); + regs.cs_program = mapped_queues[vqid].cs_state; auto base_addr = reinterpret_cast(acb.data()); while (!acb.empty()) { @@ -689,12 +694,14 @@ Liverpool::Task Liverpool::ProcessCompute(std::span acb, int vqid) { const auto* indirect_buffer = reinterpret_cast(header); auto task = ProcessCompute( {indirect_buffer->Address(), indirect_buffer->ib_size}, vqid); + task.handle.resume(); while (!task.handle.done()) { - task.handle.resume(); - + mapped_queues[vqid].cs_state = regs.cs_program; TracyFiberLeave; co_yield {}; TracyFiberEnter(acb_task_name); + regs.cs_program = mapped_queues[vqid].cs_state; + task.handle.resume(); }; break; } @@ -716,6 +723,8 @@ Liverpool::Task Liverpool::ProcessCompute(std::span acb, int vqid) { } else if (dma_data->src_sel == DmaDataSrc::Gds && dma_data->dst_sel == DmaDataDst::Memory) { // LOG_WARNING(Render_Vulkan, "GDS memory read"); + const u32 data = rasterizer->ReadDataFromGds(dma_data->src_addr_lo); + std::memcpy(dma_data->DstAddress(), &data, sizeof(data)); } else if (dma_data->src_sel == DmaDataSrc::Memory && dma_data->dst_sel == DmaDataDst::Memory) { rasterizer->InlineData(dma_data->DstAddress(), @@ -789,6 +798,7 @@ Liverpool::Task Liverpool::ProcessCompute(std::span acb, int vqid) { acb = NextPacket(acb, header->type3.NumWords() + 1); } + mapped_queues[vqid].cs_state = regs.cs_program; TracyFiberLeave; } @@ -847,7 +857,7 @@ void Liverpool::SubmitGfx(std::span dcb, std::span ccb) { } void Liverpool::SubmitAsc(u32 vqid, std::span acb) { - ASSERT_MSG(vqid >= 0 && vqid < NumTotalQueues, "Invalid virtual ASC queue index"); + ASSERT_MSG(vqid > 0 && vqid < NumTotalQueues, "Invalid virtual ASC queue index"); auto& queue = mapped_queues[vqid]; const auto& task = ProcessCompute(acb, vqid); diff --git a/src/video_core/amdgpu/liverpool.h b/src/video_core/amdgpu/liverpool.h index ca3b0161..7e971ccd 100644 --- a/src/video_core/amdgpu/liverpool.h +++ b/src/video_core/amdgpu/liverpool.h @@ -1292,7 +1292,7 @@ public: submit_cv.notify_one(); } - void reserveCopyBufferSpace() { + void ReserveCopyBufferSpace() { GpuQueue& gfx_queue = mapped_queues[GfxQueueId]; std::scoped_lock lk(gfx_queue.m_access);