mesa: add ARB_sparse_buffer NamedBufferPageCommitmentEXT function

The spec is unclear on how to handle the buffer argument so we reuse
the logic from the EXT_direct_state_access spec.
Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
parent 8b6d1941
...@@ -383,7 +383,7 @@ GL_EXT_direct_state_access additions from other extensions (complete list): ...@@ -383,7 +383,7 @@ GL_EXT_direct_state_access additions from other extensions (complete list):
GL_ARB_instanced_arrays DONE GL_ARB_instanced_arrays DONE
GL_ARB_internalformat_query2 DONE GL_ARB_internalformat_query2 DONE
GL_ARB_sparse_texture n/a GL_ARB_sparse_texture n/a
GL_ARB_sparse_buffer not started GL_ARB_sparse_buffer DONE
GL_ARB_texture_buffer_range DONE GL_ARB_texture_buffer_range DONE
GL_ARB_texture_storage DONE GL_ARB_texture_storage DONE
GL_ARB_texture_storage_multisample DONE GL_ARB_texture_storage_multisample DONE
......
...@@ -12,7 +12,13 @@ ...@@ -12,7 +12,13 @@
<param name="commit" type="GLboolean"/> <param name="commit" type="GLboolean"/>
</function> </function>
<!-- Only with GL_EXT_direct_state_access: glNamedBufferPageCommitmentEXT --> <!-- Only with GL_EXT_direct_state_access -->
<function name="NamedBufferPageCommitmentEXT">
<param name="buffer" type="GLuint"/>
<param name="offset" type="GLintptr"/>
<param name="size" type="GLsizeiptr"/>
<param name="commit" type="GLboolean"/>
</function>
<!-- Only with GL_ARB_direct_state_access --> <!-- Only with GL_ARB_direct_state_access -->
<function name="NamedBufferPageCommitmentARB"> <function name="NamedBufferPageCommitmentARB">
......
...@@ -1631,6 +1631,7 @@ offsets = { ...@@ -1631,6 +1631,7 @@ offsets = {
"VertexArrayVertexAttribLFormatEXT": 1595, "VertexArrayVertexAttribLFormatEXT": 1595,
"VertexArrayVertexAttribBindingEXT": 1596, "VertexArrayVertexAttribBindingEXT": 1596,
"VertexArrayVertexBindingDivisorEXT": 1597, "VertexArrayVertexBindingDivisorEXT": 1597,
"NamedBufferPageCommitmentEXT": 1598,
} }
functions = [ functions = [
......
...@@ -4954,3 +4954,23 @@ _mesa_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset, ...@@ -4954,3 +4954,23 @@ _mesa_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset,
buffer_page_commitment(ctx, bufferObj, offset, size, commit, buffer_page_commitment(ctx, bufferObj, offset, size, commit,
"glNamedBufferPageCommitmentARB"); "glNamedBufferPageCommitmentARB");
} }
void GLAPIENTRY
_mesa_NamedBufferPageCommitmentEXT(GLuint buffer, GLintptr offset,
GLsizeiptr size, GLboolean commit)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object *bufferObj;
/* Use NamedBuffer* functions logic from EXT_direct_state_access */
if (buffer != 0) {
bufferObj = _mesa_lookup_bufferobj(ctx, buffer);
if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &bufferObj,
"glNamedBufferPageCommitmentEXT"))
return;
} else {
bufferObj = ctx->Shared->NullBufferObj;
}
buffer_page_commitment(ctx, bufferObj, offset, size, commit,
"glNamedBufferPageCommitmentEXT");
}
...@@ -457,4 +457,8 @@ void GLAPIENTRY ...@@ -457,4 +457,8 @@ void GLAPIENTRY
_mesa_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset, _mesa_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset,
GLsizeiptr size, GLboolean commit); GLsizeiptr size, GLboolean commit);
void GLAPIENTRY
_mesa_NamedBufferPageCommitmentEXT(GLuint buffer, GLintptr offset,
GLsizeiptr size, GLboolean commit);
#endif #endif
...@@ -1299,6 +1299,7 @@ const struct function common_desktop_functions_possible[] = { ...@@ -1299,6 +1299,7 @@ const struct function common_desktop_functions_possible[] = {
/* GL_ARB_sparse_buffer */ /* GL_ARB_sparse_buffer */
{ "glBufferPageCommitmentARB", 43, -1 }, { "glBufferPageCommitmentARB", 43, -1 },
{ "glNamedBufferPageCommitmentARB", 43, -1 }, { "glNamedBufferPageCommitmentARB", 43, -1 },
{ "glNamedBufferPageCommitmentEXT", 43, -1 },
/* GL_ARB_bindless_texture */ /* GL_ARB_bindless_texture */
{ "glGetTextureHandleARB", 40, -1 }, { "glGetTextureHandleARB", 40, -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