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

Submitted by Neil Roberts on July 2, 2014, 5:37 p.m.

Details

Message ID 1404322646-24654-1-git-send-email-neil@linux.intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Neil Roberts July 2, 2014, 5:37 p.m.
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(-)

Patch hide | download patch | download mbox

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;