st/mesa: set image access flags in st_bind_images
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sun, 13 Mar 2016 14:10:53 +0000 (09:10 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 14 Mar 2016 22:24:43 +0000 (17:24 -0500)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_atom_image.c

index bf7486b794d14ca307c54e9e1f6df15ceb8c0d54..e96d10a196c25a4d43fd9ff5237515c3a2de7ffc 100644 (file)
@@ -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;