[Mesa-dev] [PATCH] tgsi: bump tgsi_opcode_info::output_mode size to 4 bits

Charmaine Lee charmainel at vmware.com
Fri Nov 17 22:44:58 UTC 2017


Reviewed-by: Charmaine Lee <charmainel at vmware.com>

________________________________________
From: Brian Paul <brianp at vmware.com>
Sent: Friday, November 17, 2017 2:40:01 PM
To: mesa-dev at lists.freedesktop.org
Cc: Charmaine Lee; Neha Bhende; Roland Scheidegger
Subject: [PATCH] tgsi: bump tgsi_opcode_info::output_mode size to 4 bits

To avoid problems with MSVC.  And verify size with ASSERT_BITFIELD_SIZE().
---
 src/gallium/auxiliary/tgsi/tgsi_info.c | 2 ++
 src/gallium/auxiliary/tgsi/tgsi_info.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c
index c39de0e..2baed5b 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
@@ -56,6 +56,8 @@ tgsi_get_opcode_info( uint opcode )
    static boolean firsttime = 1;

    ASSERT_BITFIELD_SIZE(struct tgsi_opcode_info, opcode, TGSI_OPCODE_LAST - 1);
+   ASSERT_BITFIELD_SIZE(struct tgsi_opcode_info, output_mode,
+                        TGSI_OUTPUT_OTHER);

    if (firsttime) {
       unsigned i;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.h b/src/gallium/auxiliary/tgsi/tgsi_info.h
index 8d32f47..bbd86c6 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.h
@@ -78,7 +78,7 @@ struct tgsi_opcode_info
    unsigned is_branch:1;
    unsigned pre_dedent:1;
    unsigned post_indent:1;
-   enum tgsi_output_mode output_mode:3;
+   enum tgsi_output_mode output_mode:4;
    unsigned opcode:8;
 };

--
1.9.1



More information about the mesa-dev mailing list