[Mesa-dev] [PATCH 24/25] Allocate a null state whenever there is depth/stencil

Pohjolainen, Topi topi.pohjolainen at gmail.com
Mon Nov 7 19:32:40 UTC 2016


On Sat, Oct 22, 2016 at 10:50:55AM -0700, Jason Ekstrand wrote:
> ---
>  src/intel/vulkan/genX_cmd_buffer.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)

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

> 
> diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
> index f43c643..06a0686 100644
> --- a/src/intel/vulkan/genX_cmd_buffer.c
> +++ b/src/intel/vulkan/genX_cmd_buffer.c
> @@ -180,18 +180,19 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
>     }
>  
>     bool need_null_state = false;
> -   for (uint32_t s = 0; s < pass->subpass_count; ++s) {
> -      if (pass->subpasses[s].color_count == 0) {
> -         need_null_state = true;
> -         break;
> -      }
> -   }
> -
> -   unsigned num_states = need_null_state;
> +   unsigned num_states = 0;
>     for (uint32_t i = 0; i < pass->attachment_count; ++i) {
> -      if (vk_format_is_color(pass->attachments[i].format))
> +      if (vk_format_is_color(pass->attachments[i].format)) {
>           num_states++;
> +      } else {
> +         /* We need a null state for any depth-stencil-only subpasses.
> +          * Importantly, this includes depth/stencil clears so we create one
> +          * whenever we have depth or stencil
> +          */
> +         need_null_state = true;
> +      }
>     }
> +   num_states += need_null_state;
>  
>     const uint32_t ss_stride = align_u32(isl_dev->ss.size, isl_dev->ss.align);
>     state->render_pass_states =
> -- 
> 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