Freedreno needs to know when an image has volatile or coherent access
flags in the shader.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20612>
#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
/**
* 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
{
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;