From 1f7c914ad0beea8a29c1a171c7cd1a12f2efe0fa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 20:28:45 -0600 Subject: mesa: replace gl_texture_format with gl_format Now gl_texture_image::TexFormat is a simple MESA_FORMAT_x enum. ctx->Driver.ChooseTexture format also returns a MESA_FORMAT_x. gl_texture_format will go away next. --- src/mesa/drivers/dri/common/texmem.c | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/mesa/drivers/dri/common/texmem.c') diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index b64618a03c..c9c3324ed9 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -1306,16 +1306,16 @@ driCalculateTextureFirstLastLevel( driTextureObject * t ) * little-endian Mesa formats. */ /*@{*/ -const struct gl_texture_format *_dri_texformat_rgba8888 = NULL; -const struct gl_texture_format *_dri_texformat_argb8888 = NULL; -const struct gl_texture_format *_dri_texformat_rgb565 = NULL; -const struct gl_texture_format *_dri_texformat_argb4444 = NULL; -const struct gl_texture_format *_dri_texformat_argb1555 = NULL; -const struct gl_texture_format *_dri_texformat_al88 = NULL; -const struct gl_texture_format *_dri_texformat_a8 = &_mesa_texformat_a8; -const struct gl_texture_format *_dri_texformat_ci8 = &_mesa_texformat_ci8; -const struct gl_texture_format *_dri_texformat_i8 = &_mesa_texformat_i8; -const struct gl_texture_format *_dri_texformat_l8 = &_mesa_texformat_l8; +gl_format _dri_texformat_rgba8888 = MESA_FORMAT_NONE; +gl_format _dri_texformat_argb8888 = MESA_FORMAT_NONE; +gl_format _dri_texformat_rgb565 = MESA_FORMAT_NONE; +gl_format _dri_texformat_argb4444 = MESA_FORMAT_NONE; +gl_format _dri_texformat_argb1555 = MESA_FORMAT_NONE; +gl_format _dri_texformat_al88 = MESA_FORMAT_NONE; +gl_format _dri_texformat_a8 = MESA_FORMAT_NONE; +gl_format _dri_texformat_ci8 = MESA_FORMAT_NONE; +gl_format _dri_texformat_i8 = MESA_FORMAT_NONE; +gl_format _dri_texformat_l8 = MESA_FORMAT_NONE; /*@}*/ @@ -1329,19 +1329,19 @@ driInitTextureFormats(void) const GLubyte littleEndian = *((const GLubyte *) &ui); if (littleEndian) { - _dri_texformat_rgba8888 = &_mesa_texformat_rgba8888; - _dri_texformat_argb8888 = &_mesa_texformat_argb8888; - _dri_texformat_rgb565 = &_mesa_texformat_rgb565; - _dri_texformat_argb4444 = &_mesa_texformat_argb4444; - _dri_texformat_argb1555 = &_mesa_texformat_argb1555; - _dri_texformat_al88 = &_mesa_texformat_al88; + _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888; + _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888; + _dri_texformat_rgb565 = MESA_FORMAT_RGB565; + _dri_texformat_argb4444 = MESA_FORMAT_ARGB4444; + _dri_texformat_argb1555 = MESA_FORMAT_ARGB1555; + _dri_texformat_al88 = MESA_FORMAT_AL88; } else { - _dri_texformat_rgba8888 = &_mesa_texformat_rgba8888_rev; - _dri_texformat_argb8888 = &_mesa_texformat_argb8888_rev; - _dri_texformat_rgb565 = &_mesa_texformat_rgb565_rev; - _dri_texformat_argb4444 = &_mesa_texformat_argb4444_rev; - _dri_texformat_argb1555 = &_mesa_texformat_argb1555_rev; - _dri_texformat_al88 = &_mesa_texformat_al88_rev; + _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888_REV; + _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888_REV; + _dri_texformat_rgb565 = MESA_FORMAT_RGB565_REV; + _dri_texformat_argb4444 = MESA_FORMAT_ARGB4444_REV; + _dri_texformat_argb1555 = MESA_FORMAT_ARGB1555_REV; + _dri_texformat_al88 = MESA_FORMAT_AL88_REV; } } -- cgit v1.2.3 From 9bf2aa33298db5af9128ad8f625321be47ab65c3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Oct 2009 14:49:53 -0600 Subject: dri/common: fix broken _dri_texformat_* initializations --- src/mesa/drivers/dri/common/texmem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/common/texmem.c') diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index c9c3324ed9..e8880d9ae8 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -1312,10 +1312,10 @@ gl_format _dri_texformat_rgb565 = MESA_FORMAT_NONE; gl_format _dri_texformat_argb4444 = MESA_FORMAT_NONE; gl_format _dri_texformat_argb1555 = MESA_FORMAT_NONE; gl_format _dri_texformat_al88 = MESA_FORMAT_NONE; -gl_format _dri_texformat_a8 = MESA_FORMAT_NONE; -gl_format _dri_texformat_ci8 = MESA_FORMAT_NONE; -gl_format _dri_texformat_i8 = MESA_FORMAT_NONE; -gl_format _dri_texformat_l8 = MESA_FORMAT_NONE; +gl_format _dri_texformat_a8 = MESA_FORMAT_A8; +gl_format _dri_texformat_ci8 = MESA_FORMAT_CI8; +gl_format _dri_texformat_i8 = MESA_FORMAT_I8; +gl_format _dri_texformat_l8 = MESA_FORMAT_L8; /*@}*/ -- cgit v1.2.3 From a37c9ac8eee8c0d5b49f198f490828a794dc93c4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Oct 2009 14:54:32 -0600 Subject: dri/common: use _mesa_little_endian() and update comments --- src/mesa/drivers/dri/common/texmem.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/mesa/drivers/dri/common/texmem.c') diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index e8880d9ae8..798c09f09f 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -1302,8 +1302,8 @@ driCalculateTextureFirstLastLevel( driTextureObject * t ) /** - * \name DRI texture formats. Pointers initialized to either the big- or - * little-endian Mesa formats. + * \name DRI texture formats. These vars are initialized to either the + * big- or little-endian Mesa formats. */ /*@{*/ gl_format _dri_texformat_rgba8888 = MESA_FORMAT_NONE; @@ -1320,15 +1320,13 @@ gl_format _dri_texformat_l8 = MESA_FORMAT_L8; /** - * Initialize little endian target, host byte order independent texture formats + * Initialize _dri_texformat_* vars according to whether we're on + * a big or little endian system. */ void driInitTextureFormats(void) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); - - if (littleEndian) { + if (_mesa_little_endian()) { _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888; _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888; _dri_texformat_rgb565 = MESA_FORMAT_RGB565; -- cgit v1.2.3 From fa3046431a0da5990043fd4856602b0ba57ff9af Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Oct 2009 14:57:45 -0600 Subject: dri/common: updated #includes --- src/mesa/drivers/dri/common/texmem.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri/common/texmem.c') diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index 798c09f09f..895139b55b 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -42,14 +42,10 @@ * application. */ -#include "texmem.h" -#include "main/simple_list.h" #include "main/imports.h" #include "main/macros.h" -#include "main/texformat.h" - -#include - +#include "main/simple_list.h" +#include "texmem.h" static unsigned dummy_swap_counter; -- cgit v1.2.3