From 5a29c15cc3c227d9bb93a71cb50491a822d0ccf3 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Mon, 15 Nov 2021 20:42:39 -0800 Subject: Add BGRA8 Unorm SRGB to the list of supported formats (#2016) Co-authored-by: Yong He --- tools/gfx/d3d/d3d-util.cpp | 1 + tools/gfx/render.cpp | 1 + tools/gfx/vulkan/vk-util.cpp | 1 + 3 files changed, 3 insertions(+) (limited to 'tools/gfx') diff --git a/tools/gfx/d3d/d3d-util.cpp b/tools/gfx/d3d/d3d-util.cpp index 84b5de844..e2083d39e 100644 --- a/tools/gfx/d3d/d3d-util.cpp +++ b/tools/gfx/d3d/d3d-util.cpp @@ -166,6 +166,7 @@ D3D12_DEPTH_STENCILOP_DESC D3DUtil::translateStencilOpDesc(DepthStencilOpDesc de case Format::R8G8_UNORM: return DXGI_FORMAT_R8G8_UNORM; case Format::R8_UNORM: return DXGI_FORMAT_R8_UNORM; case Format::B8G8R8A8_UNORM: return DXGI_FORMAT_B8G8R8A8_UNORM; + case Format::B8G8R8A8_UNORM_SRGB: return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB; case Format::R16G16B16A16_SNORM: return DXGI_FORMAT_R16G16B16A16_SNORM; case Format::R16G16_SNORM: return DXGI_FORMAT_R16G16_SNORM; diff --git a/tools/gfx/render.cpp b/tools/gfx/render.cpp index 6fef96f0b..293c5abcf 100644 --- a/tools/gfx/render.cpp +++ b/tools/gfx/render.cpp @@ -112,6 +112,7 @@ struct FormatInfoMap set(Format::R8G8_UNORM, SLANG_SCALAR_TYPE_FLOAT32, 2); set(Format::R8_UNORM, SLANG_SCALAR_TYPE_FLOAT32, 1); set(Format::B8G8R8A8_UNORM, SLANG_SCALAR_TYPE_FLOAT32, 4); + set(Format::B8G8R8A8_UNORM_SRGB, SLANG_SCALAR_TYPE_FLOAT32, 4); set(Format::R16G16B16A16_SNORM, SLANG_SCALAR_TYPE_FLOAT32, 4); set(Format::R16G16_SNORM, SLANG_SCALAR_TYPE_FLOAT32, 2); diff --git a/tools/gfx/vulkan/vk-util.cpp b/tools/gfx/vulkan/vk-util.cpp index 3a40152a4..574e1b9c4 100644 --- a/tools/gfx/vulkan/vk-util.cpp +++ b/tools/gfx/vulkan/vk-util.cpp @@ -69,6 +69,7 @@ namespace gfx { case Format::R8G8_UNORM: return VK_FORMAT_R8G8_UNORM; case Format::R8_UNORM: return VK_FORMAT_R8_UNORM; case Format::B8G8R8A8_UNORM: return VK_FORMAT_B8G8R8A8_UNORM; + case Format::B8G8R8A8_UNORM_SRGB: return VK_FORMAT_B8G8R8A8_SRGB; case Format::R16G16B16A16_SNORM: return VK_FORMAT_R16G16B16A16_SNORM; case Format::R16G16_SNORM: return VK_FORMAT_R16G16_SNORM; -- cgit v1.2.3