[Mesa-dev] [PATCH 16/29] anv/cmd_buffer: Pass a subpass id into begin_subpass

Pohjolainen, Topi topi.pohjolainen at gmail.com
Mon Dec 4 13:54:48 UTC 2017


On Mon, Nov 27, 2017 at 07:06:06PM -0800, Jason Ekstrand wrote:
> This is a bit less awkward than passing in the subpass because it means
> we don't have to extract the subpass id from the subpass.
> ---
>  src/intel/vulkan/genX_cmd_buffer.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
> index 6f2fa0a..56036f7 100644
> --- a/src/intel/vulkan/genX_cmd_buffer.c
> +++ b/src/intel/vulkan/genX_cmd_buffer.c
> @@ -3136,13 +3136,11 @@ cmd_buffer_subpass_sync_fast_clear_values(struct anv_cmd_buffer *cmd_buffer)
>     }
>  }
>  
> -
>  static void
>  cmd_buffer_begin_subpass(struct anv_cmd_buffer *cmd_buffer,
> -                         struct anv_subpass *subpass)
> +                         uint32_t subpass_id)
>  {
> -   cmd_buffer->state.subpass = subpass;
> -   uint32_t subpass_id = anv_get_subpass_id(&cmd_buffer->state);
> +   cmd_buffer->state.subpass = &cmd_buffer->state.pass->subpasses[subpass_id];
>  
>     cmd_buffer->state.dirty |= ANV_CMD_DIRTY_RENDER_TARGETS;
>  
> @@ -3222,7 +3220,7 @@ void genX(CmdBeginRenderPass)(
>  
>     genX(flush_pipeline_select_3d)(cmd_buffer);
>  
> -   cmd_buffer_begin_subpass(cmd_buffer, pass->subpasses);
> +   cmd_buffer_begin_subpass(cmd_buffer, 0);
>  }
>  
>  void genX(CmdNextSubpass)(
> @@ -3236,9 +3234,9 @@ void genX(CmdNextSubpass)(
>  
>     assert(cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY);
>  
> +   uint32_t prev_subpass = anv_get_subpass_id(&cmd_buffer->state);

Maybe call this "prev_subpass_id"? Either way:

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

>     cmd_buffer_end_subpass(cmd_buffer);
> -
> -   cmd_buffer_begin_subpass(cmd_buffer, cmd_buffer->state.subpass + 1);
> +   cmd_buffer_begin_subpass(cmd_buffer, prev_subpass + 1);
>  }
>  
>  void genX(CmdEndRenderPass)(
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list