mesa/gallium: do not use enum for bit-allocated member
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 13 Mar 2020 12:56:44 +0000 (13:56 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Apr 2020 21:56:21 +0000 (21:56 +0000)
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@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4648>

src/mesa/state_tracker/st_program.h

index 286fabc01172f772d9b80a1526d9ac50fe6152d3..7483450eae5e4f9ae791488ff6bc5ea71ff7bef9 100644 (file)
@@ -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];