mesa: add buffer != 0 checks to glNamedBufferEXT functions
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 26 Apr 2019 15:47:05 +0000 (17:47 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 28 Jun 2019 19:41:26 +0000 (15:41 -0400)
commit32eefb74511a4b6ff7eed169ce2a24f51ec974a0
tree4a7b2537976a5a6ccef15aa70148ffa34409b304
parent0de2754aa7b575616fb409c9c171d3ec99f269c6
mesa: add buffer != 0 checks to glNamedBufferEXT functions

The EXT_direct_state_access spec says:

    INVALID_OPERATION is generated by GetNamedBufferParameterivEXT,
    GetNamedBufferPointervEXT, GetNamedBufferSubDataEXT,
    MapNamedBufferEXT, NamedBufferDataEXT, NamedBufferSubDataEXT, and
    UnmapNamedBufferEXT if the buffer parameter is zero.

This commits adds buffer != 0 validation to the implemented functions.

glNamedBufferStorageEXT isn't included in this list and the EXT_buffer_storage
doesn't says that buffer = 0 is an error either so I didn't add the same
validation for this function.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/bufferobj.c