Skip to content

d3d12: Fix race condition when getting query results

Giancarlo Devich requested to merge gdevi/mesa:gdevi/d3d12_query into main

Before, when an application called into d3d12_query_result, and the results were not ready to be read, a flush-and-wait would be attempted via synchronized mapping of the query result resource.

This can end up calling close/execute on the command list while it is already being executed by the driver thread.

With the current fence value attached to the query, we now wait for completion if necessary and then map the resource unsynchronized, or return false if the result is not ready and wait == false.

Merge request reports