diff options
author | Iago Toral Quiroga <itoral@igalia.com> | 2020-04-21 14:05:15 +0200 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-10-13 21:21:29 +0000 |
commit | c414a241d0d6da83998cfabe4560f3b515609a4c (patch) | |
tree | fa312d032079a55ecba50040e86f8a4f162d3b6a /src/broadcom | |
parent | ffacf92485edcdb61f5239bbeca46aaf24707ad7 (diff) |
v3dv: move early-Z update to pre-draw
This needs to be updated everytime we bind a new pipeline, but we can
bind a pipeline and not have an actual job yet, so we want to postpone
this until we actually need to emit CFG_BITS, during the pre-draw
setup.
Also, rename the update helper to be about the job rather the command
buffer, since it is updating state that we track per job.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
Diffstat (limited to 'src/broadcom')
-rw-r--r-- | src/broadcom/vulkan/v3dv_cmd_buffer.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index ee90baed893..aacf5542ce9 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -1951,12 +1951,8 @@ cmd_buffer_bind_pipeline_static_state(struct v3dv_cmd_buffer *cmd_buffer, } static void -cmd_buffer_update_ez_state(struct v3dv_cmd_buffer *cmd_buffer, - struct v3dv_pipeline *pipeline) +job_update_ez_state(struct v3dv_job *job, struct v3dv_pipeline *pipeline) { - struct v3dv_job *job = cmd_buffer->state.job; - assert(job); - switch (pipeline->ez_state) { case VC5_EZ_UNDECIDED: /* If the pipeline didn't pick a direction but didn't disable, then go @@ -2181,7 +2177,6 @@ bind_graphics_pipeline(struct v3dv_cmd_buffer *cmd_buffer, cmd_buffer->state.pipeline = pipeline; cmd_buffer_bind_pipeline_static_state(cmd_buffer, &pipeline->dynamic_state); - cmd_buffer_update_ez_state(cmd_buffer, pipeline); if (cmd_buffer->state.dirty & V3DV_CMD_DIRTY_SHADER_VARIANTS) { if (update_pipeline_variants(cmd_buffer)) @@ -2633,7 +2628,12 @@ static void emit_configuration_bits(struct v3dv_cmd_buffer *cmd_buffer) { struct v3dv_job *job = cmd_buffer->state.job; + assert(job); + struct v3dv_pipeline *pipeline = cmd_buffer->state.pipeline; + assert(pipeline); + + job_update_ez_state(job, pipeline); cl_emit_with_prepacked(&job->bcl, CFG_BITS, pipeline->cfg_bits, config) { config.early_z_updates_enable = job->ez_state != VC5_EZ_DISABLED; |