Adjust occlusionquery according to Vulkan spec.
This moves vkCmdCopyQueryPoolResults outside of the Renderpass, as it should be according to the Vulkan spec. This understanably has looks wrong on the first frame, but by doing this you avoid having to use two renderpasses to get the occlusion result.
This commit is contained in:
parent
1b335ad2c8
commit
a8fd4dbc79
1 changed files with 12 additions and 12 deletions
|
|
@ -261,17 +261,6 @@ public:
|
|||
|
||||
vkCmdEndQuery(drawCmdBuffers[i], queryPool, 1);
|
||||
|
||||
// Query results
|
||||
vkCmdCopyQueryPoolResults(
|
||||
drawCmdBuffers[i],
|
||||
queryPool,
|
||||
0,
|
||||
2,
|
||||
queryResult.buffer,
|
||||
0,
|
||||
sizeof(uint64_t),
|
||||
VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT);
|
||||
|
||||
// Visible pass
|
||||
// Clear color and depth attachments
|
||||
VkClearAttachment clearAttachments[2] = {};
|
||||
|
|
@ -318,6 +307,17 @@ public:
|
|||
|
||||
vkCmdEndRenderPass(drawCmdBuffers[i]);
|
||||
|
||||
// Query results
|
||||
vkCmdCopyQueryPoolResults(
|
||||
drawCmdBuffers[i],
|
||||
queryPool,
|
||||
0,
|
||||
2,
|
||||
queryResult.buffer,
|
||||
0,
|
||||
sizeof(uint64_t),
|
||||
VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT);
|
||||
|
||||
err = vkEndCommandBuffer(drawCmdBuffers[i]);
|
||||
assert(!err);
|
||||
}
|
||||
|
|
@ -748,4 +748,4 @@ int main(const int argc, const char *argv[])
|
|||
#if !defined(__ANDROID__)
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue