summaryrefslogtreecommitdiff
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 825a23090b..680fd22ba8 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -44,6 +44,11 @@
#include "teximage.h"
#include "texobj.h"
#include "texstore.h"
+#include "texstate.h"
+
+
+/** Set this to 1 to help debug FBO incompleteness problems */
+#define DEBUG_FBO 0
/**
@@ -308,8 +313,8 @@ _mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb,
static void
att_incomplete(const char *msg)
{
-#if 0
- _mesa_printf("attachment incomplete: %s\n", msg);
+#if DEBUG_FBO
+ _mesa_debug(NULL, "attachment incomplete: %s\n", msg);
#else
(void) msg;
#endif
@@ -317,6 +322,23 @@ att_incomplete(const char *msg)
/**
+ * For debug only.
+ */
+static void
+fbo_incomplete(const char *msg, int index)
+{
+#if DEBUG_FBO
+ _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index);
+#else
+ (void) msg;
+ (void) index;
+#endif
+}
+
+
+
+
+/**
* Test if an attachment point is complete and update its Complete field.
* \param format if GL_COLOR, this is a color attachment point,
* if GL_DEPTH, this is a depth component attachment point,
@@ -468,20 +490,6 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
/**
- * Helpful for debugging
- */
-static void
-fbo_incomplete(const char *msg, int index)
-{
- (void) msg;
- (void) index;
- /*
- _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index);
- */
-}
-
-
-/**
* Test if the given framebuffer object is complete and update its
* Status field with the results.
* Calls the ctx->Driver.ValidateFramebuffer() function to allow the
@@ -1948,18 +1956,18 @@ _mesa_GenerateMipmapEXT(GLenum target)
return;
}
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texUnit = _mesa_get_current_tex_unit(ctx);
texObj = _mesa_select_tex_object(ctx, texUnit, target);
_mesa_lock_texture(ctx, texObj);
if (target == GL_TEXTURE_CUBE_MAP) {
- int face;
-
+ GLuint face;
for (face = 0; face < 6; face++)
ctx->Driver.GenerateMipmap(ctx,
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face,
texObj);
- } else {
+ }
+ else {
ctx->Driver.GenerateMipmap(ctx, target, texObj);
}
_mesa_unlock_texture(ctx, texObj);