mesa: additional instruction field size assertions
authorBrian Paul <brianp@vmware.com>
Wed, 26 Aug 2009 16:57:18 +0000 (10:57 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 26 Aug 2009 18:02:24 +0000 (12:02 -0600)
src/mesa/shader/program.c

index 4623ff60de6b5c5a7fe64f11ec44a314b8fa9cbb..963478fccdbdfa9e3de918222034d80997d6aef2 100644 (file)
@@ -62,6 +62,12 @@ _mesa_init_program(GLcontext *ctx)
    ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4
           <= (1 << INST_INDEX_BITS));
 
+   /* If this fails, increase prog_instruction::TexSrcUnit size */
+   ASSERT(MAX_TEXTURE_UNITS < (1 << 5));
+
+   /* If this fails, increase prog_instruction::TexSrcTarget size */
+   ASSERT(NUM_TEXTURE_TARGETS < (1 << 3));
+
    ctx->Program.ErrorPos = -1;
    ctx->Program.ErrorString = _mesa_strdup("");