feedback.h revision 4a49301e
17117f1b4Smrg/*
27117f1b4Smrg * Mesa 3-D graphics library
34a49301eSmrg * Version:  7.5
47117f1b4Smrg *
54a49301eSmrg * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
64a49301eSmrg * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
77117f1b4Smrg *
87117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a
97117f1b4Smrg * copy of this software and associated documentation files (the "Software"),
107117f1b4Smrg * to deal in the Software without restriction, including without limitation
117117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
127117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the
137117f1b4Smrg * Software is furnished to do so, subject to the following conditions:
147117f1b4Smrg *
157117f1b4Smrg * The above copyright notice and this permission notice shall be included
167117f1b4Smrg * in all copies or substantial portions of the Software.
177117f1b4Smrg *
187117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
197117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
207117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
217117f1b4Smrg * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
227117f1b4Smrg * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
237117f1b4Smrg * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
247117f1b4Smrg */
257117f1b4Smrg
267117f1b4Smrg#ifndef FEEDBACK_H
277117f1b4Smrg#define FEEDBACK_H
287117f1b4Smrg
297117f1b4Smrg
304a49301eSmrg#include "main/mtypes.h"
314a49301eSmrg
324a49301eSmrg
334a49301eSmrg#if FEATURE_feedback
347117f1b4Smrg
354a49301eSmrg#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) \
364a49301eSmrg   do {                                             \
374a49301eSmrg      (driver)->RenderMode = impl ## RenderMode;    \
384a49301eSmrg   } while (0)
397117f1b4Smrg
404a49301eSmrgextern void
414a49301eSmrg_mesa_feedback_vertex( GLcontext *ctx,
424a49301eSmrg                       const GLfloat win[4],
434a49301eSmrg                       const GLfloat color[4],
444a49301eSmrg                       GLfloat index,
454a49301eSmrg                       const GLfloat texcoord[4] );
467117f1b4Smrg
477117f1b4Smrg
484a49301eSmrgstatic INLINE void
494a49301eSmrg_mesa_feedback_token( GLcontext *ctx, GLfloat token )
504a49301eSmrg{
514a49301eSmrg   if (ctx->Feedback.Count < ctx->Feedback.BufferSize) {
524a49301eSmrg      ctx->Feedback.Buffer[ctx->Feedback.Count] = token;
534a49301eSmrg   }
544a49301eSmrg   ctx->Feedback.Count++;
554a49301eSmrg}
567117f1b4Smrg
577117f1b4Smrg
584a49301eSmrgextern void
594a49301eSmrg_mesa_update_hitflag( GLcontext *ctx, GLfloat z );
607117f1b4Smrg
617117f1b4Smrg
624a49301eSmrgextern void
634a49301eSmrg_mesa_init_feedback_dispatch(struct _glapi_table *disp);
647117f1b4Smrg
654a49301eSmrg#else /* FEATURE_feedback */
667117f1b4Smrg
674a49301eSmrg#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) do { } while (0)
687117f1b4Smrg
694a49301eSmrgstatic INLINE void
704a49301eSmrg_mesa_feedback_vertex( GLcontext *ctx,
714a49301eSmrg                       const GLfloat win[4],
724a49301eSmrg                       const GLfloat color[4],
734a49301eSmrg                       GLfloat index,
744a49301eSmrg                       const GLfloat texcoord[4] )
754a49301eSmrg{
764a49301eSmrg   /* render mode is always GL_RENDER */
774a49301eSmrg   ASSERT_NO_FEATURE();
784a49301eSmrg}
797117f1b4Smrg
807117f1b4Smrg
814a49301eSmrgstatic INLINE void
824a49301eSmrg_mesa_feedback_token( GLcontext *ctx, GLfloat token )
834a49301eSmrg{
844a49301eSmrg   /* render mode is always GL_RENDER */
854a49301eSmrg   ASSERT_NO_FEATURE();
864a49301eSmrg}
877117f1b4Smrg
884a49301eSmrgstatic INLINE void
894a49301eSmrg_mesa_update_hitflag( GLcontext *ctx, GLfloat z )
904a49301eSmrg{
914a49301eSmrg   /* render mode is always GL_RENDER */
924a49301eSmrg   ASSERT_NO_FEATURE();
934a49301eSmrg}
947117f1b4Smrg
954a49301eSmrgstatic INLINE void
964a49301eSmrg_mesa_init_feedback_dispatch(struct _glapi_table *disp)
974a49301eSmrg{
984a49301eSmrg}
997117f1b4Smrg
1004a49301eSmrg#endif /* FEATURE_feedback */
1017117f1b4Smrg
1024a49301eSmrgextern void
1034a49301eSmrg_mesa_init_feedback( GLcontext *ctx );
1047117f1b4Smrg
1054a49301eSmrg#endif /* FEEDBACK_H */
106