aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorAlejandro Piñeiro <[email protected]>2017-10-13 20:43:01 +0200
committerAlejandro Piñeiro <[email protected]>2019-07-17 10:45:58 +0200
commit6ed19dcf80fbc53faeb5a43e0104e4213973b014 (patch)
tree7828b2dbe7699c1d3b23b40fb78256e87f36aaa8 /src/mesa
parentf6da2a55081daba10a285c2d1a77cd928ebd2854 (diff)
spirv_extensions: add spirv_supported_extensions on gl_constants
We can use it to get real values for ARB_spirv_extensions methods. Signed-off-by: Alejandro Piñeiro <[email protected]> Signed-off-by: Arcady Goldmints-Orlov <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/mtypes.h3
-rw-r--r--src/mesa/main/spirv_extensions.c19
2 files changed, 21 insertions, 1 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 745b243254a..1313ea2a579 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4128,6 +4128,9 @@ struct gl_constants
/** GL_ARB_gl_spirv */
struct spirv_supported_capabilities SpirVCapabilities;
+
+ /** GL_ARB_spirv_extensions */
+ struct spirv_supported_extensions *SpirVExtensions;
};
diff --git a/src/mesa/main/spirv_extensions.c b/src/mesa/main/spirv_extensions.c
index 99af4db2ba0..4dd637b6607 100644
--- a/src/mesa/main/spirv_extensions.c
+++ b/src/mesa/main/spirv_extensions.c
@@ -32,13 +32,30 @@
GLuint
_mesa_get_spirv_extension_count(struct gl_context *ctx)
{
- return 0;
+ if (ctx->Const.SpirVExtensions == NULL)
+ return 0;
+
+ return ctx->Const.SpirVExtensions->count;
}
const GLubyte *
_mesa_get_enabled_spirv_extension(struct gl_context *ctx,
GLuint index)
{
+ unsigned int n = 0;
+
+ if (ctx->Const.SpirVExtensions == NULL)
+ return (const GLubyte *) 0;
+
+ for (unsigned int i = 0; i < SPV_EXTENSIONS_COUNT; i++) {
+ if (ctx->Const.SpirVExtensions->supported[i]) {
+ if (n == index)
+ return (const GLubyte *) _mesa_spirv_extensions_to_string(i);
+ else
+ n++;
+ }
+ }
+
return (const GLubyte *) 0;
}