summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/swrast
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-07-12 13:52:06 -0700
committerIan Romanick <[email protected]>2012-10-29 09:55:42 -0700
commit1f6e10f67b0fce811eb91abfbdb3e9c6ed0035a3 (patch)
tree6a4aad0d93d6ee04a9d9c6fe6503ff25988990a3 /src/mesa/drivers/dri/swrast
parent43d6fe156b2bf9754aaa65776e001c927275d765 (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/swrast')
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index c608bcdc6eb..eeeb81c0159 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -125,8 +125,7 @@ swrastFillInModes(__DRIscreen *psp,
__DRIconfig **configs;
unsigned depth_buffer_factor;
unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
+ gl_format format;
/* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
* support pageflipping at all.
@@ -162,16 +161,13 @@ swrastFillInModes(__DRIscreen *psp,
switch (pixel_bits) {
case 16:
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
+ format = MESA_FORMAT_RGB565;
break;
case 24:
- fb_format = GL_BGR;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ format = MESA_FORMAT_XRGB8888;
break;
case 32:
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ format = MESA_FORMAT_ARGB8888;
break;
default:
fprintf(stderr, "[%s:%u] bad depth %d\n", __func__, __LINE__,
@@ -179,7 +175,7 @@ swrastFillInModes(__DRIscreen *psp,
return NULL;
}
- configs = driCreateConfigs(fb_format, fb_type,
+ configs = driCreateConfigs(format,
depth_bits_array, stencil_bits_array,
depth_buffer_factor, back_buffer_modes,
back_buffer_factor, msaa_samples_array, 1,