<p><br>
On Oct 14, 2011 10:38 PM, "Brian Paul" <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>> wrote:<br>
><br>
> On 10/13/2011 09:47 PM, Yuanhan Liu wrote:<br>
>><br>
>> v2: quote the spec; explicitly exclude the GL_BITMAP case to make code<br>
>> more readable. (comments from Ian)<br>
>><br>
>> Signed-off-by: Yuanhan Liu<<a href="mailto:yuanhan.liu@linux.intel.com">yuanhan.liu@linux.intel.com</a>><br>
>> ---<br>
>> src/mesa/main/pbo.c | 12 ++++++++++++<br>
>> 1 files changed, 12 insertions(+), 0 deletions(-)<br>
>><br>
>> diff --git a/src/mesa/main/pbo.c b/src/mesa/main/pbo.c<br>
>> index 4e7e6f9..6a4ae09 100644<br>
>> --- a/src/mesa/main/pbo.c<br>
>> +++ b/src/mesa/main/pbo.c<br>
>> @@ -82,6 +82,18 @@ _mesa_validate_pbo_access(GLuint dimensions,<br>
>> } else {<br>
>> offset = ptr;<br>
>> sizeAddr = ((const GLubyte *) 0) + pack->BufferObj->Size;<br>
>> + /* The ARB_pixel_buffer_object spec says:<br>
>> + * "INVALID_OPERATION is generated by ColorTable, ColorSubTable,<br>
>> + * ConvolutionFilter2D, ConvolutionFilter1D, SeparableFilter2D,<br>
>> + * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D,<br>
>> + * TexSubImage2D, TexSubImage3D, and DrawPixels if the current<br>
>> + * PIXEL_UNPACK_BUFFER_BINDING_ARB value is non-zero and the data<br>
>> + * parameter is not evenly divisible into the number of basic machine<br>
>> + * units needed to store in memory a datum indicated by the type<br>
>> + * parameter."<br>
>> + */<br>
>> + if (type != GL_BITMAP&& ((GLuint)offset % _mesa_sizeof_type(type)))<br>
>> + return GL_FALSE;<br>
><br>
><br>
> Casting the 64-bit offset pointer to a 32-bit GLuint is going to cause compiler warnings.</p>
<p>Oh, right, I didn't notice that. Sorry about that.</p>
<p>><br>
> Using GLintptr instead of GLuint there should do the trick.</p>
<p>Will fix it next week.</p>
<p>Thanks,<br>
Yuanhan Liu</p>
<p>><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</p>