anv: add a flag tracking occlusion query count change

We'll use this later to know when to reemit
3DSTATE_STREAMOUT::ForceRendering

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
This commit is contained in:
Lionel Landwerlin 2023-08-04 13:15:35 +03:00 committed by Marge Bot
parent 0ce772bd19
commit 758540d741
3 changed files with 6 additions and 1 deletions

View file

@ -2218,6 +2218,7 @@ enum anv_cmd_dirty_bits {
ANV_CMD_DIRTY_RENDER_TARGETS = 1 << 2,
ANV_CMD_DIRTY_XFB_ENABLE = 1 << 3,
ANV_CMD_DIRTY_RESTART_INDEX = 1 << 4,
ANV_CMD_DIRTY_OCCLUSION_QUERY_ACTIVE = 1 << 5,
};
typedef enum anv_cmd_dirty_bits anv_cmd_dirty_mask_t;

View file

@ -3442,8 +3442,10 @@ genX(BeginCommandBuffer)(
cmd_buffer->state.conditional_render_enabled =
conditional_rendering_info && conditional_rendering_info->conditionalRenderingEnable;
if (pBeginInfo->pInheritanceInfo->occlusionQueryEnable)
if (pBeginInfo->pInheritanceInfo->occlusionQueryEnable) {
cmd_buffer->state.gfx.n_occlusion_queries = 1;
cmd_buffer->state.gfx.dirty |= ANV_CMD_DIRTY_OCCLUSION_QUERY_ACTIVE;
}
}
return VK_SUCCESS;

View file

@ -1017,6 +1017,7 @@ void genX(CmdBeginQueryIndexedEXT)(
switch (pool->vk.query_type) {
case VK_QUERY_TYPE_OCCLUSION:
cmd_buffer->state.gfx.n_occlusion_queries++;
cmd_buffer->state.gfx.dirty |= ANV_CMD_DIRTY_OCCLUSION_QUERY_ACTIVE;
emit_ps_depth_count(cmd_buffer, anv_address_add(query_addr, 8));
break;
@ -1201,6 +1202,7 @@ void genX(CmdEndQueryIndexedEXT)(
emit_ps_depth_count(cmd_buffer, anv_address_add(query_addr, 16));
emit_query_pc_availability(cmd_buffer, query_addr, true);
cmd_buffer->state.gfx.n_occlusion_queries--;
cmd_buffer->state.gfx.dirty |= ANV_CMD_DIRTY_OCCLUSION_QUERY_ACTIVE;
break;
case VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT: