[Piglit] [PATCH 2/2] draw-pixels: update BYTE_TO_FLOAT() macro to match Mesa

Jason Ekstrand jason at jlekstrand.net
Thu Sep 25 23:06:54 PDT 2014


Yeah, I'm OK with this too.  At some point it would be good to put a lite
effort into making both formulas valid so that piglit works on both legacy
and post 3.2 contexts.  But that's more of a to do list item than a comment
on this patch.
--Jason
On Sep 25, 2014 3:21 PM, "Brian Paul" <brianp at vmware.com> wrote:

> On 09/25/2014 03:56 PM, Anuj Phogat wrote:
>
>> On Thu, Sep 25, 2014 at 6:52 AM, Brian Paul <brianp at vmware.com> wrote:
>>
>>> Use Mesa's UBYTE_TO_FLOAT_TEX() arithmetic.  This lets Mesa pass the
>>>
>> I think you mean BYTE_TO_FLOAT_TEX() here.
>>
>
> Yes, thanks.  I'll fix that.
>
>
>
>>  test.  No regression with nvidia's driver either.
>>> ---
>>>   tests/general/draw-pixels.c |    2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tests/general/draw-pixels.c b/tests/general/draw-pixels.c
>>> index 27b1675..65f5122 100644
>>> --- a/tests/general/draw-pixels.c
>>> +++ b/tests/general/draw-pixels.c
>>> @@ -37,7 +37,7 @@
>>>   #define UBYTE_TO_FLOAT(u) ((float) u / 255.0F)
>>>
>>>   /** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0] */
>>> -#define BYTE_TO_FLOAT(B)    ((2.0F * (B) + 1.0F) * (1.0F/255.0F))
>>> +#define BYTE_TO_FLOAT(B)    ((B) == -128 ? -1.0F : (B) * (1.0F/127.0F))
>>>
>>>   /** Convert GLushort in [0,65535] to GLfloat in [0.0,1.0] */
>>>   #define USHORT_TO_FLOAT(S)  ((GLfloat) (S) * (1.0F / 65535.0F))
>>> --
>>> 1.7.10.4
>>>
>>> _______________________________________________
>>> Piglit mailing list
>>> Piglit at lists.freedesktop.org
>>> https://urldefense.proofpoint.com/v1/url?u=http://lists.
>>> freedesktop.org/mailman/listinfo/piglit&k=oIvRg1%
>>> 2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%
>>> 2BTLs8wadB%2BiIj9xpBY%3D%0A&m=ohKLzWSFy4um%
>>> 2FbQz3pESy2HCK32TcqIlTx2AShS5cEk%3D%0A&s=d3673b4789b125e183860b156956ea
>>> 907d63e764103fff30ea8f48fee26dae0d
>>>
>>
>> Both patches are:
>> Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
>>
>>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140925/0920b05d/attachment-0001.html>


More information about the Piglit mailing list