mpv-player / mpv-player/mpv

Severe visual artifacts with specific shader on vulkan

Open
#15,721 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

os:linux
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

mpv Information
mpv v0.39.0-619-gc438732b23 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Jan 21 2025 08:04:12
libplacebo version: v7.349.0
FFmpeg version: n7.1
FFmpeg library versions:
   libavcodec      61.19.100
   libavdevice     61.3.100
   libavfilter     10.4.100
   libavformat     61.7.100
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100
Other Information
- Linux version: Arch Linux
- Kernel Version: 6.12.10
- GPU Model: NVIDIA Corporation AD107 [GeForce RTX 4060]
- Mesa/GPU Driver Version: 4.6.0 NVIDIA 565.77
- Window Manager and Version: Kwin 6.2.5
- Source of mpv: Built from AUR (https://aur.archlinux.org/packages/mpv-git)
- Latest known working version: Unsure. Issue began after I switched from windows to linux.
- Issue started after the following happened: See above.
Reproduction Steps

Run the following command with this shader file: CfL_Custom.txt

mpv --no-config --gpu-api=vulkan --vo=gpu-next --gpu-debug --log-file=output.txt --glsl-shaders=CfL_Custom.glsl chroma-420.jpeg

Expected Behavior

Shader works with no visual artifacts, as shown in the screenshot below.

Image

Actual Behavior

Severe visual artifacts, as shown in the screenshot below.

Image

This only occurs on my system with `--gpu-api=vulkan'; opengl works fine. However, I have reproduced this issue on a laptop running debian with intel graphics with both vulkan and opengl. I can provide the log file from that machine as well if necessary. I can also test on another machine with and AMD gpu if that would help.

Furthermore, I've narrowed down the issue to the luma downscaling passes at the top of the shader file. When replacing them with just vec4 hook() { return LUMA_texOff(vec2(chroma_offset_x, chroma_offset_y)); }
the issue does not occur. This is an acceptable workaround but I do prefer the way it looked with quadratic downscaling.

Log File

output.txt

Sample Files

chroma-420.jpeg

I carefully read all instruction and confirm that I did the following:
  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported mpv command with CfL_Custom.glsl, chroma-420.jpeg, and output.txt, then inspect the attached log and the shader's luma downscaling passes. Compare Vulkan and OpenGL behavior, including the simplified hook workaround; the issue is done when the quadratic downscaling shader produces no visual artifacts.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.