diff options
author | Bill Hollings <bill.hollings@brenwill.com> | 2024-05-14 15:02:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-14 15:02:34 -0400 |
commit | 6b9e55983a6d22eaf96003297119f25256fdf3ba (patch) | |
tree | e68a1142aa10606af3e3ee543f67a48643312908 | |
parent | bf097edc74ec3b6dfafdcd5a38d3ce14b11952d6 (diff) | |
parent | f92e6e7d809231b7ae304e64fdcc95b1931b4ed1 (diff) | |
download | moltenvk-upstream-main.tar.gz |
Merge pull request #2236 from PENGUINLIONG/patch-1upstream-main
Enforce barrier when sampling timestamps
-rw-r--r-- | MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm index 55aabe7e..8028eb18 100644 --- a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm +++ b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm @@ -1004,14 +1004,14 @@ const MVKMTLBufferAllocation* MVKCommandEncoder::copyToTempMTLBufferAllocation(c void MVKCommandEncoder::encodeGPUCounterSample(MVKGPUCounterQueryPool* mvkQryPool, uint32_t sampleIndex, MVKCounterSamplingFlags samplingPoints){ if (_mtlRenderEncoder) { if (mvkIsAnyFlagEnabled(samplingPoints, MVK_COUNTER_SAMPLING_AT_DRAW)) { - [_mtlRenderEncoder sampleCountersInBuffer: mvkQryPool->getMTLCounterBuffer() atSampleIndex: sampleIndex withBarrier: NO]; + [_mtlRenderEncoder sampleCountersInBuffer: mvkQryPool->getMTLCounterBuffer() atSampleIndex: sampleIndex withBarrier: YES]; } } else if (_mtlComputeEncoder) { if (mvkIsAnyFlagEnabled(samplingPoints, MVK_COUNTER_SAMPLING_AT_DISPATCH)) { - [_mtlComputeEncoder sampleCountersInBuffer: mvkQryPool->getMTLCounterBuffer() atSampleIndex: sampleIndex withBarrier: NO]; + [_mtlComputeEncoder sampleCountersInBuffer: mvkQryPool->getMTLCounterBuffer() atSampleIndex: sampleIndex withBarrier: YES]; } } else if (mvkIsAnyFlagEnabled(samplingPoints, MVK_COUNTER_SAMPLING_AT_BLIT)) { - [getMTLBlitEncoder(kMVKCommandUseRecordGPUCounterSample) sampleCountersInBuffer: mvkQryPool->getMTLCounterBuffer() atSampleIndex: sampleIndex withBarrier: NO]; + [getMTLBlitEncoder(kMVKCommandUseRecordGPUCounterSample) sampleCountersInBuffer: mvkQryPool->getMTLCounterBuffer() atSampleIndex: sampleIndex withBarrier: YES]; } } |