OSDN Git Service

draw/aaline: stronger guard against no free samplers (v2)
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 6 Apr 2016 21:27:21 +0000 (16:27 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 7 Apr 2016 18:15:05 +0000 (13:15 -0500)
commitcc39879989a1f24c232a7d1b7037c4d3fcff2ce2
tree3d7a8eff7833622e7438fac79ed97a7cd7d23dc8
parent040f5cb09edef9b54510ca4b41c44f59a1f01fc3
draw/aaline: stronger guard against no free samplers (v2)

Line anti-aliasing 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/draw/draw_pipe_aaline.c