mirror of
https://github.com/mpv-player/mpv
synced 2025-01-09 00:19:32 +00:00
258487370f
In addition to the built-in nvidia compiler, we now also support a backend based on libshaderc. shaderc is sort of like glslang except it has a C API and is available as a dynamic library. The generated SPIR-V is now cached alongside the VkPipeline in the cached_program. We use a special cache header to ensure validity of this cache before passing it blindly to the vulkan implementation, since passing invalid SPIR-V can cause all sorts of nasty things. It's also designed to self-invalidate if the compiler gets better, by offering a catch-all `int compiler_version` that implementations can use as a cache invalidation marker.
14 lines
466 B
C
14 lines
466 B
C
#pragma once
|
|
|
|
#include "video/out/gpu/context.h"
|
|
#include "common.h"
|
|
|
|
// Helpers for ra_ctx based on ra_vk. These initialize ctx->ra and ctx->swchain.
|
|
void ra_vk_ctx_uninit(struct ra_ctx *ctx);
|
|
bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk,
|
|
VkPresentModeKHR preferred_mode);
|
|
bool ra_vk_ctx_resize(struct ra_swapchain *sw, int w, int h);
|
|
|
|
// May be called on a ra_ctx of any type.
|
|
struct mpvk_ctx *ra_vk_ctx_get(struct ra_ctx *ctx);
|