*/
GLboolean Layered;
- /**
- * GL_TRUE if the state of this image unit is valid and access from
- * the shader is allowed. Otherwise loads from this unit should
- * return zero and stores should have no effect.
- */
- GLboolean _Valid;
-
/**
* Layer of the texture object bound to this unit as specified by the
* application.
return GL_TRUE;
}
-void
-_mesa_validate_image_units(struct gl_context *ctx)
-{
- unsigned i;
-
- for (i = 0; i < ctx->Const.MaxImageUnits; ++i) {
- struct gl_image_unit *u = &ctx->ImageUnits[i];
- u->_Valid = validate_image_unit(ctx, u);
- }
-}
-
static GLboolean
validate_bind_image_texture(struct gl_context *ctx, GLuint unit,
GLuint texture, GLint level, GLboolean layered,
u->Access = access;
u->Format = format;
u->_ActualFormat = _mesa_get_shader_image_format(format);
- u->_Valid = _mesa_is_image_unit_valid(ctx, u);
if (u->TexObj && _mesa_tex_target_is_layered(u->TexObj->Target)) {
u->Layered = layered;
u->Access = GL_READ_WRITE;
u->Format = tex_format;
u->_ActualFormat = _mesa_get_shader_image_format(tex_format);
- u->_Valid = _mesa_is_image_unit_valid(ctx, u);
} else {
/* Unbind the texture from the unit */
_mesa_reference_texobj(&u->TexObj, NULL);
u->Access = GL_READ_ONLY;
u->Format = GL_R8;
u->_ActualFormat = MESA_FORMAT_R_UNORM8;
- u->_Valid = GL_FALSE;
}
}
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
- * changes.
- */
-void
-_mesa_validate_image_units(struct gl_context *ctx);
-
void GLAPIENTRY
_mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level,
GLboolean layered, GLint layer, GLenum access,
#include "context.h"
#include "enums.h"
#include "macros.h"
-#include "shaderimage.h"
#include "texobj.h"
#include "teximage.h"
#include "texstate.h"
if (!prog[MESA_SHADER_FRAGMENT] || !prog[MESA_SHADER_VERTEX])
update_texgen(ctx);
-
- _mesa_validate_image_units(ctx);
}