[Mesa-dev] [PATCH] st/mesa: make winsys fbo sRGB-capable when supported

Chia-I Wu olvaffe at gmail.com
Mon Mar 3 07:18:15 PST 2014


On Mon, Mar 3, 2014 at 6:06 PM, Michel Dänzer <michel at daenzer.net> wrote:
> On Mon, 2014-03-03 at 16:22 +0800, Chia-I Wu wrote:
>> The texture formats of winsys fbo are always linear becase the st manager
>> (st/dri for example) could not know the colorspace used.  But it does not mean
>> that we cannot make the fbo sRGB-capable.  By
>>
>>  - setting rb->Visual.sRGBCapable to GL_TRUE when the pipe driver supports the
>>    format in sRGB colorspace,
>>  - giving rb an sRGB internal format, and
>>  - updating code to check rb->Format instead of strb->texture->format,
>>
>> we should be good.
>>
>> Fixed bug 75226 for at least llvmpipe and ilo, with no piglit regression.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75226
>
> The apitrace in that bug works with radeonsi as well with your change,
> but I'm getting an assertion failure in the X server (using glamor)
> running piglit, because st_pipe_format_to_mesa_format() doesn't handle
> PIPE_FORMAT_B8G8R8X8_SRGB:
Thanks for the quick testing.  I don't have any fbconfig that maps to
PIPE_FORMAT_B8G8R8X8_UNORM, and thus no PIPE_FORMAT_B8G8R8X8_SRGB.  It
looks like I will need to add MESA_FORMAT_X8R8G8B8_SRGB first.

>
> #0  _debug_assert_fail (expr=expr at entry=0x7f2461301a86 "0", file=file at entry=0x7f24612ad410 "../../../src/mesa/state_tracker/st_format.c", line=line at entry=752,
>     function=function at entry=0x7f24612ad940 <__func__.34569> "st_pipe_format_to_mesa_format") at ../../../../src/gallium/auxiliary/util/u_debug.c:281
> #1  0x00007f2460faaef9 in st_pipe_format_to_mesa_format (format=format at entry=PIPE_FORMAT_B8G8R8X8_SRGB) at ../../../src/mesa/state_tracker/st_format.c:752
> #2  0x00007f2460f9fc8a in st_new_renderbuffer_fb (format=format at entry=PIPE_FORMAT_B8G8R8X8_SRGB, samples=0, sw=<optimized out>) at ../../../src/mesa/state_tracker/st_cb_fbo.c:295
> #3  0x00007f2460fc5b15 in st_framebuffer_add_renderbuffer (stfb=stfb at entry=0xe2b630, idx=<optimized out>) at ../../../src/mesa/state_tracker/st_manager.c:314
> #4  0x00007f2460fc6e41 in st_framebuffer_create (stfbi=0xe2b420, screen=0x782690) at ../../../src/mesa/state_tracker/st_manager.c:437
> #5  st_framebuffer_reuse_or_create (screen=screen at entry=0x782690, fb=<optimized out>, stfbi=stfbi at entry=0xe2b420) at ../../../src/mesa/state_tracker/st_manager.c:707
> #6  0x00007f2460fc6f26 in st_api_make_current (stapi=<optimized out>, stctxi=0xe1ae60, stdrawi=0xe2b420, streadi=0xe2b420) at ../../../src/mesa/state_tracker/st_manager.c:728
> #7  0x00007f2461206f0b in dri_make_current (cPriv=<optimized out>, driDrawPriv=0xe2b3e0, driReadPriv=0xe2b3e0) at ../../../../../../src/gallium/state_trackers/dri/sw/dri_context.c:253
> #8  0x00007f2460e4b252 in driBindContext (pcp=<optimized out>, pdp=0xe2b3e0, prp=<optimized out>) at ../../../../../src/mesa/drivers/dri/common/dri_util.c:543
> #9  0x00007f24635096d0 in DoMakeCurrent (cl=0xb92850, drawId=12582916, readId=<optimized out>, contextId=<optimized out>, tag=<optimized out>) at ../../glx/glxcmds.c:643
> #10 0x00007f246350d100 in __glXDispatch (client=<optimized out>) at ../../glx/glxext.c:606
> #11 0x00000000004368fe in Dispatch () at ../../dix/dispatch.c:433
> #12 0x000000000043a6ba in dix_main (argc=3, argv=0x7fff99253568, envp=<optimized out>) at ../../dix/main.c:294
>
>
> --
> Earthling Michel Dänzer            |                  http://www.amd.com
> Libre software enthusiast          |                Mesa and X developer
>



-- 
olv at LunarG.com


More information about the mesa-dev mailing list