Mesa (staging/20.0): mesa/gallium: do not use enum for bit-allocated member

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 23 04:37:49 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: d0a7c5b2e0e5c41cc1c3a20932b0aefa3de251f0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d0a7c5b2e0e5c41cc1c3a20932b0aefa3de251f0

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Fri Mar 13 13:56:44 2020 +0100

mesa/gallium: do not use enum for bit-allocated member

The signedness of enums are undefined, so on platforms with signed
enums, this isn't going to work. One such platform is Microsoft Windows.

So let's just use an unsigned here instead.

Fixes: b1c4c4c7f53 ("mesa/gallium: automatically lower alpha-testing")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4648>
(cherry picked from commit 013d9e40feed336d983b728357e4ce77b871c36d)

---

 .pick_status.json                   | 2 +-
 src/mesa/state_tracker/st_program.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index cd06662184a..a0abadd9378 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -463,7 +463,7 @@
         "description": "mesa/gallium: do not use enum for bit-allocated member",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "b1c4c4c7f53cde52a8f3b3ec17cd66b89bf04199"
     },
diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h
index 89d5ecfd6f3..39839c41ab3 100644
--- a/src/mesa/state_tracker/st_program.h
+++ b/src/mesa/state_tracker/st_program.h
@@ -137,7 +137,7 @@ struct st_fp_variant_key
    GLuint lower_two_sided_color:1;
 
    GLuint lower_flatshade:1;
-   enum compare_func lower_alpha_func:3;
+   unsigned lower_alpha_func:3;
 
    /** needed for ATI_fragment_shader */
    char texture_targets[MAX_NUM_FRAGMENT_REGISTERS_ATI];



More information about the mesa-commit mailing list