Mesa (mesa_7_7_branch): mesa: use simplified _BaseFormat value in render-to-texture code

Brian Paul brianp at kemper.freedesktop.org
Fri Feb 26 16:17:58 UTC 2010


Module: Mesa
Branch: mesa_7_7_branch
Commit: b0e84e22d5926cb98c1288e79f527cd89c0242ce
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0e84e22d5926cb98c1288e79f527cd89c0242ce

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Feb 26 09:10:27 2010 -0700

mesa: use simplified _BaseFormat value in render-to-texture code

Fixes fd.o bug 26762.

(cherry picked from commit c9e8ff1976cd14fdc84db440a554185be29a0ca2)

---

 src/mesa/main/texrender.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index e2432be..37cb2cc 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -499,21 +499,24 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att)
    if (trb->TexImage->TexFormat == MESA_FORMAT_Z24_S8) {
       trb->Base.Format = MESA_FORMAT_Z24_S8;
       trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
+      trb->Base._BaseFormat = GL_DEPTH_STENCIL;
    }
    else if (trb->TexImage->TexFormat == MESA_FORMAT_Z16) {
       trb->Base.Format = MESA_FORMAT_Z16;
       trb->Base.DataType = GL_UNSIGNED_SHORT;
+      trb->Base._BaseFormat = GL_DEPTH_STENCIL;
    }
    else if (trb->TexImage->TexFormat == MESA_FORMAT_Z32) {
       trb->Base.Format = MESA_FORMAT_Z32;
       trb->Base.DataType = GL_UNSIGNED_INT;
+      trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
    }
    else {
       trb->Base.Format = trb->TexImage->TexFormat;
       trb->Base.DataType = CHAN_TYPE;
+      trb->Base._BaseFormat = GL_RGBA;
    }
    trb->Base.Data = trb->TexImage->Data;
-   trb->Base._BaseFormat = _mesa_base_fbo_format(ctx, trb->Base.InternalFormat);
 }
 
 




More information about the mesa-commit mailing list