Skip to content

Checking toneMapping extended code is wrong? #536

@greggman

Description

@greggman

context.getConfiguration().toneMapping.mode !== 'extended'

The spec says

This spec requires supporting HDR via the toneMapping option. If a user agent only supports toneMapping: "standard", then the toneMapping member should not exist in GPUCanvasConfiguration, so it will not exist on the object returned by getConfiguration() and will not be accessed by configure()). This allows websites to detect feature support.

This means the code above will get

Cannot read properties of undefined (reading 'mode')

on browsers that don't support this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions