Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when HDR canvas is not supported #451

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

beaufortfrancois
Copy link
Collaborator

Following up on #432 (comment), this PR adds a warning when the browser does not support HDR canvas thanks to the new GPUCanvasContext getConfiguration() method added to spec.

}
if (
simulationParams.toneMappingMode === 'extended' &&
context.getConfiguration().toneMapping.mode !== 'extended'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this is necessary for this to work on browsers that don't expose toneMapping (though unfortunately the rest of the sample doesn't work right now in Firefox so I can't check)

Suggested change
context.getConfiguration().toneMapping.mode !== 'extended'
context.getConfiguration().toneMapping?.mode !== 'extended'

Copy link
Collaborator

Choose a reason for hiding this comment

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

(actually now that I think about it that wouldn't trigger it either because firefox probably doesn't have getConfiguration or toneMapping.)

This logic will be triggered if WebKit chooses to remove this temporarily until they implement HDR canvas. (The sample doesn't display as HDR right now in Safari TP even though the option exists so I'm assuming it's not implemented.) @mwyrzykowski

Copy link
Contributor

Choose a reason for hiding this comment

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

That's right, the WebKit PR just added the options to the idl file.

HDR Canvas is tracked by https://bugs.webkit.org/show_bug.cgi?id=276502

@kainino0x kainino0x enabled auto-merge (squash) October 1, 2024 19:19
@kainino0x kainino0x merged commit 6556fee into webgpu:main Oct 1, 2024
1 check passed
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.

3 participants