#include "dlist.h"
#include "macros.h"
#include "matrix.h"
+#include "occlude.h"
#include "pixel.h"
#include "points.h"
#include "polygon.h"
/* GL_ARB_vertex/fragment_program */
OPCODE_PROGRAM_STRING_ARB,
OPCODE_PROGRAM_ENV_PARAMETER_ARB,
-
+ /* GL_ARB_occlusion_query */
+ OPCODE_BEGIN_QUERY_ARB,
+ OPCODE_END_QUERY_ARB,
/* Vertex attributes -- fallback for when optimized display
* list build isn't active.
InstSize[OPCODE_PROGRAM_STRING_ARB] = 5;
InstSize[OPCODE_PROGRAM_ENV_PARAMETER_ARB] = 7;
#endif
+#if FEATURE_ARB_occlusion_query
+ InstSize[OPCODE_BEGIN_QUERY_ARB] = 3;
+ InstSize[OPCODE_END_QUERY_ARB] = 2;
+#endif
InstSize[OPCODE_ATTR_1F] = 3;
InstSize[OPCODE_ATTR_2F] = 4;
InstSize[OPCODE_ATTR_3F] = 5;
#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
+#ifdef FEATURE_ARB_occlusion_query
+
+static void GLAPIENTRY
+save_BeginQueryARB(GLenum target, GLuint id)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_BEGIN_QUERY_ARB, 2 );
+ if (n) {
+ n[1].e = target;
+ n[2].ui = id;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->BeginQueryARB)( target, id );
+ }
+}
+
+
+static void GLAPIENTRY
+save_EndQueryARB(GLenum target)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_END_QUERY_ARB, 1 );
+ if (n) {
+ n[1].e = target;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->EndQueryARB)( target );
+ }
+}
+
+#endif /* FEATURE_ARB_occlusion_query */
+
static void save_Attr1f( GLenum attr, GLfloat x )
n[4].f, n[5].f, n[6].f);
break;
#endif
-
+#if FEATURE_ARB_occlusion_query
+ case OPCODE_BEGIN_QUERY_ARB:
+ ctx->Exec->BeginQueryARB(n[1].e, n[2].ui);
+ break;
+ case OPCODE_END_QUERY_ARB:
+ ctx->Exec->EndQueryARB(n[1].e);
+ break;
+#endif
case OPCODE_ATTR_1F:
(*ctx->Exec->VertexAttrib1fNV)(n[1].e, n[2].f);
break;
table->UnmapBufferARB = _mesa_UnmapBufferARB;
#endif
+#if FEATURE_ARB_occlusion_query
+ table->BeginQueryARB = save_BeginQueryARB;
+ table->EndQueryARB = save_EndQueryARB;
+ table->GenQueriesARB = _mesa_GenQueriesARB;
+ table->DeleteQueriesARB = _mesa_DeleteQueriesARB;
+ table->IsQueryARB = _mesa_IsQueryARB;
+ table->GetQueryivARB = _mesa_GetQueryivARB;
+ table->GetQueryObjectivARB = _mesa_GetQueryObjectivARB;
+ table->GetQueryObjectuivARB = _mesa_GetQueryObjectuivARB;
+#endif
+
/* 299. GL_EXT_blend_equation_separate */
table->BlendEquationSeparateEXT = save_BlendEquationSeparateEXT;
}