**************************************************************************/
#include "main/imports.h"
+#include "main/shaderimage.h"
#include "program/prog_parameter.h"
#include "program/prog_print.h"
#include "compiler/glsl/ir_uniform.h"
struct st_texture_object *stObj = st_texture_object(u->TexObj);
struct pipe_image_view *img = &images[i];
- if (!stObj ||
+ if (!_mesa_is_image_unit_valid(st->ctx, u) ||
!st_finalize_texture(st->ctx, st->pipe, u->TexObj) ||
!stObj->pt) {
memset(img, 0, sizeof(*img));
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;