Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow out-of-standard-gamut colors with float canvases#4526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
kainino0x wants to merge6 commits intogpuweb:main
base:main
Choose a base branch
Loading
fromkainino0x:out-of-gamut-sometimes-valid

Conversation

@kainino0x
Copy link
Contributor

@kainino0xkainino0x commentedMar 19, 2024
edited
Loading

The spec previously said that it was undefined behavior to display "out-of-gamut premultiplied RGBA values" (R/G/B > A).

But that definition overlooked some cases. We intended to allow using an rgba16float srgb canvas to display wider-than-srgb colors, but such colors would according to the current definition be "out-of-gamut premultiplied RGBA values" (regardless of whether they're opaque like[1.04, 0, 0, 1] or transparent like[0.52, 0, 0, 0.5]).

This replaces that concept with "out-of-range premultiplied RGBA values", which is when theunpremultiplied equivalent of the color can't be represented in the format used for the color (e.g. premul[0.52, 0, 0, 0.5] inrgba8unorm). I've written it this way because Ithink it will be valid for#4108 as well if we ever get that [EDIT: fixed link to point to correct issue]. The idea is that as long as the implementation doesn't use any intermediate format that'sworse than the canvas format (in either range or precision), the color will be preserved.

@kainino0x
Copy link
ContributorAuthor

@ccameron-chromium does this seem right?

@github-actions
Copy link
Contributor

github-actionsbot commentedMar 19, 2024
edited
Loading

@kainino0x

This comment was marked as outdated.

@kainino0xkainino0x changed the titleAllow out-of-gamut premultiplied values with float canvasesAllow out-of-standard-gamut colors with float canvasesMar 19, 2024
@kainino0xkainino0xforce-pushed theout-of-gamut-sometimes-valid branch frome8ba5f4 toe7c33a8CompareMarch 19, 2024 21:09
@kainino0xkainino0xforce-pushed theout-of-gamut-sometimes-valid branch frome7c33a8 tod706a20CompareMarch 19, 2024 22:03
<!-- POSTV1(#4108): add example for XR formats, which *probably* handle this -->
</table>

Visible results may be undefined because the value could be lost at different steps of display:
Copy link
ContributorAuthor

@kainino0xkainino0xMar 19, 2024
edited
Loading

Choose a reason for hiding this comment

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

I wanted to write out an example of the actual blending math, but that ends up demonstrating a completelydifferent problem, which is that you get very different results doing nonlinear blendingin display color space (e.g.in display-p3), vsin srgb.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it gets complicated.

@kainino0x
Copy link
ContributorAuthor

kainino0x commentedMar 19, 2024
edited
Loading

Copy link
Contributor

@ccameron-chromiumccameron-chromium left a comment

Choose a reason for hiding this comment

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

This behavior seems fine. I'm a bit surprised that we're not allowing this even forrgba16float canvases (since I think that's pretty safe, and we are allowing such canvases to go out of gamut).

<!-- POSTV1(#4108): add example for XR formats, which *probably* handle this -->
</table>

Visible results may be undefined because the value could be lost at different steps of display:
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it gets complicated.

regardless of the canvas's {{GPUCanvasConfiguration/format}}.

However, when a ({{GPUCanvasAlphaMode/"premultiplied"}}) canvas containing such a value is
displayed *on screen*, the visible result for the entire canvas is undefined.
Copy link
Contributor

Choose a reason for hiding this comment

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

Checking that I understand.

Consider a canvas that is premultiplied,rgba16float,srgb being displayed on a P3 monitor.

If the value[0.52, 0, 0, 0.5] is written to the canvas, and the canvas is displayed, then the result is undefined even though it's within the gamut of the display, because of various machinations that might happen throughout the display pipeline.

This seems reasonable to me. Would the idea be to make this valid when in extended mode?

@kainino0xkainino0x added the needs-cts-issueThis change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet labelApr 27, 2024
@kainino0xkainino0x added the apiWebGPU API labelMay 21, 2024
@kainino0xkainino0x added this to theMilestone 1 milestoneJul 2, 2024
@KangzKangz modified the milestones:Milestone 1,Milestone 2Oct 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@ccameron-chromiumccameron-chromiumccameron-chromium left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

apiWebGPU APIneeds-cts-issueThis change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet

Projects

None yet

Milestone

Milestone 2

Development

Successfully merging this pull request may close these issues.

3 participants

@kainino0x@ccameron-chromium@Kangz

[8]ページ先頭

©2009-2025 Movatter.jp