Skip to content

Space efficient wide color support #4108

Open

Description

@litherum

Background

(If you already understand color theory, please feel free to skip this section.)

Let's discuss wide color. This is a term that probably requires some explanation.

For the sake of simplicity, let's pretend that sRGB is a 2-dimensional color space - just so we can visualize it a bit easier. Here's our visualization of all the colors in sRGB:

0 basic

Note how bottom left is black, top right is white, the Y axis is increasing red, and the X axis is increasing blue. The origin is at the bottom left of the image.

The "gamut" of sRGB represents the set of colors present in sRGB. Here's a visualization of the boundary of the gamut:

1 simplegamut

Okay. The goal here is to be able to represent colors more highly saturated than possible in sRGB. Here's a visualization of the colors we want to represent (also showing the gamut of sRGB as a reference):

2 widecolor

This is wide color. (It looks "wide" if you tilt your head to the side a bit...) We are essentially defining a new gamut, which is bigger than sRGB's gamut. All the colors within sRGB are present within our new "wide" color space, and then some.

3 gamuts

Note that the black point and the white point are the same - we haven't changed what black means, and we aren't supporting any brighter whites; we're only trying to represent more saturated colors: bluer blues, and redder reds.

(Aside: This is different than HDR, which would have a picture like this:)

4 hdr

(The same colors are present in HDR, but the values can go (much) beyond 1.0.)

Anyway, back to wide color. Let's imagine that our sRGB colors are represented with only 2 bits per channel. That would mean only these specific dots are representable:

5 representable values

Okay, so what do we do for wide color? It would be tempting to just move the dots around to cover the new larger gamut, like this:

6 representable values stretched

... But that's bad. The new gamut is bigger than the old gamut, so if we use the same number of dots, they get farther apart. This is bad because the distance between the dots is an intentional result of the biologic makeup of human eyes. Human eyes only have so much fidelity to distinguish adjacent colors, so there is an upper bound on how far adjacent representable colors can be in our color system. If the dots are too far apart, there become colors which are discernible by humans which are not representable in our system; whereas if the dots are too close together, you're just wasting information/bandwidth.

Okay, so we need more dots. So we want our system to look like this, instead:

7 deep color

The fact that there are more dots than there were before is called "deep color."

Okay, so now we have to map values to those points. It is tempting to just map the entire gamut from 0 to 1, like this:

8 colorspace conversion

But there's another way possible to do it, like this:

9 xr formats

This second way is a bit less intuitive, but the benefit is that compositing with sRGB content becomes trivial. If you use the first way, the compositor has to find a common color space, then map each color into it, then blend. However, if you use the second way instead, the color system is backwards compatible with sRGB, so you don't have to do any colorspace conversion to blend. Just blend on the values you've got.

Motivation

We already have FP32 and FP16 pixel formats. However, the downside to those is that, to hold an RGB color, you'd need 64 (or even 128) bits to do so. This is compared to the 32 bits that authors use today to hold RGB8 colors.

But doubling the memory use is a real shame, because the wide color gamut is only a little bit bigger than the sRGB gamut. It's nowhere near twice as big.

FP16 makes total sense for HDR rendering, where the new gamut really is multiple times as big as the sRGB gamut. But for wide color, it's a big waste.

This is particularly important because, in order for wide color to be useful during rendering, the materials in the world need to be authored in wide color too. This means that, not just the render targets would need to support wide color, but all texture assets would need it too. So we're not talking about a potential doubling of size of just a few resources; instead, we're talking about a doubling of size of potentially every texture. Doubling video memory use would probably be a dealbreaker for many content creators.

Prior Art

Metal has a family of pixel formats that match the behavior described above:

  • They are 10 bits per channel, meaning you get more representable values, therefore preserving the max distance between adjacent representable values, and avoiding banding
  • Backwards compatible. If you sample these new pixel formats and you get a value of (1, 0, 0), that means the same thing as if you had sampled a regular RGB texture and gotten the same value
  • The range of each channel is between -0.752941 to 1.25098. This is good because it goes beyond 0-1 by just enough but not a huge amount
  • The non-alpha formats are still 32-bits-per-texel, just like RGB8. The extra bits necessary for the extended range are taken from the alpha channel.

The specific texture formats are:

These Metal formats can be used for anything (including blitting) on Apple Silicon devices, but are not supported on Intel-based Macs. When blitting, they have a particular bit pattern, described in the docs above.

DirectX has just a single format like this: DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM. The docs say:

