[Mesa-dev] [v2 PATCH 6/6] spirv_extensions: i965: initialize SPIR-V extensions
Alejandro PiƱeiro
apinheiro at igalia.com
Thu Mar 8 15:00:19 UTC 2018
v2: Rebase update after changes on previous patches.
---
src/mesa/drivers/dri/i965/brw_context.c | 10 +++++++++-
src/mesa/main/context.c | 2 ++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index abd1592c0f5..4820ead5393 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -79,6 +79,8 @@
#include "common/gen_defines.h"
#include "compiler/spirv/nir_spirv.h"
+#include "compiler/spirv/spirv_extensions.h"
+
/***************************************
* Mesa's Driver Functions
***************************************/
@@ -1080,9 +1082,15 @@ brwCreateContext(gl_api api,
_mesa_compute_version(ctx);
/* GL_ARB_gl_spirv */
- if (ctx->Version >= 33)
+ if (ctx->Version >= 33) {
brw_initialize_spirv_supported_capabilities(brw);
+ /* GL_ARB_spirv_extensions */
+ ctx->Const.SpirVExtensions = MALLOC_STRUCT(spirv_supported_extensions);
+ spirv_fill_supported_spirv_extensions(ctx->Const.SpirVExtensions,
+ &ctx->Const.SpirVCapabilities);
+ }
+
_mesa_initialize_dispatch_tables(ctx);
_mesa_initialize_vbo_vtxfmt(ctx);
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index e13343b5e6c..3f482d9f545 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1382,6 +1382,8 @@ _mesa_free_context_data( struct gl_context *ctx )
if (ctx == _mesa_get_current_context()) {
_mesa_make_current(NULL, NULL, NULL);
}
+
+ free(ctx->Const.SpirVExtensions);
}
--
2.14.1
More information about the mesa-dev
mailing list