summaryrefslogtreecommitdiffstats
path: root/video/out/vulkan/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/vulkan/context.c')
-rw-r--r--video/out/vulkan/context.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c
index bd456d214c..d2445fbda7 100644
--- a/video/out/vulkan/context.c
+++ b/video/out/vulkan/context.c
@@ -16,6 +16,8 @@
*/
#include "options/m_config.h"
+#include "video/out/gpu/spirv.h"
+
#include "context.h"
#include "ra_vk.h"
#include "utils.h"
@@ -125,6 +127,17 @@ struct priv {
int last_imgidx; // the image index last acquired (for submit)
};
+static const struct ra_swapchain_fns vulkan_swapchain;
+
+struct mpvk_ctx *ra_vk_ctx_get(struct ra_ctx *ctx)
+{
+ if (ctx->swapchain->fns != &vulkan_swapchain)
+ return NULL;
+
+ struct priv *p = ctx->swapchain->priv;
+ return p->vk;
+}
+
static bool update_swapchain_info(struct priv *p,
VkSwapchainCreateInfoKHR *info)
{
@@ -265,6 +278,9 @@ bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk,
if (!mpvk_find_phys_device(vk, p->opts->device, ctx->opts.allow_sw))
goto error;
+ if (!spirv_compiler_init(ctx))
+ goto error;
+ vk->spirv = ctx->spirv;
if (!mpvk_pick_surface_format(vk))
goto error;
if (!mpvk_device_init(vk, p->opts->dev_opts))