diff options
author | Brian Paul <[email protected]> | 2008-10-10 16:40:16 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-10-10 16:40:16 -0600 |
commit | 2a6c6fe01e84ffd54b47ea11aa766960df6ddcaf (patch) | |
tree | d0cab73abfa138f30cb74371bbb16060893b6c07 | |
parent | 01e312a73b68dc5ddffca0d1b1472fc5dcb6f59e (diff) | |
parent | 24748268a3ac7bedc2c9ae5bf76c4c741d539f80 (diff) |
Merge commit 'origin/master' into gallium-0.2
-rw-r--r-- | src/mesa/main/api_loopback.c | 1 | ||||
-rw-r--r-- | src/mesa/main/blend.c | 1 | ||||
-rw-r--r-- | src/mesa/main/colormac.h | 24 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 1 | ||||
-rw-r--r-- | src/mesa/main/getstring.c | 1 | ||||
-rw-r--r-- | src/mesa/main/shaders.c | 13 | ||||
-rw-r--r-- | src/mesa/main/texstore.c | 50 | ||||
-rw-r--r-- | src/mesa/swrast/s_texcombine.c | 1 |
8 files changed, 35 insertions, 57 deletions
diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 924d7134a27..0e3f5ff9570 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -31,7 +31,6 @@ #include "glheader.h" #include "macros.h" -#include "colormac.h" #include "api_loopback.h" #include "mtypes.h" #include "glapi/glapi.h" diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 4d4a8971419..39cf6153e28 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -31,7 +31,6 @@ #include "glheader.h" #include "blend.h" -#include "colormac.h" #include "context.h" #include "enums.h" #include "macros.h" diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index a19521fc85b..a34bd2ed388 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 7.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -180,20 +180,20 @@ do { \ */ /*@{*/ -#define PACK_COLOR_8888( R, G, B, A ) \ - (((R) << 24) | ((G) << 16) | ((B) << 8) | (A)) +#define PACK_COLOR_8888( X, Y, Z, W ) \ + (((X) << 24) | ((Y) << 16) | ((Z) << 8) | (W)) -#define PACK_COLOR_8888_REV( R, G, B, A ) \ - (((A) << 24) | ((B) << 16) | ((G) << 8) | (R)) +#define PACK_COLOR_8888_REV( X, Y, Z, W ) \ + (((W) << 24) | ((Z) << 16) | ((Y) << 8) | (X)) -#define PACK_COLOR_888( R, G, B ) \ - (((R) << 16) | ((G) << 8) | (B)) +#define PACK_COLOR_888( X, Y, Z ) \ + (((X) << 16) | ((Y) << 8) | (Z)) -#define PACK_COLOR_565( R, G, B ) \ - ((((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | (((B) & 0xf8) >> 3)) +#define PACK_COLOR_565( X, Y, Z ) \ + ((((X) & 0xf8) << 8) | (((Y) & 0xfc) << 3) | (((Z) & 0xf8) >> 3)) -#define PACK_COLOR_565_REV( R, G, B ) \ - (((R) & 0xf8) | ((G) & 0xe0) >> 5 | (((G) & 0x1c) << 11) | (((B) & 0xf8) << 5)) +#define PACK_COLOR_565_REV( X, Y, Z ) \ + (((X) & 0xf8) | ((Y) & 0xe0) >> 5 | (((Y) & 0x1c) << 11) | (((Z) & 0xf8) << 5)) #define PACK_COLOR_1555( A, B, G, R ) \ ((((B) & 0xf8) << 7) | (((G) & 0xf8) << 2) | (((R) & 0xf8) >> 3) | \ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index f7660930a9c..c7db435506e 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -41,7 +41,6 @@ #endif #include "arrayobj.h" #include "clip.h" -#include "colormac.h" #include "colortab.h" #include "context.h" #include "convolve.h" diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 1a82ccce59a..94bf5de1e8b 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -25,7 +25,6 @@ #include "glheader.h" -#include "colormac.h" #include "context.h" #include "get.h" #include "version.h" diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index aeb5d4ca2ab..e5c54bb10d7 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -247,7 +247,18 @@ _mesa_GetObjectParameterivARB(GLhandleARB object, GLenum pname, GLint *params) } } else { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB"); + /* error code depends on pname */ + GLenum err; + switch (pname) { + case GL_OBJECT_TYPE_ARB: + case GL_OBJECT_DELETE_STATUS_ARB: + case GL_OBJECT_INFO_LOG_LENGTH_ARB: + err = GL_INVALID_OPERATION; + break; + default: + err = GL_INVALID_VALUE; + } + _mesa_error(ctx, err, "glGetObjectParameterivARB"); } } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 76b785ab0e0..3639a914c4c 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.3 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -1536,10 +1536,10 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) for (row = 0; row < srcHeight; row++) { GLuint *d4 = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { - d4[col] = ((0xff << 24) | - (srcRow[col * 3 + RCOMP] << 16) | - (srcRow[col * 3 + GCOMP] << 8) | - (srcRow[col * 3 + BCOMP] << 0)); + d4[col] = PACK_COLOR_8888(0xff, + srcRow[col * 3 + RCOMP], + srcRow[col * 3 + GCOMP], + srcRow[col * 3 + BCOMP]); } dstRow += dstRowStride; srcRow += srcRowStride; @@ -1551,8 +1551,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) dstFormat == &_mesa_texformat_argb8888 && srcFormat == GL_RGBA && baseInternalFormat == GL_RGBA && - srcType == GL_UNSIGNED_BYTE && - littleEndian) { + srcType == GL_UNSIGNED_BYTE) { /* same as above case, but src data has alpha too */ GLint img, row, col; /* For some reason, streaming copies to write-combined regions @@ -1573,39 +1572,10 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) for (row = 0; row < srcHeight; row++) { GLuint *d4 = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { - d4[col] = ((srcRow[col * 4 + ACOMP] << 24) | - (srcRow[col * 4 + RCOMP] << 16) | - (srcRow[col * 4 + GCOMP] << 8) | - (srcRow[col * 4 + BCOMP] << 0)); - } - dstRow += dstRowStride; - srcRow += srcRowStride; - } - } - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && - srcFormat == GL_RGBA && - baseInternalFormat == GL_RGBA && - srcType == GL_UNSIGNED_BYTE) { - - GLint img, row, col; - for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 4 + 0] = srcRow[col * 4 + BCOMP]; - dstRow[col * 4 + 1] = srcRow[col * 4 + GCOMP]; - dstRow[col * 4 + 2] = srcRow[col * 4 + RCOMP]; - dstRow[col * 4 + 3] = srcRow[col * 4 + ACOMP]; + d4[col] = PACK_COLOR_8888(srcRow[col * 4 + ACOMP], + srcRow[col * 4 + RCOMP], + srcRow[col * 4 + GCOMP], + srcRow[col * 4 + BCOMP]); } dstRow += dstRowStride; srcRow += srcRowStride; diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 4e3d329075c..632d650007e 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -26,6 +26,7 @@ #include "main/glheader.h" #include "main/context.h" #include "main/colormac.h" +#include "main/image.h" #include "main/imports.h" #include "main/macros.h" #include "main/pixel.h" |