Mesa (master): st/mesa: increase size of glsl_base_type bitfields

Brian Paul brianp at kemper.freedesktop.org
Thu Dec 28 16:50:20 UTC 2017


Module: Mesa
Branch: master
Commit: be5153fbee4925b0e6e46e008f49e36606215dc8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=be5153fbee4925b0e6e46e008f49e36606215dc8

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Dec 27 13:36:30 2017 -0700

st/mesa: increase size of glsl_base_type bitfields

Change 59f458cd8703b97b31b8 added more enums to glsl_base_type.  We
have to bump up the size of the bitfields for fields of this type
for MSVC.  Also, add another assertion to catch another place where
this enum bitfield is used.

Reviewed-by: Neha Bhende <bhenden at vmware.com>

---

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp       | 1 +
 src/mesa/state_tracker/st_glsl_to_tgsi_private.h | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 740c197c74..ec572f2739 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6254,6 +6254,7 @@ st_translate_program(
 
    ASSERT_BITFIELD_SIZE(st_src_reg, type, GLSL_TYPE_ERROR);
    ASSERT_BITFIELD_SIZE(st_dst_reg, type, GLSL_TYPE_ERROR);
+   ASSERT_BITFIELD_SIZE(glsl_to_tgsi_instruction, tex_type, GLSL_TYPE_ERROR);
    ASSERT_BITFIELD_SIZE(glsl_to_tgsi_instruction, image_format, PIPE_FORMAT_COUNT);
    ASSERT_BITFIELD_SIZE(glsl_to_tgsi_instruction, tex_target,
                         (gl_texture_index) (NUM_TEXTURE_TARGETS - 1));
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_private.h b/src/mesa/state_tracker/st_glsl_to_tgsi_private.h
index 3e519361dd..b7f535b97d 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi_private.h
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi_private.h
@@ -60,7 +60,7 @@ public:
    uint16_t swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */
    int negate:4; /**< NEGATE_XYZW mask from mesa */
    unsigned abs:1;
-   enum glsl_base_type type:5; /** GLSL_TYPE_* from GLSL IR (enum glsl_base_type) */
+   enum glsl_base_type type:6; /** GLSL_TYPE_* from GLSL IR (enum glsl_base_type) */
    unsigned has_index2:1;
    gl_register_file file:5; /**< PROGRAM_* from Mesa */
    /*
@@ -100,7 +100,7 @@ public:
    int16_t index2D;
    gl_register_file file:5; /**< PROGRAM_* from Mesa */
    unsigned writemask:4; /**< Bitfield of WRITEMASK_[XYZW] */
-   enum glsl_base_type type:5; /** GLSL_TYPE_* from GLSL IR (enum glsl_base_type) */
+   enum glsl_base_type type:6; /** GLSL_TYPE_* from GLSL IR (enum glsl_base_type) */
    unsigned has_index2:1;
    unsigned array_id:10;
 
@@ -128,7 +128,7 @@ public:
    unsigned sampler_base:5;
    unsigned sampler_array_size:6; /**< 1-based size of sampler array, 1 if not array */
    gl_texture_index tex_target:5;
-   glsl_base_type tex_type:5;
+   glsl_base_type tex_type:6;
    unsigned tex_shadow:1;
    enum pipe_format image_format:10;
    unsigned tex_offset_num_offset:3;




More information about the mesa-commit mailing list