*
* Called via ctx->Driver.NewTextureObject, unless overridden by a device
* driver.
- *
+ *
* \param shared the shared GL state structure to contain the texture object
* \param name integer name for the texture object
* \param target either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D,
}
-
/**
* Copy texture object state from one texture object to another.
* Use for glPush/PopAttrib.
if (height > 1 && t->Target != GL_TEXTURE_1D_ARRAY) {
height /= 2;
}
- if (depth > 1 && t->Target != GL_TEXTURE_2D_ARRAY && t->Target != GL_TEXTURE_CUBE_MAP_ARRAY) {
+ if (depth > 1 && t->Target != GL_TEXTURE_2D_ARRAY
+ && t->Target != GL_TEXTURE_CUBE_MAP_ARRAY) {
depth /= 2;
}
return;
}
if (img->Width2 != width) {
- incomplete(t, MIPMAP, "TexImage[%d] bad width %u", i, img->Width2);
+ incomplete(t, MIPMAP, "TexImage[%d] bad width %u", i,
+ img->Width2);
return;
}
if (img->Height2 != height) {
- incomplete(t, MIPMAP, "TexImage[%d] bad height %u", i, img->Height2);
+ incomplete(t, MIPMAP, "TexImage[%d] bad height %u", i,
+ img->Height2);
return;
}
if (img->Depth2 != depth) {
- incomplete(t, MIPMAP, "TexImage[%d] bad depth %u", i, img->Depth2);
+ incomplete(t, MIPMAP, "TexImage[%d] bad depth %u", i,
+ img->Depth2);
return;
}
/* Extra checks for cube textures */
if (face > 0) {
/* check that cube faces are the same size */
- if (img->Width2 != t->Image[0][i]->Width2 ||
+ if (img->Width2 != t->Image[0][i]->Width2 ||
img->Height2 != t->Image[0][i]->Height2) {
incomplete(t, MIPMAP, "CubeMap Image[n][i] bad size");
return;
}
}
}
-
+
if (width == 1 && height == 1 && depth == 1) {
return; /* found smallest needed mipmap, all done! */
}
return total;
}
+
static struct gl_texture_object *
invalidate_tex_image_error_check(struct gl_context *ctx, GLuint texture,
GLint level, const char *name)
* Calls _mesa_HashFindFreeKeyBlock() to find a block of free texture
* IDs which are stored in \p textures. Corresponding empty texture
* objects are also generated.
- */
+ */
void GLAPIENTRY
_mesa_GenTextures( GLsizei n, GLuint *textures )
{
}
}
+
/**
* Unbinds all textures bound to the given texture image unit.
*/
}
}
+
/**
* Delete named textures.
*
/**
* Bind a named texture to a texturing target.
- *
+ *
* \param target texture target.
* \param texName texture name.
- *
+ *
* \sa glBindTexture().
*
* Determines the old texture object bound and returns immediately if rebinding
if (newTexObj) {
/* error checking */
if (newTexObj->Target != 0 && newTexObj->Target != target) {
- /* the named texture object's target doesn't match the given target */
+ /* The named texture object's target doesn't match the
+ * given target
+ */
_mesa_error( ctx, GL_INVALID_OPERATION,
"glBindTexture(target mismatch)" );
return;
}
else {
if (ctx->API == API_OPENGL_CORE) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindTexture(non-gen name)");
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBindTexture(non-gen name)");
return;
}
/**
* Set texture priorities.
- *
+ *
* \param n number of textures.
* \param texName texture names.
* \param priorities corresponding texture priorities.
- *
+ *
* \sa glPrioritizeTextures().
- *
+ *
* Looks up each texture in the hash, clamps the corresponding priority between
* 0.0 and 1.0, and calls dd_function_table::PrioritizeTexture.
*/
/**
* See if textures are loaded in texture memory.
- *
+ *
* \param n number of textures to query.
* \param texName array with the texture names.
* \param residences array which will hold the residence status.
*
- * \return GL_TRUE if all textures are resident and \p residences is left unchanged,
- *
+ * \return GL_TRUE if all textures are resident and
+ * residences is left unchanged,
+ *
* Note: we assume all textures are always resident
*/
GLboolean GLAPIENTRY
return GL_FALSE;
}
}
-
+
return allResident;
}
*
* \return GL_TRUE if texture name corresponds to a texture, or GL_FALSE
* otherwise.
- *
+ *
* \sa glIsTexture().
*
* Calls _mesa_HashLookup().
mtx_unlock(&ctx->Shared->TexMutex);
}
+
void GLAPIENTRY
_mesa_InvalidateTexSubImage(GLuint texture, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLsizei width,
return;
}
+
void GLAPIENTRY
_mesa_InvalidateTexImage(GLuint texture, GLint level)
{