turnip: Support occlusion queries
This MR adds occlusion query support to turnip. For the most part, the branch is a translation of the command buffer emitted by freedreno for occlusion queries in GL. The code structure is inspired by genX_query.c from anvil.
A few questions:
- For some reason, adreno seems to only copy sample count to 16-byte aligned IOVAs. If the IOVA supplied to
REG_A6XX_RB_SAMPLE_COUNT_ADDR_LO
isn't aligned, it will instead copy to the previous aligned address. I get around this by adding padding to mybo
, but is there a better way? - In all of the
tu_Cmd*
functions, I need to add the querybo
to the command buffer'sbo_list
so we can actually copy data to it. Currently, I'm just adding thebo
in every function in case the application begins a query on one cmdbuf and ends it on a different cmdbuf. This works, but thebo
will appear in the list multiple times if say,vkCmdBeginQuery
andvkCmdEndQuery
are called on the same command buffer. Any suggestions on how to do this in a smarter way?
Edited by Brian Ho