mesa: fix invalid target error handling for teximage
[mesa.git] / src / mesa / main / shaderimage.h
index 4aa859ca5cccaa73aa55c9c8a44b24415bb1310e..d43578b192b6aea226d1e8a7c256a91c05dc2cd0 100644 (file)
 #include "glheader.h"
 #include "formats.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct gl_context;
 
 /**
@@ -39,13 +43,49 @@ mesa_format
 _mesa_get_shader_image_format(GLenum format);
 
 /**
- * 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 GL image format class for a shader image format GL enum
  */
+GLenum
+_mesa_get_image_format_class(GLenum format);
+
+/**
+ * Return whether an image format should be supported based on the current API
+ * version of the context.
+ */
+bool
+_mesa_is_shader_image_format_supported(const struct gl_context *ctx,
+                                       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_init_image_units(struct gl_context *ctx);
+
 void
-_mesa_validate_image_units(struct gl_context *ctx);
+_mesa_free_image_textures(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_OBJECT set.
+ */
+GLboolean
+_mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u);
+
+void GLAPIENTRY
+_mesa_BindImageTexture_no_error(GLuint unit, GLuint texture, GLint level,
+                                GLboolean layered, GLint layer, GLenum access,
+                                GLenum format);
 
 void GLAPIENTRY
 _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level,
@@ -53,9 +93,19 @@ _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level,
                        GLenum format);
 
 void GLAPIENTRY
-_mesa_BindImageTextures(GLuint first, GLsizei count, const GLuint *textures);
+_mesa_BindImageTextureEXT(GLuint unit, GLuint texture, GLint level,
+                          GLboolean layered, GLint layer, GLenum access,
+                          GLint format);
+
+void GLAPIENTRY
+_mesa_BindImageTextures_no_error(GLuint first, GLsizei count,
+                                 const GLuint *textures);
 
 void GLAPIENTRY
-_mesa_MemoryBarrier(GLbitfield barriers);
+_mesa_BindImageTextures(GLuint first, GLsizei count, const GLuint *textures);
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif