mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-07 15:31:18 +12:00
improve command buffer sync
This commit is contained in:
parent
eb7c10e89f
commit
fd16488e4c
7 changed files with 33 additions and 29 deletions
|
@ -4,14 +4,21 @@
|
|||
|
||||
bool LatteQueryObjectMtl::getResult(uint64& numSamplesPassed)
|
||||
{
|
||||
if (!m_mtlr->CommandBufferCompleted(m_commandBuffer))
|
||||
if (!CommandBufferCompleted(m_commandBuffer))
|
||||
return false;
|
||||
|
||||
numSamplesPassed = m_mtlr->GetOcclusionQueryResultsPtr()[m_queryIndex];
|
||||
printf("Num samples: %llu\n", numSamplesPassed);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
LatteQueryObjectMtl::~LatteQueryObjectMtl()
|
||||
{
|
||||
if (m_queryIndex != INVALID_UINT32)
|
||||
m_mtlr->ReleaseOcclusionQueryIndex(m_queryIndex);
|
||||
}
|
||||
|
||||
void LatteQueryObjectMtl::begin()
|
||||
{
|
||||
m_queryIndex = m_mtlr->GetAvailableOcclusionQueryIndex();
|
||||
|
@ -21,5 +28,7 @@ void LatteQueryObjectMtl::begin()
|
|||
void LatteQueryObjectMtl::end()
|
||||
{
|
||||
m_mtlr->SetActiveOcclusionQueryIndex(INVALID_UINT32);
|
||||
// TODO: request soon submit of the command buffer
|
||||
m_commandBuffer = m_mtlr->GetCurrentCommandBuffer();
|
||||
// TODO: request soon submit instead?
|
||||
m_mtlr->CommitCommandBuffer();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue