summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderimage.h
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-08-29 16:34:50 +0300
committerFrancisco Jerez <[email protected]>2015-10-09 17:48:28 +0300
commit5152db415f4047569822d648fda09bdde4171d6d (patch)
tree96c8f6d9baa2c98b2a4b09cb5793437c3a776ecf /src/mesa/main/shaderimage.h
parent5346c1167064d6429c6338974c6342f8346fd34b (diff)
mesa: Expose function to calculate whether a shader image unit is valid.
A future commit will remove all texture object-dependent derived state from the image unit struct to make validation unnecessary on texture state changes. Instead of checking gl_image_unit::_Valid drivers will be required to call this function when needed to find out whether an image unit is in a valid state and whether access from the shader is allowed. Tested-by: Ye Tian <[email protected]> CC: "11.0" <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderimage.h')
-rw-r--r--src/mesa/main/shaderimage.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/shaderimage.h b/src/mesa/main/shaderimage.h
index bbe088a2459..14a544fca8a 100644
--- a/src/mesa/main/shaderimage.h
+++ b/src/mesa/main/shaderimage.h
@@ -55,6 +55,17 @@ 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.
*
* To be called when the state of any texture bound to an image unit