diff options
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r-- | src/mesa/drivers/dri/common/spantmp2.h | 122 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/texmem.c | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/utils.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/utils.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/xmlconfig.c | 20 |
5 files changed, 26 insertions, 130 deletions
diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index f436d1398c2..abd79562f98 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -48,15 +48,6 @@ #define HW_WRITE_CLIPLOOP() HW_CLIPLOOP() #endif -#ifdef SPANTMP_MESA_FMT -#define SPANTMP_PIXEL_FMT GL_NONE -#define SPANTMP_PIXEL_TYPE GL_NONE -#endif - -#ifndef SPANTMP_MESA_FMT -#define SPANTMP_MESA_FMT MESA_FORMAT_COUNT -#endif - #if (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5) /** @@ -454,118 +445,6 @@ rgba[3] = p; \ } while (0) -#elif (SPANTMP_MESA_FMT == MESA_FORMAT_R8) - -#ifndef GET_VALUE -#ifndef GET_PTR -#define GET_PTR(_x, _y) ( buf + (_x) + (_y) * pitch) -#endif - -#define GET_VALUE(_x, _y) *(volatile GLubyte *)(GET_PTR(_x, _y)) -#define PUT_VALUE(_x, _y, _v) *(volatile GLubyte *)(GET_PTR(_x, _y)) = (_v) -#endif /* GET_VALUE */ - -# define INIT_MONO_PIXEL(p, color) \ - p = color[0] - -# define WRITE_RGBA(_x, _y, r, g, b, a) \ - PUT_VALUE(_x, _y, r) - -#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLubyte p = GET_VALUE(_x, _y); \ - rgba[0] = p; \ - rgba[1] = 0; \ - rgba[2] = 0; \ - rgba[3] = 0; \ - } while (0) - -#elif (SPANTMP_MESA_FMT == MESA_FORMAT_RG88) - -#ifndef GET_VALUE -#ifndef GET_PTR -#define GET_PTR(_x, _y) ( buf + (_x) * 2 + (_y) * pitch) -#endif - -#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y)) -#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v) -#endif /* GET_VALUE */ - -# define INIT_MONO_PIXEL(p, color) \ - PACK_COLOR_8888(color[0], color[1], 0, 0) - -# define WRITE_RGBA(_x, _y, r, g, b, a) \ - PUT_VALUE(_x, _y, r) - -#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLushort p = GET_VALUE(_x, _y); \ - rgba[0] = p & 0xff; \ - rgba[1] = (p >> 8) & 0xff; \ - rgba[2] = 0; \ - rgba[3] = 0; \ - } while (0) - -#elif (SPANTMP_MESA_FMT == MESA_FORMAT_R16) - -#ifndef GET_VALUE -#ifndef GET_PTR -#define GET_PTR(_x, _y) ( buf + (_x) * 2 + (_y) * pitch) -#endif - -#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y)) -#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v) -#endif /* GET_VALUE */ - -# define INIT_MONO_PIXEL(p, color) \ - p = color[0] - -# define WRITE_RGBA(_x, _y, r, g, b, a) \ - PUT_VALUE(_x, _y, r) - -#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLushort p = GET_VALUE(_x, _y); \ - rgba[0] = p; \ - rgba[1] = 0; \ - rgba[2] = 0; \ - rgba[3] = 0; \ - } while (0) - -#elif (SPANTMP_MESA_FMT == MESA_FORMAT_RG1616) - -#ifndef GET_VALUE -#ifndef GET_PTR -#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch) -#endif - -#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y)) -#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v) -#endif /* GET_VALUE */ - -# define INIT_MONO_PIXEL(p, color) \ - ((color[1] << 16) | (color[0])) - -# define WRITE_RGBA(_x, _y, r, g, b, a) \ - PUT_VALUE(_x, _y, r) - -#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLuint p = GET_VALUE(_x, _y); \ - rgba[0] = p & 0xffff; \ - rgba[1] = (p >> 16) & 0xffff; \ - rgba[2] = 0; \ - rgba[3] = 0; \ - } while (0) - #else #error SPANTMP_PIXEL_FMT must be set to a valid value! #endif @@ -1035,4 +914,3 @@ static void TAG(InitPointers)(struct gl_renderbuffer *rb) #undef GET_PTR #undef SPANTMP_PIXEL_FMT #undef SPANTMP_PIXEL_TYPE -#undef SPANTMP_MESA_FMT diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index 8eec07d5bcc..e927cf0addd 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -1264,17 +1264,18 @@ driCalculateTextureFirstLastLevel( driTextureObject * t ) case GL_TEXTURE_2D: case GL_TEXTURE_3D: case GL_TEXTURE_CUBE_MAP: - if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + if (tObj->Sampler.MinFilter == GL_NEAREST || + tObj->Sampler.MinFilter == GL_LINEAR) { /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. */ firstLevel = lastLevel = tObj->BaseLevel; } else { - firstLevel = tObj->BaseLevel + (GLint)(tObj->MinLod + 0.5); + firstLevel = tObj->BaseLevel + (GLint)(tObj->Sampler.MinLod + 0.5); firstLevel = MAX2(firstLevel, tObj->BaseLevel); firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5); + lastLevel = tObj->BaseLevel + (GLint)(tObj->Sampler.MaxLod + 0.5); lastLevel = MAX2(lastLevel, t->tObj->BaseLevel); lastLevel = MIN2(lastLevel, t->tObj->BaseLevel + baseImage->MaxLog2); lastLevel = MIN2(lastLevel, t->tObj->MaxLevel); diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 083edfaa9b4..d8281838233 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -96,7 +96,6 @@ driParseDebugString( const char * debug, * * \param buffer Buffer to hold the \c GL_RENDERER string. * \param hardware_name Name of the hardware. - * \param driver_date Driver date. * \param agp_mode AGP mode (speed). * * \returns @@ -105,12 +104,12 @@ driParseDebugString( const char * debug, */ unsigned driGetRendererString( char * buffer, const char * hardware_name, - const char * driver_date, GLuint agp_mode ) + GLuint agp_mode ) { unsigned offset; char *cpu; - offset = sprintf( buffer, "Mesa DRI %s %s", hardware_name, driver_date ); + offset = sprintf( buffer, "Mesa DRI %s", hardware_name ); /* Append any AGP-specific information. */ diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 6349fb4b95c..a1c9ea604ee 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -76,7 +76,7 @@ extern unsigned driParseDebugString( const char * debug, const struct dri_debug_control * control ); extern unsigned driGetRendererString( char * buffer, - const char * hardware_name, const char * driver_date, GLuint agp_mode ); + const char * hardware_name, GLuint agp_mode ); extern void driInitExtensions( struct gl_context * ctx, const struct dri_extension * card_extensions, GLboolean enable_imaging ); diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index 0312c072437..0226b38c4fc 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -64,7 +64,25 @@ extern char *program_invocation_name, *program_invocation_short_name; the basename to match BSD getprogname() */ # include <stdlib.h> # include <libgen.h> -# define GET_PROGRAM_NAME() basename(getexecname()) + +static const char *__getProgramName () { + static const char *progname; + + if (progname == NULL) { + const char *e = getexecname(); + if (e != NULL) { + /* Have to make a copy since getexecname can return a readonly + string, but basename expects to be able to modify its arg. */ + char *n = strdup(e); + if (n != NULL) { + progname = basename(n); + } + } + } + return progname; +} + +# define GET_PROGRAM_NAME() __getProgramName() #endif #if !defined(GET_PROGRAM_NAME) |