gallium: increase pipe_sampler_view::target bitfield size for MSVC
authorBrian Paul <brianp@vmware.com>
Wed, 1 Nov 2017 12:17:03 +0000 (06:17 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 1 Nov 2017 17:06:02 +0000 (11:06 -0600)
commiteedecb4ecae36c5b01968fe668b894f573fbee10
treef21a72e9fbee615504fea15bfe4ee93aa49a766a
parent5d4ffb997059fc22bd0463e648831322f939ade6
gallium: increase pipe_sampler_view::target bitfield size for MSVC

MSVC treats enums as being signed.  The 4-bit target field isn't large
enough to correctly store the value 8 (for PIPE_TEXTURE_CUBE_ARRAY).
The bitfield value 0x8 was being interpreted as -8 so matching the
target with PIPE_TEXTURE_CUBE_ARRAY in switch statements, etc. was
failing.

To keep the structure size the same, we reduce the format field from
16 bits to 15.  There don't appear to be any other enum bitfields
which need to be adjusted.

This fixes a number of Piglit cube map array tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/include/pipe/p_state.h