X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_cb_feedback.c;h=31744151f1d84759249e1d7c6527fd65b198148e;hb=f3aa4de034b0d791ce2e38e8aeb3b3abdb4e3b50;hp=923e1cdb893ce9b76d5f03b4aae14920a9045f45;hpb=0585b4e746f35efbc8577311eab6679951217ac3;p=mesa.git diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index 923e1cdb893..31744151f1d 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -43,7 +43,6 @@ #include "main/macros.h" #include "vbo/vbo.h" -#include "vbo/vbo_context.h" #include "st_context.h" #include "st_atom.h" @@ -55,7 +54,6 @@ #include "pipe/p_defines.h" #include "pipe/p_winsys.h" #include "pipe/cso_cache/cso_cache.h" -#include "vf/vf.h" #include "pipe/draw/draw_context.h" #include "pipe/draw/draw_private.h" @@ -105,13 +103,13 @@ feedback_vertex(GLcontext *ctx, const struct draw_context *draw, */ slot = st->vertex_result_to_slot[VERT_RESULT_COL0]; - if (slot != ~0) + if (slot != ~0U) color = v->data[slot]; else color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; slot = st->vertex_result_to_slot[VERT_RESULT_TEX0]; - if (slot != ~0) + if (slot != ~0U) texcoord = v->data[slot]; else texcoord = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; @@ -161,14 +159,7 @@ feedback_point( struct draw_stage *stage, struct prim_header *prim ) static void -feedback_end( struct draw_stage *stage ) -{ - /* no-op */ -} - - -static void -feedback_begin( struct draw_stage *stage ) +feedback_flush( struct draw_stage *stage, unsigned flags ) { /* no-op */ } @@ -192,11 +183,10 @@ draw_glfeedback_stage(GLcontext *ctx, struct draw_context *draw) fs->stage.draw = draw; fs->stage.next = NULL; - fs->stage.begin = feedback_begin; fs->stage.point = feedback_point; fs->stage.line = feedback_line; fs->stage.tri = feedback_tri; - fs->stage.end = feedback_end; + fs->stage.flush = feedback_flush; fs->stage.reset_stipple_counter = feedback_reset_stipple_counter; fs->ctx = ctx; @@ -236,14 +226,7 @@ select_point( struct draw_stage *stage, struct prim_header *prim ) static void -select_begin( struct draw_stage *stage ) -{ - /* no-op */ -} - - -static void -select_end( struct draw_stage *stage ) +select_flush( struct draw_stage *stage, unsigned flags ) { /* no-op */ } @@ -266,11 +249,10 @@ draw_glselect_stage(GLcontext *ctx, struct draw_context *draw) fs->stage.draw = draw; fs->stage.next = NULL; - fs->stage.begin = select_begin; fs->stage.point = select_point; fs->stage.line = select_line; fs->stage.tri = select_tri; - fs->stage.end = select_end; + fs->stage.flush = select_flush; fs->stage.reset_stipple_counter = select_reset_stipple_counter; fs->ctx = ctx; @@ -282,26 +264,25 @@ static void st_RenderMode(GLcontext *ctx, GLenum newMode ) { struct st_context *st = ctx->st; - struct vbo_context *vbo = (struct vbo_context *) ctx->swtnl_im; struct draw_context *draw = st->draw; if (newMode == GL_RENDER) { /* restore normal VBO draw function */ - vbo->draw_prims = st_draw_vbo; + vbo_set_draw_func(ctx, st_draw_vbo); } else if (newMode == GL_SELECT) { if (!st->selection_stage) st->selection_stage = draw_glselect_stage(ctx, draw); draw_set_rasterize_stage(draw, st->selection_stage); /* Plug in new vbo draw function */ - vbo->draw_prims = st_feedback_draw_vbo; + vbo_set_draw_func(ctx, st_feedback_draw_vbo); } else { if (!st->feedback_stage) st->feedback_stage = draw_glfeedback_stage(ctx, draw); draw_set_rasterize_stage(draw, st->feedback_stage); /* Plug in new vbo draw function */ - vbo->draw_prims = st_feedback_draw_vbo; + vbo_set_draw_func(ctx, st_feedback_draw_vbo); /* need to generate/use a vertex program that emits pos/color/tex */ st->dirty.st |= ST_NEW_VERTEX_PROGRAM; }