[Mesa-dev] [PATCH 03/16] mesa: Clamps the stencil value masks to GLint when queried
Eduardo Lima Mitev
elima at igalia.com
Thu Dec 18 01:28:51 PST 2014
On 12/18/2014 09:55 AM, Olivier Galibert wrote:
> Something is not clear to me: In which way -1 is incorrect?
>
Hi Olivier,
The values being queried are the front and back stencil masks. Masks are
(conceptually?) an unsigned integer, AFAIU. Also, the test I'm trying to
fix fails precisely because it expects a non-negative integer.
> Also, w.r.t comments, what you're doing is masking, not clamping,
> which incidentally is a good thing since clamping would be severely
> bad for stencil.
>
Clamping here means I'm converting an unsigned integer value (32 bits)
to a signed int (31 bits). Bit masking is the operation used to perform
that (because we can ignore the sign), but that's an "implementation
detail" if you will. The problem is fitting an unsigned int in a signed int.
Probably calling it clamping is confusing, I don't know. In any case the
final patch dropped that.
cheers,
Eduardo
More information about the mesa-dev
mailing list