A four-component, 32-bit 2.8-biased fixed-point format that supports 10 bits for each color channel and 2-bit alpha.

I didn't test this, but this would seem to indicate a range from -2 to +2.

Also, it looks like support is behind a hardware capability bit somewhere, but the docs aren't very clear about this. It doesn't appear on the "Required DXGI Formats" documentation page. I couldn't find any documentation about which operations are supported on textures of this format.

Challenges

The XR formats do not have the same behavior in Metal and D3D12:

  • The Metal formats are BGR, not RGB
  • The 32-bit Metal formats don't have an alpha channel, but the D3D12 one does
  • The bit pattern for blitting is almost certainly different
  • D3D12 doesn't have sRGB variants (for gamma)

Possible paths forward

  1. (The null path) Throw up our hands and admit defeat. Tell authors that they need to double their memory use if they want wide color.
  2. Expose multiple distinct optional features, with the Metal formats behind a different feature than the D3D12 format.
    1. I think this would violate the "Requirements for Additional Functionality" document
  3. Invent our own meta format which turns into DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM on D3D12 and MTLPixelFormatBGR10_XR (the closest option) on Metal. Restrict the use of these textures to just situations where the differences are unobservable.
    1. This is probably too restrictive to be useful; I expect the only operation they would have in common would be usable as a render target
  4. Invent our own meta format (like (3) above), but try to claw back some of that functionality by polyfilling it. E.g. implement blits via a compute shader.
  5. Invent our own meta format (like (3) above), but intentionally give up on the goal of portability. Spec the new meta format as "it behaves either like DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM or like MTLPixelFormatBGR10_XR." Tell authors to write their code in a way that works for both (somehow).

There is a related question about how to actually show wide colors in canvas, but that isn't an issue for the WebGPU standardization group.

