util/pstipple: stronger guard against no free samplers (v2)
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 6 Apr 2016 17:57:51 +0000 (12:57 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 7 Apr 2016 18:15:02 +0000 (13:15 -0500)
commit040f5cb09edef9b54510ca4b41c44f59a1f01fc3
tree5739f26f78a6b41387b2bc2c245ef29b43b6b6a2
parentb7e67b233717dddd6a1dd13fd571fee571d173bf
util/pstipple: stronger guard against no free samplers (v2)

When hasFixedUnit is false, polygon stippling will fail when there is no free
sampler available. Make the corresponding guard more robust in preparation
of raising PIPE_MAX_SAMPLERS to 32.

The literal 1 is a (signed) int, and shifting into the sign bit is undefined
in C, so change occurences of 1 to 1u.

v2: add an assert for bitfield size and use 1u << idx

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v1)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> (v1)
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
src/gallium/auxiliary/util/u_pstipple.c