diff --git a/src/video_core/amdgpu/liverpool.cpp b/src/video_core/amdgpu/liverpool.cpp index 7e99fcb2..8cca636c 100644 --- a/src/video_core/amdgpu/liverpool.cpp +++ b/src/video_core/amdgpu/liverpool.cpp @@ -87,7 +87,7 @@ void Liverpool::Process(std::stop_token stoken) { VideoCore::StartCapture(); - int qid = -1; + curr_qid = -1; while (num_submits || num_commands) { @@ -106,9 +106,9 @@ void Liverpool::Process(std::stop_token stoken) { --num_commands; } - qid = (qid + 1) % num_mapped_queues; + curr_qid = (curr_qid + 1) % num_mapped_queues; - auto& queue = mapped_queues[qid]; + auto& queue = mapped_queues[curr_qid]; Task::Handle task{}; { @@ -506,7 +506,6 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span dcb, std::span(header); - SaveDispatchContext(); auto& cs_program = GetCsRegs(); cs_program.dim_x = dispatch_direct->dim_x; cs_program.dim_y = dispatch_direct->dim_y; @@ -527,7 +526,6 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span dcb, std::span(header); - SaveDispatchContext(); auto& cs_program = GetCsRegs(); const auto offset = dispatch_indirect->data_offset; const auto ib_address = mapped_queues[GfxQueueId].indirect_args_addr; @@ -805,7 +803,6 @@ Liverpool::Task Liverpool::ProcessCompute(std::span acb, u32 vqid) { } case PM4ItOpcode::DispatchDirect: { const auto* dispatch_direct = reinterpret_cast(header); - SaveDispatchContext(vqid); auto& cs_program = GetCsRegs(); cs_program.dim_x = dispatch_direct->dim_x; cs_program.dim_y = dispatch_direct->dim_y; diff --git a/src/video_core/amdgpu/liverpool.h b/src/video_core/amdgpu/liverpool.h index ffda28db..4c74d37d 100644 --- a/src/video_core/amdgpu/liverpool.h +++ b/src/video_core/amdgpu/liverpool.h @@ -1344,7 +1344,7 @@ public: } inline ComputeProgram& GetCsRegs() { - return mapped_queues[curr_gnm_queue_id].cs_state; + return mapped_queues[curr_qid].cs_state; } struct AscQueueInfo { @@ -1397,14 +1397,6 @@ private: void Process(std::stop_token stoken); - inline void SaveDispatchContext() { - curr_gnm_queue_id = GfxQueueId; - } - - inline void SaveDispatchContext(u32 vqid) { - curr_gnm_queue_id = vqid + 1; - } - struct GpuQueue { std::mutex m_access{}; std::atomic dcb_buffer_offset; @@ -1445,7 +1437,7 @@ private: std::mutex submit_mutex; std::condition_variable_any submit_cv; std::queue> command_queue{}; - u32 curr_gnm_queue_id{GfxQueueId}; // Gnm queue processing dispatch + int curr_qid{-1}; }; static_assert(GFX6_3D_REG_INDEX(ps_program) == 0x2C08);