summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Piñeiro <[email protected]>2017-10-14 10:52:51 +0200
committerAlejandro Piñeiro <[email protected]>2019-07-17 10:47:27 +0200
commit5a8496007202f065efb3734e5925717268efc226 (patch)
treea9e42b8ca423b77235a190742e7062887b1a9917
parent6ed19dcf80fbc53faeb5a43e0104e4213973b014 (diff)
spirv_extensions: i965: initialize SPIR-V extensions
v2: Rebase update after changes on previous patches. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c11
-rw-r--r--src/mesa/main/context.c2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index c3d4784e94c..3783d1532e9 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -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);
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 42fb404b50e..6e11f88cf1b 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -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);
}