Use WGPU_MIP_LEVEL_COUNT_UNDEFINED instead of 0
The follow up CL will remove 0. Bug: dawn:1026 Change-Id: Ida62f8d8b0dd8f9722e40f3f95366d3db0c7ab52 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64164 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
This commit is contained in:
parent
857d4e62e3
commit
4935c14eec
|
@ -2086,7 +2086,7 @@
|
|||
{"name": "format", "type": "texture format", "default": "undefined"},
|
||||
{"name": "dimension", "type": "texture view dimension", "default": "undefined"},
|
||||
{"name": "base mip level", "type": "uint32_t", "default": "0"},
|
||||
{"name": "mip level count", "type": "uint32_t", "default": "0"},
|
||||
{"name": "mip level count", "type": "uint32_t", "default": "WGPU_MIP_LEVEL_COUNT_UNDEFINED"},
|
||||
{"name": "base array layer", "type": "uint32_t", "default": "0"},
|
||||
{"name": "array layer count", "type": "uint32_t", "default": "WGPU_ARRAY_LAYER_COUNT_UNDEFINED"},
|
||||
{"name": "aspect", "type": "texture aspect", "default": "all"}
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
#define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL)
|
||||
#define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL)
|
||||
#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL)
|
||||
#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL)
|
||||
|
||||
typedef uint32_t WGPUFlags;
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace wgpu {
|
|||
static constexpr uint32_t kLimitU32Undefined = WGPU_LIMIT_U32_UNDEFINED;
|
||||
static constexpr uint64_t kLimitU64Undefined = WGPU_LIMIT_U64_UNDEFINED;
|
||||
static constexpr uint32_t kArrayLayerCountUndefined = WGPU_ARRAY_LAYER_COUNT_UNDEFINED;
|
||||
static constexpr uint32_t kMipLevelCountUndefined = WGPU_MIP_LEVEL_COUNT_UNDEFINED;
|
||||
|
||||
{% for type in by_category["enum"] %}
|
||||
enum class {{as_cppType(type.name)}} : uint32_t {
|
||||
|
|
|
@ -417,7 +417,10 @@ namespace dawn_native {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (desc.mipLevelCount == 0) {
|
||||
|
||||
// TODO(jie.a.chen@intel.com): Remove 'desc.mipLevelCount == 0' once the WebGPU change is
|
||||
// landed.
|
||||
if (desc.mipLevelCount == 0 || desc.mipLevelCount == wgpu::kMipLevelCountUndefined) {
|
||||
desc.mipLevelCount = texture->GetNumMipLevels() - desc.baseMipLevel;
|
||||
}
|
||||
return desc;
|
||||
|
|
|
@ -109,10 +109,11 @@ namespace {
|
|||
ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor));
|
||||
}
|
||||
|
||||
// baseMipLevel == k && mipLevelCount == 0 means to use levels k..end.
|
||||
// baseMipLevel == k && mipLevelCount == WGPU_MIP_LEVEL_COUNT_UNDEFINED means to use levels
|
||||
// k..end.
|
||||
{
|
||||
wgpu::TextureViewDescriptor descriptor = base2DTextureViewDescriptor;
|
||||
descriptor.mipLevelCount = 0;
|
||||
descriptor.mipLevelCount = WGPU_MIP_LEVEL_COUNT_UNDEFINED;
|
||||
|
||||
descriptor.baseMipLevel = 0;
|
||||
texture.CreateView(&descriptor);
|
||||
|
@ -255,10 +256,11 @@ namespace {
|
|||
}
|
||||
}
|
||||
|
||||
// baseMipLevel == k && mipLevelCount == 0 means to use levels k..end.
|
||||
// baseMipLevel == k && mipLevelCount == WGPU_MIP_LEVEL_COUNT_UNDEFINED means to use levels
|
||||
// k..end.
|
||||
{
|
||||
wgpu::TextureViewDescriptor descriptor = base3DTextureViewDescriptor;
|
||||
descriptor.mipLevelCount = 0;
|
||||
descriptor.mipLevelCount = WGPU_MIP_LEVEL_COUNT_UNDEFINED;
|
||||
|
||||
descriptor.baseMipLevel = 0;
|
||||
texture.CreateView(&descriptor);
|
||||
|
|
Loading…
Reference in New Issue