Re: [Mesa-dev] [PATCH v2] dri/i965: fix incorrect rgbFormat in intelCreateBuffer().

2016-04-06 Thread Haixia Shi
Ilia: please review patch v4. I have added a separate patch to fix the GLES3 sRGB workaround, which fixes the colorspace issue. On Tue, Apr 5, 2016 at 5:20 PM, Ilia Mirkin wrote: > Sounds right. That's glEnable/glDisable(GL_FRAMEBUFFER_SRGB). It > defaults to off for desktop GL, and on for GL ES

Re: [Mesa-dev] [PATCH v2] dri/i965: fix incorrect rgbFormat in intelCreateBuffer().

2016-04-05 Thread Ilia Mirkin
Sounds right. That's glEnable/glDisable(GL_FRAMEBUFFER_SRGB). It defaults to off for desktop GL, and on for GL ES (why? no clue.) On Tue, Apr 5, 2016 at 8:11 PM, Haixia Shi wrote: > Are you referring to the following check > > mesa_format > _mesa_get_render_format(const struct gl_context *ctx, me

Re: [Mesa-dev] [PATCH v2] dri/i965: fix incorrect rgbFormat in intelCreateBuffer().

2016-04-05 Thread Haixia Shi
Are you referring to the following check mesa_format _mesa_get_render_format(const struct gl_context *ctx, mesa_format format) { if (ctx->Color.sRGBEnabled) return format; else return _mesa_get_srgb_format_linear(format); } So if the platform sets ctx->Color.sRGBEnabled = false

Re: [Mesa-dev] [PATCH v2] dri/i965: fix incorrect rgbFormat in intelCreateBuffer().

2016-04-05 Thread Ilia Mirkin
On Tue, Apr 5, 2016 at 4:57 PM, Haixia Shi wrote: > CC Stephane > > In my opinion we should not assume sRGB-capable when alpha is requested, > because UNORM is the more common use case. I actually have a use case where > alpha is requested but not sRGBCapable, and if we assume SRGB by default > th

Re: [Mesa-dev] [PATCH v2] dri/i965: fix incorrect rgbFormat in intelCreateBuffer().

2016-04-05 Thread Haixia Shi
CC Stephane In my opinion we should not assume sRGB-capable when alpha is requested, because UNORM is the more common use case. I actually have a use case where alpha is requested but not sRGBCapable, and if we assume SRGB by default then we will get really white-washed faded color. On Tue, Apr 5

Re: [Mesa-dev] [PATCH v2] dri/i965: fix incorrect rgbFormat in intelCreateBuffer().

2016-04-05 Thread Ilia Mirkin
On Tue, Apr 5, 2016 at 4:33 PM, Haixia Shi wrote: > It is incorrect to assume that pixel format is always in BGR byte order. > We need to check bitmask parameters (such as |redMask|) to determine whether > the RGB or BGR byte order is requested. > > Furthermore when parameter |sRGBCapable| is set

[Mesa-dev] [PATCH v2] dri/i965: fix incorrect rgbFormat in intelCreateBuffer().

2016-04-05 Thread Haixia Shi
It is incorrect to assume that pixel format is always in BGR byte order. We need to check bitmask parameters (such as |redMask|) to determine whether the RGB or BGR byte order is requested. Furthermore when parameter |sRGBCapable| is set to false, we should be using UNORM format by default. v2: r