[Mesa-dev] [PATCH] Include the border size when determining the rb size from a texture

Neil Roberts neil at linux.intel.com
Wed Jul 2 10:37:26 PDT 2014

When attaching a texture to a framebuffer it was previously using the size of
the texture minus the border when determining the renderbuffer size. However
the size of the image buffer includes the border so when used with the swrast
driver it would end up calculating the wrong stride and it would render

I tested this with the swrast driver on piglit because most of the other
drivers strip away the border. There were no regressions.
 src/mesa/main/fbobject.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index ae3a418..69965ab 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -404,9 +404,9 @@ _mesa_update_texture_renderbuffer(struct gl_context *ctx,
    rb->_BaseFormat = texImage->_BaseFormat;
    rb->Format = texImage->TexFormat;
    rb->InternalFormat = texImage->InternalFormat;
-   rb->Width = texImage->Width2;
-   rb->Height = texImage->Height2;
-   rb->Depth = texImage->Depth2;
+   rb->Width = texImage->Width;
+   rb->Height = texImage->Height;
+   rb->Depth = texImage->Depth;
    rb->NumSamples = texImage->NumSamples;
    rb->TexImage = texImage;

More information about the mesa-dev mailing list