[Mesa-dev] [PATCH] mesa: generate error if pbo offset is not aligned with the size of specified type

Liu Aleaxander aleaxander at gmail.com
Sat Oct 15 05:40:54 PDT 2011


On Fri, Oct 14, 2011 at 11:14 PM, Liu Aleaxander <aleaxander at gmail.com> wrote:
>
> On Oct 14, 2011 10:38 PM, "Brian Paul" <brianp at vmware.com> wrote:
>>
>> On 10/13/2011 09:47 PM, Yuanhan Liu wrote:
>>>
>>> v2: quote the spec; explicitly exclude the GL_BITMAP case to make code
>>> more readable. (comments from Ian)
>>>
>>> Signed-off-by: Yuanhan Liu<yuanhan.liu at linux.intel.com>
[snip]
>>> +       */
>>> +      if (type != GL_BITMAP&&  ((GLuint)offset % _mesa_sizeof_type(type)))

I came across this code today again, and I found I should call
_mesa_sizeof_packed_type() instead, as it includes packed pixel type
like GL_UNSIGNED_SHORT_5_6_5,   right?

Thanks,
Yuanhan Liu

>>> +         return GL_FALSE;
>>
>>
>> Casting the 64-bit offset pointer to a 32-bit GLuint is going to cause
>> compiler warnings.
>
> Oh, right, I didn't notice that. Sorry about that.
>
>>
>> Using GLintptr instead of GLuint there should do the trick.
>
> Will fix it next week.
>
> Thanks,
> Yuanhan Liu
>


More information about the mesa-dev mailing list