summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2017-11-06 18:11:38 -0700
committerBrian Paul <brianp@vmware.com>2017-11-16 20:35:17 -0700
commit940fba68c903d9b4da2d99a68f1c06c53d4fe82a (patch)
tree4f20c831cb791f97742005e0a550a4b4595216b5 /src/gallium/auxiliary/tgsi
parentd4726b13183c45fbc0869596c128f7c030b3cd9c (diff)
util/tgsi: use ASSERT_BITFIELD_SIZE() to check opcode field size
I've noticed at least two places where we store the TGSI opcode in an unsigned:8 bitfield. We're at 249 opcodes now. If we hit 256 we'll need to grow those bitfields. Use the new ASSERT_BITFIELD_SIZE() macro to detect that. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_info.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c
index 4e399508e5b..c39de0edfcd 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
@@ -55,6 +55,8 @@ tgsi_get_opcode_info( uint opcode )
{
static boolean firsttime = 1;
+ ASSERT_BITFIELD_SIZE(struct tgsi_opcode_info, opcode, TGSI_OPCODE_LAST - 1);
+
if (firsttime) {
unsigned i;
firsttime = 0;