radv: Add meta saving/restoring for predicating

There are a bunch of places, where this is done manually.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17625>
This commit is contained in:
Konstantin Seurer 2022-07-19 14:11:15 +02:00 committed by Marge Bot
parent 21dd305694
commit fdeca2ca0b
2 changed files with 11 additions and 0 deletions

View File

@ -213,6 +213,11 @@ radv_meta_save(struct radv_meta_saved_state *state, struct radv_cmd_buffer *cmd_
state->render_area = cmd_buffer->state.render_area;
}
if (state->flags & RADV_META_SUSPEND_PREDICATING) {
state->predicating = cmd_buffer->state.predicating;
cmd_buffer->state.predicating = false;
}
radv_suspend_queries(state, cmd_buffer);
}
@ -364,6 +369,9 @@ radv_meta_restore(const struct radv_meta_saved_state *state, struct radv_cmd_buf
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_FRAMEBUFFER;
}
if (state->flags & RADV_META_SUSPEND_PREDICATING)
cmd_buffer->state.predicating = state->predicating;
radv_resume_queries(state, cmd_buffer);
}

View File

@ -40,6 +40,7 @@ enum radv_meta_save_flags {
RADV_META_SAVE_GRAPHICS_PIPELINE = (1 << 3),
RADV_META_SAVE_COMPUTE_PIPELINE = (1 << 4),
RADV_META_SAVE_SAMPLE_LOCATIONS = (1 << 5),
RADV_META_SUSPEND_PREDICATING = (1 << 6),
};
struct radv_meta_saved_state {
@ -59,6 +60,8 @@ struct radv_meta_saved_state {
VkRect2D render_area;
unsigned active_pipeline_gds_queries;
bool predicating;
};
VkResult radv_device_init_meta_clear_state(struct radv_device *device, bool on_demand);