summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorVladimir Dergachev <volodya@freedesktop.org>2005-02-03 06:33:44 +0000
committerVladimir Dergachev <volodya@freedesktop.org>2005-02-03 06:33:44 +0000
commit19b260119a8ef78bbe1815d8011ff64a22208b3d (patch)
tree3a36f8bf43a8d1bdfb74d5492a37b4e919f449dc /src/mesa/drivers
parent3f0926b612ca2aaf7a38c2b0ac9a48baa0d7502d (diff)
Since high bits can be used for flags, mask them out.
This stops arbvpwarpmesh from segfaulting and it actually works - with immediate mode rendering.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertexprog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_vertexprog.c b/src/mesa/drivers/dri/r300/r300_vertexprog.c
index 6f1cd9fcac..f4b0d4109a 100644
--- a/src/mesa/drivers/dri/r300/r300_vertexprog.c
+++ b/src/mesa/drivers/dri/r300/r300_vertexprog.c
@@ -39,6 +39,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SCALAR_FLAG (1<<31)
#define FLAG_MASK (1<<31)
+#define OP_MASK (0xf) /* we are unlikely to have more than 15 */
#define OPN(operator, ip, op) {#operator, VP_OPCODE_##operator, ip, op}
struct{
@@ -430,7 +431,7 @@ static unsigned long op_operands(enum vp_opcode opcode)
/* Can we trust mesas opcodes to be in order ? */
for(i=0; i < sizeof(op_names) / sizeof(*op_names); i++)
if(op_names[i].opcode == opcode)
- return op_names[i].ip;
+ return op_names[i].ip & OP_MASK;
fprintf(stderr, "op %d not found in op_names\n", opcode);
exit(-1);