From 498d5ea20aed3b313cfc456d07a8003b95318764 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Thu, 10 Sep 2020 08:48:57 +0000 Subject: [PATCH] Rename BC6HRGBSfloat to BC6HRGBFloat Bug: dawn:22 Change-Id: Ib579e15ff923cbd7c4f523a58c2ef582d39ba7c4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/27200 Reviewed-by: Austin Eng Reviewed-by: Kai Ninomiya Commit-Queue: Corentin Wallez --- dawn.json | 2 +- generator/templates/webgpu.h | 1 + generator/templates/webgpu_cpp.h | 1 + src/dawn_native/Format.cpp | 2 +- src/dawn_native/d3d12/TextureD3D12.cpp | 4 ++-- src/dawn_native/metal/TextureMTL.mm | 2 +- src/dawn_native/opengl/GLFormat.cpp | 2 +- src/dawn_native/vulkan/TextureVk.cpp | 2 +- .../end2end/CompressedTextureFormatTests.cpp | 18 +++++++++--------- .../validation/TextureValidationTests.cpp | 2 +- src/utils/TextureFormatUtils.cpp | 8 ++++---- src/utils/TextureFormatUtils.h | 4 ++-- 12 files changed, 25 insertions(+), 23 deletions(-) diff --git a/dawn.json b/dawn.json index e9cf0dd2aa..c7578f1d94 100644 --- a/dawn.json +++ b/dawn.json @@ -1646,7 +1646,7 @@ {"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": 51, "name": "BC6H RGB float"}, {"value": 52, "name": "BC7 RGBA unorm"}, {"value": 53, "name": "BC7 RGBA unorm srgb"} ] diff --git a/generator/templates/webgpu.h b/generator/templates/webgpu.h index ec9db20519..8e52caca2b 100644 --- a/generator/templates/webgpu.h +++ b/generator/templates/webgpu.h @@ -95,6 +95,7 @@ typedef uint32_t WGPUFlags; {% endfor %} //* TODO(dawn:22) remove this once the PSA is sent and the deadline passed. #define WGPUTextureFormat_RG11B10Float WGPUTextureFormat_RG11B10Ufloat +#define WGPUTextureFormat_BC6HRGBSfloat WGPUTextureFormat_BC6HRGBFloat typedef struct WGPUChainedStruct { struct WGPUChainedStruct const * next; diff --git a/generator/templates/webgpu_cpp.h b/generator/templates/webgpu_cpp.h index d02bf986ac..f72e1420a9 100644 --- a/generator/templates/webgpu_cpp.h +++ b/generator/templates/webgpu_cpp.h @@ -29,6 +29,7 @@ namespace wgpu { //* TODO(dawn:22) remove this once the PSA is sent and the deadline passed. {% if type.name.canonical_case() == "texture format" %} RG11B10Float = RG11B10Ufloat, + BC6HRGBSfloat = BC6HRGBFloat, {% endif %} }; diff --git a/src/dawn_native/Format.cpp b/src/dawn_native/Format.cpp index 53af2588f6..0f47a8145b 100644 --- a/src/dawn_native/Format.cpp +++ b/src/dawn_native/Format.cpp @@ -312,7 +312,7 @@ namespace dawn_native { AddCompressedFormat(wgpu::TextureFormat::BC3RGBAUnormSrgb, 16, 4, 4, isBCFormatSupported); AddCompressedFormat(wgpu::TextureFormat::BC5RGSnorm, 16, 4, 4, isBCFormatSupported); AddCompressedFormat(wgpu::TextureFormat::BC5RGUnorm, 16, 4, 4, isBCFormatSupported); - AddCompressedFormat(wgpu::TextureFormat::BC6HRGBSfloat, 16, 4, 4, isBCFormatSupported); + AddCompressedFormat(wgpu::TextureFormat::BC6HRGBFloat, 16, 4, 4, isBCFormatSupported); AddCompressedFormat(wgpu::TextureFormat::BC6HRGBUfloat, 16, 4, 4, isBCFormatSupported); AddCompressedFormat(wgpu::TextureFormat::BC7RGBAUnorm, 16, 4, 4, isBCFormatSupported); AddCompressedFormat(wgpu::TextureFormat::BC7RGBAUnormSrgb, 16, 4, 4, isBCFormatSupported); diff --git a/src/dawn_native/d3d12/TextureD3D12.cpp b/src/dawn_native/d3d12/TextureD3D12.cpp index dff3f66663..e30534a791 100644 --- a/src/dawn_native/d3d12/TextureD3D12.cpp +++ b/src/dawn_native/d3d12/TextureD3D12.cpp @@ -191,7 +191,7 @@ namespace dawn_native { namespace d3d12 { case wgpu::TextureFormat::BC5RGUnorm: return DXGI_FORMAT_BC5_TYPELESS; - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: case wgpu::TextureFormat::BC6HRGBUfloat: return DXGI_FORMAT_BC6H_TYPELESS; @@ -312,7 +312,7 @@ namespace dawn_native { namespace d3d12 { return DXGI_FORMAT_BC5_SNORM; case wgpu::TextureFormat::BC5RGUnorm: return DXGI_FORMAT_BC5_UNORM; - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: return DXGI_FORMAT_BC6H_SF16; case wgpu::TextureFormat::BC6HRGBUfloat: return DXGI_FORMAT_BC6H_UF16; diff --git a/src/dawn_native/metal/TextureMTL.mm b/src/dawn_native/metal/TextureMTL.mm index a0b08fbe5a..22931fd5ca 100644 --- a/src/dawn_native/metal/TextureMTL.mm +++ b/src/dawn_native/metal/TextureMTL.mm @@ -225,7 +225,7 @@ namespace dawn_native { namespace metal { return MTLPixelFormatBC5_RGSnorm; case wgpu::TextureFormat::BC5RGUnorm: return MTLPixelFormatBC5_RGUnorm; - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: return MTLPixelFormatBC6H_RGBFloat; case wgpu::TextureFormat::BC6HRGBUfloat: return MTLPixelFormatBC6H_RGBUfloat; diff --git a/src/dawn_native/opengl/GLFormat.cpp b/src/dawn_native/opengl/GLFormat.cpp index 763f5554dd..eb7e3bc7cb 100644 --- a/src/dawn_native/opengl/GLFormat.cpp +++ b/src/dawn_native/opengl/GLFormat.cpp @@ -106,7 +106,7 @@ namespace dawn_native { namespace opengl { AddFormat(wgpu::TextureFormat::BC4RUnorm, GL_COMPRESSED_RED_RGTC1, GL_RED, GL_UNSIGNED_BYTE, Type::Float); AddFormat(wgpu::TextureFormat::BC5RGSnorm, GL_COMPRESSED_SIGNED_RG_RGTC2, GL_RG, GL_BYTE, Type::Float); AddFormat(wgpu::TextureFormat::BC5RGUnorm, GL_COMPRESSED_RG_RGTC2, GL_RG, GL_UNSIGNED_BYTE, Type::Float); - AddFormat(wgpu::TextureFormat::BC6HRGBSfloat, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT, GL_RGB, GL_HALF_FLOAT, Type::Float); + AddFormat(wgpu::TextureFormat::BC6HRGBFloat, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT, GL_RGB, GL_HALF_FLOAT, Type::Float); AddFormat(wgpu::TextureFormat::BC6HRGBUfloat, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT, GL_RGB, GL_HALF_FLOAT, Type::Float); AddFormat(wgpu::TextureFormat::BC7RGBAUnorm, GL_COMPRESSED_RGBA_BPTC_UNORM, GL_RGBA, GL_UNSIGNED_BYTE, Type::Float); AddFormat(wgpu::TextureFormat::BC7RGBAUnormSrgb, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM, GL_RGBA, GL_UNSIGNED_BYTE, Type::Float); diff --git a/src/dawn_native/vulkan/TextureVk.cpp b/src/dawn_native/vulkan/TextureVk.cpp index f7e6dfb763..5112a4cf07 100644 --- a/src/dawn_native/vulkan/TextureVk.cpp +++ b/src/dawn_native/vulkan/TextureVk.cpp @@ -360,7 +360,7 @@ namespace dawn_native { namespace vulkan { return VK_FORMAT_BC5_SNORM_BLOCK; case wgpu::TextureFormat::BC5RGUnorm: return VK_FORMAT_BC5_UNORM_BLOCK; - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: return VK_FORMAT_BC6H_SFLOAT_BLOCK; case wgpu::TextureFormat::BC6HRGBUfloat: return VK_FORMAT_BC6H_UFLOAT_BLOCK; diff --git a/src/tests/end2end/CompressedTextureFormatTests.cpp b/src/tests/end2end/CompressedTextureFormatTests.cpp index 20bd34d61f..446db6dd72 100644 --- a/src/tests/end2end/CompressedTextureFormatTests.cpp +++ b/src/tests/end2end/CompressedTextureFormatTests.cpp @@ -322,7 +322,7 @@ class CompressedTextureBCFormatTest : public DawnTest { case wgpu::TextureFormat::BC5RGUnorm: return {0xff, 0x0, 0x40, 0x2, 0x24, 0x40, 0x2, 0x24, 0xff, 0x0, 0x9, 0x90, 0x0, 0x9, 0x90, 0x0}; - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: return {0xe3, 0x1f, 0x0, 0x0, 0x0, 0xe0, 0x1f, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff}; case wgpu::TextureFormat::BC6HRGBUfloat: @@ -376,7 +376,7 @@ class CompressedTextureBCFormatTest : public DawnTest { case wgpu::TextureFormat::BC5RGSnorm: case wgpu::TextureFormat::BC5RGUnorm: - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: case wgpu::TextureFormat::BC6HRGBUfloat: return FillExpectedData(testRegion, RGBA8::kRed, RGBA8::kGreen); @@ -417,13 +417,13 @@ class CompressedTextureBCFormatTest : public DawnTest { } const std::array kBCFormats = { - wgpu::TextureFormat::BC1RGBAUnorm, wgpu::TextureFormat::BC1RGBAUnormSrgb, - wgpu::TextureFormat::BC2RGBAUnorm, wgpu::TextureFormat::BC2RGBAUnormSrgb, - wgpu::TextureFormat::BC3RGBAUnorm, wgpu::TextureFormat::BC3RGBAUnormSrgb, - wgpu::TextureFormat::BC4RSnorm, wgpu::TextureFormat::BC4RUnorm, - wgpu::TextureFormat::BC5RGSnorm, wgpu::TextureFormat::BC5RGUnorm, - wgpu::TextureFormat::BC6HRGBSfloat, wgpu::TextureFormat::BC6HRGBUfloat, - wgpu::TextureFormat::BC7RGBAUnorm, wgpu::TextureFormat::BC7RGBAUnormSrgb}; + wgpu::TextureFormat::BC1RGBAUnorm, wgpu::TextureFormat::BC1RGBAUnormSrgb, + wgpu::TextureFormat::BC2RGBAUnorm, wgpu::TextureFormat::BC2RGBAUnormSrgb, + wgpu::TextureFormat::BC3RGBAUnorm, wgpu::TextureFormat::BC3RGBAUnormSrgb, + wgpu::TextureFormat::BC4RSnorm, wgpu::TextureFormat::BC4RUnorm, + wgpu::TextureFormat::BC5RGSnorm, wgpu::TextureFormat::BC5RGUnorm, + wgpu::TextureFormat::BC6HRGBFloat, wgpu::TextureFormat::BC6HRGBUfloat, + wgpu::TextureFormat::BC7RGBAUnorm, wgpu::TextureFormat::BC7RGBAUnormSrgb}; // Tthe block width and height in texels are 4 for all BC formats. static constexpr uint32_t kBCBlockWidthInTexels = 4; diff --git a/src/tests/unittests/validation/TextureValidationTests.cpp b/src/tests/unittests/validation/TextureValidationTests.cpp index 12ce761e58..b93c784a6f 100644 --- a/src/tests/unittests/validation/TextureValidationTests.cpp +++ b/src/tests/unittests/validation/TextureValidationTests.cpp @@ -390,7 +390,7 @@ namespace { 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::BC6HRGBUfloat, wgpu::TextureFormat::BC6HRGBFloat, wgpu::TextureFormat::BC7RGBAUnorm, wgpu::TextureFormat::BC7RGBAUnormSrgb}; }; diff --git a/src/utils/TextureFormatUtils.cpp b/src/utils/TextureFormatUtils.cpp index 89cd7d0ee2..af5ff10ef7 100644 --- a/src/utils/TextureFormatUtils.cpp +++ b/src/utils/TextureFormatUtils.cpp @@ -150,7 +150,7 @@ namespace utils { case wgpu::TextureFormat::BC5RGUnorm: case wgpu::TextureFormat::BC5RGSnorm: case wgpu::TextureFormat::BC6HRGBUfloat: - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: case wgpu::TextureFormat::BC7RGBAUnorm: case wgpu::TextureFormat::BC7RGBAUnormSrgb: return 16u; @@ -218,7 +218,7 @@ namespace utils { case wgpu::TextureFormat::BC5RGUnorm: case wgpu::TextureFormat::BC5RGSnorm: case wgpu::TextureFormat::BC6HRGBUfloat: - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: case wgpu::TextureFormat::BC7RGBAUnorm: case wgpu::TextureFormat::BC7RGBAUnormSrgb: return 4u; @@ -284,7 +284,7 @@ namespace utils { case wgpu::TextureFormat::BC5RGUnorm: case wgpu::TextureFormat::BC5RGSnorm: case wgpu::TextureFormat::BC6HRGBUfloat: - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: case wgpu::TextureFormat::BC7RGBAUnorm: case wgpu::TextureFormat::BC7RGBAUnormSrgb: return 4u; @@ -378,7 +378,7 @@ namespace utils { case wgpu::TextureFormat::BC5RGUnorm: case wgpu::TextureFormat::BC5RGSnorm: case wgpu::TextureFormat::BC6HRGBUfloat: - case wgpu::TextureFormat::BC6HRGBSfloat: + case wgpu::TextureFormat::BC6HRGBFloat: case wgpu::TextureFormat::BC7RGBAUnorm: case wgpu::TextureFormat::BC7RGBAUnormSrgb: case wgpu::TextureFormat::Depth32Float: diff --git a/src/utils/TextureFormatUtils.h b/src/utils/TextureFormatUtils.h index 7a7fa429bd..4602e8b5d2 100644 --- a/src/utils/TextureFormatUtils.h +++ b/src/utils/TextureFormatUtils.h @@ -73,7 +73,7 @@ namespace utils { wgpu::TextureFormat::BC5RGUnorm, wgpu::TextureFormat::BC5RGSnorm, wgpu::TextureFormat::BC6HRGBUfloat, - wgpu::TextureFormat::BC6HRGBSfloat, + wgpu::TextureFormat::BC6HRGBFloat, wgpu::TextureFormat::BC7RGBAUnorm, wgpu::TextureFormat::BC7RGBAUnormSrgb, }; @@ -84,7 +84,7 @@ namespace utils { 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::BC6HRGBUfloat, wgpu::TextureFormat::BC6HRGBFloat, wgpu::TextureFormat::BC7RGBAUnorm, wgpu::TextureFormat::BC7RGBAUnormSrgb}; const char* GetColorTextureComponentTypePrefix(wgpu::TextureFormat textureFormat);