[Mesa-dev] [PATCH v3 5/6] spirv_extensions: i965: initialize SPIR-V extensions

Eduardo Lima Mitev elima at igalia.com
Wed Dec 13 20:09:18 UTC 2017


From: Alejandro PiƱeiro <apinheiro at igalia.com>

v2: Rebase update after changes on previous patches.
---
 src/mesa/drivers/dri/i965/brw_context.c | 9 ++++++++-
 src/mesa/main/context.c                 | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index a37bbb753d8..ea5892a8abf 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -76,6 +76,7 @@
 #include "isl/isl.h"
 
 #include "compiler/spirv/nir_spirv.h"
+#include "compiler/spirv/spirv_extensions.h"
 /***************************************
  * Mesa's Driver Functions
  ***************************************/
@@ -1084,9 +1085,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 3fa9f69f883..b48481d4372 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1377,6 +1377,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.15.1



More information about the mesa-dev mailing list