summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2009-04-09 10:14:35 +1000
committerDave Airlie <[email protected]>2009-04-09 10:31:08 +1000
commitd1a9b1f513109c975a5a7ed5a2d0c329b280afe4 (patch)
tree5c85af47b4f5af0661acf129e3ce3f59e43cbfd9 /src/mesa/main/image.c
parent90ffce497395d8c02fee2ea4ee4c025eede3d876 (diff)
parent8648c2685870174cf620ef15de70ef030a8d5a20 (diff)
Merge remote branch 'origin/master' into radeon-rewrite
Conflicts: src/mesa/drivers/dri/r200/r200_tex.c src/mesa/drivers/dri/r300/r300_cmdbuf.c src/mesa/drivers/dri/r300/r300_context.h src/mesa/drivers/dri/r300/r300_swtcl.c src/mesa/drivers/dri/r300/r300_tex.c src/mesa/drivers/dri/r300/r300_texmem.c src/mesa/drivers/dri/r300/r300_texstate.c src/mesa/drivers/dri/radeon/radeon_tex.c
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index fa3149d56da..ddae456fa12 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1677,7 +1677,6 @@ _mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n,
* Used to pack an array [][4] of RGBA float colors as specified
* by the dstFormat, dstType and dstPacking. Used by glReadPixels,
* glGetConvolutionFilter(), etc.
- * Incoming colors will be clamped to [0,1] if needed.
* Note: the rgba values will be modified by this function when any pixel
* transfer ops are enabled.
*/
@@ -1691,19 +1690,12 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
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) {
+
+ /* XXX
+ * This test should probably go away. Have the caller set/clear the
+ * IMAGE_CLAMP_BIT as needed.
+ */
+ if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
/* need to clamp to [0, 1] */
transferOps |= IMAGE_CLAMP_BIT;
}
@@ -4554,6 +4546,17 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n,
}
return;
}
+ if (srcType == GL_UNSIGNED_INT_24_8
+ && dstType == GL_UNSIGNED_INT
+ && depthMax == 0xffffff) {
+ const GLuint *src = (const GLuint *) source;
+ GLuint *dst = (GLuint *) dest;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i] = src[i] >> 8;
+ }
+ return;
+ }
/* XXX may want to add additional cases here someday */
}