[Mesa-dev] [PATCH 1/2 v2] dri/i965: extend GLES3 sRGB workaround to cover all formats

Kenneth Graunke kenneth at whitecape.org
Tue Apr 12 09:12:33 UTC 2016


On Thursday, April 7, 2016 11:05:08 AM PDT Haixia Shi wrote:
> It is incorrect to assume BGRA byte order for the GLES3 sRGB workaround.
> 
> v2: use _mesa_get_srgb_format_linear to handle all formats
> 
> Signed-off-by: Haixia Shi <hshi at chromium.org>
> Reviewed-by: Stéphane Marchesin <marcheu at chromium.org>
> Cc: kenneth.w.graunke at intel.com
> 
> Change-Id: I5a081d7eaa7544afff0e7874cffef80d3f69a401
> ---
>  src/mesa/drivers/dri/i965/brw_context.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/
i965/brw_context.c
> index 2d480d0..63ac3bc 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -1151,10 +1151,9 @@ intel_gles3_srgb_workaround(struct brw_context *brw,
>      */
>     fb->Visual.sRGBCapable = false;
>     for (int i = 0; i < BUFFER_COUNT; i++) {
> -      if (fb->Attachment[i].Renderbuffer &&
> -          fb->Attachment[i].Renderbuffer->Format == 
MESA_FORMAT_B8G8R8A8_SRGB) {
> -         fb->Attachment[i].Renderbuffer->Format = 
MESA_FORMAT_B8G8R8A8_UNORM;
> -      }
> +      struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
> +      if (rb)
> +         rb->Format = _mesa_get_srgb_format_linear(rb->Format);
>     }
>  }
>  
> 

Thanks!  I've pushed this patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160412/e2c3d519/attachment.sig>


More information about the mesa-dev mailing list