summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2008-05-30 13:46:18 +0200
committerJakob Bornecrantz <[email protected]>2008-05-30 13:46:18 +0200
commit3869c3c87a40d9f41414082ad8dd3d747e6b34d8 (patch)
tree04d493660504d59b7e2d3c8b2a5178b3865b84ec /src/mesa
parent2ade5268dca67a73d3f5f8cc41ea86d1e48de9f0 (diff)
parent012c0dd6321e858af22389f98201c8dcb8f8780c (diff)
Merge branch 'gallium-tex-surfaces' into gallium-0.1
Conflicts: src/gallium/drivers/i915simple/i915_context.h
Diffstat (limited to 'src/mesa')
-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 */