aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_blitter.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-06-09 02:13:10 +0200
committerMarek Olšák <[email protected]>2010-06-09 02:26:24 +0200
commit8f17e011c341ff78ada9543545c1f41caf66b2e9 (patch)
tree45011af6002e694230e964bd94bff109844e9719 /src/gallium/auxiliary/util/u_blitter.h
parent89dc925150a6e180c80f75a84196008dc954ae99 (diff)
util: reference vertex buffers in blitter
Diffstat (limited to 'src/gallium/auxiliary/util/u_blitter.h')
-rw-r--r--src/gallium/auxiliary/util/u_blitter.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h
index 10143a5e0f2..22849280ab9 100644
--- a/src/gallium/auxiliary/util/u_blitter.h
+++ b/src/gallium/auxiliary/util/u_blitter.h
@@ -27,6 +27,7 @@
#ifndef U_BLITTER_H
#define U_BLITTER_H
+#include "util/u_inlines.h"
#include "util/u_memory.h"
#include "pipe/p_state.h"
@@ -259,9 +260,18 @@ util_blitter_save_vertex_buffers(struct blitter_context *blitter,
int num_vertex_buffers,
struct pipe_vertex_buffer *vertex_buffers)
{
+ unsigned i;
assert(num_vertex_buffers <= Elements(blitter->saved_vertex_buffers));
blitter->saved_num_vertex_buffers = num_vertex_buffers;
+
+ for (i = 0; i < num_vertex_buffers; i++) {
+ if (vertex_buffers[i].buffer) {
+ pipe_resource_reference(&blitter->saved_vertex_buffers[i].buffer,
+ vertex_buffers[i].buffer);
+ }
+ }
+
memcpy(blitter->saved_vertex_buffers,
vertex_buffers,
num_vertex_buffers * sizeof(struct pipe_vertex_buffer));