mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.22k stars 2.89k forks source link

HDR videos fail to tonemap/play with GPU-Next VO and Vulkan backend #10667

Closed BlueSwordM closed 2 years ago

BlueSwordM commented 2 years ago

Important Information

Reproduction steps

Build and run mpv normally. Use the GPU-Next and Vulkan backend in either the command line configuration or with other methods. All videos will play fine...unless they are HDR videos. HW decoding or software decoding does not change that.

Expected behavior

HDR videos play fine with the GPU-Next VO and Vulkan backend.

Actual behavior

Pink screen output: https://i.slow.pics/7A6NKENK.png If I use the OpenGL backend, the error doesn't appear in the first place.

Log file

https://0x0.st/oVyo.txt

Sample files

Any HDR clip from Youtube should work fine for testing, or something from Netflix's open library like Sol Levante.

Additional notes

The relevant bits are that SPIR-V 1.3 bits aren't installed(which is weird, since they are. I triple checked so, especially since I do have Vulkan 1.3 and SPIR-V 1.3 came with VK 1.1):

[vo/gpu-next/vulkan/libplacebo] input:178: error: 'subgroup op' : requires SPIR-V 1.3
[vo/gpu-next/vulkan/libplacebo] input:179: error: 'subgroup op' : requires SPIR-V 1.3
[vo/gpu-next/vulkan/libplacebo] input:180: error: 'subgroup op' : requires SPIR-V 1.3
[vo/gpu-next/vulkan/libplacebo] 
[vo/gpu-next/vulkan/libplacebo] shaderc compile status 'error' (3 errors, 0 warnings)
[vo/gpu-next/vulkan/libplacebo] vk_compile_glsl(gpu, tmp, GLSL_SHADER_COMPUTE, params->glsl_shader, &comp): VK_ERROR_INITIALIZATION_FAILED (../src/vulkan/gpu_pass.c:523)

libplacebo build information for reference: https://0x0.st/oVyH.txt

If it is more relevant to post this to the libplacebo repository, I will do so.

Traneptora commented 2 years ago

Try to do a clean rebuild of libplacebo, with rm -rf build/ and reconfiguring with meson again.

haasn commented 2 years ago

Looks like a glslang/shaderc bug. Unfortunately, I can't reproduce it on my end. What version of shaderc / glslang are you on?

Edit: Nvm, I see it in your build log.

haasn commented 2 years ago

Can you try upgrading to shaderc v2022.2? That's what I'm using and I don't get this issue

Traneptora commented 2 years ago

(This is a bug I encountered last May, and I solved it by doing a clean rebuild as above.)

Anyway I believe it's an issue with meson cache.

BlueSwordM commented 2 years ago

Well, yesterday and today, I decided to rebuild mpv and libplacebo a bunch of times, but I didn't even try shaderc. Let's do that and let's see if that fixes anything.

BlueSwordM commented 2 years ago

@haasn Ugrading to shaderc v2022.2 fixed the issue entirely. Thanks for your help.