[Mesa-dev] [PATCH] mesa: handle zero-size buffers in MapBuffer and ranges in MapBufferRange
Ian Romanick
idr at freedesktop.org
Tue Aug 30 13:50:08 PDT 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 08/30/2011 12:26 PM, Marek Olšák wrote:
> On Tue, Aug 30, 2011 at 8:54 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 08/30/2011 10:15 AM, Marek Olšák wrote:
>>> Moved from st/mesa.
>>> This also fixes an assertion failure in piglit/fdo31934 on gallium drivers.
>>
>> So... I guess I don't understand why the mapping can't just fail and set
>> GL_OUT_OF_MEMORY. Returning a pointer to some random bit of storage
>> seems like a recipe for bugs that are excruciating for app developers to
>> debug.
>
> I checked the ARB_vertex_buffer_object and ARB_map_buffer_range specs
> and what should happen in this particular case is not specified. I
> guess this is the reason st/mesa does not throw an error and silently
> provides a dummy pointer.
It is somewhat ambiguous, and I'll submit a spec bug. However, I think
the language quoted below covers us. If there is no data store, then it
seems reasonable that you cannot map it. :)
"OUT_OF_MEMORY may be generated when MapBufferARB is called if the
data store of the buffer object in question cannot be mapped. This
may occur for a variety of system-specific reasons, such as the
absence of sufficient remaining virtual memory."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAk5dTQAACgkQX1gOwKyEAw+hRACeIQXa2kauf3NShLYfhg7iVR4w
vPYAnRlqrqETeq7mL5kapbjZv1GIQU1B
=IGNn
-----END PGP SIGNATURE-----
More information about the mesa-dev
mailing list