Mesa (mesa_7_2_branch): mesa: fix vertex format/attribute bug

Brian Paul brianp at kemper.freedesktop.org
Wed Oct 8 15:35:51 UTC 2008


Module: Mesa
Branch: mesa_7_2_branch
Commit: 24571503eb40a3de1f7bba4dc6f4b0a81d5a107f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=24571503eb40a3de1f7bba4dc6f4b0a81d5a107f

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Wed Oct  8 09:28:10 2008 -0600

mesa: fix vertex format/attribute bug

If the tnl output attributes matches the swsetup input attributes we still
need to check if the desired vertex color type (float vs. chan) has changed
so that we use the right emit functions.

Fixes a conformance failure found with logicop test at pathlevel 3.

---

 src/mesa/swrast_setup/ss_context.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index a4f949d..4c5253d 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -111,22 +111,25 @@ setup_vertex_format(GLcontext *ctx)
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+   GLboolean intColors = !ctx->FragmentProgram._Current
+                      && !ctx->ATIFragmentShader._Enabled
+                      && ctx->RenderMode == GL_RENDER
+                      && CHAN_TYPE == GL_UNSIGNED_BYTE;
 
-   if (!RENDERINPUTS_EQUAL(tnl->render_inputs_bitset,
+   if (intColors != swsetup->intColors ||
+       !RENDERINPUTS_EQUAL(tnl->render_inputs_bitset,
                            swsetup->last_index_bitset)) {
       DECLARE_RENDERINPUTS(index_bitset);
       struct tnl_attr_map map[_TNL_ATTRIB_MAX];
       int i, e = 0;
 
+      swsetup->intColors = intColors;
+
       RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset );
 
       EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] );
 
       if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) {
-         swsetup->intColors = !ctx->FragmentProgram._Current
-                           && !ctx->ATIFragmentShader._Enabled
-                           && ctx->RenderMode == GL_RENDER
-                           && CHAN_TYPE == GL_UNSIGNED_BYTE;
          if (swsetup->intColors)
             EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color );
          else




More information about the mesa-commit mailing list