MVKQueryPool: Fix ending a query outside a render pass.
I missed this when I fixed occlusion queries begun outside a render pass.
This commit is contained in:
parent
f319e9bd68
commit
bbe45e4a8a
@ -290,6 +290,9 @@ public:
|
||||
/** If a render encoder is active, encodes store actions for all attachments to it. */
|
||||
void encodeStoreActions(bool storeOverride = false);
|
||||
|
||||
/** Returns whether or not we are presently in a render pass. */
|
||||
bool isInRenderPass() { return _renderPass != nullptr; }
|
||||
|
||||
/** Returns the render subpass that is currently active. */
|
||||
MVKRenderSubpass* getSubpass();
|
||||
|
||||
|
@ -31,7 +31,7 @@ using namespace std;
|
||||
#pragma mark MVKQueryPool
|
||||
|
||||
void MVKQueryPool::endQuery(uint32_t query, MVKCommandEncoder* cmdEncoder) {
|
||||
uint32_t queryCount = cmdEncoder->getSubpass()->getViewCountInMetalPass(cmdEncoder->getMultiviewPassIndex());
|
||||
uint32_t queryCount = cmdEncoder->isInRenderPass() ? cmdEncoder->getSubpass()->getViewCountInMetalPass(cmdEncoder->getMultiviewPassIndex()) : 1;
|
||||
lock_guard<mutex> lock(_availabilityLock);
|
||||
for (uint32_t i = query; i < query + queryCount; ++i) {
|
||||
_availability[i] = DeviceAvailable;
|
||||
|
Loading…
x
Reference in New Issue
Block a user