mpv-player / mpv-player/mpv

max_pq_y is not available in shaders

Open
#16,752 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

mpv Information
mpv v0.40.0-288-g80d2a6a7e-dirty Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Aug 23 2025 19:30:45
libplacebo version: v7.353.0 (v7.351.0-55-ga0fd4f3-dirty)
FFmpeg version: n7.1.1
FFmpeg library versions:
   libavcodec      61.19.101
   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
- Windows version: Windows 11 Pro
- GPU model, driver and version: NVIDIA GeForce RTX 5080, 577.00 Studio
Reproduction Steps

Playing a normal HDR file using this mpv.conf:

input-ipc-server=mpvpipe
hwdec=auto-copy
hwdec-codecs=all
vo=gpu-next
gpu-api=d3d11
profile=gpu-hq

vf=format=dolbyvision=no
target-colorspace-hint=no
target-trc=pq
target-prim=bt.2020
hdr-compute-peak=yes
hdr-peak-decay-rate=0
tone-mapping=clip
gamut-mapping-mode=clip

glsl-shader=~~/shaders/test.glsl

and this shader:

//!PARAM max_pq_y
//!TYPE DYNAMIC float
1.0

//!HOOK OUTPUT
//!BIND HOOKED
//!DESC Test

vec4 hook() {
	vec4 color = HOOKED_tex(HOOKED_pos);

	if (max_pq_y == 0.0) { return vec4(1.0, 0.0, 0.0, 0.0); }

	return color;
}
Expected Behavior

The value of max_pq_y should change per frame.

Actual Behavior

The value of max_pq_y is always equal to 0.0.

Log File

mpv_log.txt

Sample Files

No response

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

Reproduce the issue with the shown mpv.conf and test.glsl using vo=gpu-next and gpu-api=d3d11. Trace how the max_pq_y dynamic shader parameter is supplied, then verify that it receives a changing per-frame value instead of always being 0.0.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.