summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-03-22 04:54:58 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-03-22 04:54:58 +0000
commit1a59875367b4e38710b37422143efb702b0b1420 (patch)
treec11419a3105822a6587bed95918dd5e1eac28523 /src/mesa
parente9313a64c182701d22a5c6d2a82863c658e7424f (diff)
added GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/extensions.c4
-rw-r--r--src/mesa/main/texstate.c16
-rw-r--r--src/mesa/swrast/s_texture.c24
3 files changed, 39 insertions, 5 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 6a7d25fe20..e3b9592b89 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -1,4 +1,4 @@
-/* $Id: extensions.c,v 1.53 2001/03/18 08:53:49 gareth Exp $ */
+/* $Id: extensions.c,v 1.54 2001/03/22 04:54:58 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -61,6 +61,8 @@ static struct {
{ OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) },
{ OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) },
{ OFF, "GL_ARB_texture_env_add", F(EXT_texture_env_add) },
+ { OFF, "GL_ARB_texture_env_combine", F(EXT_texture_env_combine) },
+ { OFF, "GL_ARB_texture_env_dot3", F(EXT_texture_env_dot3) },
{ ON, "GL_ARB_tranpose_matrix", 0 },
{ ON, "GL_EXT_abgr", 0 },
{ ON, "GL_EXT_bgra", 0 },
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 1a6a42a85c..438ba6f142 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.37 2001/03/18 08:53:50 gareth Exp $ */
+/* $Id: texstate.c,v 1.38 2001/03/22 04:54:58 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -55,6 +55,14 @@
#endif
+/* XXX this is temporary, until GL/glext.h is updated. */
+#ifndef GL_DOT3_RGB_ARB
+#define GL_DOT3_RGB_ARB 0x86AE
+#endif
+#ifndef GL_DOT3_RGBA_ARB
+#define GL_DOT3_RGBA_ARB 0x86AF
+#endif
+
/**********************************************************************/
@@ -127,6 +135,8 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
break;
case GL_DOT3_RGB_EXT:
case GL_DOT3_RGBA_EXT:
+ case GL_DOT3_RGB_ARB:
+ case GL_DOT3_RGBA_ARB:
if (!ctx->Extensions.EXT_texture_env_dot3) {
_mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(param)");
return;
@@ -272,7 +282,10 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
if (ctx->Extensions.EXT_texture_env_combine) {
GLenum operand = (GLenum) (GLint) *param;
switch (operand) {
+ case GL_SRC_COLOR: /* ARB combine only */
+ case GL_ONE_MINUS_SRC_COLOR: /* ARB combine only */
case GL_SRC_ALPHA:
+ case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */
if (texUnit->CombineOperandRGB[2] == operand)
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -292,6 +305,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
GLenum operand = (GLenum) (GLint) *param;
switch (operand) {
case GL_SRC_ALPHA:
+ case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */
if (texUnit->CombineOperandA[2] == operand)
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index 6bbf482119..c4512480d5 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -1,4 +1,4 @@
-/* $Id: s_texture.c,v 1.17 2001/03/21 16:04:49 brianp Exp $ */
+/* $Id: s_texture.c,v 1.18 2001/03/22 04:54:58 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -38,6 +38,14 @@
#include "s_texture.h"
+/* XXX this is temporary, until GL/glext.h is updated. */
+#ifndef GL_DOT3_RGB_ARB
+#define GL_DOT3_RGB_ARB 0x86AE
+#endif
+#ifndef GL_DOT3_RGBA_ARB
+#define GL_DOT3_RGBA_ARB 0x86AF
+#endif
+
/*
* These values are used in the fixed-point arithmetic used
@@ -1689,6 +1697,9 @@ texture_combine(const GLcontext *ctx,
ASSERT(ctx->Extensions.EXT_texture_env_combine);
+ /*
+ * Do operand setup for up to 3 operands. Loop over the terms.
+ */
for (j = 0; j < 3; j++) {
switch (textureUnit->CombineSourceA[j]) {
case GL_TEXTURE:
@@ -1763,7 +1774,8 @@ texture_combine(const GLcontext *ctx,
dst[i][BCOMP] = src[i][ACOMP];
}
}
- else { /* GL_ONE_MINUS_SRC_ALPHA */
+ else {
+ ASSERT(textureUnit->CombineOperandRGB[j] ==GL_ONE_MINUS_SRC_ALPHA);
src = (const GLchan (*)[4]) argA[j];
for (i = 0; i < n; i++) {
dst[i][RCOMP] = CHAN_MAX - src[i][ACOMP];
@@ -1794,6 +1806,9 @@ texture_combine(const GLcontext *ctx,
}
}
+ /*
+ * Do the texture combine.
+ */
switch (textureUnit->CombineModeRGB) {
case GL_REPLACE:
{
@@ -1887,6 +1902,8 @@ texture_combine(const GLcontext *ctx,
break;
case GL_DOT3_RGB_EXT:
case GL_DOT3_RGBA_EXT:
+ case GL_DOT3_RGB_ARB:
+ case GL_DOT3_RGBA_ARB:
{
const GLubyte (*arg0)[4] = (const GLubyte (*)[4]) argRGB[0];
const GLubyte (*arg1)[4] = (const GLubyte (*)[4]) argRGB[1];
@@ -1980,7 +1997,8 @@ texture_combine(const GLcontext *ctx,
/* Fix the alpha component for GL_DOT3_RGBA_EXT combining.
*/
- if (textureUnit->CombineModeRGB == GL_DOT3_RGBA_EXT) {
+ if (textureUnit->CombineModeRGB == GL_DOT3_RGBA_EXT ||
+ textureUnit->CombineModeRGB == GL_DOT3_RGBA_ARB) {
for (i = 0; i < n; i++) {
rgba[i][ACOMP] = rgba[i][RCOMP];
}