Commit ebaadba3 authored by Timothy Arceri's avatar Timothy Arceri

mesa: add support for glMapNamedBufferEXT()

parent 1fad91a0
......@@ -154,6 +154,12 @@
<param name="data" type="const GLvoid *" />
</function>
<function name="MapNamedBufferEXT">
<return type="GLvoid *" />
<param name="buffer" type="GLuint" />
<param name="access" type="GLenum" />
</function>
<function name="UnmapNamedBufferEXT">
<return type="GLboolean" />
<param name="buffer" type="GLuint" />
......
......@@ -3418,6 +3418,29 @@ _mesa_MapNamedBuffer(GLuint buffer, GLenum access)
"glMapNamedBuffer");
}
void * GLAPIENTRY
_mesa_MapNamedBufferEXT(GLuint buffer, GLenum access)
{
GET_CURRENT_CONTEXT(ctx);
GLbitfield accessFlags;
if (!get_map_buffer_access_flags(ctx, access, &accessFlags)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glMapNamedBufferEXT(invalid access)");
return NULL;
}
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
&bufObj, "glMapNamedBufferEXT"))
return NULL;
if (!validate_map_buffer_range(ctx, bufObj, 0, bufObj->Size, accessFlags,
"glMapNamedBufferEXT"))
return NULL;
return map_buffer_range(ctx, bufObj, 0, bufObj->Size, accessFlags,
"glMapNamedBufferEXT");
}
static void
flush_mapped_buffer_range(struct gl_context *ctx,
......
......@@ -370,6 +370,8 @@ void * GLAPIENTRY
_mesa_MapNamedBuffer_no_error(GLuint buffer, GLenum access);
void * GLAPIENTRY
_mesa_MapNamedBuffer(GLuint buffer, GLenum access);
void * GLAPIENTRY
_mesa_MapNamedBufferEXT(GLuint buffer, GLenum access);
void GLAPIENTRY
_mesa_FlushMappedBufferRange_no_error(GLenum target, GLintptr offset,
......
......@@ -1134,7 +1134,7 @@ const struct function common_desktop_functions_possible[] = {
/* GL_EXT_direct_state_access - GL 1.5 */
{ "glNamedBufferDataEXT", 10, -1 },
{ "glNamedBufferSubDataEXT", 10, -1 },
//{ "glMapNamedBufferEXT", 10, -1 },
{ "glMapNamedBufferEXT", 10, -1 },
{ "glUnmapNamedBufferEXT", 10, -1 },
//{ "glGetNamedBufferParameterivEXT", 10, -1 },
//{ "glGetNamedBufferPointervEXT", 10, -1 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment