Mesa (outputswritten64): Fix assertions that VS outpus will fit in bitfields.

Ian Romanick idr at kemper.freedesktop.org
Mon Nov 2 20:50:30 UTC 2009


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Oct 28 15:24:01 2009 -0700

Fix assertions that VS outpus will fit in bitfields.

---

 src/mesa/main/context.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index ea1ee22..4711b78 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -599,9 +599,11 @@ _mesa_init_constants(GLcontext *ctx)
    ASSERT(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX);
    ASSERT(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX);
 
-   /* check that we don't exceed various 32-bit bitfields */
-   ASSERT(VERT_RESULT_MAX <= 32);
-   ASSERT(FRAG_ATTRIB_MAX <= 32);
+   /* check that we don't exceed the size of various bitfields */
+   ASSERT(VERT_RESULT_MAX <=
+	  (8 * sizeof(ctx->VertexProgram._Current->Base.OutputsWritten)));
+   ASSERT(FRAG_ATTRIB_MAX <=
+	  (8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead)));
 }
 
 




More information about the mesa-commit mailing list