summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-01-14 19:12:46 -0700
committerBrian <[email protected]>2008-01-14 19:13:34 -0700
commitac95fee4fffee77bb7bd798d094ed2e3a7c4019b (patch)
treedb6569f204ba1414d11c7bf4be8b47dafb7c2b0c /src/mesa/state_tracker/st_draw.c
parentb4e4fafb4157d416077e985c03204ed5bbe0f2e1 (diff)
Fix problems with vertex shaders and the private draw module.
The CSO returned by pipe->create_vs_state() can't be passed to the private draw module. That was causing glRasterPos to blow up. Add a 'draw_shader' field to st_vertex_program for use with the private draw module. Change st_context->state.vs type from cso_vertex_shader to st_vertex_program.
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r--src/mesa/state_tracker/st_draw.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 96db9e3c03b..94b3a9531a8 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -241,7 +241,7 @@ st_draw_vbo(GLcontext *ctx,
/* must get these after state validation! */
vp = ctx->st->vp;
- vs = &ctx->st->state.vs->state;
+ vs = &ctx->st->state.vs->cso->state;
/* loop over TGSI shader inputs to determine vertex buffer
* and attribute info
@@ -447,7 +447,7 @@ set_feedback_vertex_format(GLcontext *ctx)
else {
/* GL_FEEDBACK, or glRasterPos */
/* emit all attribs (pos, color, texcoord) as GLfloat[4] */
- vinfo.num_attribs = st->state.vs->state.num_outputs;
+ vinfo.num_attribs = st->state.vs->cso->state.num_outputs;
for (i = 0; i < vinfo.num_attribs; i++) {
vinfo.format[i] = FORMAT_4F;
vinfo.interp_mode[i] = INTERP_LINEAR;
@@ -491,7 +491,11 @@ st_feedback_draw_vbo(GLcontext *ctx,
/* must get these after state validation! */
vp = ctx->st->vp;
- vs = &ctx->st->state.vs->state;
+ vs = &ctx->st->state.vs->cso->state;
+
+ if (!st->state.vs->draw_shader) {
+ st->state.vs->draw_shader = draw_create_vertex_shader(draw, vs);
+ }
/*
* Set up the draw module's state.
@@ -503,7 +507,7 @@ st_feedback_draw_vbo(GLcontext *ctx,
draw_set_viewport_state(draw, &st->state.viewport);
draw_set_clip_state(draw, &st->state.clip);
draw_set_rasterizer_state(draw, &st->state.rasterizer->state);
- draw_bind_vertex_shader(draw, st->state.vs->data);
+ draw_bind_vertex_shader(draw, st->state.vs->draw_shader);
set_feedback_vertex_format(ctx);
/* loop over TGSI shader inputs to determine vertex buffer