Fix race condition between query pool reset and accessing query results

Affects tests:
dEQP-VK.query_pool.occlusion_query.get_results*(wait_query|wait_none)*

These tests access query pool results on host, without any synchronization
with command buffer which performs the query - they either use
VK_QUERY_RESULT_WAIT_BIT or allow for incomplete results to be captured.

This may have a race condition, mentioned by spec:

"""
Applications must take care to ensure that use of the
VK_QUERY_RESULT_WAIT_BIT bit has the desired effect. For example, if
a query has been used previously and a command buffer records the
commands vkCmdResetQueryPool, vkCmdBeginQuery, and vkCmdEndQuery for
that query, then the query will remain in the available state until the
 vkCmdResetQueryPool command executes on a queue.
"""

In affected tests, this change moves vkCmdResetQueryPool to separate
command buffer that is sumitted and completed before query is used on
device & host.

Additionally code handling RESULTS_MODE_COPY mode is refactored to use
new haveSeparateCopyCmdBuf() function instead of tons of flags and conditions.

Change-Id: Id4a538b912030f2a86b09593fecaae37f1819a71
1 file changed
tree: cfe45e6be49ba4ca75419efc5873afdfd583ad11
  1. android/
  2. data/
  3. doc/
  4. execserver/
  5. executor/
  6. external/
  7. framework/
  8. modules/
  9. scripts/
  10. targets/
  11. .gitignore
  12. Android.mk
  13. CMakeLists.txt
  14. LICENSE
  15. MODULE_LICENSE_APACHE2
  16. NOTICE
  17. README.md
README.md

dEQP README

This repository contains a GPU testing suite called dEQP (drawElements Quality Program). dEQP contains tests for several graphics APIs, including OpenGL ES, EGL, and Vulkan.

Documentation

Up-to-date documentation for the dEQP is available at Android Open Source Project site.

Khronos Vulkan Conformance Tests

This repository includes Khronos Vulkan CTS under external/vulkancts directory. For more information see Vulkan CTS README.