summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/cso_cache
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-04-02 14:30:16 +0200
committerMarek Olšák <[email protected]>2017-05-10 19:00:16 +0200
commitc24c3b94ed29ecd99b1101c74c6c4606f9b5580e (patch)
tree81f6966bc59a68d9867693c65d35fae9bb1d9819 /src/gallium/auxiliary/cso_cache
parentfe437882ea2d60e91c244cc95beb4b79c615af49 (diff)
gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytes
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 3d3c44cf81a..68f7b9e7bfe 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -408,8 +408,8 @@ void cso_destroy_context( struct cso_context *ctx )
util_unreference_framebuffer_state(&ctx->fb);
util_unreference_framebuffer_state(&ctx->fb_saved);
- pipe_resource_reference(&ctx->aux_vertex_buffer_current.buffer, NULL);
- pipe_resource_reference(&ctx->aux_vertex_buffer_saved.buffer, NULL);
+ pipe_vertex_buffer_unreference(&ctx->aux_vertex_buffer_current);
+ pipe_vertex_buffer_unreference(&ctx->aux_vertex_buffer_saved);
for (i = 0; i < PIPE_SHADER_TYPES; i++) {
pipe_resource_reference(&ctx->aux_constbuf_current[i].buffer, NULL);
@@ -1150,15 +1150,9 @@ void cso_set_vertex_buffers(struct cso_context *ctx,
const struct pipe_vertex_buffer *vb =
buffers + (ctx->aux_vertex_buffer_index - start_slot);
- pipe_resource_reference(&ctx->aux_vertex_buffer_current.buffer,
- vb->buffer);
- memcpy(&ctx->aux_vertex_buffer_current, vb,
- sizeof(struct pipe_vertex_buffer));
- }
- else {
- pipe_resource_reference(&ctx->aux_vertex_buffer_current.buffer,
- NULL);
- ctx->aux_vertex_buffer_current.user_buffer = NULL;
+ pipe_vertex_buffer_reference(&ctx->aux_vertex_buffer_current, vb);
+ } else {
+ pipe_vertex_buffer_unreference(&ctx->aux_vertex_buffer_current);
}
}
@@ -1175,10 +1169,8 @@ cso_save_aux_vertex_buffer_slot(struct cso_context *ctx)
return;
}
- pipe_resource_reference(&ctx->aux_vertex_buffer_saved.buffer,
- ctx->aux_vertex_buffer_current.buffer);
- memcpy(&ctx->aux_vertex_buffer_saved, &ctx->aux_vertex_buffer_current,
- sizeof(struct pipe_vertex_buffer));
+ pipe_vertex_buffer_reference(&ctx->aux_vertex_buffer_saved,
+ &ctx->aux_vertex_buffer_current);
}
static void
@@ -1193,7 +1185,7 @@ cso_restore_aux_vertex_buffer_slot(struct cso_context *ctx)
cso_set_vertex_buffers(ctx, ctx->aux_vertex_buffer_index, 1,
&ctx->aux_vertex_buffer_saved);
- pipe_resource_reference(&ctx->aux_vertex_buffer_saved.buffer, NULL);
+ pipe_vertex_buffer_unreference(&ctx->aux_vertex_buffer_saved);
}
unsigned cso_get_aux_vertex_buffer_slot(struct cso_context *ctx)