From b118451e301d734e3e783b3acdf871f3f6ea851c Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Wed, 6 Nov 2024 01:47:26 +0800 Subject: Move switch statement bodies to their own lines (#5493) * Move switch statement bodies to their own lines * format --------- Co-authored-by: Yong He --- tools/gfx-unit-test/gfx-test-texture-util.cpp | 236 ++++++++++++++++---------- 1 file changed, 151 insertions(+), 85 deletions(-) (limited to 'tools/gfx-unit-test/gfx-test-texture-util.cpp') diff --git a/tools/gfx-unit-test/gfx-test-texture-util.cpp b/tools/gfx-unit-test/gfx-test-texture-util.cpp index a4f86d1d8..bb2c9c5eb 100644 --- a/tools/gfx-unit-test/gfx-test-texture-util.cpp +++ b/tools/gfx-unit-test/gfx-test-texture-util.cpp @@ -35,8 +35,10 @@ TextureAspect getTextureAspect(Format format) switch (format) { case Format::D16_UNORM: - case Format::D32_FLOAT: return TextureAspect::Depth; - default: return TextureAspect::Color; + case Format::D32_FLOAT: + return TextureAspect::Depth; + default: + return TextureAspect::Color; } } @@ -56,88 +58,151 @@ RefPtr getValidationTextureFormat(Format format) { switch (format) { - case Format::R32G32B32A32_TYPELESS: return new ValidationTextureFormat(4); - case Format::R32G32B32_TYPELESS: return new ValidationTextureFormat(3); - case Format::R32G32_TYPELESS: return new ValidationTextureFormat(2); - case Format::R32_TYPELESS: return new ValidationTextureFormat(1); - - case Format::R16G16B16A16_TYPELESS: return new ValidationTextureFormat(4); - case Format::R16G16_TYPELESS: return new ValidationTextureFormat(2); - case Format::R16_TYPELESS: return new ValidationTextureFormat(1); - - case Format::R8G8B8A8_TYPELESS: return new ValidationTextureFormat(4); - case Format::R8G8_TYPELESS: return new ValidationTextureFormat(2); - case Format::R8_TYPELESS: return new ValidationTextureFormat(1); - case Format::B8G8R8A8_TYPELESS: return new ValidationTextureFormat(4); - - case Format::R32G32B32A32_FLOAT: return new ValidationTextureFormat(4); - case Format::R32G32B32_FLOAT: return new ValidationTextureFormat(3); - case Format::R32G32_FLOAT: return new ValidationTextureFormat(2); - case Format::R32_FLOAT: return new ValidationTextureFormat(1); - - case Format::R16G16B16A16_FLOAT: return new ValidationTextureFormat(4); - case Format::R16G16_FLOAT: return new ValidationTextureFormat(2); - case Format::R16_FLOAT: return new ValidationTextureFormat(1); - - case Format::R64_UINT: return new ValidationTextureFormat(1); - - case Format::R32G32B32A32_UINT: return new ValidationTextureFormat(4); - case Format::R32G32B32_UINT: return new ValidationTextureFormat(3); - case Format::R32G32_UINT: return new ValidationTextureFormat(2); - case Format::R32_UINT: return new ValidationTextureFormat(1); - - case Format::R16G16B16A16_UINT: return new ValidationTextureFormat(4); - case Format::R16G16_UINT: return new ValidationTextureFormat(2); - case Format::R16_UINT: return new ValidationTextureFormat(1); - - case Format::R8G8B8A8_UINT: return new ValidationTextureFormat(4); - case Format::R8G8_UINT: return new ValidationTextureFormat(2); - case Format::R8_UINT: return new ValidationTextureFormat(1); - - case Format::R64_SINT: return new ValidationTextureFormat(1); - - case Format::R32G32B32A32_SINT: return new ValidationTextureFormat(4); - case Format::R32G32B32_SINT: return new ValidationTextureFormat(3); - case Format::R32G32_SINT: return new ValidationTextureFormat(2); - case Format::R32_SINT: return new ValidationTextureFormat(1); - - case Format::R16G16B16A16_SINT: return new ValidationTextureFormat(4); - case Format::R16G16_SINT: return new ValidationTextureFormat(2); - case Format::R16_SINT: return new ValidationTextureFormat(1); - - case Format::R8G8B8A8_SINT: return new ValidationTextureFormat(4); - case Format::R8G8_SINT: return new ValidationTextureFormat(2); - case Format::R8_SINT: return new ValidationTextureFormat(1); - - case Format::R16G16B16A16_UNORM: return new ValidationTextureFormat(4); - case Format::R16G16_UNORM: return new ValidationTextureFormat(2); - case Format::R16_UNORM: return new ValidationTextureFormat(1); - - case Format::R8G8B8A8_UNORM: return new ValidationTextureFormat(4); - case Format::R8G8B8A8_UNORM_SRGB: return new ValidationTextureFormat(4); - case Format::R8G8_UNORM: return new ValidationTextureFormat(2); - case Format::R8_UNORM: return new ValidationTextureFormat(1); - case Format::B8G8R8A8_UNORM: return new ValidationTextureFormat(4); - case Format::B8G8R8A8_UNORM_SRGB: return new ValidationTextureFormat(4); - case Format::B8G8R8X8_UNORM: return new ValidationTextureFormat(3); - case Format::B8G8R8X8_UNORM_SRGB: return new ValidationTextureFormat(3); - - case Format::R16G16B16A16_SNORM: return new ValidationTextureFormat(4); - case Format::R16G16_SNORM: return new ValidationTextureFormat(2); - case Format::R16_SNORM: return new ValidationTextureFormat(1); - - case Format::R8G8B8A8_SNORM: return new ValidationTextureFormat(4); - case Format::R8G8_SNORM: return new ValidationTextureFormat(2); - case Format::R8_SNORM: return new ValidationTextureFormat(1); - - case Format::D32_FLOAT: return new ValidationTextureFormat(1); - case Format::D16_UNORM: return new ValidationTextureFormat(1); - - case Format::B4G4R4A4_UNORM: return new PackedValidationTextureFormat(4, 4, 4, 4); - case Format::B5G6R5_UNORM: return new PackedValidationTextureFormat(5, 6, 5, 0); - case Format::B5G5R5A1_UNORM: return new PackedValidationTextureFormat(5, 5, 5, 1); - - case Format::R9G9B9E5_SHAREDEXP: return new ValidationTextureFormat(1); + case Format::R32G32B32A32_TYPELESS: + return new ValidationTextureFormat(4); + case Format::R32G32B32_TYPELESS: + return new ValidationTextureFormat(3); + case Format::R32G32_TYPELESS: + return new ValidationTextureFormat(2); + case Format::R32_TYPELESS: + return new ValidationTextureFormat(1); + + case Format::R16G16B16A16_TYPELESS: + return new ValidationTextureFormat(4); + case Format::R16G16_TYPELESS: + return new ValidationTextureFormat(2); + case Format::R16_TYPELESS: + return new ValidationTextureFormat(1); + + case Format::R8G8B8A8_TYPELESS: + return new ValidationTextureFormat(4); + case Format::R8G8_TYPELESS: + return new ValidationTextureFormat(2); + case Format::R8_TYPELESS: + return new ValidationTextureFormat(1); + case Format::B8G8R8A8_TYPELESS: + return new ValidationTextureFormat(4); + + case Format::R32G32B32A32_FLOAT: + return new ValidationTextureFormat(4); + case Format::R32G32B32_FLOAT: + return new ValidationTextureFormat(3); + case Format::R32G32_FLOAT: + return new ValidationTextureFormat(2); + case Format::R32_FLOAT: + return new ValidationTextureFormat(1); + + case Format::R16G16B16A16_FLOAT: + return new ValidationTextureFormat(4); + case Format::R16G16_FLOAT: + return new ValidationTextureFormat(2); + case Format::R16_FLOAT: + return new ValidationTextureFormat(1); + + case Format::R64_UINT: + return new ValidationTextureFormat(1); + + case Format::R32G32B32A32_UINT: + return new ValidationTextureFormat(4); + case Format::R32G32B32_UINT: + return new ValidationTextureFormat(3); + case Format::R32G32_UINT: + return new ValidationTextureFormat(2); + case Format::R32_UINT: + return new ValidationTextureFormat(1); + + case Format::R16G16B16A16_UINT: + return new ValidationTextureFormat(4); + case Format::R16G16_UINT: + return new ValidationTextureFormat(2); + case Format::R16_UINT: + return new ValidationTextureFormat(1); + + case Format::R8G8B8A8_UINT: + return new ValidationTextureFormat(4); + case Format::R8G8_UINT: + return new ValidationTextureFormat(2); + case Format::R8_UINT: + return new ValidationTextureFormat(1); + + case Format::R64_SINT: + return new ValidationTextureFormat(1); + + case Format::R32G32B32A32_SINT: + return new ValidationTextureFormat(4); + case Format::R32G32B32_SINT: + return new ValidationTextureFormat(3); + case Format::R32G32_SINT: + return new ValidationTextureFormat(2); + case Format::R32_SINT: + return new ValidationTextureFormat(1); + + case Format::R16G16B16A16_SINT: + return new ValidationTextureFormat(4); + case Format::R16G16_SINT: + return new ValidationTextureFormat(2); + case Format::R16_SINT: + return new ValidationTextureFormat(1); + + case Format::R8G8B8A8_SINT: + return new ValidationTextureFormat(4); + case Format::R8G8_SINT: + return new ValidationTextureFormat(2); + case Format::R8_SINT: + return new ValidationTextureFormat(1); + + case Format::R16G16B16A16_UNORM: + return new ValidationTextureFormat(4); + case Format::R16G16_UNORM: + return new ValidationTextureFormat(2); + case Format::R16_UNORM: + return new ValidationTextureFormat(1); + + case Format::R8G8B8A8_UNORM: + return new ValidationTextureFormat(4); + case Format::R8G8B8A8_UNORM_SRGB: + return new ValidationTextureFormat(4); + case Format::R8G8_UNORM: + return new ValidationTextureFormat(2); + case Format::R8_UNORM: + return new ValidationTextureFormat(1); + case Format::B8G8R8A8_UNORM: + return new ValidationTextureFormat(4); + case Format::B8G8R8A8_UNORM_SRGB: + return new ValidationTextureFormat(4); + case Format::B8G8R8X8_UNORM: + return new ValidationTextureFormat(3); + case Format::B8G8R8X8_UNORM_SRGB: + return new ValidationTextureFormat(3); + + case Format::R16G16B16A16_SNORM: + return new ValidationTextureFormat(4); + case Format::R16G16_SNORM: + return new ValidationTextureFormat(2); + case Format::R16_SNORM: + return new ValidationTextureFormat(1); + + case Format::R8G8B8A8_SNORM: + return new ValidationTextureFormat(4); + case Format::R8G8_SNORM: + return new ValidationTextureFormat(2); + case Format::R8_SNORM: + return new ValidationTextureFormat(1); + + case Format::D32_FLOAT: + return new ValidationTextureFormat(1); + case Format::D16_UNORM: + return new ValidationTextureFormat(1); + + case Format::B4G4R4A4_UNORM: + return new PackedValidationTextureFormat(4, 4, 4, 4); + case Format::B5G6R5_UNORM: + return new PackedValidationTextureFormat(5, 6, 5, 0); + case Format::B5G5R5A1_UNORM: + return new PackedValidationTextureFormat(5, 5, 5, 1); + + case Format::R9G9B9E5_SHAREDEXP: + return new ValidationTextureFormat(1); case Format::R10G10B10A2_TYPELESS: return new PackedValidationTextureFormat(10, 10, 10, 2); case Format::R10G10B10A2_UNORM: @@ -162,7 +227,8 @@ RefPtr getValidationTextureFormat(Format format) // BC6H_SF16, // BC7_UNORM, // BC7_UNORM_SRGB, - default: return nullptr; + default: + return nullptr; } } -- cgit v1.2.3