mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 00:47:13 +00:00
Disallow creating multisampled 2D array textures
Currently we decide not to support multisampled 2D array textures because on Metal they are only available on macOS version greater than 10.14. This patch also removes the compatibility check between cube map texture views and sample counts because currently the sample count of 2D array textures is always equal to 1. BUG=dawn:56 TEST=dawn_unittests Change-Id: I9736c977192409c79572f061fa1b7681b5b3e6c8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6000 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
committed by
Commit Bot service account
parent
cae68ff846
commit
5f4bcbb946
@@ -84,6 +84,15 @@ TEST_F(TextureValidationTest, SampleCount) {
|
||||
|
||||
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
|
||||
}
|
||||
|
||||
// Currently we do not support multisampled 2D array textures.
|
||||
{
|
||||
dawn::TextureDescriptor descriptor = defaultDescriptor;
|
||||
descriptor.sampleCount = 4;
|
||||
descriptor.arrayLayerCount = 2;
|
||||
|
||||
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
|
||||
}
|
||||
}
|
||||
|
||||
// Test that it is valid to destroy a texture
|
||||
|
||||
@@ -200,30 +200,6 @@ TEST_F(TextureViewValidationTest, CreateCubeMapTextureView) {
|
||||
descriptor.arrayLayerCount = 12;
|
||||
ASSERT_DEVICE_ERROR(nonSquareTexture.CreateTextureView(&descriptor));
|
||||
}
|
||||
|
||||
// It is an error to create a cube map texture view on a multisampled texture.
|
||||
{
|
||||
constexpr uint32_t kSampleCount = 4;
|
||||
dawn::Texture multisampledTexture = Create2DArrayTexture(device, kDefaultArrayLayers,
|
||||
kWidth, kHeight, 1, kSampleCount);
|
||||
dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor;
|
||||
descriptor.dimension = dawn::TextureViewDimension::Cube;
|
||||
descriptor.arrayLayerCount = 6;
|
||||
descriptor.mipLevelCount = 1;
|
||||
ASSERT_DEVICE_ERROR(multisampledTexture.CreateTextureView(&descriptor));
|
||||
}
|
||||
|
||||
// It is an error to create a cube map array texture view on a multisampled texture.
|
||||
{
|
||||
constexpr uint32_t kSampleCount = 4;
|
||||
dawn::Texture multisampledTexture = Create2DArrayTexture(device, kDefaultArrayLayers,
|
||||
kWidth, kHeight, 1, kSampleCount);
|
||||
dawn::TextureViewDescriptor descriptor = base2DArrayTextureViewDescriptor;
|
||||
descriptor.dimension = dawn::TextureViewDimension::CubeArray;
|
||||
descriptor.arrayLayerCount = 12;
|
||||
descriptor.mipLevelCount = 1;
|
||||
ASSERT_DEVICE_ERROR(multisampledTexture.CreateTextureView(&descriptor));
|
||||
}
|
||||
}
|
||||
|
||||
// Test the format compatibility rules when creating a texture view.
|
||||
|
||||
Reference in New Issue
Block a user