Merge commit 'origin/master' into gallium-0.2

This commit is contained in:
Brian Paul 2008-10-10 16:40:16 -06:00
commit 2a6c6fe01e
8 changed files with 35 additions and 57 deletions

View file

@ -31,7 +31,6 @@
#include "glheader.h"
#include "macros.h"
#include "colormac.h"
#include "api_loopback.h"
#include "mtypes.h"
#include "glapi/glapi.h"

View file

@ -31,7 +31,6 @@
#include "glheader.h"
#include "blend.h"
#include "colormac.h"
#include "context.h"
#include "enums.h"
#include "macros.h"

View file

@ -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) | \

View file

@ -41,7 +41,6 @@
#endif
#include "arrayobj.h"
#include "clip.h"
#include "colormac.h"
#include "colortab.h"
#include "context.h"
#include "convolve.h"

View file

@ -25,7 +25,6 @@
#include "glheader.h"
#include "colormac.h"
#include "context.h"
#include "get.h"
#include "version.h"

View file

@ -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");
}
}

View file

@ -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;

View file

@ -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"