mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-07 15:31:18 +12:00
handle occlusion queries with no draws
This commit is contained in:
parent
fd16488e4c
commit
934b1f8b55
3 changed files with 18 additions and 6 deletions
|
@ -4,12 +4,16 @@
|
|||
|
||||
bool LatteQueryObjectMtl::getResult(uint64& numSamplesPassed)
|
||||
{
|
||||
if (!m_commandBuffer)
|
||||
{
|
||||
numSamplesPassed = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CommandBufferCompleted(m_commandBuffer))
|
||||
return false;
|
||||
|
||||
numSamplesPassed = m_mtlr->GetOcclusionQueryResultsPtr()[m_queryIndex];
|
||||
printf("Num samples: %llu\n", numSamplesPassed);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -28,7 +32,10 @@ void LatteQueryObjectMtl::begin()
|
|||
void LatteQueryObjectMtl::end()
|
||||
{
|
||||
m_mtlr->SetActiveOcclusionQueryIndex(INVALID_UINT32);
|
||||
m_commandBuffer = m_mtlr->GetCurrentCommandBuffer();
|
||||
// TODO: request soon submit instead?
|
||||
m_mtlr->CommitCommandBuffer();
|
||||
if (m_mtlr->IsCommandBufferActive())
|
||||
{
|
||||
m_commandBuffer = m_mtlr->GetCurrentCommandBuffer();
|
||||
// TODO: request soon submit instead?
|
||||
m_mtlr->CommitCommandBuffer();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue