diff options
author | Ian Romanick <[email protected]> | 2012-07-12 13:52:06 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-10-29 09:55:42 -0700 |
commit | 1f6e10f67b0fce811eb91abfbdb3e9c6ed0035a3 (patch) | |
tree | 6a4aad0d93d6ee04a9d9c6fe6503ff25988990a3 /src/mesa/drivers/dri/radeon | |
parent | 43d6fe156b2bf9754aaa65776e001c927275d765 (diff) |
dri: Convert driCreateConfigs to use a gl_format enum
This is instead of the pair of GLenums for format and type that were
previously used. This is necessary for the Intel drivers to expose sRGB
framebuffer formats.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 52247a9e726..6f4750a02ff 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -710,8 +710,11 @@ radeonDestroyBuffer(__DRIdrawable *driDrawPriv) static const __DRIconfig **radeonInitScreen2(__DRIscreen *psp) { - GLenum fb_format[3]; - GLenum fb_type[3]; + static const gl_format formats[3] = { + MESA_FORMAT_RGB565, + MESA_FORMAT_XRGB8888, + MESA_FORMAT_ARGB8888 + }; /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't * support pageflipping at all. */ @@ -736,19 +739,10 @@ __DRIconfig **radeonInitScreen2(__DRIscreen *psp) msaa_samples_array[0] = 0; - fb_format[0] = GL_RGB; - fb_type[0] = GL_UNSIGNED_SHORT_5_6_5; - - fb_format[1] = GL_BGR; - fb_type[1] = GL_UNSIGNED_INT_8_8_8_8_REV; - - fb_format[2] = GL_BGRA; - fb_type[2] = GL_UNSIGNED_INT_8_8_8_8_REV; - - for (color = 0; color < ARRAY_SIZE(fb_format); color++) { + for (color = 0; color < ARRAY_SIZE(formats); color++) { __DRIconfig **new_configs; - new_configs = driCreateConfigs(fb_format[color], fb_type[color], + new_configs = driCreateConfigs(formats[color], depth_bits, stencil_bits, ARRAY_SIZE(depth_bits), |