summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderimage.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2015-08-29 16:34:50 +0300
committerFrancisco Jerez <currojerez@riseup.net>2015-10-09 17:48:28 +0300
commit5152db415f4047569822d648fda09bdde4171d6d (patch)
tree96c8f6d9baa2c98b2a4b09cb5793437c3a776ecf /src/mesa/main/shaderimage.c
parent5346c1167064d6429c6338974c6342f8346fd34b (diff)
downloadexternal_mesa3d-5152db415f4047569822d648fda09bdde4171d6d.zip
external_mesa3d-5152db415f4047569822d648fda09bdde4171d6d.tar.gz
external_mesa3d-5152db415f4047569822d648fda09bdde4171d6d.tar.bz2
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 <yex.tian@intel.com> CC: "11.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/shaderimage.c')
-rw-r--r--src/mesa/main/shaderimage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index bd4b7c7..acc8fa9 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -415,8 +415,8 @@ _mesa_init_image_units(struct gl_context *ctx)
ctx->ImageUnits[i] = _mesa_default_image_unit(ctx);
}
-static GLboolean
-validate_image_unit(struct gl_context *ctx, struct gl_image_unit *u)
+GLboolean
+_mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u)
{
struct gl_texture_object *t = u->TexObj;
mesa_format tex_format;
@@ -567,7 +567,7 @@ _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level,
u->Access = access;
u->Format = format;
u->_ActualFormat = _mesa_get_shader_image_format(format);
- u->_Valid = validate_image_unit(ctx, u);
+ u->_Valid = _mesa_is_image_unit_valid(ctx, u);
if (u->TexObj && _mesa_tex_target_is_layered(u->TexObj->Target)) {
u->Layered = layered;
@@ -703,7 +703,7 @@ _mesa_BindImageTextures(GLuint first, GLsizei count, const GLuint *textures)
u->Access = GL_READ_WRITE;
u->Format = tex_format;
u->_ActualFormat = _mesa_get_shader_image_format(tex_format);
- u->_Valid = validate_image_unit(ctx, u);
+ u->_Valid = _mesa_is_image_unit_valid(ctx, u);
} else {
/* Unbind the texture from the unit */
_mesa_reference_texobj(&u->TexObj, NULL);