Skip to content

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
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