summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderimage.c
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-01-31 17:00:19 +0200
committerFrancisco Jerez <[email protected]>2015-05-04 17:44:16 +0300
commitb663d6bc6f4de9439107fc6444e436d14e21ee79 (patch)
tree6fc0665bf99f67a91769bce8d91c21ea94da36a6 /src/mesa/main/shaderimage.c
parent1b9990e37333076fdc112295ae09193bbe8d57db (diff)
mesa: Initialize image units to default state on context creation.
This is the required initial image unit state according to "Table 23.45. Image State (state per image unit)" of the OpenGL 4.3 specification. Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderimage.c')
-rw-r--r--src/mesa/main/shaderimage.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index 8caff2f2660..efe439c6dfd 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -331,6 +331,19 @@ get_image_format_class(mesa_format format)
}
}
+void
+_mesa_init_image_units(struct gl_context *ctx)
+{
+ unsigned i;
+
+ for (i = 0; i < ARRAY_SIZE(ctx->ImageUnits); ++i) {
+ struct gl_image_unit *u = &ctx->ImageUnits[i];
+ u->Access = GL_READ_ONLY;
+ u->Format = GL_R8;
+ u->_ActualFormat = _mesa_get_shader_image_format(u->Format);
+ }
+}
+
static GLboolean
validate_image_unit(struct gl_context *ctx, struct gl_image_unit *u)
{