summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-02-27 22:18:33 -0700
committerBrian Paul <[email protected]>2009-02-28 09:35:15 -0700
commitbf8a187f71bd667a0dc0f70164a897d8e62361a8 (patch)
treea9304fc17c41a27b53a8df6bc4708355c75f0dda /src/mesa/main
parent559aec47015b741e045d57362f7732b3a04f9450 (diff)
mesa: replace FEEDBACK_TOKEN macro with _mesa_feedback_token() inline function
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/drawpix.c8
-rw-r--r--src/mesa/main/feedback.c31
-rw-r--r--src/mesa/main/feedback.h17
3 files changed, 30 insertions, 26 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index 13cfa0e756e..e9de0c097a0 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -103,7 +103,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
else if (ctx->RenderMode == GL_FEEDBACK) {
/* Feedback the current raster pos info */
FLUSH_CURRENT( ctx, 0 );
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
+ _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
_mesa_feedback_vertex( ctx,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
@@ -166,7 +166,7 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
}
else if (ctx->RenderMode == GL_FEEDBACK) {
FLUSH_CURRENT( ctx, 0 );
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN );
+ _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN );
_mesa_feedback_vertex( ctx,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
@@ -243,7 +243,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
#if _HAVE_FULL_GL
else if (ctx->RenderMode == GL_FEEDBACK) {
FLUSH_CURRENT(ctx, 0);
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN );
+ _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN );
_mesa_feedback_vertex( ctx,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
@@ -311,7 +311,7 @@ _mesa_DrawDepthPixelsMESA( GLsizei width, GLsizei height,
else if (ctx->RenderMode == GL_FEEDBACK) {
/* Feedback the current raster pos info */
FLUSH_CURRENT( ctx, 0 );
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
+ _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
_mesa_feedback_vertex( ctx,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
index 9a62db0be3b..5073ccbef59 100644
--- a/src/mesa/main/feedback.c
+++ b/src/mesa/main/feedback.c
@@ -111,8 +111,8 @@ _mesa_PassThrough( GLfloat token )
if (ctx->RenderMode==GL_FEEDBACK) {
FLUSH_VERTICES(ctx, 0);
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_PASS_THROUGH_TOKEN );
- FEEDBACK_TOKEN( ctx, token );
+ _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_PASS_THROUGH_TOKEN );
+ _mesa_feedback_token( ctx, token );
}
}
@@ -127,31 +127,32 @@ _mesa_feedback_vertex(GLcontext *ctx,
GLfloat index,
const GLfloat texcoord[4])
{
- FEEDBACK_TOKEN( ctx, win[0] );
- FEEDBACK_TOKEN( ctx, win[1] );
+ _mesa_feedback_token( ctx, win[0] );
+ _mesa_feedback_token( ctx, win[1] );
if (ctx->Feedback._Mask & FB_3D) {
- FEEDBACK_TOKEN( ctx, win[2] );
+ _mesa_feedback_token( ctx, win[2] );
}
if (ctx->Feedback._Mask & FB_4D) {
- FEEDBACK_TOKEN( ctx, win[3] );
+ _mesa_feedback_token( ctx, win[3] );
}
if (ctx->Feedback._Mask & FB_INDEX) {
- FEEDBACK_TOKEN( ctx, (GLfloat) index );
+ _mesa_feedback_token( ctx, (GLfloat) index );
}
if (ctx->Feedback._Mask & FB_COLOR) {
- FEEDBACK_TOKEN( ctx, color[0] );
- FEEDBACK_TOKEN( ctx, color[1] );
- FEEDBACK_TOKEN( ctx, color[2] );
- FEEDBACK_TOKEN( ctx, color[3] );
+ _mesa_feedback_token( ctx, color[0] );
+ _mesa_feedback_token( ctx, color[1] );
+ _mesa_feedback_token( ctx, color[2] );
+ _mesa_feedback_token( ctx, color[3] );
}
if (ctx->Feedback._Mask & FB_TEXTURE) {
- FEEDBACK_TOKEN( ctx, texcoord[0] );
- FEEDBACK_TOKEN( ctx, texcoord[1] );
- FEEDBACK_TOKEN( ctx, texcoord[2] );
- FEEDBACK_TOKEN( ctx, texcoord[3] );
+ _mesa_feedback_token( ctx, texcoord[0] );
+ _mesa_feedback_token( ctx, texcoord[1] );
+ _mesa_feedback_token( ctx, texcoord[2] );
+ _mesa_feedback_token( ctx, texcoord[3] );
}
}
+
#endif /* _HAVE_FULL_GL */
diff --git a/src/mesa/main/feedback.h b/src/mesa/main/feedback.h
index c6478b02e10..72c2acd5edd 100644
--- a/src/mesa/main/feedback.h
+++ b/src/mesa/main/feedback.h
@@ -30,13 +30,6 @@
#include "mtypes.h"
-#define FEEDBACK_TOKEN( CTX, T ) \
- if (CTX->Feedback.Count < CTX->Feedback.BufferSize) { \
- CTX->Feedback.Buffer[CTX->Feedback.Count] = (GLfloat) (T); \
- } \
- CTX->Feedback.Count++;
-
-
extern void
_mesa_init_feedback( GLcontext *ctx );
@@ -48,6 +41,16 @@ _mesa_feedback_vertex( GLcontext *ctx,
const GLfloat texcoord[4] );
+static INLINE void
+_mesa_feedback_token( GLcontext *ctx, GLfloat token )
+{
+ if (ctx->Feedback.Count < ctx->Feedback.BufferSize) {
+ ctx->Feedback.Buffer[ctx->Feedback.Count] = token;
+ }
+ ctx->Feedback.Count++;
+}
+
+
extern void
_mesa_update_hitflag( GLcontext *ctx, GLfloat z );