X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_cb_feedback.c;h=9b85a39beddf62ca0e94d9caf020f48620ce05d4;hb=9c1b41879aab2ff7386c547a2ccce7686c018cf5;hp=19021411cfc9ec9fc6581d6c4cd2400ad3768d84;hpb=a22d865f93a1db7f72e0bfe216810f67bf4c2f2c;p=mesa.git diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index 19021411cfc..9b85a39bedd 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -40,32 +40,30 @@ #include "main/imports.h" #include "main/context.h" #include "main/feedback.h" -#include "main/macros.h" +#include "main/mfeatures.h" #include "vbo/vbo.h" #include "st_context.h" -#include "st_atom.h" #include "st_draw.h" #include "st_cb_feedback.h" -#include "st_cb_bufferobjects.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_winsys.h" -#include "cso_cache/cso_cache.h" #include "draw/draw_context.h" #include "draw/draw_pipe.h" +#if FEATURE_feedback + /** * This is actually used for both feedback and selection. */ struct feedback_stage { struct draw_stage stage; /**< Base class */ - GLcontext *ctx; /**< Rendering context */ + struct gl_context *ctx; /**< Rendering context */ GLboolean reset_stipple_counter; }; @@ -82,13 +80,12 @@ feedback_stage( struct draw_stage *stage ) static void -feedback_vertex(GLcontext *ctx, const struct draw_context *draw, +feedback_vertex(struct gl_context *ctx, const struct draw_context *draw, const struct vertex_header *v) { - const struct st_context *st = ctx->st; + const struct st_context *st = st_context(ctx); GLfloat win[4]; const GLfloat *color, *texcoord; - const GLfloat ci = 0; GLuint slot; /* Recall that Y=0=Top of window for Gallium wincoords */ @@ -114,7 +111,7 @@ feedback_vertex(GLcontext *ctx, const struct draw_context *draw, else texcoord = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - _mesa_feedback_vertex(ctx, win, color, ci, texcoord); + _mesa_feedback_vertex(ctx, win, color, texcoord); } @@ -123,8 +120,8 @@ feedback_tri( struct draw_stage *stage, struct prim_header *prim ) { struct feedback_stage *fs = feedback_stage(stage); struct draw_context *draw = stage->draw; - FEEDBACK_TOKEN(fs->ctx, (GLfloat) GL_POLYGON_TOKEN); - FEEDBACK_TOKEN(fs->ctx, (GLfloat) 3); /* three vertices */ + _mesa_feedback_token(fs->ctx, (GLfloat) GL_POLYGON_TOKEN); + _mesa_feedback_token(fs->ctx, (GLfloat) 3); /* three vertices */ feedback_vertex(fs->ctx, draw, prim->v[0]); feedback_vertex(fs->ctx, draw, prim->v[1]); feedback_vertex(fs->ctx, draw, prim->v[2]); @@ -137,11 +134,11 @@ feedback_line( struct draw_stage *stage, struct prim_header *prim ) struct feedback_stage *fs = feedback_stage(stage); struct draw_context *draw = stage->draw; if (fs->reset_stipple_counter) { - FEEDBACK_TOKEN(fs->ctx, (GLfloat) GL_LINE_RESET_TOKEN); + _mesa_feedback_token(fs->ctx, (GLfloat) GL_LINE_RESET_TOKEN); fs->reset_stipple_counter = GL_FALSE; } else { - FEEDBACK_TOKEN(fs->ctx, (GLfloat) GL_LINE_TOKEN); + _mesa_feedback_token(fs->ctx, (GLfloat) GL_LINE_TOKEN); } feedback_vertex(fs->ctx, draw, prim->v[0]); feedback_vertex(fs->ctx, draw, prim->v[1]); @@ -153,7 +150,7 @@ feedback_point( struct draw_stage *stage, struct prim_header *prim ) { struct feedback_stage *fs = feedback_stage(stage); struct draw_context *draw = stage->draw; - FEEDBACK_TOKEN(fs->ctx, (GLfloat) GL_POINT_TOKEN); + _mesa_feedback_token(fs->ctx, (GLfloat) GL_POINT_TOKEN); feedback_vertex(fs->ctx, draw, prim->v[0]); } @@ -183,9 +180,9 @@ feedback_destroy( struct draw_stage *stage ) * Create GL feedback drawing stage. */ static struct draw_stage * -draw_glfeedback_stage(GLcontext *ctx, struct draw_context *draw) +draw_glfeedback_stage(struct gl_context *ctx, struct draw_context *draw) { - struct feedback_stage *fs = CALLOC_STRUCT(feedback_stage); + struct feedback_stage *fs = ST_CALLOC_STRUCT(feedback_stage); fs->stage.draw = draw; fs->stage.next = NULL; @@ -256,9 +253,9 @@ select_destroy( struct draw_stage *stage ) * Create GL selection mode drawing stage. */ static struct draw_stage * -draw_glselect_stage(GLcontext *ctx, struct draw_context *draw) +draw_glselect_stage(struct gl_context *ctx, struct draw_context *draw) { - struct feedback_stage *fs = CALLOC_STRUCT(feedback_stage); + struct feedback_stage *fs = ST_CALLOC_STRUCT(feedback_stage); fs->stage.draw = draw; fs->stage.next = NULL; @@ -275,9 +272,9 @@ draw_glselect_stage(GLcontext *ctx, struct draw_context *draw) static void -st_RenderMode(GLcontext *ctx, GLenum newMode ) +st_RenderMode(struct gl_context *ctx, GLenum newMode ) { - struct st_context *st = ctx->st; + struct st_context *st = st_context(ctx); struct draw_context *draw = st->draw; if (newMode == GL_RENDER) { @@ -308,3 +305,5 @@ void st_init_feedback_functions(struct dd_function_table *functions) { functions->RenderMode = st_RenderMode; } + +#endif /* FEATURE_feedback */