Documented guaranteed swap chain formats and validation by toji · Pull Request #1185 · gpuweb/gpuweb

I thought one of the outcomes from today's call was that we would have fixed sets of allowed formats, consistent across all systems, and the preferred format would always be one of them. So for the default case, this might just be bgra8unorm and rgba8unorm. Maybe we should write the spec for now such that only those two are allowed?

In particular, I'm not sure whether it makes sense to have the -srgb variants in there by default. They might only be available when the canvas context has been created with CanvasColorEncodingEnum "unorm8-srgb"? See https://github.com/WICG/canvas-color-space. (Also, note it currently says "Support for "unorm8" is mandatory. All other encodings are optional." I would very much like to be able to require srgb support...)

HDR is probably just rgba16float, though maybe we need rgb10a2unorm, I'm not sure (note CanvasColorEncodingEnum doesn't have such a thing now). Similarly we may only allow these formats if the canvas context has been created with some special flags in the first place.

Alternatively, maybe we shouldn't use the CanvasColorEncodingEnum part of canvas-color-space at all, and instead express it using our own (more concrete) texture formats in swap chain creation.