diff options
| -rw-r--r-- | docs/gfx-user-guide/unsupported-formats.md | 1 | ||||
| -rw-r--r-- | slang-gfx.h | 2 | ||||
| -rw-r--r-- | tools/gfx-unit-test/format-unit-tests.cpp | 8 | ||||
| -rw-r--r-- | tools/gfx/d3d/d3d-util.cpp | 1 | ||||
| -rw-r--r-- | tools/gfx/render.cpp | 1 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-util.cpp | 1 |
6 files changed, 13 insertions, 1 deletions
diff --git a/docs/gfx-user-guide/unsupported-formats.md b/docs/gfx-user-guide/unsupported-formats.md index a7a51e20d..54fd1a0f1 100644 --- a/docs/gfx-user-guide/unsupported-formats.md +++ b/docs/gfx-user-guide/unsupported-formats.md @@ -79,7 +79,6 @@ VK_FORMAT_B8G8R8A8_USCALED \ VK_FORMAT_B8G8R8A8_SSCALED \ VK_FORMAT_B8G8R8A8_UINT \ VK_FORMAT_B8G8R8A8_SINT \ -VK_FORMAT_B8G8R8A8_SRGB \ VK_FORMAT_A8B8G8R8_UNORM_PACK32 \ VK_FORMAT_A8B8G8R8_SNORM_PACK32 \ VK_FORMAT_A8B8G8R8_USCALED_PACK32 \ diff --git a/slang-gfx.h b/slang-gfx.h index 9a813a78e..2fa24f903 100644 --- a/slang-gfx.h +++ b/slang-gfx.h @@ -188,6 +188,7 @@ public: x(R8G8_UNORM, 2, 1) \ x(R8_UNORM, 1, 1) \ x(B8G8R8A8_UNORM, 4, 1) \ + x(B8G8R8A8_UNORM_SRGB, 4, 1) \ \ x(R16G16B16A16_SNORM, 8, 1) \ x(R16G16_SNORM, 4, 1) \ @@ -292,6 +293,7 @@ enum class Format R8G8_UNORM, R8_UNORM, B8G8R8A8_UNORM, + B8G8R8A8_UNORM_SRGB, R16G16B16A16_SNORM, R16G16_SNORM, diff --git a/tools/gfx-unit-test/format-unit-tests.cpp b/tools/gfx-unit-test/format-unit-tests.cpp index 0498bc670..b499b67bd 100644 --- a/tools/gfx-unit-test/format-unit-tests.cpp +++ b/tools/gfx-unit-test/format-unit-tests.cpp @@ -744,6 +744,14 @@ namespace gfx_test floatResults, Slang::makeArray<float>(0.0f, 0.0f, 0.0f, 1.0f, 0.498039216f, 0.498039216f, 0.498039216f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f)); + + texView = createTexView(device, size, gfx::Format::B8G8R8A8_UNORM_SRGB, &subData); + setUpAndRunTest(device, texView, floatBufferView, "copyTexFloat4"); + compareComputeResult( + device, + floatResults, + Slang::makeArray<float>(0.0f, 0.0f, 0.0f, 1.0f, 0.211914062f, 0.211914062f, 0.211914062f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f)); } { 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; |
