From 66467a4d8f75faa170fe7b464c611b4cb8dde8b8 Mon Sep 17 00:00:00 2001 From: Li Hao Date: Tue, 30 Nov 2021 03:36:49 +0000 Subject: [PATCH] Add Depth16Unorm texture format in utils/TextureUtils.h The Depth16Unorm format has been implemented at https://dawn-review.googlesource.com/c/dawn/+/62420, we can add it to kAllTextureFormats and kDepthFormats in utils/TextureUtils.h. Bug=dawn:570 Change-Id: I5abf845341debc1d6881c639bc400c40b14fc3bc Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70900 Reviewed-by: Austin Eng Reviewed-by: Brandon Jones Commit-Queue: Hao Li --- src/utils/TextureUtils.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/TextureUtils.h b/src/utils/TextureUtils.h index 9fe3e48b09..be271ccd82 100644 --- a/src/utils/TextureUtils.h +++ b/src/utils/TextureUtils.h @@ -22,8 +22,8 @@ #include "common/Assert.h" namespace utils { - // TODO(dawn:666, 570): Add Stencil8, Depth16Unorm formats if they are implemented. - static constexpr std::array kAllTextureFormats = { + // TODO(dawn:666): Add Stencil8 format when it's implemented. + static constexpr std::array kAllTextureFormats = { wgpu::TextureFormat::R8Unorm, wgpu::TextureFormat::R8Snorm, wgpu::TextureFormat::R8Uint, @@ -60,6 +60,7 @@ namespace utils { wgpu::TextureFormat::RGBA32Float, wgpu::TextureFormat::RGBA32Uint, wgpu::TextureFormat::RGBA32Sint, + wgpu::TextureFormat::Depth16Unorm, wgpu::TextureFormat::Depth32Float, wgpu::TextureFormat::Depth24Plus, wgpu::TextureFormat::Depth24PlusStencil8, @@ -182,12 +183,11 @@ namespace utils { kBCFormats.size() + kETC2Formats.size() + kASTCFormats.size(), "Number of compressed format must equal number of BC, ETC2, and ASTC formats."); - // TODO(dawn:666, 570): Add more depth/stencil formats if Stencil8, Depth16Unorm are - // implemented. - static constexpr std::array kDepthFormats = { - wgpu::TextureFormat::Depth32Float, wgpu::TextureFormat::Depth24Plus, - wgpu::TextureFormat::Depth24PlusStencil8, wgpu::TextureFormat::Depth24UnormStencil8, - wgpu::TextureFormat::Depth32FloatStencil8, + // TODO(dawn:666): Add Stencil8 format when it's implemented. + static constexpr std::array kDepthFormats = { + wgpu::TextureFormat::Depth16Unorm, wgpu::TextureFormat::Depth32Float, + wgpu::TextureFormat::Depth24Plus, wgpu::TextureFormat::Depth24PlusStencil8, + wgpu::TextureFormat::Depth24UnormStencil8, wgpu::TextureFormat::Depth32FloatStencil8, }; static constexpr std::array kStencilFormats = { wgpu::TextureFormat::Depth24PlusStencil8,