diff options
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_feedback.c | 7 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index 537a58f39d..f0c6bf6185 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -293,6 +293,13 @@ st_RenderMode(GLcontext *ctx, GLenum newMode ) draw_set_rasterize_stage(draw, st->selection_stage); /* Plug in new vbo draw function */ vbo->draw_prims = st_feedback_draw_vbo; + /* setup post-transform vertex attribs */ + { + /* just emit pos as GLfloat[4] */ + static const uint attrs[1] = { FORMAT_4F }; + const interp_mode *interp = NULL; + draw_set_vertex_attributes(draw, attrs, interp, 1); + } } else { if (!st->feedback_stage) diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 640fa8263e..7fcc4d8e65 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -336,6 +336,7 @@ st_feedback_draw_vbo(GLcontext *ctx, struct pipe_buffer_handle *index_buffer_handle = 0; struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS]; GLuint attr, i; + ubyte *mapped_constants; assert(ctx->RenderMode == GL_SELECT || ctx->RenderMode == GL_FEEDBACK); @@ -439,6 +440,17 @@ st_feedback_draw_vbo(GLcontext *ctx, PIPE_BUFFER_FLAG_READ); draw_set_mapped_element_buffer(draw, indexSize, map); } + else { + /* no index/element buffer */ + draw_set_mapped_element_buffer(draw, 0, NULL); + } + + + /* map constant buffers */ + mapped_constants = winsys->buffer_map(winsys, + st->state.constants[PIPE_SHADER_VERTEX].buffer, + PIPE_BUFFER_FLAG_READ); + draw_set_mapped_constant_buffer(st->draw, mapped_constants); /* draw here */ @@ -447,6 +459,9 @@ st_feedback_draw_vbo(GLcontext *ctx, } + /* unmap constant buffers */ + winsys->buffer_unmap(winsys, st->state.constants[PIPE_SHADER_VERTEX].buffer); + /* * unmap vertex/index buffers */ |