Skip to content

Conversation

@Headcrabed
Copy link
Contributor

No description provided.

@Headcrabed
Copy link
Contributor Author

@kasper93 Do you think this is ok?

both source and target metadata is correct.
both source and target metadata is correct. If you are using macOS, Windows
with ACM enabled, or Wayland that compositor has color management protocol
support, metadata should be always correct.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does color management have to do with source metadata?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metadata is provided by compositor's color management API, isn't it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option requires that both source and target metadata is correct. The compositor has nothing to do with the source, it doesn't even know anything about the source file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option requires that both source and target metadata is correct. The compositor has nothing to do with the source, it doesn't even know anything about the source file.

Then my opinion is to change this part to “output metadata should be always correct”, is this ok?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer saying "On color managed platforms, the output metadata will most likely be correct" instead of the current way of listing gpu-apis and platforms with their settings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated description, what's your opinion?

@Headcrabed Headcrabed force-pushed the description_improvement branch from 6b1a431 to bdbb1d5 Compare November 4, 2025 18:07
@Headcrabed
Copy link
Contributor Author

Also sdr-adjust-gamma=auto should be aware of icc-profile and icc-profile-auto, but I'm not sure how to do this. Any advice?

@kasper93
Copy link
Member

kasper93 commented Nov 4, 2025

Also sdr-adjust-gamma=auto should be aware of icc-profile and icc-profile-auto, but I'm not sure how to do this. Any advice?

What do you mean? icc-profile takes precedence over any other target options.

@Headcrabed
Copy link
Contributor Author

Also sdr-adjust-gamma=auto should be aware of icc-profile and icc-profile-auto, but I'm not sure how to do this. Any advice?

What do you mean? icc-profile takes precedence over any other target options.

So icc-profile will be correctly working when sdr-adjust-gamma=auto?

@kasper93
Copy link
Member

kasper93 commented Nov 5, 2025

Also sdr-adjust-gamma=auto should be aware of icc-profile and icc-profile-auto, but I'm not sure how to do this. Any advice?

What do you mean? icc-profile takes precedence over any other target options.

So icc-profile will be correctly working when sdr-adjust-gamma=auto?

Yes. Is there evidence that would say otherwise?

@Headcrabed
Copy link
Contributor Author

Also sdr-adjust-gamma=auto should be aware of icc-profile and icc-profile-auto, but I'm not sure how to do this. Any advice?

What do you mean? icc-profile takes precedence over any other target options.

So icc-profile will be correctly working when sdr-adjust-gamma=auto?

Yes. Is there evidence that would say otherwise?

When I'm testing under windows+ACM off and set icc-profile, setting sdr-adjust-gamma=auto would result in shift+i shows srgb, while sdr-adjust-gamma=yes would result in shift+i shows bt.1886(same as previous version)

@Headcrabed Headcrabed force-pushed the description_improvement branch from bdbb1d5 to fa4801a Compare November 5, 2025 03:32
@Headcrabed Headcrabed force-pushed the description_improvement branch from fa4801a to 6c4c803 Compare November 5, 2025 08:29
@github-actions
Copy link

github-actions bot commented Nov 5, 2025


