Browse Source

added GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3

tags/mesa_3_5
Brian Paul 24 years ago
parent
commit
1a59875367
4 changed files with 42 additions and 6 deletions
  1. 3
    1
      docs/VERSIONS
  2. 3
    1
      src/mesa/main/extensions.c
  3. 15
    1
      src/mesa/main/texstate.c
  4. 21
    3
      src/mesa/swrast/s_texture.c

+ 3
- 1
docs/VERSIONS View File

$Id: VERSIONS,v 1.51 2001/03/17 00:47:19 brianp Exp $
$Id: VERSIONS,v 1.52 2001/03/22 04:55:48 brianp Exp $




Mesa Version History Mesa Version History
- GL_SGIX_depth_texture extension - GL_SGIX_depth_texture extension
- GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions
- demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow
- GL_ARB_texture_env_combine extension
- GL_ARB_texture_env_dot3 extension
- OSMesaCreateContextExt() function - OSMesaCreateContextExt() function
- libOSMesa.so library, contains the OSMesa driver interface - libOSMesa.so library, contains the OSMesa driver interface
- GL/glxext.h header file for GLX extensions - GL/glxext.h header file for GLX extensions

+ 3
- 1
src/mesa/main/extensions.c View File

/* $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 * Mesa 3-D graphics library
{ OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) }, { OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) },
{ OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) }, { 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_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_ARB_tranpose_matrix", 0 },
{ ON, "GL_EXT_abgr", 0 }, { ON, "GL_EXT_abgr", 0 },
{ ON, "GL_EXT_bgra", 0 }, { ON, "GL_EXT_bgra", 0 },

+ 15
- 1
src/mesa/main/texstate.c View File

/* $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 * Mesa 3-D graphics library
#endif #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





/**********************************************************************/ /**********************************************************************/
break; break;
case GL_DOT3_RGB_EXT: case GL_DOT3_RGB_EXT:
case GL_DOT3_RGBA_EXT: case GL_DOT3_RGBA_EXT:
case GL_DOT3_RGB_ARB:
case GL_DOT3_RGBA_ARB:
if (!ctx->Extensions.EXT_texture_env_dot3) { if (!ctx->Extensions.EXT_texture_env_dot3) {
_mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(param)"); _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(param)");
return; return;
if (ctx->Extensions.EXT_texture_env_combine) { if (ctx->Extensions.EXT_texture_env_combine) {
GLenum operand = (GLenum) (GLint) *param; GLenum operand = (GLenum) (GLint) *param;
switch (operand) { switch (operand) {
case GL_SRC_COLOR: /* ARB combine only */
case GL_ONE_MINUS_SRC_COLOR: /* ARB combine only */
case GL_SRC_ALPHA: case GL_SRC_ALPHA:
case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */
if (texUnit->CombineOperandRGB[2] == operand) if (texUnit->CombineOperandRGB[2] == operand)
return; return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE); FLUSH_VERTICES(ctx, _NEW_TEXTURE);
GLenum operand = (GLenum) (GLint) *param; GLenum operand = (GLenum) (GLint) *param;
switch (operand) { switch (operand) {
case GL_SRC_ALPHA: case GL_SRC_ALPHA:
case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */
if (texUnit->CombineOperandA[2] == operand) if (texUnit->CombineOperandA[2] == operand)
return; return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE); FLUSH_VERTICES(ctx, _NEW_TEXTURE);

+ 21
- 3
src/mesa/swrast/s_texture.c View File

/* $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 * Mesa 3-D graphics library
#include "s_texture.h" #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 * These values are used in the fixed-point arithmetic used


ASSERT(ctx->Extensions.EXT_texture_env_combine); 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++) { for (j = 0; j < 3; j++) {
switch (textureUnit->CombineSourceA[j]) { switch (textureUnit->CombineSourceA[j]) {
case GL_TEXTURE: case GL_TEXTURE:
dst[i][BCOMP] = src[i][ACOMP]; 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]; src = (const GLchan (*)[4]) argA[j];
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
dst[i][RCOMP] = CHAN_MAX - src[i][ACOMP]; dst[i][RCOMP] = CHAN_MAX - src[i][ACOMP];
} }
} }


/*
* Do the texture combine.
*/
switch (textureUnit->CombineModeRGB) { switch (textureUnit->CombineModeRGB) {
case GL_REPLACE: case GL_REPLACE:
{ {
break; break;
case GL_DOT3_RGB_EXT: case GL_DOT3_RGB_EXT:
case GL_DOT3_RGBA_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 (*arg0)[4] = (const GLubyte (*)[4]) argRGB[0];
const GLubyte (*arg1)[4] = (const GLubyte (*)[4]) argRGB[1]; const GLubyte (*arg1)[4] = (const GLubyte (*)[4]) argRGB[1];


/* Fix the alpha component for GL_DOT3_RGBA_EXT combining. /* 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++) { for (i = 0; i < n; i++) {
rgba[i][ACOMP] = rgba[i][RCOMP]; rgba[i][ACOMP] = rgba[i][RCOMP];
} }

Loading…
Cancel
Save