Reset query counter even if we haven’t rasterized

This is technically in violation of the Vulkan spec, but this allows Ryujinx’s occlusion queries to function correctly.
This commit is contained in:
Isaac Marovitz 2024-03-13 21:55:51 +00:00
parent bf097edc74
commit dc1503e1cc
No known key found for this signature in database
GPG Key ID: 97250B2B09A132E1

View File

@ -1343,7 +1343,7 @@ void MVKGPUAddressableBuffersCommandEncoderState::encodeImpl(uint32_t stage) {
// Don't copy occlusion info until after rasterization, as Metal renderpasses can be ended prematurely during tessellation.
void MVKOcclusionQueryCommandEncoderState::endMetalRenderPass() {
const MVKMTLBufferAllocation* vizBuff = _cmdEncoder->_pEncodingContext->visibilityResultBuffer;
if ( !_hasRasterized || !vizBuff || _mtlRenderPassQueries.empty() ) { return; } // Nothing to do.
if ( !vizBuff || _mtlRenderPassQueries.empty() ) { return; } // Nothing to do.
id<MTLComputePipelineState> mtlAccumState = _cmdEncoder->getCommandEncodingPool()->getAccumulateOcclusionQueryResultsMTLComputePipelineState();
id<MTLComputeCommandEncoder> mtlAccumEncoder = _cmdEncoder->getMTLComputeEncoder(kMVKCommandUseAccumOcclusionQuery, true);