projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5c79c08
)
bump up MAX_INSTRUCTIONS and add an assertion to catch emitting too many instructions
author
Brian
<brian.paul@tungstengraphics.com>
Tue, 23 Oct 2007 16:23:01 +0000
(10:23 -0600)
committer
Brian
<brian.paul@tungstengraphics.com>
Tue, 23 Oct 2007 16:23:01 +0000
(10:23 -0600)
src/mesa/main/texenvprogram.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/texenvprogram.c
b/src/mesa/main/texenvprogram.c
index a554c033c4075dcf2528c769e3e33f275479885e..2614440a747a6edc398c108fe45218c2136fb3f5 100644
(file)
--- a/
src/mesa/main/texenvprogram.c
+++ b/
src/mesa/main/texenvprogram.c
@@
-36,10
+36,11
@@
#include "texenvprogram.h"
/**
#include "texenvprogram.h"
/**
- * According to Glean's texCombine test, no more than 21 instructions
- * are needed. Allow a few extra just in case.
+ * This MAX is probably a bit generous, but that's OK. There can be
+ * up to four instructions per texture unit (TEX + 3 for combine),
+ * then there's fog and specular add.
*/
*/
-#define MAX_INSTRUCTIONS
24
+#define MAX_INSTRUCTIONS
((MAX_TEXTURE_UNITS * 4) + 12)
#define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM)
#define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM)
@@
-478,6
+479,8
@@
emit_op(struct texenv_fragment_program *p,
GLuint nr = p->program->Base.NumInstructions++;
struct prog_instruction *inst = &p->program->Base.Instructions[nr];
GLuint nr = p->program->Base.NumInstructions++;
struct prog_instruction *inst = &p->program->Base.Instructions[nr];
+ assert(nr < MAX_INSTRUCTIONS);
+
_mesa_init_instructions(inst, 1);
inst->Opcode = op;
_mesa_init_instructions(inst, 1);
inst->Opcode = op;