Use pair of spans instead of references in copy command buffers function
This commit is contained in:
parent
87ccfdfbbd
commit
dfb30ea955
|
@ -569,7 +569,8 @@ Liverpool::Task Liverpool::ProcessCompute(std::span<const u32> acb, int vqid) {
|
||||||
TracyFiberLeave;
|
TracyFiberLeave;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Liverpool::CopyCmdBuffers(std::span<const u32>& dcb, std::span<const u32>& ccb) {
|
std::pair<std::span<const u32>, std::span<const u32>> Liverpool::CopyCmdBuffers(
|
||||||
|
std::span<const u32> dcb, std::span<const u32> ccb) {
|
||||||
auto& queue = mapped_queues[GfxQueueId];
|
auto& queue = mapped_queues[GfxQueueId];
|
||||||
|
|
||||||
queue.dcb_buffer.resize(
|
queue.dcb_buffer.resize(
|
||||||
|
@ -594,13 +595,15 @@ void Liverpool::CopyCmdBuffers(std::span<const u32>& dcb, std::span<const u32>&
|
||||||
ccb = std::span<const u32>{queue.ccb_buffer.begin() + prev_ccb_buffer_offset,
|
ccb = std::span<const u32>{queue.ccb_buffer.begin() + prev_ccb_buffer_offset,
|
||||||
queue.ccb_buffer.begin() + queue.ccb_buffer_offset};
|
queue.ccb_buffer.begin() + queue.ccb_buffer_offset};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return std::make_pair(dcb, ccb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Liverpool::SubmitGfx(std::span<const u32> dcb, std::span<const u32> ccb) {
|
void Liverpool::SubmitGfx(std::span<const u32> dcb, std::span<const u32> ccb) {
|
||||||
auto& queue = mapped_queues[GfxQueueId];
|
auto& queue = mapped_queues[GfxQueueId];
|
||||||
|
|
||||||
if (Config::copyGPUCmdBuffers()) {
|
if (Config::copyGPUCmdBuffers()) {
|
||||||
CopyCmdBuffers(dcb, ccb);
|
std::tie(dcb, ccb) = CopyCmdBuffers(dcb, ccb);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto task = ProcessGraphics(dcb, ccb);
|
auto task = ProcessGraphics(dcb, ccb);
|
||||||
|
|
|
@ -1111,7 +1111,8 @@ private:
|
||||||
Handle handle;
|
Handle handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
void CopyCmdBuffers(std::span<const u32>& dcb, std::span<const u32>& ccb);
|
std::pair<std::span<const u32>, std::span<const u32>> CopyCmdBuffers(std::span<const u32> dcb,
|
||||||
|
std::span<const u32> ccb);
|
||||||
Task ProcessGraphics(std::span<const u32> dcb, std::span<const u32> ccb);
|
Task ProcessGraphics(std::span<const u32> dcb, std::span<const u32> ccb);
|
||||||
Task ProcessCeUpdate(std::span<const u32> ccb);
|
Task ProcessCeUpdate(std::span<const u32> ccb);
|
||||||
Task ProcessCompute(std::span<const u32> acb, int vqid);
|
Task ProcessCompute(std::span<const u32> acb, int vqid);
|
||||||
|
@ -1120,8 +1121,8 @@ private:
|
||||||
|
|
||||||
struct GpuQueue {
|
struct GpuQueue {
|
||||||
std::mutex m_access{};
|
std::mutex m_access{};
|
||||||
std::atomic_uint32_t dcb_buffer_offset;
|
std::atomic<u32> dcb_buffer_offset;
|
||||||
std::atomic_uint32_t ccb_buffer_offset;
|
std::atomic<u32> ccb_buffer_offset;
|
||||||
std::vector<u32> dcb_buffer;
|
std::vector<u32> dcb_buffer;
|
||||||
std::vector<u32> ccb_buffer;
|
std::vector<u32> ccb_buffer;
|
||||||
std::queue<Task::Handle> submits{};
|
std::queue<Task::Handle> submits{};
|
||||||
|
|
Loading…
Reference in New Issue