Compat: unlower limits
Because we excluded Mali-T624,T628,T720 we can make the
lower limit of maxStorageBuffersPerShaderStage be 8,
maxStorageBuffersInFragmentShaders be 4,
and maxStorageTexturesInFragmentShaders be 4
I removed 2 tests because AFAICT they are hard to fix AND, they
are tested in the CTS so they'll still be tested.
The issue is the tests were testing that, in compat, when
maxStorageTexturesInFragmentStage is less than
maxStorageTexturesPerShaderStage and you try to use
more than maxStorageTexturesInFragmentStage you get an
error. This only happens in compat because in core the
2 limits are always the max of the 2.
With the change so that maxStorageTextureInFragmentStage
is 4 it's not, by default, lower than maxStorageTexturesPerShaderStage
which is also 4.
The testing infra for the dawn_unittests doesn't appear to
have any easy way to change this. To test you'd need some way
to tell dawn to return an adapter with maxStorageTexturesPerShaderStage
greater than 4. Setting that all up seems like a waste of time given
the CTS can and does test this already.
If it is important it can be done in a different CL.
Note: tested this with a CTS that expects the new limits.
Note: this will have to wait for a CTS roll or suppressions
added to expectations.
Bug: 406729256,406729255
Fixed: 406729256,406729255
Change-Id: I9c1ddbba8d1a9e65a899ef978e3b214ae6affd28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/233398
Commit-Queue: Gregg Tavares <gman@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/native/Limits.cpp b/src/dawn/native/Limits.cpp
index 79f799c..8bacc9a 100644
--- a/src/dawn/native/Limits.cpp
+++ b/src/dawn/native/Limits.cpp
@@ -72,7 +72,7 @@
X(Maximum, maxSampledTexturesPerShaderStage, 16, 16, 16) \
X(Maximum, maxSamplersPerShaderStage, 16, 16, 16) \
X(Maximum, maxStorageTexturesPerShaderStage, 4, 4, 8) \
- X(Maximum, maxStorageTexturesInFragmentStage, 0, 4, 8) \
+ X(Maximum, maxStorageTexturesInFragmentStage, 4, 4, 8) \
X(Maximum, maxStorageTexturesInVertexStage, 0, 4, 8) \
X(Maximum, maxUniformBuffersPerShaderStage, 12, 12, 12)
@@ -82,8 +82,8 @@
// offers slightly better than default limits.
//
#define LIMITS_STORAGE_BUFFER_BINDINGS(X) \
- X(Maximum, maxStorageBuffersPerShaderStage, 4, 8, 10) \
- X(Maximum, maxStorageBuffersInFragmentStage, 0, 8, 10) \
+ X(Maximum, maxStorageBuffersPerShaderStage, 8, 8, 10) \
+ X(Maximum, maxStorageBuffersInFragmentStage, 4, 8, 10) \
X(Maximum, maxStorageBuffersInVertexStage, 0, 8, 10)
// TODO(crbug.com/dawn/685):
diff --git a/src/dawn/tests/unittests/native/LimitsTests.cpp b/src/dawn/tests/unittests/native/LimitsTests.cpp
index eaa0444..f51a08c 100644
--- a/src/dawn/tests/unittests/native/LimitsTests.cpp
+++ b/src/dawn/tests/unittests/native/LimitsTests.cpp
@@ -80,8 +80,8 @@
Limits reified = ReifyDefaultLimits(limits, wgpu::FeatureLevel::Compatibility);
EXPECT_EQ(reified.maxTextureDimension1D, 4096u);
EXPECT_EQ(reified.maxStorageBufferBindingSize, 134217728ul);
- EXPECT_EQ(reified.maxStorageBuffersInFragmentStage, 0u);
- EXPECT_EQ(reified.maxStorageTexturesInFragmentStage, 0u);
+ EXPECT_EQ(reified.maxStorageBuffersInFragmentStage, 4u);
+ EXPECT_EQ(reified.maxStorageTexturesInFragmentStage, 4u);
EXPECT_EQ(reified.maxStorageBuffersInVertexStage, 0u);
EXPECT_EQ(reified.maxStorageTexturesInVertexStage, 0u);
}
diff --git a/src/dawn/tests/unittests/validation/CompatValidationTests.cpp b/src/dawn/tests/unittests/validation/CompatValidationTests.cpp
index 447374b..0aaacc5 100644
--- a/src/dawn/tests/unittests/validation/CompatValidationTests.cpp
+++ b/src/dawn/tests/unittests/validation/CompatValidationTests.cpp
@@ -678,7 +678,7 @@
}
}
-TEST_F(CompatValidationTest, CanNotUseStorageBufferInFragmentAndVertexStageWithDefaultLimit0) {
+TEST_F(CompatValidationTest, CanNotUseStorageBufferInVertexStageWithDefaultLimit0) {
const wgpu::ShaderStage stages[] = {
wgpu::ShaderStage::Compute,
wgpu::ShaderStage::Fragment,
@@ -703,7 +703,7 @@
descriptor.entryCount = 1;
descriptor.entries = entries;
- if (stage == wgpu::ShaderStage::Compute) {
+ if (stage != wgpu::ShaderStage::Vertex) {
wgpu::BindGroupLayout layout = device.CreateBindGroupLayout(&descriptor);
} else {
ASSERT_DEVICE_ERROR(device.CreateBindGroupLayout(&descriptor),
@@ -713,7 +713,7 @@
}
}
-TEST_F(CompatValidationTest, CanNotUseStorageTexturesInFragmentAndVertexStageWithDefaultLimit0) {
+TEST_F(CompatValidationTest, CanNotUseStorageTexturesInVertexStageWithDefaultLimit0) {
const wgpu::ShaderStage stages[] = {
wgpu::ShaderStage::Compute,
wgpu::ShaderStage::Fragment,
@@ -741,7 +741,7 @@
descriptor.entryCount = 1;
descriptor.entries = entries;
- if (stage == wgpu::ShaderStage::Compute) {
+ if (stage != wgpu::ShaderStage::Vertex) {
wgpu::BindGroupLayout layout = device.CreateBindGroupLayout(&descriptor);
} else {
ASSERT_DEVICE_ERROR(device.CreateBindGroupLayout(&descriptor),
@@ -2053,19 +2053,6 @@
"maxStorageBuffersInVertexStage");
}
-// Test that in compat we get an error if we use more than maxStorageTexturesInFragmentStage
-// when it's lower than maxStorageTexturesPerShaderStage in createBindGroupLayout
-TEST_F(CompatLayoutLimitsTests, CanNotPassLimitOfStorageTexturesInFragmentStageBindGroupLayout) {
- const auto limits = GetSupportedLimits();
- wgpu::BindGroupLayoutEntry entry;
- entry.visibility = wgpu::ShaderStage::Fragment;
- entry.storageTexture.format = wgpu::TextureFormat::R32Float;
- entry.storageTexture.access = wgpu::StorageTextureAccess::ReadOnly;
- DoBindGroupLayoutTest(limits.maxStorageTexturesInFragmentStage,
- limits.maxStorageTexturesPerShaderStage, entry,
- "maxStorageTexturesInFragmentStage");
-}
-
// Test that in compat we get an error if we use more than maxStorageTexturesInVertexStage
// when it's lower than maxStorageTexturesPerShaderStage in createBindGroupLayout
TEST_F(CompatLayoutLimitsTests, CanNotPassLimitOfStorageTexturesInVertexStageBindGroupLayout) {
@@ -2103,19 +2090,6 @@
"maxStorageBuffersInVertexStage");
}
-// Test that in compat we get an error if we use more than maxStorageTexturesInFragmentStage
-// when it's lower than maxStorageTexturesPerShaderStage in createPipelineLayout
-TEST_F(CompatLayoutLimitsTests, CanNotPassLimitOfStorageTexturesInFragmentStagePipelineLayout) {
- const auto limits = GetSupportedLimits();
- wgpu::BindGroupLayoutEntry entry;
- entry.visibility = wgpu::ShaderStage::Fragment;
- entry.storageTexture.format = wgpu::TextureFormat::R32Float;
- entry.storageTexture.access = wgpu::StorageTextureAccess::ReadOnly;
- DoPipelineLayoutTest(limits.maxStorageTexturesInFragmentStage,
- limits.maxStorageTexturesPerShaderStage, entry,
- "maxStorageTexturesInFragmentStage");
-}
-
// Test that in compat we get an error if we use more than maxStorageTexturesInVertexStage
// when it's lower than maxStorageTexturesPerShaderStage in createPipelineLayout
TEST_F(CompatLayoutLimitsTests, CanNotPassLimitOfStorageTexturesInVertexStagePipelineLayout) {
diff --git a/webgpu-cts/compat-expectations.txt b/webgpu-cts/compat-expectations.txt
index 28388fc..c5bb0bb 100644
--- a/webgpu-cts/compat-expectations.txt
+++ b/webgpu-cts/compat-expectations.txt
@@ -143,6 +143,37 @@
# Compressed texture image_copy failures on Pixel 6
crbug.com/364917742 [ android arm ] webgpu:api,operation,command_buffer,image_copy:offsets_and_sizes:* [ Skip ]
+# Temp suppressions for change in compat limits
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:default: [ Failure ]
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:limit,worse_than_default:limit="maxStorageBuffersInFragmentStage" [ Failure ]
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:limit,worse_than_default:limit="maxStorageBuffersPerShaderStage" [ Failure ]
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:limit,worse_than_default:limit="maxStorageTexturesInFragmentStage" [ Failure ]
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:limits,supported:limit="maxStorageBuffersInFragmentStage" [ Failure ]
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:limits,supported:limit="maxStorageBuffersInFragmentStage" [ Failure ]
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:limits,supported:limit="maxStorageBuffersPerShaderStage" [ Failure ]
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:limits,supported:limit="maxStorageBuffersPerShaderStage" [ Failure ]
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:limits,supported:limit="maxStorageTexturesInFragmentStage" [ Failure ]
+crbug.com/406729256 webgpu:api,operation,adapter,requestDevice:limits,supported:limit="maxStorageTexturesInFragmentStage" [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersInFragmentStage:auto_upgraded_from_per_stage,maxStorageBuffersPerShaderStage: [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersInFragmentStage:auto_upgraded_from_per_stage,maxStorageBuffersPerShaderStage: [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersInFragmentStage:createBindGroupLayout,at_over:* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersInFragmentStage:createPipeline,at_over:* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersInFragmentStage:createPipelineLayout,at_over:* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersPerShaderStage:createBindGroupLayout,at_over:* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersPerShaderStage:createPipeline,at_over:* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersPerShaderStage:createPipelineLayout,at_over:limitTest="atDefault";* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersPerShaderStage:createPipelineLayout,at_over:limitTest="betweenDefaultAndMaximum";* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageBuffersPerShaderStage:createPipelineLayout,at_over:limitTest="underDefault";* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageTexturesInFragmentStage:auto_upgraded_from_per_stage,maxStorageTexturesPerShaderStage: [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageTexturesInFragmentStage:createBindGroupLayout,at_over:limitTest="atDefault";* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageTexturesInFragmentStage:createBindGroupLayout,at_over:limitTest="betweenDefaultAndMaximum";* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageTexturesInFragmentStage:createPipeline,at_over:limitTest="atDefault";* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageTexturesInFragmentStage:createPipeline,at_over:limitTest="betweenDefaultAndMaximum";* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageTexturesInFragmentStage:createPipelineLayout,at_over:limitTest="atDefault";* [ Failure ]
+crbug.com/406729256 webgpu:api,validation,capability_checks,limits,maxStorageTexturesInFragmentStage:createPipelineLayout,at_over:limitTest="betweenDefaultAndMaximum";* [ Failure ]
+crbug.com/406729256 webgpu:idl,javascript:limits:type="adapter" [ Failure ]
+crbug.com/406729256 webgpu:idl,javascript:limits:type="device" [ Failure ]
+
# Buffer already has an outstanding map pending
crbug.com/391414855 [ android-Pixel-6 arm ] webgpu:api,validation,buffer,mapping:getMappedRange,state,mappingPending:* [ Skip ]