summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h21
-rw-r--r--src/gallium/auxiliary/vl/vl_compositor.c2
2 files changed, 22 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 4ba6ad72b62..4bd9b7e3c62 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -284,6 +284,27 @@ pipe_buffer_create( struct pipe_screen *screen,
}
+static inline struct pipe_resource *
+pipe_buffer_create_const0(struct pipe_screen *screen,
+ unsigned bind,
+ enum pipe_resource_usage usage,
+ unsigned size)
+{
+ struct pipe_resource buffer;
+ memset(&buffer, 0, sizeof buffer);
+ buffer.target = PIPE_BUFFER;
+ buffer.format = PIPE_FORMAT_R8_UNORM;
+ buffer.bind = bind;
+ buffer.usage = usage;
+ buffer.flags = screen->get_param(screen, PIPE_CAP_CONSTBUF0_FLAGS);
+ buffer.width0 = size;
+ buffer.height0 = 1;
+ buffer.depth0 = 1;
+ buffer.array_size = 1;
+ return screen->resource_create(screen, &buffer);
+}
+
+
/**
* Map a range of a resource.
* \param offset start of region, in bytes
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 67ad7f5beea..725bfd9126e 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -1437,7 +1437,7 @@ vl_compositor_init_state(struct vl_compositor_state *s, struct pipe_context *pip
* Const buffer contains the color conversion matrix and bias vectors
*/
/* XXX: Create with IMMUTABLE/STATIC... although it does change every once in a long while... */
- s->csc_matrix = pipe_buffer_create
+ s->csc_matrix = pipe_buffer_create_const0
(
pipe->screen,
PIPE_BIND_CONSTANT_BUFFER,