mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
mesa: add support for glMapNamedBufferRangeEXT()
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
eec5c01b5e
commit
cb0f25a926
5 changed files with 55 additions and 21 deletions
|
|
@ -145,5 +145,16 @@
|
|||
<param name="size" type="GLsizeiptr" />
|
||||
<param name="data" type="const GLvoid *" />
|
||||
</function>
|
||||
|
||||
<!-- OpenGL 3.0 -->
|
||||
|
||||
<function name="MapNamedBufferRangeEXT">
|
||||
<return type="GLvoid *" />
|
||||
<param name="buffer" type="GLuint" />
|
||||
<param name="offset" type="GLintptr" />
|
||||
<param name="length" type="GLsizeiptr" />
|
||||
<param name="access" type="GLbitfield" />
|
||||
</function>
|
||||
|
||||
</category>
|
||||
</OpenGLAPI>
|
||||
|
|
|
|||
|
|
@ -1477,6 +1477,7 @@ offsets = {
|
|||
"NamedBufferDataEXT": 1441,
|
||||
"NamedBufferSubDataEXT": 1442,
|
||||
"NamedBufferStorageEXT": 1443,
|
||||
"MapNamedBufferRangeEXT": 1444,
|
||||
}
|
||||
|
||||
functions = [
|
||||
|
|
|
|||
|
|
@ -3277,30 +3277,49 @@ _mesa_MapNamedBufferRange_no_error(GLuint buffer, GLintptr offset,
|
|||
"glMapNamedBufferRange");
|
||||
}
|
||||
|
||||
static void *
|
||||
map_named_buffer_range(GLuint buffer, GLintptr offset, GLsizeiptr length,
|
||||
GLbitfield access, bool dst_ext, const char *func)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_buffer_object *bufObj = NULL;
|
||||
|
||||
if (!ctx->Extensions.ARB_map_buffer_range) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"%s(ARB_map_buffer_range not supported)", func);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (dst_ext) {
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &bufObj, func))
|
||||
return NULL;
|
||||
} else {
|
||||
bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, func);
|
||||
if (!bufObj)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!validate_map_buffer_range(ctx, bufObj, offset, length, access, func))
|
||||
return NULL;
|
||||
|
||||
return map_buffer_range(ctx, bufObj, offset, length, access, func);
|
||||
}
|
||||
|
||||
void * GLAPIENTRY
|
||||
_mesa_MapNamedBufferRangeEXT(GLuint buffer, GLintptr offset, GLsizeiptr length,
|
||||
GLbitfield access)
|
||||
{
|
||||
return map_named_buffer_range(buffer, offset, length, access, true,
|
||||
"glMapNamedBufferRangeEXT");
|
||||
}
|
||||
|
||||
void * GLAPIENTRY
|
||||
_mesa_MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length,
|
||||
GLbitfield access)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_buffer_object *bufObj;
|
||||
|
||||
if (!ctx->Extensions.ARB_map_buffer_range) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glMapNamedBufferRange("
|
||||
"ARB_map_buffer_range not supported)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, "glMapNamedBufferRange");
|
||||
if (!bufObj)
|
||||
return NULL;
|
||||
|
||||
if (!validate_map_buffer_range(ctx, bufObj, offset, length, access,
|
||||
"glMapNamedBufferRange"))
|
||||
return NULL;
|
||||
|
||||
return map_buffer_range(ctx, bufObj, offset, length, access,
|
||||
"glMapNamedBufferRange");
|
||||
return map_named_buffer_range(buffer, offset, length, access, false,
|
||||
"glMapNamedBufferRange");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -357,6 +357,9 @@ _mesa_MapNamedBufferRange_no_error(GLuint buffer, GLintptr offset,
|
|||
void * GLAPIENTRY
|
||||
_mesa_MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length,
|
||||
GLbitfield access);
|
||||
void * GLAPIENTRY
|
||||
_mesa_MapNamedBufferRangeEXT(GLuint buffer, GLintptr offset,
|
||||
GLsizeiptr length, GLbitfield access);
|
||||
|
||||
void * GLAPIENTRY
|
||||
_mesa_MapBuffer_no_error(GLenum target, GLenum access);
|
||||
|
|
|
|||
|
|
@ -1222,7 +1222,7 @@ const struct function common_desktop_functions_possible[] = {
|
|||
//{ "glGetVertexArrayPointervEXT", 30, -1 },
|
||||
//{ "glGetVertexArrayIntegeri_vEXT", 30, -1 },
|
||||
//{ "glGetVertexArrayPointeri_vEXT", 30, -1 },
|
||||
//{ "glMapNamedBufferRangeEXT", 30, -1 },
|
||||
{ "glMapNamedBufferRangeEXT", 30, -1 },
|
||||
//{ "glFlushMappedNamedBufferRangeEXT", 30, -1 },
|
||||
|
||||
/* GL_ARB_internalformat_query */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue