summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2009-03-27 19:39:52 +0100
committerRoland Scheidegger <[email protected]>2009-03-28 02:02:42 +0100
commitc6a6cc191813e8343a17b028146a34f193a6ce44 (patch)
treecb1ecd35ac15c9b2c0cf3740dbdc631c7622233a /src/mesa/main/image.c
parenta9bf5b5ccac2a75f1a2470d4910361e65b2d8eab (diff)
mesa: add new signed rgba texture format
This is a (partial) backport of the signed texture format support in OGL 3.1. Since it wasn't promoted from an existing extension roll our own.
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index fa3149d56da..44972ae8e2c 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1686,24 +1686,13 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
GLenum dstFormat, GLenum dstType,
GLvoid *dstAddr,
const struct gl_pixelstore_attrib *dstPacking,
- GLbitfield transferOps)
+ GLbitfield transferOps, GLboolean noClamp)
{
GLfloat luminance[MAX_WIDTH];
const GLint comps = _mesa_components_in_format(dstFormat);
GLuint i;
- /* clamping only applies to colors, not the dudv values, but still need
- it if converting to unsigned values (which doesn't make much sense) */
- if (dstFormat == GL_DUDV_ATI || dstFormat == GL_DU8DV8_ATI) {
- switch (dstType) {
- case GL_UNSIGNED_BYTE:
- case GL_UNSIGNED_SHORT:
- case GL_UNSIGNED_INT:
- transferOps |= IMAGE_CLAMP_BIT;
- break;
- /* actually might want clamp to [-1,1] otherwise but shouldn't matter? */
- }
- }
- else if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
+
+ if ((!noClamp) && (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE)) {
/* need to clamp to [0, 1] */
transferOps |= IMAGE_CLAMP_BIT;
}