Index | Thread | Search

From:
Sebastien Marie <semarie@kapouay.eu.org>
Subject:
Re: mpv shows a blue screen and libplacebo errors
To:
"Kirill A. Korinsky" <kirill@korins.ky>, Walter Alejandro Iglesias <wai@roquesor.com>
Cc:
ports@openbsd.org
Date:
Sun, 09 Nov 2025 12:18:02 +0100

Download raw body.

Thread
Kirill A. Korinsky <kirill@korins.ky> writes:

> On Sun, 09 Nov 2025 08:13:11 +0100,
> Walter Alejandro Iglesias <wai@roquesor.com> wrote:
>> 
>> After latest 'pkg_add -u' 'mpv --no-config' shows me a blue screen when
>> playing any video, it doesn't happen using '-vo xv' or '-vo x11'.  And a
>> very verbose ouptut in red about libplacebo:
>> 
>> MESA-INTEL: warning: /usr/xenocara/lib/mesa/mk/libanv_common/../../src/intel/vulkan/anv_formats.c:834: FINISHME: support more multi-planar formats with DRM modifiers
>> AO: [sndio] 48000Hz stereo 2ch s16
>> VO: [gpu] 1920x1080 yuv420p10
>> [vo/gpu/libplacebo] shaderc output:
>> [vo/gpu/libplacebo] shaderc: internal error: compilation succeeded but failed to optimize: Invalid SPIR-V binary version 1.6 for target environment SPIR-V 1.0 (under Vulkan 1.0 semantics).
>> [vo/gpu/libplacebo] 
>> [vo/gpu/libplacebo] 
>> [vo/gpu/libplacebo] shaderc compile status 'error' (0 errors, 0 warnings)
>> [vo/gpu/libplacebo] vk_compile_glsl(gpu, tmp, GLSL_SHADER_VERTEX, params->vertex_shader, &vert): VK_ERROR_INITIALIZATION_FAILED (../libplacebo-7.351.0/src/vulkan/gpu_pass.c:460)
>> [vo/gpu/libplacebo] vertex shader source:
>> 
>> (another 250 lines repeating the errors above)
>>
>
> Thanks for the report.
>
> The last update of libplacebo introduced an issue which upstream fixed at:
> https://code.videolan.org/videolan/libplacebo/-/commit/3662b1f5d5a721f31cbf6c0ad090ac2345834cab
>
> Here a backport that patch which fixes issue on my side.

fix the problem on my side too.

ok semarie@

