[Mesa-dev] [PATCH 07/10] st/mesa: set image access flags in st_bind_images
Nicolai Hähnle
nhaehnle at gmail.com
Sun Mar 13 14:29:49 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/mesa/state_tracker/st_atom_image.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c
index bf7486b..e96d10a1 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;
--
2.5.0
More information about the mesa-dev
mailing list