However, your render API should also support passing output metadata to MPV.
Setting ``--gpu-api`` to ``d3d11`` or ``vulkan`` (``opengl`` won't work)
would allow this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, it is recommended to enable this option, if you can ensure that both source and target metadata is correct. On color managed platforms, the output metadata will most likely be correct. Such platforms include macOS, Windows with ACM and Wayland compositors with color management protocol support.

The part about render API is not necessary or even correct because Vulkan doesn't tell us anything about the target metadata. On Windows, we get it via D3D11 and on Wayland we get it via the protocol. This information is completely agnostic of the rendering API used, opengl just won't do any hinting unless we use the wayland protocol for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emmm you don't treat VK_COLOR_SPACE as metadata source?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the description here again, do you think this is ok?

@kasper93
Copy link
Member

kasper93 commented Nov 5, 2025

Also sdr-adjust-gamma=auto should be aware of icc-profile and icc-profile-auto, but I'm not sure how to do this. Any advice?

What do you mean? icc-profile takes precedence over any other target options.

So icc-profile will be correctly working when sdr-adjust-gamma=auto?

Yes. Is there evidence that would say otherwise?

When I'm testing under windows+ACM off and set icc-profile, setting sdr-adjust-gamma=auto would result in shift+i shows srgb, while sdr-adjust-gamma=yes would result in shift+i shows bt.1886(same as previous version)

It doesn't matter. named transfer function is not used when icc profile is applied or any other lut.

@Headcrabed Headcrabed force-pushed the description_improvement branch from 6c4c803 to d202cb3 Compare November 7, 2025 03:20
Add some description about output metadata.

Signed-off-by: Shengyu Qu <[email protected]>
@Headcrabed Headcrabed force-pushed the description_improvement branch from d202cb3 to f24dec3 Compare November 7, 2025 03:39
@Headcrabed Headcrabed force-pushed the description_improvement branch from f24dec3 to ee1184b Compare November 9, 2025 17:50
@Headcrabed
Copy link
Contributor Author

I added another commit to partially revert #17008
Since macOS is doing things correctly by default: https://projects.blender.org/blender/blender/issues/145022

@Headcrabed
Copy link
Contributor Author

I added another commit to partially revert #17008 Since macOS is doing things correctly by default: https://projects.blender.org/blender/blender/issues/145022

Forget about this. My mind wasn't clear. This extra commit is not needed, I've reverted it.

@Headcrabed Headcrabed force-pushed the description_improvement branch from 8a36849 to ee1184b Compare November 10, 2025 04:10
@Headcrabed
Copy link
Contributor Author

Headcrabed commented Nov 17, 2025

@kasper93 anything is blocking it from getting merged?

case PL_COLOR_TRC_GAMMA22:
case PL_COLOR_TRC_SRGB:
#ifdef __APPLE__
if (opts->sdr_adjust_gamma == 0)
Copy link
Member

@kasper93 kasper93 Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't do that. the option is should be respected. You could set default value to yes for macos, but I'm not sure it's correct.

/cc @Akemi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using different default values on different OSes looks weird... I didn't see any existing options doing like this, is there any?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

historical we never set different default values for different platforms, or at least not via a conditional preprocessor or similar. not sure if we have such cases now?

if we needed a different behaviour or default we usual let the context/backend/platform specific code decide such things, for example with a callback or similar (like these

struct ra_ctx_params {
// For special contexts (i.e. wayland) that want to check visibility
// before drawing a frame.
bool (*check_visible)(struct ra_ctx *ctx);
// See ra_swapchain_fns.color_depth.
int (*color_depth)(struct ra_ctx *ctx);
// Preferred device color space. Optional.
pl_color_space_t (*preferred_csp)(struct ra_ctx *ctx);
// See ra_swapchain_fns.get_vsync.
void (*get_vsync)(struct ra_ctx *ctx, struct vo_vsync_info *info);
// Set to the platform-specific function to swap buffers, like
// glXSwapBuffers, eglSwapBuffers etc. This will be called by
// ra_gl_ctx_swap_buffers. Required unless you either never call that
// function or if you override it yourself.
void (*swap_buffers)(struct ra_ctx *ctx);
};
).

i am also not sure of the necessity of this change, but admittedly this might be a bit over my head atm. it would probably be a good idea to properly describe the problem, how this fixes the problem and what the difference are (before/after).

maybe in the end it would just be okay to document that setting it to yes is preferred on macOS and leave it up to the user to se it. we have quite a few cases (in the past) where the default are not optimal for every platform.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am also not sure of the necessity of this change

I also don't see why it's needed and how does this differ from other platforms.

…no" on macOS

On macOS, global color management is always enabled, so there's no need to
make "auto" behave like "no".

Signed-off-by: Shengyu Qu <[email protected]>
@Headcrabed Headcrabed force-pushed the description_improvement branch from ee1184b to 77476a9 Compare November 18, 2025 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants