--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<OpenGLAPI>
+
+<category name="GL_ARB_spirv_extensions" number="194">
+
+ <enum name="SPIR_V_EXTENSIONS" value="0x9553"/>
+ <enum name="NUM_SPIR_V_EXTENSIONS" value="0x9554"/>
+
+</category>
+
+</OpenGLAPI>
<xi:include href="ARB_gl_spirv.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<!-- ARB extensions 191 - 193 -->
+
+<xi:include href="ARB_spirv_extensions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
<!-- Non-ARB extensions sorted by extension number. -->
<category name="GL_EXT_blend_color" number="2">
'ARB_shader_subroutine.xml',
'ARB_shader_storage_buffer_object.xml',
'ARB_sparse_buffer.xml',
+ 'ARB_spirv_extensions.xml',
'ARB_sync.xml',
'ARB_tessellation_shader.xml',
'ARB_texture_barrier.xml',
main/shader_query.cpp \
main/shared.c \
main/shared.h \
+ main/spirv_extensions.c \
+ main/spirv_extensions.h \
main/state.c \
main/state.h \
main/stencil.c \
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_spirv_extensions , ARB_spirv_extensions , x, GLC, x , x , 2016)
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 , GLL, GLC, x , x , 2009)
#include "get.h"
#include "macros.h"
#include "mtypes.h"
+#include "spirv_extensions.h"
#include "state.h"
#include "texcompress.h"
#include "texstate.h"
EXTRA_EXT(NV_conservative_raster_pre_snap_triangles);
EXTRA_EXT(ARB_sample_locations);
EXTRA_EXT(AMD_framebuffer_multisample_advanced);
+EXTRA_EXT(ARB_spirv_extensions);
static const int
extra_ARB_color_buffer_float_or_glcore[] = {
v->value_int_n.ints[0] = GL_PROGRAM_BINARY_FORMAT_MESA;
}
break;
+ /* ARB_spirv_extensions */
+ case GL_NUM_SPIR_V_EXTENSIONS:
+ v->value_int = _mesa_get_spirv_extension_count(ctx);
+ break;
/* GL_EXT_disjoint_timer_query */
case GL_GPU_DISJOINT_EXT:
{
# GL_ARB_sampler_objects / GL 3.3 / GLES 3.0
[ "SAMPLER_BINDING", "LOC_CUSTOM, TYPE_INT, GL_SAMPLER_BINDING, NO_EXTRA" ],
+# GL_ARB_spirv_extensions
+ [ "NUM_SPIR_V_EXTENSIONS", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_spirv_extensions" ],
+
# GL_ARB_sync
[ "MAX_SERVER_WAIT_TIMEOUT", "CONTEXT_INT64(Const.MaxServerWaitTimeout), extra_ARB_sync" ],
#include "mtypes.h"
#include "macros.h"
#include "version.h"
+#include "spirv_extensions.h"
/**
* Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query.
}
return (const GLubyte *) version;
}
+ case GL_SPIR_V_EXTENSIONS:
+ if (!ctx->Extensions.ARB_spirv_extensions) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetStringi");
+ return (const GLubyte *) 0;
+ }
+
+ if (index >= _mesa_get_spirv_extension_count(ctx)) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetStringi(index=%u)", index);
+ return (const GLubyte *) 0;
+ }
+ return _mesa_get_enabled_spirv_extension(ctx, index);
+
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetStringi");
return (const GLubyte *) 0;
GLboolean ARB_shadow;
GLboolean ARB_sparse_buffer;
GLboolean ARB_stencil_texturing;
+ GLboolean ARB_spirv_extensions;
GLboolean ARB_sync;
GLboolean ARB_tessellation_shader;
GLboolean ARB_texture_border_clamp;
--- /dev/null
+/*
+ * Copyright © 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file
+ * \brief SPIRV-V extension handling. See ARB_spirv_extensions
+ */
+
+#include "spirv_extensions.h"
+
+GLuint
+_mesa_get_spirv_extension_count(struct gl_context *ctx)
+{
+ return 0;
+}
+
+const GLubyte *
+_mesa_get_enabled_spirv_extension(struct gl_context *ctx,
+ GLuint index)
+{
+ return (const GLubyte *) 0;
+}
--- /dev/null
+/*
+ * Copyright 2017 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file
+ * \brief SPIRV-V extension handling. See ARB_spirv_extensions
+ */
+
+#ifndef _SPIRVEXTENSIONS_H_
+#define _SPIRVEXTENSIONS_H_
+
+#include "mtypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern GLuint
+_mesa_get_spirv_extension_count(struct gl_context *ctx);
+
+extern const GLubyte *
+_mesa_get_enabled_spirv_extension(struct gl_context *ctx,
+ GLuint index);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SPIRVEXTENSIONS_H */
'main/shader_query.cpp',
'main/shared.c',
'main/shared.h',
+ 'main/spirv_extensions.c',
+ 'main/spirv_extensions.h',
'main/state.c',
'main/state.h',
'main/stencil.c',