spirv_extensions: i965: initialize SPIR-V extensions
authorAlejandro Piñeiro <apinheiro@igalia.com>
Sat, 14 Oct 2017 08:52:51 +0000 (10:52 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Wed, 17 Jul 2019 08:47:27 +0000 (10:47 +0200)
v2: Rebase update after changes on previous patches.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/main/context.c

index c3d4784e94c3ce014021ced7e0da5976c77be994..3783d1532e9b1ea6961bc0b3af203e147311e6b4 100644 (file)
@@ -46,6 +46,7 @@
 #include "main/framebuffer.h"
 #include "main/stencil.h"
 #include "main/state.h"
+#include "main/spirv_extensions.h"
 
 #include "vbo/vbo.h"
 
@@ -1126,9 +1127,17 @@ brwCreateContext(gl_api api,
    _mesa_compute_version(ctx);
 
    /* GL_ARB_gl_spirv */
-   if (ctx->Extensions.ARB_gl_spirv)
+   if (ctx->Extensions.ARB_gl_spirv) {
       brw_initialize_spirv_supported_capabilities(brw);
 
+      if (ctx->Extensions.ARB_spirv_extensions) {
+         /* GL_ARB_spirv_extensions */
+         ctx->Const.SpirVExtensions = MALLOC_STRUCT(spirv_supported_extensions);
+         _mesa_fill_supported_spirv_extensions(ctx->Const.SpirVExtensions,
+                                               &ctx->Const.SpirVCapabilities);
+      }
+   }
+
    _mesa_initialize_dispatch_tables(ctx);
    _mesa_initialize_vbo_vtxfmt(ctx);
 
index 42fb404b50ecd2e039d6b927f2f35f1688cb4fe4..6e11f88cf1ba19d60bd9795f291c65e08be1d0fc 100644 (file)
@@ -1403,6 +1403,8 @@ _mesa_free_context_data(struct gl_context *ctx, bool destroy_compiler_types)
    if (ctx == _mesa_get_current_context()) {
       _mesa_make_current(NULL, NULL, NULL);
    }
+
+   free(ctx->Const.SpirVExtensions);
 }