summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_bitmap.c10
-rw-r--r--src/mesa/state_tracker/st_draw.c34
2 files changed, 33 insertions, 11 deletions
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index 3a102df67f1..593938f8cf5 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -567,8 +567,9 @@ void
st_flush_bitmap_cache(struct st_context *st)
{
if (!st->bitmap.cache->empty) {
+ struct bitmap_cache *cache = st->bitmap.cache;
+
if (st->ctx->DrawBuffer) {
- struct bitmap_cache *cache = st->bitmap.cache;
struct pipe_context *pipe = st->pipe;
struct pipe_screen *screen = pipe->screen;
@@ -592,10 +593,11 @@ st_flush_bitmap_cache(struct st_context *st)
st->ctx->Current.RasterPos[2],
BITMAP_CACHE_WIDTH, BITMAP_CACHE_HEIGHT,
cache->texture);
-
- /* release/free the texture */
- pipe_texture_reference(&cache->texture, NULL);
}
+
+ /* release/free the texture */
+ pipe_texture_reference(&cache->texture, NULL);
+
reset_cache(st);
}
}
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index a3bffbfc95b..5300848ef6a 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -365,14 +365,33 @@ st_draw_vbo(GLcontext *ctx,
}
/* draw */
- for (i = 0; i < nr_prims; i++) {
+ if (nr_prims == 1 && pipe->draw_range_elements != NULL) {
+ i = 0;
+
+ /* XXX: exercise temporary path to pass min/max directly
+ * through to driver & draw module. These interfaces still
+ * need a bit of work...
+ */
setup_edgeflags(ctx, prims[i].mode,
prims[i].start + indexOffset, prims[i].count,
arrays[VERT_ATTRIB_EDGEFLAG]);
- pipe->draw_elements(pipe, indexBuf, indexSize,
- prims[i].mode,
- prims[i].start + indexOffset, prims[i].count);
+ pipe->draw_range_elements(pipe, indexBuf, indexSize,
+ min_index,
+ max_index,
+ prims[i].mode,
+ prims[i].start + indexOffset, prims[i].count);
+ }
+ else {
+ for (i = 0; i < nr_prims; i++) {
+ setup_edgeflags(ctx, prims[i].mode,
+ prims[i].start + indexOffset, prims[i].count,
+ arrays[VERT_ATTRIB_EDGEFLAG]);
+
+ pipe->draw_elements(pipe, indexBuf, indexSize,
+ prims[i].mode,
+ prims[i].start + indexOffset, prims[i].count);
+ }
}
pipe_reference_buffer(pipe, &indexBuf, NULL);
@@ -577,9 +596,10 @@ st_feedback_draw_vbo(GLcontext *ctx,
/* map constant buffers */
mapped_constants = pipe_buffer_map(pipe,
- st->state.constants[PIPE_SHADER_VERTEX].buffer,
- PIPE_BUFFER_USAGE_CPU_READ);
- draw_set_mapped_constant_buffer(st->draw, mapped_constants);
+ st->state.constants[PIPE_SHADER_VERTEX].buffer,
+ PIPE_BUFFER_USAGE_CPU_READ);
+ draw_set_mapped_constant_buffer(st->draw, mapped_constants,
+ st->state.constants[PIPE_SHADER_VERTEX].buffer->size);
/* draw here */