[Mesa-dev] [RFC 44/63] mesa/shaderimage: Make is_image_format_supported public
Eduardo Lima Mitev
elima at igalia.com
Tue Jan 19 08:42:24 PST 2016
From: Antia Puentes <apuentes at igalia.com>
It will be used by the ARB_internalformat_query2 implementation
to implement queries related to the ARB_shader_image_load_store
extension.
---
src/mesa/main/shaderimage.c | 13 +++++--------
src/mesa/main/shaderimage.h | 8 ++++++++
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index 040e9fd..a71686d 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -331,12 +331,9 @@ get_image_format_class(mesa_format format)
}
}
-/**
- * Return whether an image format should be supported based on the current API
- * version of the context.
- */
-static bool
-is_image_format_supported(const struct gl_context *ctx, GLenum format)
+bool
+_mesa_is_shader_image_format_supported(const struct gl_context *ctx,
+ GLenum format)
{
switch (format) {
/* Formats supported on both desktop and ES GL, c.f. table 8.27 of the
@@ -503,7 +500,7 @@ validate_bind_image_texture(struct gl_context *ctx, GLuint unit,
return GL_FALSE;
}
- if (!is_image_format_supported(ctx, format)) {
+ if (!_mesa_is_shader_image_format_supported(ctx, format)) {
_mesa_error(ctx, GL_INVALID_VALUE, "glBindImageTexture(format)");
return GL_FALSE;
}
@@ -668,7 +665,7 @@ _mesa_BindImageTextures(GLuint first, GLsizei count, const GLuint *textures)
tex_format = image->InternalFormat;
}
- if (!is_image_format_supported(ctx, tex_format)) {
+ if (!_mesa_is_shader_image_format_supported(ctx, tex_format)) {
/* The ARB_multi_bind spec says:
*
* "An INVALID_OPERATION error is generated if the internal
diff --git a/src/mesa/main/shaderimage.h b/src/mesa/main/shaderimage.h
index 94ee814..794c926 100644
--- a/src/mesa/main/shaderimage.h
+++ b/src/mesa/main/shaderimage.h
@@ -43,6 +43,14 @@ mesa_format
_mesa_get_shader_image_format(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
--
2.5.3
More information about the mesa-dev
mailing list