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:
Petros Bantolas 2016-05-16 11:19:02 +01:00
parent 1b335ad2c8
commit a8fd4dbc79

View file

@ -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);
}