[Mesa-dev] [PATCH v2 01/25] mesa: Add GL_ARB_sparse_buffer boilerplate
Nicolai Hähnle
nhaehnle at gmail.com
Tue Mar 28 09:11:51 UTC 2017
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
src/mapi/glapi/gen/ARB_sparse_buffer.xml | 30 ++++++++++++++++++++++++++++++
src/mapi/glapi/gen/Makefile.am | 1 +
src/mapi/glapi/gen/gl_API.xml | 3 +++
src/mesa/main/bufferobj.c | 12 ++++++++++++
src/mesa/main/bufferobj.h | 7 +++++++
src/mesa/main/extensions_table.h | 1 +
src/mesa/main/mtypes.h | 1 +
src/mesa/main/tests/dispatch_sanity.cpp | 4 ++++
8 files changed, 59 insertions(+)
create mode 100644 src/mapi/glapi/gen/ARB_sparse_buffer.xml
diff --git a/src/mapi/glapi/gen/ARB_sparse_buffer.xml b/src/mapi/glapi/gen/ARB_sparse_buffer.xml
new file mode 100644
index 0000000..90bc659
--- /dev/null
+++ b/src/mapi/glapi/gen/ARB_sparse_buffer.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<OpenGLAPI>
+
+<category name="GL_ARB_sparse_buffer" number="172">
+
+ <function name="BufferPageCommitmentARB">
+ <param name="target" type="GLenum"/>
+ <param name="offset" type="GLintptr"/>
+ <param name="size" type="GLsizeiptr"/>
+ <param name="commit" type="GLboolean"/>
+ </function>
+
+ <!-- Only with GL_EXT_direct_state_access: glNamedBufferPageCommitmentEXT -->
+
+ <!-- Only with GL_ARB_direct_state_access -->
+ <function name="NamedBufferPageCommitmentARB">
+ <param name="buffer" type="GLuint"/>
+ <param name="offset" type="GLintptr"/>
+ <param name="size" type="GLsizeiptr"/>
+ <param name="commit" type="GLboolean"/>
+ </function>
+
+ <enum name="SPARSE_STORAGE_BIT_ARB" value="0x0400"/>
+ <enum name="SPARSE_BUFFER_PAGE_SIZE_ARB" value="0x82F8"/>
+
+</category>
+
+</OpenGLAPI>
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index 4133259..c793067 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -157,20 +157,21 @@ API_XML = \
ARB_program_interface_query.xml \
ARB_robustness.xml \
ARB_sample_shading.xml \
ARB_sampler_objects.xml \
ARB_seamless_cube_map.xml \
ARB_separate_shader_objects.xml \
ARB_shader_atomic_counters.xml \
ARB_shader_image_load_store.xml \
ARB_shader_subroutine.xml \
ARB_shader_storage_buffer_object.xml \
+ ARB_sparse_buffer.xml \
ARB_sync.xml \
ARB_tessellation_shader.xml \
ARB_texture_barrier.xml \
ARB_texture_buffer_object.xml \
ARB_texture_buffer_range.xml \
ARB_texture_compression_rgtc.xml \
ARB_texture_cube_map_array.xml \
ARB_texture_float.xml \
ARB_texture_gather.xml \
ARB_texture_multisample.xml \
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index dfaeaaf..02d87d3 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -8307,20 +8307,23 @@
<xi:include href="ARB_texture_barrier.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="KHR_context_flush_control.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- ARB extension 170 -->
<xi:include href="KHR_robustness.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- ARB extension 171 -->
<xi:include href="ARB_pipeline_statistics_query.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<!-- ARB extension 172 -->
+<xi:include href="ARB_sparse_buffer.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
<category name="es3.2">
<!-- This should be in es_EXT, but this file is included first and
the alias doesn't work otherwise. -->
<function name="PrimitiveBoundingBox" es2="3.2" desktop="false">
<param name="minX" type="GLfloat"/>
<param name="minY" type="GLfloat"/>
<param name="minZ" type="GLfloat"/>
<param name="minW" type="GLfloat"/>
<param name="maxX" type="GLfloat"/>
<param name="maxY" type="GLfloat"/>
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index eca86aa..cbd9228 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -4036,10 +4036,22 @@ _mesa_InvalidateBufferData(GLuint buffer)
if (_mesa_check_disallowed_mapping(bufObj)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glInvalidateBufferData(intersection with mapped "
"range)");
return;
}
if (ctx->Driver.InvalidateBufferSubData)
ctx->Driver.InvalidateBufferSubData(ctx, bufObj, 0, bufObj->Size);
}
+
+void GLAPIENTRY
+_mesa_BufferPageCommitmentARB(GLenum target, GLintptr offset, GLsizeiptr size,
+ GLboolean commit)
+{
+}
+
+void GLAPIENTRY
+_mesa_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset,
+ GLsizeiptr size, GLboolean commit)
+{
+}
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 5dcc553..cd0df93 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -341,12 +341,19 @@ _mesa_BindBuffersRange(GLenum target, GLuint first, GLsizei count,
void GLAPIENTRY
_mesa_BindBuffersBase(GLenum target, GLuint first, GLsizei count,
const GLuint *buffers);
void GLAPIENTRY
_mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
GLsizeiptr length);
void GLAPIENTRY
_mesa_InvalidateBufferData(GLuint buffer);
+void GLAPIENTRY
+_mesa_BufferPageCommitmentARB(GLenum target, GLintptr offset, GLsizeiptr size,
+ GLboolean commit);
+
+void GLAPIENTRY
+_mesa_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset,
+ GLsizeiptr size, GLboolean commit);
#endif
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index ec71791..734741a 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -118,20 +118,21 @@ EXT(ARB_shader_precision , ARB_shader_precision
EXT(ARB_shader_stencil_export , ARB_shader_stencil_export , GLL, GLC, x , x , 2009)
EXT(ARB_shader_storage_buffer_object , ARB_shader_storage_buffer_object , GLL, GLC, x , x , 2012)
EXT(ARB_shader_subroutine , ARB_shader_subroutine , x , GLC, x , x , 2010)
EXT(ARB_shader_texture_image_samples , ARB_shader_texture_image_samples , GLL, GLC, x , x , 2014)
EXT(ARB_shader_texture_lod , ARB_shader_texture_lod , GLL, GLC, x , x , 2009)
EXT(ARB_shader_viewport_layer_array , ARB_shader_viewport_layer_array , x , GLC, x , x , 2015)
EXT(ARB_shading_language_100 , dummy_true , GLL, x , x , x , 2003)
EXT(ARB_shading_language_420pack , ARB_shading_language_420pack , GLL, GLC, x , x , 2011)
EXT(ARB_shading_language_packing , ARB_shading_language_packing , GLL, GLC, x , x , 2011)
EXT(ARB_shadow , ARB_shadow , GLL, x , x , x , 2001)
+EXT(ARB_sparse_buffer , ARB_sparse_buffer , GLL, GLC, x , x , 2014)
EXT(ARB_stencil_texturing , ARB_stencil_texturing , GLL, GLC, x , x , 2012)
EXT(ARB_sync , ARB_sync , GLL, GLC, x , x , 2003)
EXT(ARB_tessellation_shader , ARB_tessellation_shader , x , GLC, x , x , 2009)
EXT(ARB_texture_barrier , NV_texture_barrier , GLL, GLC, x , x , 2014)
EXT(ARB_texture_border_clamp , ARB_texture_border_clamp , GLL, x , x , x , 2000)
EXT(ARB_texture_buffer_object , ARB_texture_buffer_object , x , GLC, x , x , 2008)
EXT(ARB_texture_buffer_object_rgb32 , ARB_texture_buffer_object_rgb32 , x , GLC, x , x , 2009)
EXT(ARB_texture_buffer_range , ARB_texture_buffer_range , x , GLC, x , x , 2012)
EXT(ARB_texture_compression , dummy_true , GLL, x , x , x , 2000)
EXT(ARB_texture_compression_bptc , ARB_texture_compression_bptc , GLL, GLC, x , x , 2010)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index be78b96..5f8b889 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3901,20 +3901,21 @@ struct gl_extensions
GLboolean ARB_shader_precision;
GLboolean ARB_shader_stencil_export;
GLboolean ARB_shader_storage_buffer_object;
GLboolean ARB_shader_subroutine;
GLboolean ARB_shader_texture_image_samples;
GLboolean ARB_shader_texture_lod;
GLboolean ARB_shader_viewport_layer_array;
GLboolean ARB_shading_language_packing;
GLboolean ARB_shading_language_420pack;
GLboolean ARB_shadow;
+ GLboolean ARB_sparse_buffer;
GLboolean ARB_stencil_texturing;
GLboolean ARB_sync;
GLboolean ARB_tessellation_shader;
GLboolean ARB_texture_border_clamp;
GLboolean ARB_texture_buffer_object;
GLboolean ARB_texture_buffer_object_rgb32;
GLboolean ARB_texture_buffer_range;
GLboolean ARB_texture_compression_bptc;
GLboolean ARB_texture_compression_rgtc;
GLboolean ARB_texture_cube_map;
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 2ea8704..12a9ee7 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -954,20 +954,24 @@ const struct function common_desktop_functions_possible[] = {
/* GL_GREMEDY_string_marker */
{ "glStringMarkerGREMEDY", 15, -1 },
/* GL_EXT_window_rectangles */
{ "glWindowRectanglesEXT", 30, -1 },
/* GL_KHR_blend_equation_advanced */
{ "glBlendBarrierKHR", 20, -1 },
+ /* GL_ARB_sparse_buffer */
+ { "glBufferPageCommitmentARB", 43, -1 },
+ { "glNamedBufferPageCommitmentARB", 43, -1 },
+
{ NULL, 0, -1 }
};
const struct function gl_compatibility_functions_possible[] = {
{ "glBindVertexArrayAPPLE", 10, -1 },
{ "glGenVertexArraysAPPLE", 10, -1 },
{ "glBindRenderbufferEXT", 10, -1 },
{ "glBindFramebufferEXT", 10, -1 },
{ "glNewList", 10, _gloffset_NewList },
{ "glEndList", 10, _gloffset_EndList },
--
2.9.3
More information about the mesa-dev
mailing list