mesa: add new GLvertexformat entries for integer-valued attributes
[mesa.git] / src / mesa / main / texobj.c
index feba6e95b6b5234b4a3a9818d413c8452050aee1..e08df0f7fedebc7d6e39a2aacfe772cc71fd9a6a 100644 (file)
@@ -40,7 +40,7 @@
 #include "teximage.h"
 #include "texobj.h"
 #include "mtypes.h"
-#include "shader/prog_instruction.h"
+#include "program/prog_instruction.h"
 
 
 
@@ -53,7 +53,7 @@
  * Return the gl_texture_object for a given ID.
  */
 struct gl_texture_object *
-_mesa_lookup_texture(GLcontext *ctx, GLuint id)
+_mesa_lookup_texture(struct gl_context *ctx, GLuint id)
 {
    return (struct gl_texture_object *)
       _mesa_HashLookup(ctx->Shared->TexObjects, id);
@@ -77,7 +77,7 @@ _mesa_lookup_texture(GLcontext *ctx, GLuint id)
  * \return pointer to new texture object.
  */
 struct gl_texture_object *
-_mesa_new_texture_object( GLcontext *ctx, GLuint name, GLenum target )
+_mesa_new_texture_object( struct gl_context *ctx, GLuint name, GLenum target )
 {
    struct gl_texture_object *obj;
    (void) ctx;
@@ -149,7 +149,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
  * target it's getting bound to (GL_TEXTURE_1D/2D/etc).
  */
 static void
-finish_texture_init(GLcontext *ctx, GLenum target,
+finish_texture_init(struct gl_context *ctx, GLenum target,
                     struct gl_texture_object *obj)
 {
    assert(obj->Target == 0);
@@ -181,7 +181,7 @@ finish_texture_init(GLcontext *ctx, GLenum target,
  * \param texObj the texture object to delete.
  */
 void
-_mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj )
+_mesa_delete_texture_object( struct gl_context *ctx, struct gl_texture_object *texObj )
 {
    GLuint i, face;
 
@@ -265,7 +265,7 @@ _mesa_copy_texture_object( struct gl_texture_object *dest,
  * \sa _mesa_clear_texture_image().
  */
 void
-_mesa_clear_texture_object(GLcontext *ctx, struct gl_texture_object *texObj)
+_mesa_clear_texture_object(struct gl_context *ctx, struct gl_texture_object *texObj)
 {
    GLuint i, j;
 
@@ -331,6 +331,7 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
       struct gl_texture_object *oldTex = *ptr;
 
       ASSERT(valid_texture_object(oldTex));
+      (void) valid_texture_object; /* silence warning in release builds */
 
       _glthread_LOCK_MUTEX(oldTex->Mutex);
       ASSERT(oldTex->RefCount > 0);
@@ -383,7 +384,7 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
 static void
 incomplete(const struct gl_texture_object *t, const char *why)
 {
-   _mesa_printf("Texture Obj %d incomplete because: %s\n", t->Name, why);
+   printf("Texture Obj %d incomplete because: %s\n", t->Name, why);
 }
 #else
 #define incomplete(t, why)
@@ -403,7 +404,7 @@ incomplete(const struct gl_texture_object *t, const char *why)
  * present and has the expected size.
  */
 void
-_mesa_test_texobj_completeness( const GLcontext *ctx,
+_mesa_test_texobj_completeness( const struct gl_context *ctx,
                                 struct gl_texture_object *t )
 {
    const GLint baseLevel = t->BaseLevel;
@@ -416,7 +417,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
     */
    if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) {
       char s[100];
-      _mesa_sprintf(s, "base level = %d is invalid", baseLevel);
+      _mesa_snprintf(s, sizeof(s), "base level = %d is invalid", baseLevel);
       incomplete(t, s);
       t->_Complete = GL_FALSE;
       return;
@@ -425,7 +426,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
    /* Always need the base level image */
    if (!t->Image[0][baseLevel]) {
       char s[100];
-      _mesa_sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel);
+      _mesa_snprintf(s, sizeof(s), "Image[baseLevel=%d] == NULL", baseLevel);
       incomplete(t, s);
       t->_Complete = GL_FALSE;
       return;
@@ -695,7 +696,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
  * \param invalidate_state also invalidate context state.
  */
 void
-_mesa_dirty_texobj(GLcontext *ctx, struct gl_texture_object *texObj,
+_mesa_dirty_texobj(struct gl_context *ctx, struct gl_texture_object *texObj,
                    GLboolean invalidate_state)
 {
    texObj->_Complete = GL_FALSE;
@@ -711,7 +712,7 @@ _mesa_dirty_texobj(GLcontext *ctx, struct gl_texture_object *texObj,
  * incomplete texture.
  */
 struct gl_texture_object *
-_mesa_get_fallback_texture(GLcontext *ctx)
+_mesa_get_fallback_texture(struct gl_context *ctx)
 {
    if (!ctx->Shared->FallbackTex) {
       /* create fallback texture now */
@@ -829,7 +830,7 @@ _mesa_GenTextures( GLsizei n, GLuint *textures )
  * read framebuffer.  If so, Unbind it.
  */
 static void
-unbind_texobj_from_fbo(GLcontext *ctx, struct gl_texture_object *texObj)
+unbind_texobj_from_fbo(struct gl_context *ctx, struct gl_texture_object *texObj)
 {
    const GLuint n = (ctx->DrawBuffer == ctx->ReadBuffer) ? 1 : 2;
    GLuint i;
@@ -854,7 +855,7 @@ unbind_texobj_from_fbo(GLcontext *ctx, struct gl_texture_object *texObj)
  * unbind it if so (revert to default textures).
  */
 static void
-unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj)
+unbind_texobj_from_texunits(struct gl_context *ctx, struct gl_texture_object *texObj)
 {
    GLuint u, tex;
 
@@ -1213,7 +1214,7 @@ _mesa_IsTexture( GLuint texture )
  * See also _mesa_lock/unlock_texture() in teximage.h
  */
 void
-_mesa_lock_context_textures( GLcontext *ctx )
+_mesa_lock_context_textures( struct gl_context *ctx )
 {
    _glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
 
@@ -1225,7 +1226,7 @@ _mesa_lock_context_textures( GLcontext *ctx )
 
 
 void
-_mesa_unlock_context_textures( GLcontext *ctx )
+_mesa_unlock_context_textures( struct gl_context *ctx )
 {
    assert(ctx->Shared->TextureStateStamp == ctx->TextureStateTimestamp);
    _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);