mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
Deprecate TextureDescriptor::arrayLayerCount -> size.depth
This updates CL: - Adds a deprecation warning to use size.depth instead of arrayLayerCount. - Changes all tests and samples to use size.depth. - Adds deprecation tests for the change. In particular the state tracking in TextureBase isn't changed yet because it requires non-trivial changes in the backends. It will be done in a follow-up CL. Bug:dawn:22 Change-Id: Ic02dfb5baaba8d5b06cd339ce988e9b1d16cb5e9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23101 Reviewed-by: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
6b3a974b42
commit
4234d78201
@@ -26,12 +26,11 @@ class BindGroupValidationTest : public ValidationTest {
|
||||
uint32_t layerCount) {
|
||||
wgpu::TextureDescriptor descriptor;
|
||||
descriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
descriptor.size = {16, 16, 1};
|
||||
descriptor.size = {16, 16, layerCount};
|
||||
descriptor.sampleCount = 1;
|
||||
descriptor.mipLevelCount = 1;
|
||||
descriptor.usage = usage;
|
||||
descriptor.format = format;
|
||||
descriptor.arrayLayerCount = layerCount;
|
||||
|
||||
return device.CreateTexture(&descriptor);
|
||||
}
|
||||
|
||||
@@ -39,8 +39,7 @@ class CopyCommandTest : public ValidationTest {
|
||||
descriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
descriptor.size.width = width;
|
||||
descriptor.size.height = height;
|
||||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayerCount = arrayLayerCount;
|
||||
descriptor.size.depth = arrayLayerCount;
|
||||
descriptor.sampleCount = sampleCount;
|
||||
descriptor.format = format;
|
||||
descriptor.mipLevelCount = mipLevelCount;
|
||||
@@ -548,7 +547,7 @@ TEST_F(CopyCommandTest_B2T, BufferOrTextureInErrorState) {
|
||||
ASSERT_DEVICE_ERROR(wgpu::Buffer errorBuffer = device.CreateBuffer(&errorBufferDescriptor));
|
||||
|
||||
wgpu::TextureDescriptor errorTextureDescriptor;
|
||||
errorTextureDescriptor.arrayLayerCount = 0;
|
||||
errorTextureDescriptor.size.depth = 0;
|
||||
ASSERT_DEVICE_ERROR(wgpu::Texture errorTexture = device.CreateTexture(&errorTextureDescriptor));
|
||||
|
||||
wgpu::BufferCopyView errorBufferCopyView = utils::CreateBufferCopyView(errorBuffer, 0, 0, 0);
|
||||
@@ -879,7 +878,7 @@ TEST_F(CopyCommandTest_T2B, BufferOrTextureInErrorState) {
|
||||
ASSERT_DEVICE_ERROR(wgpu::Buffer errorBuffer = device.CreateBuffer(&errorBufferDescriptor));
|
||||
|
||||
wgpu::TextureDescriptor errorTextureDescriptor;
|
||||
errorTextureDescriptor.arrayLayerCount = 0;
|
||||
errorTextureDescriptor.size.depth = 0;
|
||||
ASSERT_DEVICE_ERROR(wgpu::Texture errorTexture = device.CreateTexture(&errorTextureDescriptor));
|
||||
|
||||
wgpu::BufferCopyView errorBufferCopyView = utils::CreateBufferCopyView(errorBuffer, 0, 0, 0);
|
||||
|
||||
@@ -55,8 +55,7 @@ wgpu::Texture CreateTexture(wgpu::Device& device,
|
||||
descriptor.dimension = dimension;
|
||||
descriptor.size.width = width;
|
||||
descriptor.size.height = height;
|
||||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayerCount = arrayLayerCount;
|
||||
descriptor.size.depth = arrayLayerCount;
|
||||
descriptor.sampleCount = sampleCount;
|
||||
descriptor.format = format;
|
||||
descriptor.mipLevelCount = mipLevelCount;
|
||||
|
||||
@@ -227,7 +227,6 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) {
|
||||
baseTextureDescriptor.size.width = 4;
|
||||
baseTextureDescriptor.size.height = 4;
|
||||
baseTextureDescriptor.size.depth = 1;
|
||||
baseTextureDescriptor.arrayLayerCount = 1;
|
||||
baseTextureDescriptor.mipLevelCount = 1;
|
||||
baseTextureDescriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
baseTextureDescriptor.usage = wgpu::TextureUsage::OutputAttachment;
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace {
|
||||
wgpu::TextureDescriptor descriptor;
|
||||
descriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
descriptor.size = {1, 1, 1};
|
||||
descriptor.arrayLayerCount = 1;
|
||||
descriptor.sampleCount = 1;
|
||||
descriptor.mipLevelCount = 1;
|
||||
descriptor.usage = usage;
|
||||
|
||||
@@ -89,8 +89,7 @@ class StorageTextureValidationTests : public ValidationTest {
|
||||
uint32_t arrayLayerCount = 1) {
|
||||
wgpu::TextureDescriptor descriptor;
|
||||
descriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
descriptor.size = {16, 16, 1};
|
||||
descriptor.arrayLayerCount = arrayLayerCount;
|
||||
descriptor.size = {16, 16, arrayLayerCount};
|
||||
descriptor.sampleCount = sampleCount;
|
||||
descriptor.format = format;
|
||||
descriptor.mipLevelCount = 1;
|
||||
|
||||
@@ -28,8 +28,7 @@ namespace {
|
||||
wgpu::TextureUsage usage) {
|
||||
wgpu::TextureDescriptor texDesc;
|
||||
texDesc.dimension = wgpu::TextureDimension::e2D;
|
||||
texDesc.size = {kSize, kSize, 1};
|
||||
texDesc.arrayLayerCount = arrayLayerCount;
|
||||
texDesc.size = {kSize, kSize, arrayLayerCount};
|
||||
texDesc.sampleCount = 1;
|
||||
texDesc.mipLevelCount = mipLevelCount;
|
||||
texDesc.usage = usage;
|
||||
|
||||
@@ -31,8 +31,7 @@ class TextureValidationTest : public ValidationTest {
|
||||
wgpu::TextureDescriptor descriptor;
|
||||
descriptor.size.width = kWidth;
|
||||
descriptor.size.height = kHeight;
|
||||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayerCount = kDefaultArraySize;
|
||||
descriptor.size.depth = kDefaultDepth;
|
||||
descriptor.mipLevelCount = kDefaultMipLevels;
|
||||
descriptor.sampleCount = kDefaultSampleCount;
|
||||
descriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
@@ -46,7 +45,7 @@ class TextureValidationTest : public ValidationTest {
|
||||
private:
|
||||
static constexpr uint32_t kWidth = 32;
|
||||
static constexpr uint32_t kHeight = 32;
|
||||
static constexpr uint32_t kDefaultArraySize = 1;
|
||||
static constexpr uint32_t kDefaultDepth = 1;
|
||||
static constexpr uint32_t kDefaultMipLevels = 1;
|
||||
static constexpr uint32_t kDefaultSampleCount = 1;
|
||||
|
||||
@@ -94,7 +93,7 @@ TEST_F(TextureValidationTest, SampleCount) {
|
||||
{
|
||||
wgpu::TextureDescriptor descriptor = defaultDescriptor;
|
||||
descriptor.sampleCount = 4;
|
||||
descriptor.arrayLayerCount = 2;
|
||||
descriptor.size.depth = 2;
|
||||
|
||||
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
|
||||
}
|
||||
@@ -204,7 +203,7 @@ TEST_F(TextureValidationTest, ArrayLayerCount) {
|
||||
// Array layer count exceeding kMaxTexture2DArrayLayers is not allowed
|
||||
{
|
||||
wgpu::TextureDescriptor descriptor = defaultDescriptor;
|
||||
descriptor.arrayLayerCount = kMaxTexture2DArrayLayers + 1u;
|
||||
descriptor.size.depth = kMaxTexture2DArrayLayers + 1u;
|
||||
|
||||
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
|
||||
}
|
||||
@@ -212,7 +211,7 @@ TEST_F(TextureValidationTest, ArrayLayerCount) {
|
||||
// Array layer count less than kMaxTexture2DArrayLayers is allowed;
|
||||
{
|
||||
wgpu::TextureDescriptor descriptor = defaultDescriptor;
|
||||
descriptor.arrayLayerCount = kMaxTexture2DArrayLayers >> 1;
|
||||
descriptor.size.depth = kMaxTexture2DArrayLayers >> 1;
|
||||
|
||||
device.CreateTexture(&descriptor);
|
||||
}
|
||||
@@ -220,7 +219,7 @@ TEST_F(TextureValidationTest, ArrayLayerCount) {
|
||||
// Array layer count equal to kMaxTexture2DArrayLayers is allowed;
|
||||
{
|
||||
wgpu::TextureDescriptor descriptor = defaultDescriptor;
|
||||
descriptor.arrayLayerCount = kMaxTexture2DArrayLayers;
|
||||
descriptor.size.depth = kMaxTexture2DArrayLayers;
|
||||
|
||||
device.CreateTexture(&descriptor);
|
||||
}
|
||||
@@ -487,7 +486,7 @@ TEST_F(CompressedTextureFormatsValidationTests, 2DArrayTexture) {
|
||||
for (wgpu::TextureFormat format : kBCFormats) {
|
||||
wgpu::TextureDescriptor descriptor = CreateDefaultTextureDescriptor();
|
||||
descriptor.format = format;
|
||||
descriptor.arrayLayerCount = 6;
|
||||
descriptor.size.depth = 6;
|
||||
device.CreateTexture(&descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,7 @@ wgpu::Texture Create2DArrayTexture(wgpu::Device& device,
|
||||
descriptor.dimension = wgpu::TextureDimension::e2D;
|
||||
descriptor.size.width = width;
|
||||
descriptor.size.height = height;
|
||||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayerCount = arrayLayerCount;
|
||||
descriptor.size.depth = arrayLayerCount;
|
||||
descriptor.sampleCount = sampleCount;
|
||||
descriptor.format = kDefaultTextureFormat;
|
||||
descriptor.mipLevelCount = mipLevelCount;
|
||||
|
||||
@@ -105,7 +105,6 @@ ValidationTest::DummyRenderPass::DummyRenderPass(const wgpu::Device& device)
|
||||
descriptor.size.width = width;
|
||||
descriptor.size.height = height;
|
||||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayerCount = 1;
|
||||
descriptor.sampleCount = 1;
|
||||
descriptor.format = attachmentFormat;
|
||||
descriptor.mipLevelCount = 1;
|
||||
|
||||
Reference in New Issue
Block a user