mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-01-09 08:29:21 +01:00
implement occlusion query flush
This commit is contained in:
parent
ea0a30b564
commit
552c4901b9
@ -1232,7 +1232,7 @@ void MetalRenderer::draw_updateVertexBuffersDirectAccess()
|
|||||||
MPTR bufferAddress = LatteGPUState.contextRegister[bufferBaseRegisterIndex + 0];
|
MPTR bufferAddress = LatteGPUState.contextRegister[bufferBaseRegisterIndex + 0];
|
||||||
|
|
||||||
if (bufferAddress == MPTR_NULL) [[unlikely]]
|
if (bufferAddress == MPTR_NULL) [[unlikely]]
|
||||||
bufferAddress = 0x10000000; // TODO: really?
|
bufferAddress = m_memoryManager->GetImportedMemBaseAddress();
|
||||||
|
|
||||||
m_state.m_vertexBufferOffsets[bufferIndex] = bufferAddress - m_memoryManager->GetImportedMemBaseAddress();
|
m_state.m_vertexBufferOffsets[bufferIndex] = bufferAddress - m_memoryManager->GetImportedMemBaseAddress();
|
||||||
}
|
}
|
||||||
@ -1317,7 +1317,9 @@ void MetalRenderer::occlusionQuery_destroy(LatteQueryObject* queryObj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MetalRenderer::occlusionQuery_flush() {
|
void MetalRenderer::occlusionQuery_flush() {
|
||||||
// TODO: implement
|
// TODO: wait for all command buffers with occlusion queries?
|
||||||
|
if (m_occlusionQuery.m_lastCommandBuffer)
|
||||||
|
m_occlusionQuery.m_lastCommandBuffer->waitUntilCompleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetalRenderer::occlusionQuery_updateState() {
|
void MetalRenderer::occlusionQuery_updateState() {
|
||||||
|
@ -429,6 +429,12 @@ public:
|
|||||||
void EndOcclusionQuery()
|
void EndOcclusionQuery()
|
||||||
{
|
{
|
||||||
m_occlusionQuery.m_active = false;
|
m_occlusionQuery.m_active = false;
|
||||||
|
if (m_occlusionQuery.m_lastCommandBuffer)
|
||||||
|
m_occlusionQuery.m_lastCommandBuffer->release();
|
||||||
|
if (IsCommandBufferActive())
|
||||||
|
m_occlusionQuery.m_lastCommandBuffer = GetCurrentCommandBuffer()->retain();
|
||||||
|
else
|
||||||
|
m_occlusionQuery.m_lastCommandBuffer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -480,6 +486,7 @@ private:
|
|||||||
uint64* m_resultsPtr;
|
uint64* m_resultsPtr;
|
||||||
uint32 m_currentIndex = 0;
|
uint32 m_currentIndex = 0;
|
||||||
bool m_active = false;
|
bool m_active = false;
|
||||||
|
MTL::CommandBuffer* m_lastCommandBuffer = nullptr;
|
||||||
} m_occlusionQuery;
|
} m_occlusionQuery;
|
||||||
|
|
||||||
// Active objects
|
// Active objects
|
||||||
|
Loading…
x
Reference in New Issue
Block a user