summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2019-11-07 14:25:19 +0100
committerPierre-Eric Pelloux-Prayer <[email protected]>2019-11-19 08:49:45 +0100
commit1ef297645c9f22d7f44e019b5a9ca09a84030f49 (patch)
tree9d3d1522be4d06e86aef8ad3ed1b0c5f56b4a10e /src/mesa
parent8b6d19413f05077f4d337273a12abb5cbb67c3b5 (diff)
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: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/bufferobj.c20
-rw-r--r--src/mesa/main/bufferobj.h4
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp1
3 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 73b210d105a..b5d6bb188d9 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -4954,3 +4954,23 @@ _mesa_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset,
buffer_page_commitment(ctx, bufferObj, offset, size, commit,
"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");
+}
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 23c4f20f3e2..588a6a7449b 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -457,4 +457,8 @@ void GLAPIENTRY
_mesa_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset,
GLsizeiptr size, GLboolean commit);
+void GLAPIENTRY
+_mesa_NamedBufferPageCommitmentEXT(GLuint buffer, GLintptr offset,
+ GLsizeiptr size, GLboolean commit);
+
#endif
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 66b77d09598..8b892c6fec2 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -1299,6 +1299,7 @@ const struct function common_desktop_functions_possible[] = {
/* GL_ARB_sparse_buffer */
{ "glBufferPageCommitmentARB", 43, -1 },
{ "glNamedBufferPageCommitmentARB", 43, -1 },
+ { "glNamedBufferPageCommitmentEXT", 43, -1 },
/* GL_ARB_bindless_texture */
{ "glGetTextureHandleARB", 40, -1 },