diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index c838fa09509..7830a7699c9 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -728,6 +728,8 @@ enum pipe_conservative_raster_mode #define PIPE_IMAGE_ACCESS_WRITE (1 << 1) #define PIPE_IMAGE_ACCESS_READ_WRITE (PIPE_IMAGE_ACCESS_READ | \ PIPE_IMAGE_ACCESS_WRITE) +#define PIPE_IMAGE_ACCESS_COHERENT (1 << 2) +#define PIPE_IMAGE_ACCESS_VOLATILE (1 << 3) /** * Implementation capabilities/limits which are queried through diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index a6121b571a5..5194011d30e 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -510,6 +510,10 @@ struct pipe_sampler_view /** * A description of a buffer or texture image that can be bound to a shader * stage. + * + * Note that pipe_image_view::access comes from the frontend API, while + * shader_access comes from the shader and may contain additional information + * (ie. coherent/volatile may be set on shader_access but not on access) */ struct pipe_image_view { diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c index 5331f903c72..d36b12ab4f0 100644 --- a/src/mesa/state_tracker/st_atom_image.c +++ b/src/mesa/state_tracker/st_atom_image.c @@ -74,6 +74,10 @@ st_convert_image(const struct st_context *st, const struct gl_image_unit *u, img->shader_access |= PIPE_IMAGE_ACCESS_READ; if (!(shader_access & ACCESS_NON_WRITEABLE)) img->shader_access |= PIPE_IMAGE_ACCESS_WRITE; + if (shader_access & ACCESS_COHERENT) + img->shader_access |= PIPE_IMAGE_ACCESS_COHERENT; + if (shader_access & ACCESS_VOLATILE) + img->shader_access |= PIPE_IMAGE_ACCESS_VOLATILE; if (stObj->Target == GL_TEXTURE_BUFFER) { struct gl_buffer_object *stbuf = stObj->BufferObject;