summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-09-02 10:36:48 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-09-02 10:36:48 +0100
commitdccf951be0db8e9ac0e25b1a9ecba937e2c2efcd (patch)
tree3a0e123134978fa4f864dcd5c99b578e1748b885
parent2e073da3447ee593dd46c8cc3c4c7f5b3023b7af (diff)
tgsi: Ensure number of srcs/dsts match the expected.
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index cb50ab0a45..63f6da130a 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -29,6 +29,7 @@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "tgsi/tgsi_ureg.h"
+#include "tgsi/tgsi_info.h"
#include "tgsi/tgsi_dump.h"
#include "util/u_memory.h"
#include "util/u_math.h"
@@ -654,6 +655,17 @@ ureg_insn(struct ureg_program *ureg,
unsigned insn, i;
boolean saturate;
+#ifdef DEBUG
+ {
+ const struct tgsi_opcode_info *info = tgsi_get_opcode_info( opcode );
+ assert(info);
+ if(info) {
+ assert(nr_dst == info->num_dst);
+ assert(nr_src == info->num_src);
+ }
+ }
+#endif
+
saturate = nr_dst ? dst[0].Saturate : FALSE;
insn = ureg_emit_insn( ureg, opcode, saturate, nr_dst, nr_src );