{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_env_add", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
- { "GL_HP_occlusion_test", NULL },
{ "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions },
#ifdef need_GL_ARB_point_parameters
}
-
-/*
- * Return the current value of the occlusion test flag and
- * reset the flag (hardware counters) to false.
- */
-static GLboolean get_occlusion_result( GLcontext *ctx )
-{
- tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
- GLboolean result;
-
- LOCK_HARDWARE( fxMesa );
- fxMesa->Glide.grFinish(); /* required to flush the FIFO - FB 21-01-2002 */
-
- if (ctx->Depth.OcclusionTest) {
- if (ctx->OcclusionResult) {
- result = GL_TRUE; /* result of software rendering */
- }
- else {
- FxI32 zfail, in;
- fxMesa->Glide.grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, 4, &zfail);
- fxMesa->Glide.grGet(GR_STATS_PIXELS_IN, 4, &in);
- /* Geometry is occluded if there is no input (in == 0) */
- /* or if all pixels failed the depth test (zfail == in) */
- /* The < 1 is there because I have empirically seen cases where */
- /* zfail > in.... go figure. FB - 21-01-2002. */
- result = ((in - zfail) < 1 || in == 0) ? GL_FALSE : GL_TRUE;
- }
- }
- else {
- result = ctx->OcclusionResultSaved;
- }
-
- /* reset results now */
- fxMesa->Glide.grReset(GR_STATS_PIXELS);
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
-
- UNLOCK_HARDWARE( fxMesa );
-
- return result;
-}
-
-
-/*
- * We're only implementing this function to handle the
- * GL_OCCLUSTION_TEST_RESULT_HP case. It's special because it
- * has a side-effect: resetting the occlustion result flag.
- */
-static GLboolean tdfxDDGetBooleanv( GLcontext *ctx, GLenum pname,
- GLboolean *result )
-{
- if ( pname == GL_OCCLUSION_TEST_RESULT_HP ) {
- *result = get_occlusion_result( ctx );
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-static GLboolean tdfxDDGetDoublev( GLcontext *ctx, GLenum pname,
- GLdouble *result )
-{
- if ( pname == GL_OCCLUSION_TEST_RESULT_HP ) {
- *result = (GLdouble) get_occlusion_result( ctx );
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-static GLboolean tdfxDDGetFloatv( GLcontext *ctx, GLenum pname,
- GLfloat *result )
-{
- if ( pname == GL_OCCLUSION_TEST_RESULT_HP ) {
- *result = (GLfloat) get_occlusion_result( ctx );
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-static GLboolean tdfxDDGetIntegerv( GLcontext *ctx, GLenum pname,
- GLint *result )
-{
- if ( pname == GL_OCCLUSION_TEST_RESULT_HP ) {
- *result = (GLint) get_occlusion_result( ctx );
- return GL_TRUE;
- }
- return GL_FALSE;
-}
-
-
-
#define VISUAL_EQUALS_RGBA(vis, r, g, b, a) \
((vis->redBits == r) && \
(vis->greenBits == g) && \
{
functions->ReadPixels = tdfx_readpixels_R5G6B5;
}
-
- functions->GetBooleanv = tdfxDDGetBooleanv;
- functions->GetDoublev = tdfxDDGetDoublev;
- functions->GetFloatv = tdfxDDGetFloatv;
- functions->GetIntegerv = tdfxDDGetIntegerv;
}
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
_mesa_ClearDepth(depth->Clear);
_mesa_set_enable(ctx, GL_DEPTH_TEST, depth->Test);
_mesa_DepthMask(depth->Mask);
- if (ctx->Extensions.HP_occlusion_test)
- _mesa_set_enable(ctx, GL_OCCLUSION_TEST_HP,
- depth->OcclusionTest);
}
break;
case GL_ENABLE_BIT:
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
ctx->Depth.Clear = 1.0;
ctx->Depth.Func = GL_LESS;
ctx->Depth.Mask = GL_TRUE;
- ctx->Depth.OcclusionTest = GL_FALSE;
/* XXX this is now per-framebuffer state */
#if 00
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
x = IROUND(ctx->Current.RasterPos[0]);
y = IROUND(ctx->Current.RasterPos[1]);
- ctx->OcclusionResult = GL_TRUE;
ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
&ctx->Unpack, pixels);
}
destx = IROUND(ctx->Current.RasterPos[0]);
desty = IROUND(ctx->Current.RasterPos[1]);
- ctx->OcclusionResult = GL_TRUE;
-
ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
type );
}
_mesa_update_state(ctx);
}
- ctx->OcclusionResult = GL_TRUE;
ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap );
}
#if _HAVE_FULL_GL
x = IROUND(ctx->Current.RasterPos[0]);
y = IROUND(ctx->Current.RasterPos[1]);
- ctx->OcclusionResult = GL_TRUE;
ctx->Driver.DrawDepthPixelsMESA(ctx, x, y, width, height,
colorFormat, colorType, colors,
depthType, depths, &ctx->Unpack);
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
client_state( ctx, cap, state );
return;
- /* GL_HP_occlusion_test */
- case GL_OCCLUSION_TEST_HP:
- CHECK_EXTENSION(HP_occlusion_test, cap);
- if (ctx->Depth.OcclusionTest == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- ctx->Depth.OcclusionTest = state;
- if (state)
- ctx->OcclusionResult = ctx->OcclusionResultSaved;
- else
- ctx->OcclusionResultSaved = ctx->OcclusionResult;
- break;
-
/* GL_SGIS_pixel_texture */
case GL_PIXEL_TEXTURE_SGIS:
CHECK_EXTENSION(SGIS_pixel_texture, cap);
CHECK_EXTENSION(EXT_histogram);
return ctx->Pixel.MinMaxEnabled;
- /* GL_HP_occlusion_test */
- case GL_OCCLUSION_TEST_HP:
- CHECK_EXTENSION(HP_occlusion_test);
- return ctx->Depth.OcclusionTest;
-
/* GL_SGIS_pixel_texture */
case GL_PIXEL_TEXTURE_SGIS:
CHECK_EXTENSION(SGIS_pixel_texture);
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
{ OFF, "GL_ATI_texture_env_combine3", F(ATI_texture_env_combine3)},
{ OFF, "GL_ATI_texture_mirror_once", F(ATI_texture_mirror_once)},
{ OFF, "GL_ATI_fragment_shader", F(ATI_fragment_shader)},
- { OFF, "GL_HP_occlusion_test", F(HP_occlusion_test) },
{ OFF, "GL_IBM_multimode_draw_arrays", F(IBM_multimode_draw_arrays) },
{ ON, "GL_IBM_rasterpos_clip", F(IBM_rasterpos_clip) },
{ OFF, "GL_IBM_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)},
ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
- ctx->Extensions.HP_occlusion_test = GL_TRUE;
ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;
ctx->Extensions.MESA_pack_invert = GL_TRUE;
#if FEATURE_MESA_program_debug
params[15] = FLOAT_TO_BOOLEAN(matrix[15]);
}
break;
- case GL_OCCLUSION_TEST_HP:
- CHECK_EXTENSION_B(HP_occlusion_test, pname);
- params[0] = ctx->Depth.OcclusionTest;
- break;
- case GL_OCCLUSION_TEST_RESULT_HP:
- CHECK_EXTENSION_B(HP_occlusion_test, pname);
- {
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- if (ctx->Depth.OcclusionTest)
- params[0] = ctx->OcclusionResult;
- else
- params[0] = ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- return;
- }
- break;
case GL_PIXEL_TEXTURE_SGIS:
CHECK_EXTENSION_B(SGIS_pixel_texture, pname);
params[0] = ctx->Pixel.PixelTextureEnabled;
params[15] = matrix[15];
}
break;
- case GL_OCCLUSION_TEST_HP:
- CHECK_EXTENSION_F(HP_occlusion_test, pname);
- params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.OcclusionTest);
- break;
- case GL_OCCLUSION_TEST_RESULT_HP:
- CHECK_EXTENSION_F(HP_occlusion_test, pname);
- {
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- if (ctx->Depth.OcclusionTest)
- params[0] = ctx->OcclusionResult;
- else
- params[0] = ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- return;
- }
- break;
case GL_PIXEL_TEXTURE_SGIS:
CHECK_EXTENSION_F(SGIS_pixel_texture, pname);
params[0] = BOOLEAN_TO_FLOAT(ctx->Pixel.PixelTextureEnabled);
params[15] = IROUND(matrix[15]);
}
break;
- case GL_OCCLUSION_TEST_HP:
- CHECK_EXTENSION_I(HP_occlusion_test, pname);
- params[0] = BOOLEAN_TO_INT(ctx->Depth.OcclusionTest);
- break;
- case GL_OCCLUSION_TEST_RESULT_HP:
- CHECK_EXTENSION_I(HP_occlusion_test, pname);
- {
- FLUSH_VERTICES(ctx, _NEW_DEPTH);
- if (ctx->Depth.OcclusionTest)
- params[0] = ctx->OcclusionResult;
- else
- params[0] = ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- return;
- }
- break;
case GL_PIXEL_TEXTURE_SGIS:
CHECK_EXTENSION_I(SGIS_pixel_texture, pname);
params[0] = BOOLEAN_TO_INT(ctx->Pixel.PixelTextureEnabled);
"matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"],
"const GLfloat *matrix = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Top->m;", None ),
- # GL_HP_occlusion_test
- ( "GL_OCCLUSION_TEST_HP", GLboolean, ["ctx->Depth.OcclusionTest"], "",
- "HP_occlusion_test" ),
- ( "GL_OCCLUSION_TEST_RESULT_HP", GLboolean, [],
- """FLUSH_VERTICES(ctx, _NEW_DEPTH);
- if (ctx->Depth.OcclusionTest)
- params[0] = ctx->OcclusionResult;
- else
- params[0] = ctx->OcclusionResultSaved;
- /* reset flag now */
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
- return;""",
- "HP_occlusion_test" ),
-
# GL_SGIS_pixel_texture
( "GL_PIXEL_TEXTURE_SGIS", GLboolean, ["ctx->Pixel.PixelTextureEnabled"],
"", "SGIS_pixel_texture" ),
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
GLclampd Clear; /**< Value to clear depth buffer to */
GLboolean Test; /**< Depth buffering enabled flag */
GLboolean Mask; /**< Depth buffer writable? */
- GLboolean OcclusionTest; /**< GL_HP_occlusion_test */
GLboolean BoundsTest; /**< GL_EXT_depth_bounds_test */
GLfloat BoundsMin, BoundsMax;/**< GL_EXT_depth_bounds_test */
};
GLboolean ATI_texture_mirror_once;
GLboolean ATI_texture_env_combine3;
GLboolean ATI_fragment_shader;
- GLboolean HP_occlusion_test;
GLboolean IBM_rasterpos_clip;
GLboolean IBM_multimode_draw_arrays;
GLboolean MESA_pack_invert;
struct gl_list_extensions ListExt; /**< driver dlist extensions */
- GLboolean OcclusionResult; /**< for GL_HP_occlusion_test */
- GLboolean OcclusionResultSaved; /**< for GL_HP_occlusion_test */
GLuint _Facing; /**< This is a hack for 2-sided stencil test.
*
* We don't have a better way to communicate this value from
/*
* Mesa 3-D graphics library
- * Version: 6.0.2
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#if FEATURE_ARB_occlusion_query
ctx->Occlusion.QueryObjects = _mesa_NewHashTable();
#endif
- ctx->OcclusionResult = GL_FALSE;
- ctx->OcclusionResultSaved = GL_FALSE;
}
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
ltor = (GLboolean) (area < 0.0F);
}
-#ifndef DO_OCCLUSION_TEST
- ctx->OcclusionResult = GL_TRUE;
-#endif
-
/* Plane equation setup:
* We evaluate plane equations at window (x,y) coordinates in order
* to compute color, Z, fog, texcoords, etc. This isn't terribly
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
rasterMask |= CLIP_BIT;
}
- if (ctx->Depth.OcclusionTest || ctx->Occlusion.Active)
+ if (ctx->Occlusion.Active)
rasterMask |= OCCLUSION_BIT;
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
}
}
- /* if we get here, something passed the depth test */
- if (ctx->Depth.OcclusionTest) {
- ctx->OcclusionResult = GL_TRUE;
- }
-
#if FEATURE_ARB_occlusion_query
if (ctx->Occlusion.Active) {
/* update count of 'passed' fragments */
}
}
- /* if we get here, some fragments passed the depth test */
- if (ctx->Depth.OcclusionTest) {
- ctx->OcclusionResult = GL_TRUE;
- }
-
#if FEATURE_ARB_occlusion_query
if (ctx->Occlusion.Active) {
/* update count of 'passed' fragments */
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
ASSERT(ctx->Depth.Test); \
ASSERT(!ctx->Depth.Mask); \
ASSERT(ctx->Depth.Func == GL_LESS); \
- if (ctx->OcclusionResult && !ctx->Occlusion.Active) { \
+ if (!ctx->Occlusion.Active) { \
return; \
}
#define RENDER_SPAN( span ) \
for (i = 0; i < span.end; i++) { \
GLdepth z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
- ctx->OcclusionResult = GL_TRUE; \
ctx->Occlusion.PassedCounter++; \
} \
span.z += span.zStep; \
rb->GetPointer(ctx, rb, span.x, span.y); \
for (i = 0; i < span.end; i++) { \
if ((GLuint)span.z < zRow[i]) { \
- ctx->OcclusionResult = GL_TRUE; \
ctx->Occlusion.PassedCounter++; \
} \
span.z += span.zStep; \
}
/* special case for occlusion testing */
- if ((ctx->Depth.OcclusionTest || ctx->Occlusion.Active) &&
+ if (ctx->Occlusion.Active &&
ctx->Depth.Test &&
ctx->Depth.Mask == GL_FALSE &&
ctx->Depth.Func == GL_LESS &&
-
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.5
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#define TAG(x) clip_##x##_verts
#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
-#define RESET_OCCLUSION ctx->OcclusionResult = GL_TRUE
#define PRESERVE_VB_DEFS
#include "t_vb_rendertmp.h"
(void) elt; (void) stipple
#define RESET_STIPPLE if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
-#define RESET_OCCLUSION ctx->OcclusionResult = GL_TRUE
#define INIT(x) tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RENDER_TAB_QUALIFIER
#define PRESERVE_VB_DEFS
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 6.5
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#define RESET_STIPPLE
#endif
-#ifndef RESET_OCCLUSION
-#define RESET_OCCLUSION
-#endif
-
#ifndef TEST_PRIM_END
#define TEST_PRIM_END(flags) (flags & PRIM_END)
#define TEST_PRIM_BEGIN(flags) (flags & PRIM_BEGIN)
LOCAL_VARS;
(void) flags;
- RESET_OCCLUSION;
INIT(GL_POINTS);
RENDER_POINTS( start, count );
POSTFIX;
LOCAL_VARS;
(void) flags;
- RESET_OCCLUSION;
INIT(GL_LINES);
for (j=start+1; j<count; j+=2 ) {
RESET_STIPPLE;
LOCAL_VARS;
(void) flags;
- RESET_OCCLUSION;
INIT(GL_LINE_STRIP);
if (TEST_PRIM_BEGIN(flags)) {
(void) flags;
- RESET_OCCLUSION;
INIT(GL_LINE_LOOP);
if (start+1 < count) {