gallium: Add image volatile/coherent flags

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>
This commit is contained in:
Rob Clark
2023-01-09 11:34:04 -08:00
committed by Marge Bot
parent 5fb0992a53
commit 1e22971d92
3 changed files with 10 additions and 0 deletions

View File

@@ -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

View File

@@ -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
{

View File

@@ -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;