diff --git a/dawn.json b/dawn.json index 3a5bb80ddc..791763c92d 100644 --- a/dawn.json +++ b/dawn.json @@ -1645,37 +1645,38 @@ {"value": 23, "name": "BGRA8 unorm"}, {"value": 24, "name": "BGRA8 unorm srgb"}, {"value": 25, "name": "RGB10 A2 unorm"}, - {"value": 26, "name": "RG11 B10 float"}, + {"value": 26, "name": "RG11 B10 ufloat"}, + {"value": 27, "name": "RGB9 E5 ufloat"}, - {"value": 27, "name": "RG32 float"}, - {"value": 28, "name": "RG32 uint"}, - {"value": 29, "name": "RG32 sint"}, - {"value": 30, "name": "RGBA16 uint"}, - {"value": 31, "name": "RGBA16 sint"}, - {"value": 32, "name": "RGBA16 float"}, + {"value": 28, "name": "RG32 float"}, + {"value": 29, "name": "RG32 uint"}, + {"value": 30, "name": "RG32 sint"}, + {"value": 31, "name": "RGBA16 uint"}, + {"value": 32, "name": "RGBA16 sint"}, + {"value": 33, "name": "RGBA16 float"}, - {"value": 33, "name": "RGBA32 float"}, - {"value": 34, "name": "RGBA32 uint"}, - {"value": 35, "name": "RGBA32 sint"}, + {"value": 34, "name": "RGBA32 float"}, + {"value": 35, "name": "RGBA32 uint"}, + {"value": 36, "name": "RGBA32 sint"}, - {"value": 36, "name": "depth32 float"}, - {"value": 37, "name": "depth24 plus"}, - {"value": 38, "name": "depth24 plus stencil8"}, + {"value": 37, "name": "depth32 float"}, + {"value": 38, "name": "depth24 plus"}, + {"value": 39, "name": "depth24 plus stencil8"}, - {"value": 39, "name": "BC1 RGBA unorm"}, - {"value": 40, "name": "BC1 RGBA unorm srgb"}, - {"value": 41, "name": "BC2 RGBA unorm"}, - {"value": 42, "name": "BC2 RGBA unorm srgb"}, - {"value": 43, "name": "BC3 RGBA unorm"}, - {"value": 44, "name": "BC3 RGBA unorm srgb"}, - {"value": 45, "name": "BC4 R unorm"}, - {"value": 46, "name": "BC4 R snorm"}, - {"value": 47, "name": "BC5 RG unorm"}, - {"value": 48, "name": "BC5 RG snorm"}, - {"value": 49, "name": "BC6H RGB ufloat"}, - {"value": 50, "name": "BC6H RGB sfloat"}, - {"value": 51, "name": "BC7 RGBA unorm"}, - {"value": 52, "name": "BC7 RGBA unorm srgb"} + {"value": 40, "name": "BC1 RGBA unorm"}, + {"value": 41, "name": "BC1 RGBA unorm srgb"}, + {"value": 42, "name": "BC2 RGBA unorm"}, + {"value": 43, "name": "BC2 RGBA unorm srgb"}, + {"value": 44, "name": "BC3 RGBA unorm"}, + {"value": 45, "name": "BC3 RGBA unorm srgb"}, + {"value": 46, "name": "BC4 R unorm"}, + {"value": 47, "name": "BC4 R snorm"}, + {"value": 48, "name": "BC5 RG unorm"}, + {"value": 49, "name": "BC5 RG snorm"}, + {"value": 50, "name": "BC6H RGB ufloat"}, + {"value": 51, "name": "BC6H RGB sfloat"}, + {"value": 52, "name": "BC7 RGBA unorm"}, + {"value": 53, "name": "BC7 RGBA unorm srgb"} ] }, "texture usage": { diff --git a/generator/templates/webgpu.h b/generator/templates/webgpu.h index 4e1c7c8ef3..ec9db20519 100644 --- a/generator/templates/webgpu.h +++ b/generator/templates/webgpu.h @@ -93,6 +93,8 @@ typedef uint32_t WGPUFlags; {% endif %} {% endfor %} +//* TODO(dawn:22) remove this once the PSA is sent and the deadline passed. +#define WGPUTextureFormat_RG11B10Float WGPUTextureFormat_RG11B10Ufloat typedef struct WGPUChainedStruct { struct WGPUChainedStruct const * next; diff --git a/generator/templates/webgpu_cpp.h b/generator/templates/webgpu_cpp.h index c523a17966..d02bf986ac 100644 --- a/generator/templates/webgpu_cpp.h +++ b/generator/templates/webgpu_cpp.h @@ -26,6 +26,10 @@ namespace wgpu { {% for value in type.values %} {{as_cppEnum(value.name)}} = 0x{{format(value.value, "08X")}}, {% endfor %} + //* TODO(dawn:22) remove this once the PSA is sent and the deadline passed. + {% if type.name.canonical_case() == "texture format" %} + RG11B10Float = RG11B10Ufloat, + {% endif %} }; {% endfor %} diff --git a/src/dawn_native/Format.cpp b/src/dawn_native/Format.cpp index 3b65c3f860..11b71d269b 100644 --- a/src/dawn_native/Format.cpp +++ b/src/dawn_native/Format.cpp @@ -282,7 +282,8 @@ namespace dawn_native { AddColorFormat(wgpu::TextureFormat::BGRA8UnormSrgb, true, false, 4, Type::Float); AddColorFormat(wgpu::TextureFormat::RGB10A2Unorm, true, false, 4, Type::Float); - AddColorFormat(wgpu::TextureFormat::RG11B10Float, false, false, 4, Type::Float); + AddColorFormat(wgpu::TextureFormat::RG11B10Ufloat, false, false, 4, Type::Float); + AddColorFormat(wgpu::TextureFormat::RGB9E5Ufloat, false, false, 4, Type::Float); // 8 bytes color formats AddColorFormat(wgpu::TextureFormat::RG32Uint, true, true, 8, Type::Uint); diff --git a/src/dawn_native/Format.h b/src/dawn_native/Format.h index 8113a94448..15c6c311a3 100644 --- a/src/dawn_native/Format.h +++ b/src/dawn_native/Format.h @@ -37,7 +37,7 @@ namespace dawn_native { // The number of formats Dawn knows about. Asserts in BuildFormatTable ensure that this is the // exact number of known format. - static constexpr size_t kKnownFormatCount = 52; + static constexpr size_t kKnownFormatCount = 53; // A wgpu::TextureFormat along with all the information about it necessary for validation. struct Format : TexelBlockInfo { diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp index 4fdd708c3d..6057e70d6e 100644 --- a/src/dawn_native/ShaderModule.cpp +++ b/src/dawn_native/ShaderModule.cpp @@ -194,7 +194,7 @@ namespace dawn_native { case spv::ImageFormatRgb10A2: return wgpu::TextureFormat::RGB10A2Unorm; case spv::ImageFormatR11fG11fB10f: - return wgpu::TextureFormat::RG11B10Float; + return wgpu::TextureFormat::RG11B10Ufloat; case spv::ImageFormatRg32f: return wgpu::TextureFormat::RG32Float; case spv::ImageFormatRg32ui: @@ -265,7 +265,7 @@ namespace dawn_native { case shaderc_spvc_storage_texture_format_rgb10a2unorm: return wgpu::TextureFormat::RGB10A2Unorm; case shaderc_spvc_storage_texture_format_rg11b10float: - return wgpu::TextureFormat::RG11B10Float; + return wgpu::TextureFormat::RG11B10Ufloat; case shaderc_spvc_storage_texture_format_rg32float: return wgpu::TextureFormat::RG32Float; case shaderc_spvc_storage_texture_format_rg32uint: diff --git a/src/dawn_native/d3d12/TextureD3D12.cpp b/src/dawn_native/d3d12/TextureD3D12.cpp index 4780634d7f..a7dd331501 100644 --- a/src/dawn_native/d3d12/TextureD3D12.cpp +++ b/src/dawn_native/d3d12/TextureD3D12.cpp @@ -144,8 +144,10 @@ namespace dawn_native { namespace d3d12 { case wgpu::TextureFormat::RGB10A2Unorm: return DXGI_FORMAT_R10G10B10A2_TYPELESS; - case wgpu::TextureFormat::RG11B10Float: + case wgpu::TextureFormat::RG11B10Ufloat: return DXGI_FORMAT_R11G11B10_FLOAT; + case wgpu::TextureFormat::RGB9E5Ufloat: + return DXGI_FORMAT_R9G9B9E5_SHAREDEXP; case wgpu::TextureFormat::RG32Uint: case wgpu::TextureFormat::RG32Sint: @@ -258,8 +260,10 @@ namespace dawn_native { namespace d3d12 { return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB; case wgpu::TextureFormat::RGB10A2Unorm: return DXGI_FORMAT_R10G10B10A2_UNORM; - case wgpu::TextureFormat::RG11B10Float: + case wgpu::TextureFormat::RG11B10Ufloat: return DXGI_FORMAT_R11G11B10_FLOAT; + case wgpu::TextureFormat::RGB9E5Ufloat: + return DXGI_FORMAT_R9G9B9E5_SHAREDEXP; case wgpu::TextureFormat::RG32Uint: return DXGI_FORMAT_R32G32_UINT; diff --git a/src/dawn_native/metal/TextureMTL.mm b/src/dawn_native/metal/TextureMTL.mm index 16fc7f0ba0..fc5906b48d 100644 --- a/src/dawn_native/metal/TextureMTL.mm +++ b/src/dawn_native/metal/TextureMTL.mm @@ -172,8 +172,10 @@ namespace dawn_native { namespace metal { return MTLPixelFormatBGRA8Unorm_sRGB; case wgpu::TextureFormat::RGB10A2Unorm: return MTLPixelFormatRGB10A2Unorm; - case wgpu::TextureFormat::RG11B10Float: + case wgpu::TextureFormat::RG11B10Ufloat: return MTLPixelFormatRG11B10Float; + case wgpu::TextureFormat::RGB9E5Ufloat: + return MTLPixelFormatRGB9E5Float; case wgpu::TextureFormat::RG32Uint: return MTLPixelFormatRG32Uint; diff --git a/src/dawn_native/opengl/GLFormat.cpp b/src/dawn_native/opengl/GLFormat.cpp index 9e1a20c09b..763f5554dd 100644 --- a/src/dawn_native/opengl/GLFormat.cpp +++ b/src/dawn_native/opengl/GLFormat.cpp @@ -74,7 +74,8 @@ namespace dawn_native { namespace opengl { // This doesn't have an enum for the internal format in OpenGL, so use RGBA8. AddFormat(wgpu::TextureFormat::BGRA8Unorm, GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, Type::Float); AddFormat(wgpu::TextureFormat::RGB10A2Unorm, GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, Type::Float); - AddFormat(wgpu::TextureFormat::RG11B10Float, GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, Type::Float); + AddFormat(wgpu::TextureFormat::RG11B10Ufloat, GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, Type::Float); + AddFormat(wgpu::TextureFormat::RGB9E5Ufloat, GL_RGB9_E5, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV, Type::Float); // 8 bytes color formats AddFormat(wgpu::TextureFormat::RG32Uint, GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT, Type::Uint); diff --git a/src/dawn_native/vulkan/TextureVk.cpp b/src/dawn_native/vulkan/TextureVk.cpp index 936ad9fccf..6553406f96 100644 --- a/src/dawn_native/vulkan/TextureVk.cpp +++ b/src/dawn_native/vulkan/TextureVk.cpp @@ -295,8 +295,10 @@ namespace dawn_native { namespace vulkan { return VK_FORMAT_B8G8R8A8_SRGB; case wgpu::TextureFormat::RGB10A2Unorm: return VK_FORMAT_A2B10G10R10_UNORM_PACK32; - case wgpu::TextureFormat::RG11B10Float: + case wgpu::TextureFormat::RG11B10Ufloat: return VK_FORMAT_B10G11R11_UFLOAT_PACK32; + case wgpu::TextureFormat::RGB9E5Ufloat: + return VK_FORMAT_E5B9G9R9_UFLOAT_PACK32; case wgpu::TextureFormat::RG32Uint: return VK_FORMAT_R32G32_UINT; diff --git a/src/tests/end2end/TextureFormatTests.cpp b/src/tests/end2end/TextureFormatTests.cpp index cad7b31ea0..fbd0941ca7 100644 --- a/src/tests/end2end/TextureFormatTests.cpp +++ b/src/tests/end2end/TextureFormatTests.cpp @@ -20,6 +20,7 @@ #include "utils/TextureFormatUtils.h" #include "utils/WGPUHelpers.h" +#include #include // An expectation for float buffer content that can correctly compare different NaN values and @@ -685,8 +686,8 @@ TEST_P(TextureFormatTest, RGB10A2Unorm) { uncompressedData, textureData); } -// Test the RG11B10Float format -TEST_P(TextureFormatTest, RG11B10Float) { +// Test the RG11B10Ufloat format +TEST_P(TextureFormatTest, RG11B10Ufloat) { constexpr uint32_t kFloat11Zero = 0; constexpr uint32_t kFloat11Infinity = 0x7C0; constexpr uint32_t kFloat11Nan = 0x7C1; @@ -714,7 +715,7 @@ TEST_P(TextureFormatTest, RG11B10Float) { }; // This is one of the only 3-channel formats, so we don't have specific testing for them. Alpha - // should slways be sampled as 1 + // should always be sampled as 1 // clang-format off std::vector uncompressedData = { 0.0f, INFINITY, NAN, 1.0f, @@ -725,7 +726,54 @@ TEST_P(TextureFormatTest, RG11B10Float) { // clang-format on DoFloatFormatSamplingTest( - {wgpu::TextureFormat::RG11B10Float, 4, wgpu::TextureComponentType::Float, 4}, textureData, + {wgpu::TextureFormat::RG11B10Ufloat, 4, wgpu::TextureComponentType::Float, 4}, textureData, + uncompressedData); + // This format is not renderable. +} + +// Test the RGB9E5Ufloat format +TEST_P(TextureFormatTest, RGB9E5Ufloat) { + // RGB9E5 is different from other floating point formats because the mantissa doesn't index in + // the window defined by the exponent but is instead treated as a pure multiplier. There is + // also no Infinity or NaN. The OpenGL 4.6 spec has the best explanation I've found in section + // 8.25 "Shared Exponent Texture Color Conversion": + // + // red = reduint * 2^(expuint - B - N) = reduint * 2^(expuint - 24) + // + // Where reduint and expuint are the integer values when considering the E5 as a 5bit uint, and + // the r9 as a 9bit uint. B the number of bits of the mantissa (9), and N the offset for the + // exponent (15). + + float smallestExponent = std::pow(2.0f, -24.0f); + float largestExponent = std::pow(2.0f, float(31 - 24)); + + auto MakeRGB9E5 = [](uint32_t r, uint32_t g, uint32_t b, uint32_t e) { + ASSERT((r & 0x1FF) == r); + ASSERT((g & 0x1FF) == g); + ASSERT((b & 0x1FF) == b); + ASSERT((e & 0x1F) == e); + return r | g << 9 | b << 18 | e << 27; + }; + + // Test the smallest largest, and "1" exponents + std::vector textureData = { + MakeRGB9E5(0, 1, 2, 0b00000), + MakeRGB9E5(2, 1, 0, 0b11111), + MakeRGB9E5(0, 1, 2, 0b11000), + }; + + // This is one of the only 3-channel formats, so we don't have specific testing for them. Alpha + // should always be sampled as 1 + // clang-format off + std::vector uncompressedData = { + 0.0f, smallestExponent, 2.0f * smallestExponent, 1.0f, + 2.0f * largestExponent, largestExponent, 0.0f, 1.0f, + 0.0f, 1.0f, 2.0f, 1.0f, + }; + // clang-format on + + DoFloatFormatSamplingTest( + {wgpu::TextureFormat::RGB9E5Ufloat, 4, wgpu::TextureComponentType::Float, 4}, textureData, uncompressedData); // This format is not renderable. } diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index 0cc34e4361..d0af33fb6e 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -152,11 +152,11 @@ TEST_F(RenderPipelineValidationTest, NonRenderableFormat) { } { - // Fails because RG11B10Float is non-renderable + // Fails because RG11B10Ufloat is non-renderable utils::ComboRenderPipelineDescriptor descriptor(device); descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; - descriptor.cColorStates[0].format = wgpu::TextureFormat::RG11B10Float; + descriptor.cColorStates[0].format = wgpu::TextureFormat::RG11B10Ufloat; ASSERT_DEVICE_ERROR(device.CreateRenderPipeline(&descriptor)); } diff --git a/src/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/tests/unittests/validation/StorageTextureValidationTests.cpp index ca3e3b289c..180b576b15 100644 --- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp +++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp @@ -344,7 +344,7 @@ TEST_F(StorageTextureValidationTests, StorageTextureFormatInShaders) { wgpu::TextureFormat::RG8Snorm, wgpu::TextureFormat::RG8Uint, wgpu::TextureFormat::RG8Sint, wgpu::TextureFormat::RG16Uint, wgpu::TextureFormat::RG16Sint, wgpu::TextureFormat::RG16Float, - wgpu::TextureFormat::RGB10A2Unorm, wgpu::TextureFormat::RG11B10Float}; + wgpu::TextureFormat::RGB10A2Unorm, wgpu::TextureFormat::RG11B10Ufloat}; for (wgpu::BindingType storageTextureBindingType : kSupportedStorageTextureBindingTypes) { for (wgpu::TextureFormat format : kWGPUTextureFormatSupportedAsSPIRVImageFormats) { diff --git a/src/tests/unittests/validation/TextureValidationTests.cpp b/src/tests/unittests/validation/TextureValidationTests.cpp index 52dc1597fa..12ce761e58 100644 --- a/src/tests/unittests/validation/TextureValidationTests.cpp +++ b/src/tests/unittests/validation/TextureValidationTests.cpp @@ -330,7 +330,7 @@ namespace { device.CreateTexture(&descriptor); wgpu::TextureFormat nonRenderableFormats[] = { - wgpu::TextureFormat::RG11B10Float, + wgpu::TextureFormat::RG11B10Ufloat, wgpu::TextureFormat::R8Snorm, wgpu::TextureFormat::RG8Snorm, wgpu::TextureFormat::RGBA8Snorm, diff --git a/src/utils/TextureFormatUtils.cpp b/src/utils/TextureFormatUtils.cpp index 9a577798df..89cd7d0ee2 100644 --- a/src/utils/TextureFormatUtils.cpp +++ b/src/utils/TextureFormatUtils.cpp @@ -27,7 +27,8 @@ namespace utils { case wgpu::TextureFormat::RGBA8Unorm: case wgpu::TextureFormat::RGBA8Snorm: case wgpu::TextureFormat::RGB10A2Unorm: - case wgpu::TextureFormat::RG11B10Float: + case wgpu::TextureFormat::RG11B10Ufloat: + case wgpu::TextureFormat::RGB9E5Ufloat: case wgpu::TextureFormat::RG32Float: case wgpu::TextureFormat::RGBA16Float: case wgpu::TextureFormat::RGBA32Float: @@ -118,7 +119,8 @@ namespace utils { case wgpu::TextureFormat::BGRA8Unorm: case wgpu::TextureFormat::BGRA8UnormSrgb: case wgpu::TextureFormat::RGB10A2Unorm: - case wgpu::TextureFormat::RG11B10Float: + case wgpu::TextureFormat::RG11B10Ufloat: + case wgpu::TextureFormat::RGB9E5Ufloat: case wgpu::TextureFormat::Depth32Float: return 4u; @@ -189,7 +191,8 @@ namespace utils { case wgpu::TextureFormat::BGRA8Unorm: case wgpu::TextureFormat::BGRA8UnormSrgb: case wgpu::TextureFormat::RGB10A2Unorm: - case wgpu::TextureFormat::RG11B10Float: + case wgpu::TextureFormat::RG11B10Ufloat: + case wgpu::TextureFormat::RGB9E5Ufloat: case wgpu::TextureFormat::RG32Float: case wgpu::TextureFormat::RG32Uint: case wgpu::TextureFormat::RG32Sint: @@ -254,7 +257,8 @@ namespace utils { case wgpu::TextureFormat::BGRA8Unorm: case wgpu::TextureFormat::BGRA8UnormSrgb: case wgpu::TextureFormat::RGB10A2Unorm: - case wgpu::TextureFormat::RG11B10Float: + case wgpu::TextureFormat::RG11B10Ufloat: + case wgpu::TextureFormat::RGB9E5Ufloat: case wgpu::TextureFormat::RG32Float: case wgpu::TextureFormat::RG32Uint: case wgpu::TextureFormat::RG32Sint: @@ -338,7 +342,7 @@ namespace utils { return "rgba8i"; case wgpu::TextureFormat::RGB10A2Unorm: return "rgb10_a2"; - case wgpu::TextureFormat::RG11B10Float: + case wgpu::TextureFormat::RG11B10Ufloat: return "r11f_g11f_b10f"; case wgpu::TextureFormat::RG32Float: return "rg32f"; @@ -359,6 +363,7 @@ namespace utils { case wgpu::TextureFormat::RGBA32Sint: return "rgba32i"; + case wgpu::TextureFormat::RGB9E5Ufloat: case wgpu::TextureFormat::RGBA8UnormSrgb: case wgpu::TextureFormat::BGRA8Unorm: case wgpu::TextureFormat::BGRA8UnormSrgb: diff --git a/src/utils/TextureFormatUtils.h b/src/utils/TextureFormatUtils.h index cdd8942583..b78f902309 100644 --- a/src/utils/TextureFormatUtils.h +++ b/src/utils/TextureFormatUtils.h @@ -22,33 +22,60 @@ #include "common/Assert.h" namespace utils { - static constexpr std::array kAllTextureFormats = { - wgpu::TextureFormat::R8Unorm, wgpu::TextureFormat::R8Snorm, - wgpu::TextureFormat::R8Uint, wgpu::TextureFormat::R8Sint, - wgpu::TextureFormat::R16Uint, wgpu::TextureFormat::R16Sint, - wgpu::TextureFormat::R16Float, wgpu::TextureFormat::RG8Unorm, - wgpu::TextureFormat::RG8Snorm, wgpu::TextureFormat::RG8Uint, - wgpu::TextureFormat::RG8Sint, wgpu::TextureFormat::R32Float, - wgpu::TextureFormat::R32Uint, wgpu::TextureFormat::R32Sint, - wgpu::TextureFormat::RG16Uint, wgpu::TextureFormat::RG16Sint, - wgpu::TextureFormat::RG16Float, wgpu::TextureFormat::RGBA8Unorm, - wgpu::TextureFormat::RGBA8UnormSrgb, wgpu::TextureFormat::RGBA8Snorm, - wgpu::TextureFormat::RGBA8Uint, wgpu::TextureFormat::RGBA8Sint, - wgpu::TextureFormat::BGRA8Unorm, wgpu::TextureFormat::BGRA8UnormSrgb, - wgpu::TextureFormat::RGB10A2Unorm, wgpu::TextureFormat::RG11B10Float, - wgpu::TextureFormat::RG32Float, wgpu::TextureFormat::RG32Uint, - wgpu::TextureFormat::RG32Sint, wgpu::TextureFormat::RGBA16Uint, - wgpu::TextureFormat::RGBA16Sint, wgpu::TextureFormat::RGBA16Float, - wgpu::TextureFormat::RGBA32Float, wgpu::TextureFormat::RGBA32Uint, - wgpu::TextureFormat::RGBA32Sint, wgpu::TextureFormat::Depth32Float, - wgpu::TextureFormat::Depth24Plus, wgpu::TextureFormat::Depth24PlusStencil8, - wgpu::TextureFormat::BC1RGBAUnorm, wgpu::TextureFormat::BC1RGBAUnormSrgb, - wgpu::TextureFormat::BC2RGBAUnorm, wgpu::TextureFormat::BC2RGBAUnormSrgb, - wgpu::TextureFormat::BC3RGBAUnorm, wgpu::TextureFormat::BC3RGBAUnormSrgb, - wgpu::TextureFormat::BC4RUnorm, wgpu::TextureFormat::BC4RSnorm, - wgpu::TextureFormat::BC5RGUnorm, wgpu::TextureFormat::BC5RGSnorm, - wgpu::TextureFormat::BC6HRGBUfloat, wgpu::TextureFormat::BC6HRGBSfloat, - wgpu::TextureFormat::BC7RGBAUnorm, wgpu::TextureFormat::BC7RGBAUnormSrgb, + static constexpr std::array kAllTextureFormats = { + wgpu::TextureFormat::R8Unorm, + wgpu::TextureFormat::R8Snorm, + wgpu::TextureFormat::R8Uint, + wgpu::TextureFormat::R8Sint, + wgpu::TextureFormat::R16Uint, + wgpu::TextureFormat::R16Sint, + wgpu::TextureFormat::R16Float, + wgpu::TextureFormat::RG8Unorm, + wgpu::TextureFormat::RG8Snorm, + wgpu::TextureFormat::RG8Uint, + wgpu::TextureFormat::RG8Sint, + wgpu::TextureFormat::R32Float, + wgpu::TextureFormat::R32Uint, + wgpu::TextureFormat::R32Sint, + wgpu::TextureFormat::RG16Uint, + wgpu::TextureFormat::RG16Sint, + wgpu::TextureFormat::RG16Float, + wgpu::TextureFormat::RGBA8Unorm, + wgpu::TextureFormat::RGBA8UnormSrgb, + wgpu::TextureFormat::RGBA8Snorm, + wgpu::TextureFormat::RGBA8Uint, + wgpu::TextureFormat::RGBA8Sint, + wgpu::TextureFormat::BGRA8Unorm, + wgpu::TextureFormat::BGRA8UnormSrgb, + wgpu::TextureFormat::RGB10A2Unorm, + wgpu::TextureFormat::RG11B10Ufloat, + wgpu::TextureFormat::RGB9E5Ufloat, + wgpu::TextureFormat::RG32Float, + wgpu::TextureFormat::RG32Uint, + wgpu::TextureFormat::RG32Sint, + wgpu::TextureFormat::RGBA16Uint, + wgpu::TextureFormat::RGBA16Sint, + wgpu::TextureFormat::RGBA16Float, + wgpu::TextureFormat::RGBA32Float, + wgpu::TextureFormat::RGBA32Uint, + wgpu::TextureFormat::RGBA32Sint, + wgpu::TextureFormat::Depth32Float, + wgpu::TextureFormat::Depth24Plus, + wgpu::TextureFormat::Depth24PlusStencil8, + wgpu::TextureFormat::BC1RGBAUnorm, + wgpu::TextureFormat::BC1RGBAUnormSrgb, + wgpu::TextureFormat::BC2RGBAUnorm, + wgpu::TextureFormat::BC2RGBAUnormSrgb, + wgpu::TextureFormat::BC3RGBAUnorm, + wgpu::TextureFormat::BC3RGBAUnormSrgb, + wgpu::TextureFormat::BC4RUnorm, + wgpu::TextureFormat::BC4RSnorm, + wgpu::TextureFormat::BC5RGUnorm, + wgpu::TextureFormat::BC5RGSnorm, + wgpu::TextureFormat::BC6HRGBUfloat, + wgpu::TextureFormat::BC6HRGBSfloat, + wgpu::TextureFormat::BC7RGBAUnorm, + wgpu::TextureFormat::BC7RGBAUnormSrgb, }; const char* GetColorTextureComponentTypePrefix(wgpu::TextureFormat textureFormat);