[Mesa-dev] [PATCH] i965/blorp: Use the renderbuffer format for clears

Andres Gomez agomez at igalia.com
Mon Jul 10 20:34:48 UTC 2017


Jason, which is the status of this patch? Has it been superseded or
discarded?


On Mon, 2017-06-26 at 09:01 -0700, Jason Ekstrand wrote:
> This fixes the Piglit ARB_texture_views rendering-formats test.
> 
> Cc: "17.1" <mesa-stable at lists.freedesktop.org>
> ---
>  src/mesa/drivers/dri/i965/brw_blorp.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
> index 87c9dd4..96dc657 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp.c
> +++ b/src/mesa/drivers/dri/i965/brw_blorp.c
> @@ -746,9 +746,9 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
>  {
>     struct gl_context *ctx = &brw->ctx;
>     struct intel_renderbuffer *irb = intel_renderbuffer(rb);
> -   mesa_format format = irb->mt->format;
>     uint32_t x0, x1, y0, y1;
>  
> +   mesa_format format = irb->Base.Base.Format;
>     if (!encode_srgb && _mesa_get_format_color_encoding(format) == GL_SRGB)
>        format = _mesa_get_srgb_format_linear(format);
>  
> @@ -772,6 +772,14 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
>     if (set_write_disables(irb, ctx->Color.ColorMask[buf], color_write_disable))
>        can_fast_clear = false;
>  
> +   /* We store clear colors as floats or uints as needed.  If there are
> +    * texture views in play, the formats will not properly be respected
> +    * during resolves because the resolve operations only know about the
> +    * miptree and not the renderbuffer.
> +    */
> +   if (irb->Base.Base.Format != irb->mt->format)
> +      can_fast_clear = false;
> +
>     if (!irb->mt->supports_fast_clear ||
>         !brw_is_color_fast_clear_compatible(brw, irb->mt, &ctx->Color.ClearColor))
>        can_fast_clear = false;
-- 
Br,

Andres


More information about the mesa-dev mailing list