summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-07-13 20:07:37 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-07-13 20:07:37 +0000
commitf431a3fb4dc1bf860203d79e54657e3a62bc50df (patch)
tree51a598faf5e8b971b2bd7cf85702e021426f54c6 /src/mesa/main
parentbc07a99cc3faeb1aa48700065b34baa76c201e7d (diff)
assorted changes for supporting GLfloat color channels (not done)
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/Makefile.OSMesa164
-rw-r--r--src/mesa/main/config.h4
-rw-r--r--src/mesa/main/mtypes.h4
-rw-r--r--src/mesa/main/pixel.c10
-rw-r--r--src/mesa/main/teximage.c6
-rw-r--r--src/mesa/main/texstore.c36
6 files changed, 37 insertions, 27 deletions
diff --git a/src/mesa/main/Makefile.OSMesa16 b/src/mesa/main/Makefile.OSMesa16
index b96ca802a6..43193aa36b 100644
--- a/src/mesa/main/Makefile.OSMesa16
+++ b/src/mesa/main/Makefile.OSMesa16
@@ -1,10 +1,10 @@
-# $Id: Makefile.OSMesa16,v 1.3 2001/06/18 17:26:08 brianp Exp $
+# $Id: Makefile.OSMesa16,v 1.4 2001/07/13 20:07:37 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.5
# Copyright (C) 1995-2001 Brian Paul
-# Makefile for building Mesa for 16-bit/channel rendering with the OSMesa
+# Makefile for building Mesa for 16/32-bit/channel rendering with the OSMesa
# driver.
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 805da1e7b7..507f499a1f 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -1,4 +1,4 @@
-/* $Id: config.h,v 1.32 2001/06/13 14:56:14 brianp Exp $ */
+/* $Id: config.h,v 1.33 2001/07/13 20:07:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -142,7 +142,7 @@
/*
- * Bits per accumulation buffer color component: 8 or 16
+ * Bits per accumulation buffer color component: 8, 16 or 32
*/
#define ACCUM_BITS 16
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 8b0eb4fd8b..9bf185f7f3 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,4 +1,4 @@
-/* $Id: mtypes.h,v 1.48 2001/06/26 21:15:35 brianp Exp $ */
+/* $Id: mtypes.h,v 1.49 2001/07/13 20:07:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -74,6 +74,8 @@
typedef GLbyte GLaccum;
#elif ACCUM_BITS==16
typedef GLshort GLaccum;
+#elif ACCUM_BITS==32
+ typedef GLfloat GLaccum;
#else
# error "illegal number of accumulation bits"
#endif
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 55f6b99b0f..e0acfd5b93 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -1,4 +1,4 @@
-/* $Id: pixel.c,v 1.29 2001/05/23 23:55:01 brianp Exp $ */
+/* $Id: pixel.c,v 1.30 2001/07/13 20:07:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -580,13 +580,13 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param )
switch (pname) {
case GL_MAP_COLOR:
- if (ctx->Pixel.MapColorFlag == param ? GL_TRUE : GL_FALSE)
+ if (ctx->Pixel.MapColorFlag == (param ? GL_TRUE : GL_FALSE))
return;
FLUSH_VERTICES(ctx, _NEW_PIXEL);
ctx->Pixel.MapColorFlag = param ? GL_TRUE : GL_FALSE;
break;
case GL_MAP_STENCIL:
- if (ctx->Pixel.MapStencilFlag == param ? GL_TRUE : GL_FALSE)
+ if (ctx->Pixel.MapStencilFlag == (param ? GL_TRUE : GL_FALSE))
return;
FLUSH_VERTICES(ctx, _NEW_PIXEL);
ctx->Pixel.MapStencilFlag = param ? GL_TRUE : GL_FALSE;
@@ -1290,6 +1290,9 @@ void
_mesa_chan_to_float_span(const GLcontext *ctx, GLuint n,
CONST GLchan rgba[][4], GLfloat rgbaf[][4])
{
+#if CHAN_TYPE == GL_FLOAT
+ MEMCPY(rgbaf, rgba, n * 4 * sizeof(GLfloat));
+#else
const GLuint rShift = CHAN_BITS - ctx->Visual.redBits;
const GLuint gShift = CHAN_BITS - ctx->Visual.greenBits;
const GLuint bShift = CHAN_BITS - ctx->Visual.blueBits;
@@ -1319,4 +1322,5 @@ _mesa_chan_to_float_span(const GLcontext *ctx, GLuint n,
rgbaf[i][BCOMP] = (GLfloat) b * bScale;
rgbaf[i][ACOMP] = (GLfloat) a * aScale;
}
+#endif
}
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index b13b4395f3..ffddeffbab 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.99 2001/07/13 15:44:21 brianp Exp $ */
+/* $Id: teximage.c,v 1.100 2001/07/13 20:07:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -58,6 +58,9 @@
#ifdef DEBUG
static void PrintTexture(const struct gl_texture_image *img)
{
+#if CHAN_TYPE == GL_FLOAT
+ _mesa_problem(NULL, "PrintTexture doesn't support float channels");
+#else
GLuint i, j, c;
const GLchan *data = (const GLchan *) img->Data;
@@ -101,6 +104,7 @@ static void PrintTexture(const struct gl_texture_image *img)
}
printf("\n");
}
+#endif
}
#endif
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 6474121b70..56ec66e13a 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1,4 +1,4 @@
-/* $Id: texstore.c,v 1.30 2001/07/13 16:38:44 brianp Exp $ */
+/* $Id: texstore.c,v 1.31 2001/07/13 20:07:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1021,13 +1021,13 @@ do_row(const struct gl_texture_format *format, GLint srcWidth,
for (i = j = 0, k = k0; i < dstWidth;
i++, j += colStride, k += colStride) {
dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) >> 2;
+ rowB[j][0] + rowB[k][0]) / 4;
dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) >> 2;
+ rowB[j][1] + rowB[k][1]) / 4;
dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) >> 2;
+ rowB[j][2] + rowB[k][2]) / 4;
dst[i][3] = (rowA[j][3] + rowA[k][3] +
- rowB[j][3] + rowB[k][3]) >> 2;
+ rowB[j][3] + rowB[k][3]) / 4;
}
}
return;
@@ -1040,11 +1040,11 @@ do_row(const struct gl_texture_format *format, GLint srcWidth,
for (i = j = 0, k = k0; i < dstWidth;
i++, j += colStride, k += colStride) {
dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) >> 2;
+ rowB[j][0] + rowB[k][0]) / 4;
dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) >> 2;
+ rowB[j][1] + rowB[k][1]) / 4;
dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) >> 2;
+ rowB[j][2] + rowB[k][2]) / 4;
}
}
return;
@@ -1059,7 +1059,7 @@ do_row(const struct gl_texture_format *format, GLint srcWidth,
GLchan *dst = (GLchan *) dstRow;
for (i = j = 0, k = k0; i < dstWidth;
i++, j += colStride, k += colStride) {
- dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) >> 2;
+ dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4;
}
}
return;
@@ -1072,9 +1072,9 @@ do_row(const struct gl_texture_format *format, GLint srcWidth,
for (i = j = 0, k = k0; i < dstWidth;
i++, j += colStride, k += colStride) {
dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) >> 2;
+ rowB[j][0] + rowB[k][0]) / 4;
dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) >> 2;
+ rowB[j][1] + rowB[k][1]) / 4;
}
}
return;
@@ -1101,13 +1101,13 @@ do_row(const struct gl_texture_format *format, GLint srcWidth,
for (i = j = 0, k = k0; i < dstWidth;
i++, j += colStride, k += colStride) {
dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) >> 2;
+ rowB[j][0] + rowB[k][0]) / 4;
dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) >> 2;
+ rowB[j][1] + rowB[k][1]) / 4;
dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) >> 2;
+ rowB[j][2] + rowB[k][2]) / 4;
dst[i][3] = (rowA[j][3] + rowA[k][3] +
- rowB[j][3] + rowB[k][3]) >> 2;
+ rowB[j][3] + rowB[k][3]) / 4;
}
}
return;
@@ -1120,11 +1120,11 @@ do_row(const struct gl_texture_format *format, GLint srcWidth,
for (i = j = 0, k = k0; i < dstWidth;
i++, j += colStride, k += colStride) {
dst[i][0] = (rowA[j][0] + rowA[k][0] +
- rowB[j][0] + rowB[k][0]) >> 2;
+ rowB[j][0] + rowB[k][0]) / 4;
dst[i][1] = (rowA[j][1] + rowA[k][1] +
- rowB[j][1] + rowB[k][1]) >> 2;
+ rowB[j][1] + rowB[k][1]) / 4;
dst[i][2] = (rowA[j][2] + rowA[k][2] +
- rowB[j][2] + rowB[k][2]) >> 2;
+ rowB[j][2] + rowB[k][2]) / 4;
}
}
return;