summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-01-27 02:05:23 +0100
committerMarek Olšák <[email protected]>2018-02-17 04:20:55 +0100
commit16be55da94ea5e68edc1da8b354402d85306ab20 (patch)
treed9e1b48f7fbaa40e019526a6b84c8e928aefc378 /src/gallium/auxiliary/util
parent8e7222f4e5d624313bf972637d22b49fc7200383 (diff)
gallium: use PIPE_CAP_CONSTBUF0_FLAGS
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h21
1 files changed, 21 insertions, 0 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