Skip to content

turnip: Support occlusion queries

Brian Ho requested to merge brkho/mesa:turnip-occlusion-query into master

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 my bo, but is there a better way?
  • In all of the tu_Cmd* functions, I need to add the query bo to the command buffer's bo_list so we can actually copy data to it. Currently, I'm just adding the bo in every function in case the application begins a query on one cmdbuf and ends it on a different cmdbuf. This works, but the bo will appear in the list multiple times if say, vkCmdBeginQuery and vkCmdEndQuery are called on the same command buffer. Any suggestions on how to do this in a smarter way?

/cc @robclark @krh

Edited by Brian Ho

Merge request reports