summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-03-13 09:10:53 -0500
committerNicolai Hähnle <[email protected]>2016-03-14 17:24:43 -0500
commitf6dc4f5558754b0bf36180cf28a977e2caf319bc (patch)
treeef1763a4e6da03c29d37dbcd73669c2fea82db86 /src/mesa
parent71a1b54b33d2c1db1a0576943c31ae9adaf8d5e2 (diff)
st/mesa: set image access flags in st_bind_images
Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_atom_image.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c
index bf7486b794d..e96d10a196c 100644
--- a/src/mesa/state_tracker/st_atom_image.c
+++ b/src/mesa/state_tracker/st_atom_image.c
@@ -70,6 +70,21 @@ st_bind_images(struct st_context *st, struct gl_shader *shader,
img->resource = stObj->pt;
img->format = st_mesa_format_to_pipe_format(st, u->_ActualFormat);
+
+ switch (u->Access) {
+ case GL_READ_ONLY:
+ img->access = PIPE_IMAGE_ACCESS_READ;
+ break;
+ case GL_WRITE_ONLY:
+ img->access = PIPE_IMAGE_ACCESS_WRITE;
+ break;
+ case GL_READ_WRITE:
+ img->access = PIPE_IMAGE_ACCESS_READ_WRITE;
+ break;
+ default:
+ unreachable("bad gl_image_unit::Access");
+ }
+
if (stObj->pt->target == PIPE_BUFFER) {
unsigned base, size;
unsigned f, n;