Skip to content

Clarify the semantics of packed formats #224

Open

Description

@kvark

Related to #206 , cc @grorg
Vulkan and Metal disagree on what the "packed" means:

  • in Vulkan, packed formats on little-endian systems have reverse order of components
  • in Metal, packed formats on little-endian systems have straight order of components
  • D3D12 doesn't have "packed" semantics, and given that it's only available on little-endian systems, it's effectively matching Metal

I suggest we don't define the "packed" in any confusing way, and just make the component ordering straight, like in Metal and D3D12.

Activity

  1. grorg commented on Mar 18, 2019

    @grorg
    Contributor

    Discussed at 18 Mar 2019 teleconference

  2. litherum commented on Mar 18, 2019

    @litherum
    Contributor

    We resolved to pick straight order today.

  3. added this to the V1.0 milestone on Sep 2, 2021
  4. added
    copyediting
    on Nov 25, 2021
  5. modified the milestones: V1.0, on Mar 2, 2023
  6. modified the milestones: , V1.0 on Aug 15, 2023
  7. fdwr commented on Feb 7, 2024

    @fdwr

    I suggest we don't define the "packed" in any confusing way

    Dzmitry: Thank you for creating this issue (a while ago!), as I was just reading through the spec and couldn't be sure whether rgba8unorm actually meant what you'd naturally expect (red, green, blue, and then alpha in memory order), or whether it might be backwards like Vulkan VK_FORMAT_A8B8G8R8_UNORM_PACK32. The texture formats section could use a little note clarifying that.

    We resolved to pick straight order today.

    Myles: Great, that makes WebGPU's formats more internally self-consistent, such that rgba32float means red comes first in memory and that rgba8unorm also means red comes first in memory, which is consistent with the GenICam Pixel Format Naming specification, DXGI_FORMAT_R8G8B8A8_UNORM, MTLPixelFormat::rgba8Unorm, kCVPixelFormatType_32RGBA, AV_PIX_FMT_RGBA, and VK_FORMAT_R8G8B8A8_UNORM. Now named formats like VK_FORMAT_A8B8G8R8_UNORM_PACK32 and PIXMAN_a8r8g8b8 can fade away as a sources of confusion.

  8. kainino0x commented on Feb 7, 2024

    @kainino0x
    Contributor

    This bug is still open indeed to clarify this in the spec. There just isn't much time for spec work among the team these days, so it's been open for... uh... 5 years.

  9. fdwr commented on Feb 8, 2024

    @fdwr

    @kainino0x: 🤔 You think if I created a small CR that someone would have time to review it?

  10. kainino0x commented on Feb 8, 2024

    @kainino0x
    Contributor

    @fdwr yes, just @ me!

  11. added
    api resolved
    api
    and removed
    copyediting
    on Apr 23, 2024
  12. added
    moved-m0-to-m1
    on Jul 1, 2024
  13. modified the milestones: Milestone 1, Milestone 2 on Oct 2, 2025
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

    apiapi resolvedinvestigationmoved-m0-to-m1proposal

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions