ctx->ImageUnits[i] = _mesa_default_image_unit(ctx);
}
-static GLboolean
-validate_image_unit(struct gl_context *ctx, struct gl_image_unit *u)
+GLboolean
+_mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u)
{
struct gl_texture_object *t = u->TexObj;
mesa_format tex_format;
u->Access = access;
u->Format = format;
u->_ActualFormat = _mesa_get_shader_image_format(format);
- u->_Valid = validate_image_unit(ctx, u);
+ u->_Valid = _mesa_is_image_unit_valid(ctx, u);
if (u->TexObj && _mesa_tex_target_is_layered(u->TexObj->Target)) {
u->Layered = layered;
u->Access = GL_READ_WRITE;
u->Format = tex_format;
u->_ActualFormat = _mesa_get_shader_image_format(tex_format);
- u->_Valid = validate_image_unit(ctx, u);
+ u->_Valid = _mesa_is_image_unit_valid(ctx, u);
} else {
/* Unbind the texture from the unit */
_mesa_reference_texobj(&u->TexObj, NULL);
void
_mesa_init_image_units(struct gl_context *ctx);
+/**
+ * Return GL_TRUE if the state of the image unit passed as argument is valid
+ * and access from the shader is allowed. Otherwise loads from this unit
+ * should return zero and stores should have no effect.
+ *
+ * The result depends on context state other than the passed image unit, part
+ * of the _NEW_TEXTURE set.
+ */
+GLboolean
+_mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u);
+
/**
* Recalculate the \c _Valid flag of a context's shader image units.
*