Activity

  1. kainino0x commented on May 12, 2023

    @kainino0x
    Contributor

    I think your option 1, which only goes from 0 to 1, is rgb10a2unorm, which we already have (unfortunately there's no srgb version of it though).

    About the D3D format's usages, it can't be sampled or used as a render target. It's actually just rgb10a2, but with a bit of metadata about how it should be used for scan-out.

    The DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM format has only the display scan-out, CPU lockable, and "cast within bit layout" resource attributes. Therefore, to render to a resource, the application typically creates a render target view of format DXGI_FORMAT_R10G10B10A2_*.
    https://learn.microsoft.com/en-us/windows-hardware/drivers/display/dxgi-format-r10g10b10-xr-bias-a2-unorm

    In WebGPU we could express this using configure with format: 'rgb10a2' and colorSpace set to a new color space that encodes the bias and scale of this format.

    I think it would also be theoretically possible to make a new format that's bound in a special way that lets us inject conversions from/to the format when sampled/written. But this adds some complexities, for example it wouldn't be blendable.

    I didn't test this, but this would seem to indicate a range from -2 to +2.

    The encoding appears to be exactly the same as Metal except possibly with one extra value at the end.
    https://learn.microsoft.com/en-us/windows-hardware/drivers/display/xr-bias-to-float-conversion-rules

    Value D3D12 representation Metal representation
    -0.752941 0000000000 0000000000
    1.25098 1111111110 1111111110[2]
    1.25294 1111111111?[1] none?

    [1] I'm not sure whether this is actually allowed, the d3d12 docs just don't seem to say it's not.
    [2] This is a guess based on the 1.25098 value in the Metal docs. That's exactly 0b1111111110 with the same bias and scale factor that D3D12 use.

    The scale factor of 510 is explicitly chosen to provide a cleanly invertible conversion between a BGR8888-type format and XR_BIAS without causing the nonlinear jump near 0.5 that would be implied by a scale factor of 511.

    (510 = 255 * 2)

  2. added this to the post-V1 milestone on May 12, 2023
  3. litherum commented on May 12, 2023

    @litherum
    ContributorAuthor

    nit: rgb10a2unorm is deep color, but not wide color. It can't represent values outside of 0-1. If an author wants wide color, they can’t use rgb10a2unorm (unless they do the scaling and biasing themselves in software) but instead would have to use float16.

  4. kainino0x commented on May 15, 2023

    @kainino0x
    Contributor

    Yes, but what I discovered was that D3D12 doesn't have a format that's wide-color throughout the pipeline. They have this format that does wide-color for scanout but you have to reinterpret it from rgb10a2unorm (non-wide-color) and therefore must do the scaling and biasing in software to use it, AFAICT.

  5. kainino0x commented on May 15, 2023

    @kainino0x
    Contributor

    (And that we could achieve what D3D12 has with a new colorSpace option.)

  6. litherum commented on May 17, 2023

    @litherum
    ContributorAuthor

    OK. We're going to pursue this at the canvas level, then. We're going to see if it's possible for the canvas to be backed by one of:

    • RGBA8 (like it is today)
    • FP16 (there are ongoing discussions about this)
    • 10A2 (a new option)

    Closing this issue, because this issue is WebGPU-specific, and we're going to migrate to canvas instead.

  7. kainino0x commented on May 18, 2023

    @kainino0x
    Contributor

    Each of the canvas context types specifies its pixel formats independently (ours is in GPUCanvasConfiguration, and we have float16 already) so I think this should be left open.

  8. kainino0x commented on Jun 6, 2023

    @kainino0x
    Contributor

    Editors discussed today. We think there are two possible designs within what's possible in D3D12:

    1. Simply don't do XR formats. Instead, just add support for rgb10a2unorm with display-p3. The detriment of this is that compositors will always have to convert the data in order to composite it onto the display. Apple's compositor can operate in this XR format so that no conversions are needed even when mixing narrow-color and wide-color content.
    2. Do the D3D12 thing: the application can configure the canvas to use the XR color encoding, but gets an rgb10a2unorm texture, and must apply the bias/encoding itself before writing the a value to the texture. The texture data then gets reinterpret-casted to the XR format for presentation.

    Open questions:

    • Whether this actually works across platforms. [Of the XR formats,] D3D12 seems to have only rgb10a2, Metal only has bgr10 and bgr10a10.
      • How do we handle RGBA vs BGRA?
      • Can we handle the alpha difference?
      • There's a similar situation right now with rgb10a2unorm [in D3D12/Vulkan] though. Why does that work?
    • For Microsoft folks (@RafaelCintron) about the exact benefit of the XR formats on Windows. If they exist for the same reason they exist on Apple (as a compositor working format), then why aren't they sampleable and renderable? Wouldn't the compositor need those anyway?
  9. litherum commented on Jun 7, 2023

    @litherum
    ContributorAuthor
  10. kainino0x commented on Jun 7, 2023

    @kainino0x
    Contributor

    Metal has MTLPixelFormatRGB10A2Unorm

    Unsure which of the 2 things above this was a reply to:

    • D3D12 seems to have only rgb10a2, Metal only has bgr10 and bgr10a10.

    This was referring to the XR formats specifically.

    • There's a similar situation right now with rgb10a2 though. Why does that work?

    This was referring to D3D12/Vulkan. In bits 0..31 order:

  11. kdashg commented on Jun 8, 2023

    @kdashg
    Contributor
    GPU Web 2023-06-07/08 (Pacific time)
    • MM: couple different points
    • MM: there is the concept of wide color, it's different from HDR
      • Can show "more saturated" / "more red" than sRGB
      • Can't show "brighter" colors
    • For rendering: the space of representable colors gets a little, but not a lot, bigger
    • To represent wide color using the same format as for HDR, float16, would be a waste. 2x the memory as RGBA8, but color volume isn't 2x as large.
    • We're looking at formats that have a little bit more representable values.
    • E.g. RGB10_A2 formats
    • 2 ways to expose these.
      1. Take the volume expressed by RGB, say, this is the volume I want to map to the wide-color gamut. RGB(1,0,0) is the most red the new gamut can represent.
      • KN: and you can do that today by setting canvas's color space to display-p3.
      • MM: yes. Because color volume's bigger with wide-color, it's OK mechanically to say I have a normal RGB texture and its values are in the bigger color gamut, but the downside is that two adjacent colors will have visible differences - will show banding in the larger color volume.
      1. Say that some small range of values outside the (0.0, 1.0) range in the new color volume are legal. sRGB colors in the new volume are unchanged, so blending works well. Downside is it's a different mental model compared to other texture formats.
      • KN: current status: we in principle can do this now. If you use float16 format, you can go outside the 0-1 range. Using extended sRGB colorspace, it'll map meaningfully. What we don't have is a way to do this aside from float16. That's what the XR formats do.
    • KG: following the overview, but quibbles about some assertions. Can table these for now.
    • KG: don't think that things being more prone to banding means that banding occurs much in practice. Have concerns about the XR stuff, but not about the 10 bit stuff.
    • MM: good segue. The XR color pixel formats in mac/IOS world - let's say the oracle tells you the in-memory bits are 0. Sample it - result of sample won't be 0. It'll be -0.25 for example. Similar for 1.0 - result will be ~1.25.
      • Windows has similarly named pixel format, but its caps are different. Docs are sparse. Can't be sampled from? Not sure.
      • KN: Rafael is tasked with finding this answer.
      • If the Windows formats can be sampled from and rendered to, then there's a possibility of adding them to WebGPU. If not, then no avenue for this. (Don't want to spec mac/ios specific feature).
      • In that case, wouldn't spec XR formats. Render into regular 10_a2 formats, and annotate the canvas - the canvas is now p3 (and have to add 10_a2 as a canvas backing store format).
    • KR: XR stands for eXtended Range?
    • MM: yes.
    • MM: we're interested in wide-color, you can use the same facilities as HDR, but has memory consumption downside. Looking for suitable replacement.
    • KR: what about shared exponent formats? Are they used more for HDR? They have 9 bits per color channel.
    • MM: not sure, know they're used for HDR, not sure about wide-color applications.
    • MM: also - if you're a game - not enough for your dest to support wide color. Need for your texture assets to use wide color, too.
    • KG: the way the HW APIs work - less to do with the pixel format. That's just the shape of the data. Doing math on abstract values in the shader. What does 1.0 red mean? In particular, curious to know what we're missing that's not captured by RGB10 formats.
    • MM: if app chooses to render into XR format rather than 10_a2 format - the thing we get from the platform is cheaper compositing. Don't have to invoke the colorspace logic. If app renders into 10_a2 format but then says 1,0,0 doesn't mean sRGB max red, but other colorspace's max red - have to turn on color matching facilities, and those are expensive.
    • KN: almost certainly can't put the XR formats into the API, but they seem like sRGB formats, and apply some mapping to the values. A 1:1 mapping between shader value and the value stored in the texture. Instead of being linear, it's something slightly more complex. But colorspace still stays out of it until you have a surface. In our case, if we had this format, you should only be able to use it with sRGB. Doesn't make sense to use it with other things (use 10_a2 otherwise). Windows restrictions probably make it unusable. But we could use the XR formats under the hood. We use 10_a2 and you say display-p3, but then color conversion has to happen. There's a middle ground where the app can take advantage of it, but might be confusing.
    • KN: have suggested to do the D3D12 thing, on the issue.
    • KG: interested in being able to reach system compositor fast paths. Aside from that, should pursue existing mechanics. We don't have space-efficient wide color support - or, if we do, it's because we haven't gotten around to exposing rgb10 formats at the canvas level. Today, all Windows machines with P3 or larger gamuts just stretch across the whole gamut with 8 bits, and banding isn't a persistent problem. We don't see >8-bit-per-channel as a hard requirement.
    • MM: it's true that 10 bit per channel isn't a hard requirement for wide color gamut. Our goal isn't to add XR formats to WebGPU; it's to let apps run their whole pipeline in wide color and for it to look good.
    • Continue next week
  12. aleino-nv commented on Jun 8, 2023

    @aleino-nv

    @litherum Coordinate system question:
    In this picture, would e.g. the value (-0.2, 1.2) be the value you got in the pixel shader when sampling a completely red wide color texture?

  13. litherum commented on Jun 14, 2023

    @litherum
    ContributorAuthor

    @litherum Coordinate system question: In this picture, would e.g. the value (-0.2, 1.2) be the value you got in the pixel shader when sampling a completely red wide color texture?

    When you say “completely red” I’m assuming you mean “the most saturated red that wide color can represent”

    If so, then the answer is yes.

    Another way to describe this is: imagine there was an oracle that could observe the contents of memory. Imagine we had a texture that was using one of these XR formats. Imagine the oracle observes the bits in memory for a particular texel, and sees that they are 0000000000b. If you sampled the texture from a shader at this particular location, the float value you would receive would be -0.752941. Likewise, imagine the oracle observes that another particular texel contains the bits 1111111111b in memory. If you then sampled that location from a shader, the float result you would receive would be 1.25098.

    The idea is that if your rendering destination is tagged as being in the “extended sRGB” color space, then the values in these XR formats cover the gamut of display-p3 (since they go just a bit below zero and a bit above 1). That’s the image you linked to.

    If, however, you used the non-XR 10A2 formats (and kept your rendering destination tagged as “extended sRGB”) then that would cover just the sRGB gamut - albeit with more representable values within that gamut. This is because, with the 10A2 formats, if the oracle observes a bit pattern of 1111111111b, then it means 1.0, and extended sRGB’s 1.0 position is exactly the boundary of the sRGB gamut. The whole point of “extended sRGB” is that it’s just like sRGB, but has infinite gamut.

    The approach we’re currently pursuing is to not tag rendering destinations as extended sRGB, and instead just tag them as display-p3. Doing it this way causes a meaning of 1.0 to be mapped to p3’s gamut, which means the existing 10A2 formats will work great. The downside here is that the window server is going to have to do color matching if there is other content on the screen that isn’t tagged as being in the P3 color space (which will essentially always be the case). The benefit of the XR formats is that, because it’s backwards-compatible with sRGB, no color conversion has to be done to blend windows / layers together, even if some content on the screen is wide color and some is normal sRGB.

  14. aleino-nv commented on Jun 14, 2023

    @aleino-nv

    @litherum Coordinate system question: In this picture, would e.g. the value (-0.2, 1.2) be the value you got in the pixel shader when sampling a completely red wide color texture?

    When you say “completely red” I’m assuming you mean “the most saturated red that wide color can represent”

    If so, then the answer is yes.

    Thanks! Yeah, I meant the "wide color red" in the very corner of the wide color gamut.
    That would then mean that the transform from texture colors to shader colors is non-diagonal (i.e. not just "axis-aligned scaling"). I believe that's not the case for e.g. any of the Vulkan RGB formats.
    Also, I assume on most hardware you'd have to do some math in the shader after the texture fetch, to implement this transformation.
    That would be a downside for the sRGB-compatible option corresponding to this picture.

    Another way to describe this is: imagine there was an oracle that could observe the contents of memory. Imagine we had a texture that was using one of these XR formats. Imagine the oracle observes the bits in memory for a particular texel, and sees that they are 0000000000b. If you sampled the texture from a shader at this particular location, the float value you would receive would be -0.752941. Likewise, imagine the oracle observes that another particular texel contains the bits 1111111111b in memory. If you then sampled that location from a shader, the float result you would receive would be 1.25098.

    The idea is that if your rendering destination is tagged as being in the “extended sRGB” color space, then the values in these XR formats cover the gamut of display-p3 (since they go just a bit below zero and a bit above 1). That’s the image you linked to.

    If, however, you used the non-XR 10A2 formats (and kept your rendering destination tagged as “extended sRGB”) then that would cover just the sRGB gamut - albeit with more representable values within that gamut. This is because, with the 10A2 formats, if the oracle observes a bit pattern of 1111111111b, then it means 1.0, and extended sRGB’s 1.0 position is exactly the boundary of the sRGB gamut. The whole point of “extended sRGB” is that it’s just like sRGB, but has infinite gamut.

    The approach we’re currently pursuing is to not tag rendering destinations as extended sRGB, and instead just tag them as display-p3. Doing it this way causes a meaning of 1.0 to be mapped to p3’s gamut, which means the existing 10A2 formats will work great. The downside here is that the window server is going to have to do color matching if there is other content on the screen that isn’t tagged as being in the P3 color space (which will essentially always be the case). The benefit of the XR formats is that, because it’s backwards-compatible with sRGB, no color conversion has to be done to blend windows / layers together, even if some content on the screen is wide color and some is normal sRGB.

    Question on how the compatibility with sRGB would work.
    Commenting on the same picture again, what would the grid of sample points look like? Would it be aligned with the green sRGB square, or with the "tilted" wide-color gamut? (I would attach a picture but I can't figure out how to do it.)

  15. RafaelCintron commented on Jun 15, 2023

    @RafaelCintron
    Contributor

    For Microsoft folks (@RafaelCintron) about the exact benefit of the XR formats on Windows. If they exist for the same reason they exist on Apple (as a compositor working format), then why aren't they sampleable and renderable? Wouldn't the compositor need those anyway?

    On Windows, while you can instantiate textures with XR formats, you can't sample from them, render to them, or make a swap chains in the format. Conformance test coverage is limited. We should avoid using them.

    Since that format was introduced, color management on Windows has evolved in the direction of separating out the storage (bits per pixel, float vs unorm, etc) from the color space. You provide these to Windows via separate APIs. The developer is responsible for ensuring that colors are stored in the color space you declare.

    For instance, you can use DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 to get 2020 primaries with 2.2 gamma. It's different from the space specified by XR_BIAS but effectively gives you wide gamut 10bpc, non-HDR content.

  16. litherum commented on Jun 16, 2023

    @litherum
    ContributorAuthor

    I assume on most hardware you'd have to do some math in the shader after the texture fetch

    This happens in hardware for us. The Metal feature set tables indicate that these formats are only present on Apple devices - not Intel-based Macs. Indeed; it must happen in hardware, because the shader compiler doesn’t know at compile time which format is being used. It’s possible to run the same shader twice, once with an XR format, and one with a non-XR format, without recompiling.

    If we wanted to polyfill these formats on devices which don’t support them in hardware, we’d either have to require the shader compiler to know which resources will be set to XR textures so it can emit the extra instructions (this is what we did with BGR vs RGB storage textures) OR it would have to unconditionally emit the extra instructions at every sample() call but also pass in some side-channel data at setBindGroup() time that has the effect of making the extra instructions do nothing when bound to non-XR formats.

    But I’m not even sure that we’d want to polyfill this in the first place. It would already be an optional feature, so I think it would make sense to just say “the optional feature would only be present on devices which have support for it.”

    what would the grid of sample points look like?

    They’d be axis-aligned (parallel to the green box) but the grid of points would extend a little bit beyond the edges of the green box. The colored area would be entirely contained within the space the points occupy.

    There are representable points in the XR formats that are outside both the sRGB and the P3 wide color gamut. Those get clipped or otherwise tonemapped.

    We should avoid using them.

    Well that makes it pretty clear, doesn’t it.

    Understanding that, just for my own curiosity: if a Windows app does render to one of these formats, how does the window server composite that window with all the other windows, if the format can’t be sampled from?

  17. RafaelCintron commented on Jun 16, 2023

    @RafaelCintron
    Contributor

    if a Windows app does render to one of these formats, how does the window server composite that window with all the other windows, if the format can’t be sampled from?

    @litherum developers can't make a swap chain with these formats because there is no support in the Desktop Window Manager (DWM) for them. Without support in the DWM, you can't use them as the contents of a window.

    You also can't make a render target view (RTV) of this format so you can't draw to textures with it either.

  18. kainino0x commented on Jun 16, 2023

    @kainino0x
    Contributor

    This may not be important anymore if we're not going to use these D3D formats, but if they can't be used in DWM then what does "display scan-out" support mean you can do?

    In any case, even if we shouldn't use these on Windows, I think both options 1/2 above (#4108 (comment)) are still viable, though 2 becomes an Apple-specific optimization sadly.

    Even if we give up on the idea of D3D support, I think it still doesn't make sense to do what I'll call option 3 (just so it has a name):

    1. Fully support Metal's XR formats as an optional feature

    Given the state of things I'd like to propose we do option 1 for now. It's very straightforward, IMO we want it anyway, and it doesn't prevent us from doing 2 or 3 later on.

  19. kainino0x commented on Jun 16, 2023

    @kainino0x
    Contributor

    This was referring to D3D12/Vulkan. In bits 0..31 order:

    As a side note, I somehow misread something in the Vulkan spec. It does have both RGB10A2 (VK_FORMAT_A2B10G10R10_UNORM_PACK32) and BGR10A2 (VK_FORMAT_A2R10G10B10_UNORM_PACK32) formats.

  20. litherum commented on Jun 17, 2023

    @litherum
    ContributorAuthor

    (In case I wasn’t clear, we do not want to make any Apple-specific optional features; I spent quite a while in the group making sure there would be no vendor-specific optional features.)

    We think the best way to proceed, given the discussion in this thread, is not to standardize any XR formats, but instead to add 10A2 backing store support to canvas.

    For WebGPU, the only change would be adding the 10A2 formats to the supported context formats set.

  21. litherum commented on Jun 17, 2023

    @litherum
    ContributorAuthor

    (Also, @RafaelCintron, +1 to Kai’s question about what the D3D formats are meant for. What is their use case?)

  22. litherum commented on Jun 28, 2023

    @litherum
    ContributorAuthor

    Resolution:

    1. Add RGB10A2 to the supported context formats set

    Follow-up items:

    1. Should there be a BGR10A2 format? Is there a fast path for it?
    2. How should getPreferredFormat() work?
  23. added a commit that references this issue on Jun 28, 2023
  24. RafaelCintron commented on Jul 3, 2023

    @RafaelCintron
    Contributor

    This may not be important anymore if we're not going to use these D3D formats, but if they can't be used in DWM then what does "display scan-out" support mean you can do?

    @kainino0x For our WebGPU purposes, we should consider the XR formats as unsupported on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions