int images_used;
enum tgsi_texture_type image_targets[PIPE_MAX_SHADER_IMAGES];
enum pipe_format image_formats[PIPE_MAX_SHADER_IMAGES];
+ bool image_wr[PIPE_MAX_SHADER_IMAGES];
bool indirect_addr_consts;
int wpos_transform_const;
static void
get_image_qualifiers(ir_dereference *ir, const glsl_type **type,
bool *memory_coherent, bool *memory_volatile,
- bool *memory_restrict, unsigned *image_format)
+ bool *memory_restrict, bool *memory_read_only,
+ unsigned *image_format)
{
switch (ir->ir_type) {
struct_type->fields.structure[fild_idx].memory_volatile;
*memory_restrict =
struct_type->fields.structure[fild_idx].memory_restrict;
+ *memory_read_only =
+ struct_type->fields.structure[fild_idx].memory_read_only;
*image_format =
struct_type->fields.structure[fild_idx].image_format;
break;
ir_dereference_array *deref_arr = ir->as_dereference_array();
get_image_qualifiers((ir_dereference *)deref_arr->array, type,
memory_coherent, memory_volatile, memory_restrict,
- image_format);
+ memory_read_only, image_format);
break;
}
*memory_coherent = var->data.memory_coherent;
*memory_volatile = var->data.memory_volatile;
*memory_restrict = var->data.memory_restrict;
+ *memory_read_only = var->data.memory_read_only;
*image_format = var->data.image_format;
break;
}
ir_dereference *img = (ir_dereference *)param;
const ir_variable *imgvar = img->variable_referenced();
unsigned sampler_array_size = 1, sampler_base = 0;
- bool memory_coherent = false, memory_volatile = false, memory_restrict = false;
+ bool memory_coherent = false, memory_volatile = false,
+ memory_restrict = false, memory_read_only = false;
unsigned image_format = 0;
const glsl_type *type = NULL;
get_image_qualifiers(img, &type, &memory_coherent, &memory_volatile,
- &memory_restrict, &image_format);
+ &memory_restrict, &memory_read_only, &image_format);
st_src_reg reladdr;
st_src_reg image(PROGRAM_IMAGE, 0, GLSL_TYPE_UINT);
inst->tex_target = type->sampler_index();
inst->image_format = st_mesa_format_to_pipe_format(st_context(ctx),
_mesa_get_shader_image_format(image_format));
+ inst->read_only = memory_read_only;
if (memory_coherent)
inst->buffer_access |= TGSI_MEMORY_COHERENT;
v->image_targets[idx] =
st_translate_texture_target(inst->tex_target, false);
v->image_formats[idx] = inst->image_format;
+ v->image_wr[idx] = !inst->read_only;
}
}
}
t->images[i] = ureg_DECL_image(ureg, i,
program->image_targets[i],
program->image_formats[i],
- true, false);
+ program->image_wr[i],
+ false);
}
}