> Index: Makefile
> ===================================================================
> RCS file: /home/cvs/ports/graphics/libplacebo/Makefile,v
> diff -u -p -r1.14 Makefile
> --- Makefile	3 Nov 2025 12:20:48 -0000	1.14
> +++ Makefile	9 Nov 2025 08:22:55 -0000
> @@ -3,6 +3,7 @@ COMMENT=	reusable library for GPU-accele
>  GH_ACCOUNT=	haasn
>  GH_PROJECT=	libplacebo
>  GH_TAGNAME=	v7.351.0
> +REVISION=	0
>  CATEGORIES=	graphics
>  
>  SHARED_LIBS=	placebo	9.0
> Index: patches/patch-src_glsl_meson_build
> ===================================================================
> RCS file: patches/patch-src_glsl_meson_build
> diff -N patches/patch-src_glsl_meson_build
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_glsl_meson_build	9 Nov 2025 08:24:04 -0000
> @@ -0,0 +1,21 @@
> +glsl/spirv_shaderc: check if shaderc recognizes Vulkan 1.4
> +https://code.videolan.org/videolan/libplacebo/-/commit/3662b1f5d5a721f31cbf6c0ad090ac2345834cab
> +
> +Index: src/glsl/meson.build
> +--- src/glsl/meson.build.orig
> ++++ src/glsl/meson.build
> +@@ -4,6 +4,14 @@ components.set('shaderc', shaderc.found())
> + if shaderc.found()
> +   build_deps += shaderc
> +   sources += 'glsl/spirv_shaderc.c'
> ++
> ++  # Version check for shaderc is not possible because everything after v2023.8
> ++  # uses this version due to a malformed version line.
> ++  # See https://github.com/google/shaderc/issues/1496
> ++  conf_internal.set('PL_HAVE_SHADERC_VK_1_4',
> ++    cc.has_header_symbol('shaderc/shaderc.h', 'shaderc_env_version_vulkan_1_4', dependencies: shaderc))
> ++  conf_internal.set('PL_HAVE_SHADERC_VK_1_3',
> ++    cc.has_header_symbol('shaderc/shaderc.h', 'shaderc_env_version_vulkan_1_3', dependencies: shaderc))
> + endif
> + 
> + # glslang
> Index: patches/patch-src_glsl_spirv_shaderc_c
> ===================================================================
> RCS file: patches/patch-src_glsl_spirv_shaderc_c
> diff -N patches/patch-src_glsl_spirv_shaderc_c
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_glsl_spirv_shaderc_c	9 Nov 2025 08:24:20 -0000
> @@ -0,0 +1,50 @@
> +glsl/spirv_shaderc: check if shaderc recognizes Vulkan 1.4
> +https://code.videolan.org/videolan/libplacebo/-/commit/3662b1f5d5a721f31cbf6c0ad090ac2345834cab
> +
> +Index: src/glsl/spirv_shaderc.c
> +--- src/glsl/spirv_shaderc.c.orig
> ++++ src/glsl/spirv_shaderc.c
> +@@ -22,6 +22,17 @@
> + #include "spirv.h"
> + #include "utils.h"
> + 
> ++#define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU)
> ++#define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU)
> ++
> ++#if defined(PL_HAVE_SHADERC_VK_1_4)
> ++# define SHADERC_VULKAN_MAX PL_VLK_VERSION(1, 4)
> ++#elif defined(PL_HAVE_SHADERC_VK_1_3)
> ++# define SHADERC_VULKAN_MAX PL_VLK_VERSION(1, 3)
> ++#else
> ++# define SHADERC_VULKAN_MAX PL_VLK_VERSION(1, 2)
> ++#endif
> ++
> + const struct spirv_compiler pl_spirv_shaderc;
> + 
> + struct priv {
> +@@ -57,8 +68,25 @@ static pl_spirv shaderc_create(pl_log log, struct pl_s
> + 
> +     // Clamp to supported version by shaderc
> +     if (ver < spirv->version.spv_version) {
> ++        PL_WARN(spirv, "SPIR-V %u.%u is not supported by the current"
> ++                       " version of shaderc. Falling back to %u.%u!",
> ++                spirv->version.spv_version >> 16, (spirv->version.spv_version >> 8) & 0xff,
> ++                ver >> 16, (ver >> 8) & 0xff);
> +         spirv->version.spv_version = ver;
> +         spirv->version.env_version = pl_spirv_version_to_vulkan(ver);
> ++    }
> ++
> ++    if (SHADERC_VULKAN_MAX < spirv->version.env_version) {
> ++        PL_WARN(spirv, "Vulkan %u.%u is not supported by the current"
> ++                       " version of shaderc. Falling back to %u.%u!",
> ++                       VK_API_VERSION_MAJOR(spirv->version.env_version),
> ++                       VK_API_VERSION_MINOR(spirv->version.env_version),
> ++                       VK_API_VERSION_MAJOR(SHADERC_VULKAN_MAX),
> ++                       VK_API_VERSION_MINOR(SHADERC_VULKAN_MAX));
> ++        // The SPIR-V version has already been clamped above.
> ++        // In practice, this only occurs for Vulkan 1.3 and 1.4,
> ++        // where the SPIR-V version is the same (1.6).
> ++        spirv->version.env_version = SHADERC_VULKAN_MAX;
> +     }
> + 
> +     pl_hash_merge(&spirv->signature, (uint64_t) spirv->version.spv_version << 32 |
-- 
Sebastien Marie