mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-12-28 18:46:06 +00:00
even more simplification for context saving
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
This commit is contained in:
parent
9c304b9af8
commit
04f3054bbb
|
@ -87,7 +87,7 @@ void Liverpool::Process(std::stop_token stoken) {
|
||||||
|
|
||||||
VideoCore::StartCapture();
|
VideoCore::StartCapture();
|
||||||
|
|
||||||
int qid = -1;
|
curr_qid = -1;
|
||||||
|
|
||||||
while (num_submits || num_commands) {
|
while (num_submits || num_commands) {
|
||||||
|
|
||||||
|
@ -106,9 +106,9 @@ void Liverpool::Process(std::stop_token stoken) {
|
||||||
--num_commands;
|
--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{};
|
Task::Handle task{};
|
||||||
{
|
{
|
||||||
|
@ -506,7 +506,6 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
|
||||||
}
|
}
|
||||||
case PM4ItOpcode::DispatchDirect: {
|
case PM4ItOpcode::DispatchDirect: {
|
||||||
const auto* dispatch_direct = reinterpret_cast<const PM4CmdDispatchDirect*>(header);
|
const auto* dispatch_direct = reinterpret_cast<const PM4CmdDispatchDirect*>(header);
|
||||||
SaveDispatchContext();
|
|
||||||
auto& cs_program = GetCsRegs();
|
auto& cs_program = GetCsRegs();
|
||||||
cs_program.dim_x = dispatch_direct->dim_x;
|
cs_program.dim_x = dispatch_direct->dim_x;
|
||||||
cs_program.dim_y = dispatch_direct->dim_y;
|
cs_program.dim_y = dispatch_direct->dim_y;
|
||||||
|
@ -527,7 +526,6 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
|
||||||
case PM4ItOpcode::DispatchIndirect: {
|
case PM4ItOpcode::DispatchIndirect: {
|
||||||
const auto* dispatch_indirect =
|
const auto* dispatch_indirect =
|
||||||
reinterpret_cast<const PM4CmdDispatchIndirect*>(header);
|
reinterpret_cast<const PM4CmdDispatchIndirect*>(header);
|
||||||
SaveDispatchContext();
|
|
||||||
auto& cs_program = GetCsRegs();
|
auto& cs_program = GetCsRegs();
|
||||||
const auto offset = dispatch_indirect->data_offset;
|
const auto offset = dispatch_indirect->data_offset;
|
||||||
const auto ib_address = mapped_queues[GfxQueueId].indirect_args_addr;
|
const auto ib_address = mapped_queues[GfxQueueId].indirect_args_addr;
|
||||||
|
@ -805,7 +803,6 @@ Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, u32 vqid) {
|
||||||
}
|
}
|
||||||
case PM4ItOpcode::DispatchDirect: {
|
case PM4ItOpcode::DispatchDirect: {
|
||||||
const auto* dispatch_direct = reinterpret_cast<const PM4CmdDispatchDirect*>(header);
|
const auto* dispatch_direct = reinterpret_cast<const PM4CmdDispatchDirect*>(header);
|
||||||
SaveDispatchContext(vqid);
|
|
||||||
auto& cs_program = GetCsRegs();
|
auto& cs_program = GetCsRegs();
|
||||||
cs_program.dim_x = dispatch_direct->dim_x;
|
cs_program.dim_x = dispatch_direct->dim_x;
|
||||||
cs_program.dim_y = dispatch_direct->dim_y;
|
cs_program.dim_y = dispatch_direct->dim_y;
|
||||||
|
|
|
@ -1344,7 +1344,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ComputeProgram& GetCsRegs() {
|
inline ComputeProgram& GetCsRegs() {
|
||||||
return mapped_queues[curr_gnm_queue_id].cs_state;
|
return mapped_queues[curr_qid].cs_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct AscQueueInfo {
|
struct AscQueueInfo {
|
||||||
|
@ -1397,14 +1397,6 @@ private:
|
||||||
|
|
||||||
void Process(std::stop_token stoken);
|
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 {
|
struct GpuQueue {
|
||||||
std::mutex m_access{};
|
std::mutex m_access{};
|
||||||
std::atomic<u32> dcb_buffer_offset;
|
std::atomic<u32> dcb_buffer_offset;
|
||||||
|
@ -1445,7 +1437,7 @@ private:
|
||||||
std::mutex submit_mutex;
|
std::mutex submit_mutex;
|
||||||
std::condition_variable_any submit_cv;
|
std::condition_variable_any submit_cv;
|
||||||
std::queue<Common::UniqueFunction<void>> command_queue{};
|
std::queue<Common::UniqueFunction<void>> 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);
|
static_assert(GFX6_3D_REG_INDEX(ps_program) == 0x2C08);
|
||||||
|
|
Loading…
Reference in a new issue