summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.c')
-rw-r--r--src/gallium/drivers/r300/r300_context.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 15d1278c3bb..934871f6553 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -80,6 +80,7 @@ static void r300_release_referenced_objects(struct r300_context *r300)
/* Manually-created vertex buffers. */
pipe_resource_reference(&r300->dummy_vb, NULL);
pipe_resource_reference(&r300->vbo, NULL);
+ pipe_resource_reference((struct pipe_resource**)&r300->vb_instanceid, NULL);
/* If there are any queries pending or not destroyed, remove them now. */
foreach_s(query, temp, &r300->query_list) {
@@ -494,6 +495,31 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
}
{
+ int i, num = 128000;
+ struct pipe_resource vb, *r;
+ struct pipe_transfer *transfer;
+ float *buf;
+
+ memset(&vb, 0, sizeof(vb));
+ vb.target = PIPE_BUFFER;
+ vb.format = PIPE_FORMAT_R8_UNORM;
+ vb.bind = PIPE_BIND_VERTEX_BUFFER;
+ vb.usage = PIPE_USAGE_IMMUTABLE;
+ vb.width0 = 4 * num;
+ vb.height0 = 1;
+ vb.depth0 = 1;
+
+ r = screen->resource_create(screen, &vb);
+
+ buf = pipe_buffer_map(&r300->context, r, PIPE_TRANSFER_WRITE, &transfer);
+ for (i = 0; i < num; i++)
+ buf[i] = i;
+ pipe_buffer_unmap(&r300->context, transfer);
+
+ r300->vb_instanceid = r300_resource(r);
+ }
+
+ {
struct pipe_depth_stencil_alpha_state dsa;
memset(&dsa, 0, sizeof(dsa));
dsa.depth.writemask = 1;