mesa/main: not fill mesa_error on _mesa_legal_texture_base_format_for_target
[mesa.git] / src / mesa / main / shaderimage.h
index 733ac774777fff6826125cd4ca03e64737e5cac2..94ee814a71627c3d092ed433dcdce719198a947f 100644 (file)
 #define SHADERIMAGE_H
 
 #include "glheader.h"
+#include "formats.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 struct gl_context;
 
 /**
- * Recalculate the \c _Valid flag of a context's shader image units.
- *
- * To be called when the state of any texture bound to an image unit
- * changes.
+ * Get the matching mesa_format for a shader image format GL enum.
+ */
+mesa_format
+_mesa_get_shader_image_format(GLenum format);
+
+/**
+ * Get a single image unit struct with the default state.
+ */
+struct gl_image_unit
+_mesa_default_image_unit(struct gl_context *ctx);
+
+/**
+ * Initialize a context's shader image units to the default state.
  */
 void
-_mesa_validate_image_units(struct gl_context *ctx);
+_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);
 
 void GLAPIENTRY
 _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level,
@@ -51,4 +76,11 @@ _mesa_BindImageTextures(GLuint first, GLsizei count, const GLuint *textures);
 void GLAPIENTRY
 _mesa_MemoryBarrier(GLbitfield barriers);
 
+void GLAPIENTRY
+_mesa_MemoryBarrierByRegion(GLbitfield barriers);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif