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
garbage.

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;
 
-- 
1.9.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to