Mesa (master): intel: FBOs with texture border are unsupported

Ian Romanick idr at kemper.freedesktop.org
Fri Feb 3 18:04:49 UTC 2012


Module: Mesa
Branch: master
Commit: 87b4c9b322dabeba7c9a9d02e9efefd2c89e6625
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=87b4c9b322dabeba7c9a9d02e9efefd2c89e6625

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Feb  1 10:18:13 2012 -0700

intel: FBOs with texture border are unsupported

FBOs differ from textures in a significant way.  With textures, we can
strip the border and get correct rendering except when the application
fetches texels outside [0,1].

With an FBO, the pixel at (0,0) is in the border.  The
ARB_framebuffer_object spec says:

    "If the attached image is a texture image, then the window
    coordinates (x[w], y[w]) correspond to the texel (i, j, k), from
    figure 3.10 as follows:

                           i = (x[w] - b)

                           j = (y[w] - b)

                           k = (layer - b)

    where <b> is the texture image's border width..."

Since the border doesn't exist, we can never render any pixels in the
correct location.  Just mark these FBOs FRAMEBUFFER_UNSUPPORTED.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42336

---

 src/mesa/drivers/dri/intel/intel_fbo.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 2ba43ac..185602a 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -762,6 +762,17 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
 	 continue;
       }
 
+      if (fb->Attachment[i].Type == GL_TEXTURE) {
+	 const struct gl_texture_image *img =
+	    _mesa_get_attachment_teximage_const(&fb->Attachment[i]);
+
+	 if (img->Border) {
+	    DBG("texture with border\n");
+	    fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+	    continue;
+	 }
+      }
+
       irb = intel_renderbuffer(rb);
       if (irb == NULL) {
 	 DBG("software rendering renderbuffer\n");




More information about the mesa-commit mailing list