summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gpu/context.c')
-rw-r--r--video/out/gpu/context.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/video/out/gpu/context.c b/video/out/gpu/context.c
index 25e2a754bf..69f322c422 100644
--- a/video/out/gpu/context.c
+++ b/video/out/gpu/context.c
@@ -31,6 +31,7 @@
#include "video/out/vo.h"
#include "context.h"
+#include "spirv.h"
extern const struct ra_ctx_fns ra_ctx_glx;
extern const struct ra_ctx_fns ra_ctx_glx_probe;
@@ -185,10 +186,17 @@ struct ra_ctx *ra_ctx_create(struct vo *vo, const char *context_type,
return NULL;
}
-void ra_ctx_destroy(struct ra_ctx **ctx)
+void ra_ctx_destroy(struct ra_ctx **ctx_ptr)
{
- if (*ctx)
- (*ctx)->fns->uninit(*ctx);
- talloc_free(*ctx);
- *ctx = NULL;
+ struct ra_ctx *ctx = *ctx_ptr;
+ if (!ctx)
+ return;
+
+ if (ctx->spirv && ctx->spirv->fns->uninit)
+ ctx->spirv->fns->uninit(ctx);
+
+ ctx->fns->uninit(ctx);
+ talloc_free(ctx);
+
+ *ctx_ptr = NULL;
}