MCPcopy Create free account
hub / github.com/InoriRus/Kyty / ThreadBatchRun

Method ThreadBatchRun

source/emulator/src/Graphics/GraphicsRun.cpp:792–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

790}
791
792void GraphicsRing::ThreadBatchRun(void* data)
793{
794 EXIT_IF(data == nullptr);
795
796 static std::atomic_uint64_t seq = 0;
797
798 auto* ring = static_cast<GraphicsRing*>(data);
799 auto* cp = ring->m_cp;
800
801 EXIT_IF(ring == nullptr);
802 EXIT_IF(cp == nullptr);
803
804 for (;;)
805 {
806 CmdBatch buf = ring->GetCmdBatch();
807
808 cp->RunLock();
809 {
810 cp->BufferInit();
811 cp->ResetDeCe();
812 cp->SetFlip(buf.flip);
813 cp->SetSumbitId(++seq);
814
815 ring->m_job1.Execute([cp, buf](void* /*unused*/) { cp->Run(buf.draw_buffer.data, buf.draw_buffer.num_dw); });
816 ring->m_job2.Execute([cp, buf](void* /*unused*/) { cp->Run(buf.const_buffer.data, buf.const_buffer.num_dw); });
817 ring->m_job1.Wait();
818 ring->m_job2.Wait();
819
820 cp->BufferFlush();
821 }
822 cp->RunUnlock();
823 }
824}
825
826void ComputeRing::ThreadRun(void* data)
827{

Callers

nothing calls this directly

Calls 11

GetCmdBatchMethod · 0.80
RunLockMethod · 0.80
BufferInitMethod · 0.80
ResetDeCeMethod · 0.80
SetFlipMethod · 0.80
SetSumbitIdMethod · 0.80
BufferFlushMethod · 0.80
RunUnlockMethod · 0.80
ExecuteMethod · 0.45
RunMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected