Add more constants for max texture sizes

Currently we only implemented 2D and 2DArray texture. kMaxTextureSize
is actually for 2D texture only. This patch adds a few more constants
for texture size for 1D and 3D textures, and changes kMaxTextureSize
to kMaxTextureDimension2D.

Bug: dawn:558

Change-Id: I9088dd7c060dc096a65abea37c7fb01f760524e9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36540
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
Yunchao He
2021-01-11 18:04:12 +00:00
committed by Commit Bot service account
parent 77fcdf7eaa
commit 0325e4503b
5 changed files with 36 additions and 33 deletions

View File

@@ -58,11 +58,13 @@ static constexpr float kLodMin = 0.0;
static constexpr float kLodMax = 1000.0;
// Max texture size constants
static constexpr uint32_t kMaxTextureSize = 8192u;
static constexpr uint32_t kMaxTexture2DArrayLayers = 256u;
static constexpr uint32_t kMaxTextureDimension1D = 8192u;
static constexpr uint32_t kMaxTextureDimension2D = 8192u;
static constexpr uint32_t kMaxTextureDimension3D = 2048u;
static constexpr uint32_t kMaxTextureArrayLayers = 2048u;
static constexpr uint32_t kMaxTexture2DMipLevels = 14u;
static_assert(1 << (kMaxTexture2DMipLevels - 1) == kMaxTextureSize,
"kMaxTexture2DMipLevels and kMaxTextureSize size mismatch");
static_assert(1 << (kMaxTexture2DMipLevels - 1) == kMaxTextureDimension2D,
"kMaxTexture2DMipLevels and kMaxTextureDimension2D size mismatch");
// Offset alignment for CopyB2B. Strictly speaking this alignment is required only
// on macOS, but we decide to do it on all platforms.