Removes deprecation period code for maxColorAttachmentBytesPerSample.

- Note that by default these are already errors, not warnings.

Change-Id: I33202a0cca8167c4c79e4aeee680b6b7cf1ff830
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128062
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Loko Kung 2023-04-21 04:43:13 +00:00 committed by Dawn LUCI CQ
parent 8525cdfca4
commit f9719b7588
4 changed files with 11 additions and 15 deletions

View File

@ -519,9 +519,8 @@ MaybeError ValidateColorAttachmentBytesPerSample(DeviceBase* device,
}
uint32_t maxColorAttachmentBytesPerSample =
device->GetLimits().v1.maxColorAttachmentBytesPerSample;
// TODO(dawn:1522) Promote to DAWN_INVALID_IF after deprecation period.
DAWN_DEPRECATED_IF(
device, totalByteSize > maxColorAttachmentBytesPerSample,
DAWN_INVALID_IF(
totalByteSize > maxColorAttachmentBytesPerSample,
"Total color attachment bytes per sample (%u) exceeds maximum (%u) with formats (%s).",
totalByteSize, maxColorAttachmentBytesPerSample, TextureFormatsToString(formats));

View File

@ -1145,7 +1145,7 @@ TEST_F(RenderBundleValidationTest, TextureFormats) {
// Tests validation for per-pixel accounting for render targets. The tests currently assume that the
// default maxColorAttachmentBytesPerSample limit of 32 is used.
TEST_P(DeprecationTests, RenderBundleColorFormatsBytesPerSample) {
TEST_F(RenderBundleValidationTest, RenderBundleColorFormatsBytesPerSample) {
struct TestCase {
std::vector<wgpu::TextureFormat> formats;
bool success;
@ -1203,7 +1203,7 @@ TEST_P(DeprecationTests, RenderBundleColorFormatsBytesPerSample) {
if (testCase.success) {
device.CreateRenderBundleEncoder(&descriptor);
} else {
EXPECT_DEPRECATION_ERROR_OR_WARNING(device.CreateRenderBundleEncoder(&descriptor));
ASSERT_DEVICE_ERROR(device.CreateRenderBundleEncoder(&descriptor));
}
}
}

View File

@ -1450,7 +1450,7 @@ TEST_F(RenderPassDescriptorValidationTest, ValidateDepthStencilAllAspects) {
// Tests validation for per-pixel accounting for render targets. The tests currently assume that the
// default maxColorAttachmentBytesPerSample limit of 32 is used.
TEST_P(DeprecationTests, RenderPassColorAttachmentBytesPerSample) {
TEST_F(RenderPassDescriptorValidationTest, RenderPassColorAttachmentBytesPerSample) {
struct TestCase {
std::vector<wgpu::TextureFormat> formats;
bool success;
@ -1506,12 +1506,12 @@ TEST_P(DeprecationTests, RenderPassColorAttachmentBytesPerSample) {
}
utils::ComboRenderPassDescriptor descriptor(colorAttachmentInfo);
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&descriptor);
renderPassEncoder.End();
if (testCase.success) {
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&descriptor);
renderPassEncoder.End();
commandEncoder.Finish();
} else {
EXPECT_DEPRECATION_WARNING_ONLY(commandEncoder.BeginRenderPass(&descriptor));
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
}
}
}

View File

@ -1612,7 +1612,7 @@ TEST_F(RenderPipelineValidationTest, MaxFragmentCombinedOutputResources) {
// Tests validation for per-pixel accounting for render targets. The tests currently assume that the
// default maxColorAttachmentBytesPerSample limit of 32 is used.
TEST_P(DeprecationTests, RenderPipelineColorAttachmentBytesPerSample) {
TEST_F(RenderPipelineValidationTest, RenderPipelineColorAttachmentBytesPerSample) {
// Creates a fragment shader with maximum number of color attachments to enable testing.
auto CreateShader = [&](const std::vector<wgpu::TextureFormat>& formats) -> wgpu::ShaderModule {
// Default type to use when formats.size() < kMaxColorAttachments.
@ -1690,10 +1690,7 @@ TEST_P(DeprecationTests, RenderPipelineColorAttachmentBytesPerSample) {
for (const TestCase& testCase : kTestCases) {
utils::ComboRenderPipelineDescriptor descriptor;
descriptor.vertex.module = utils::CreateShaderModule(device, R"(
@vertex fn main() -> @builtin(position) vec4f {
return vec4f(0.0, 0.0, 0.0, 1.0);
})");
descriptor.vertex.module = vsModule;
descriptor.vertex.entryPoint = "main";
descriptor.cFragment.module = CreateShader(testCase.formats);
descriptor.cFragment.entryPoint = "main";
@ -1704,7 +1701,7 @@ TEST_P(DeprecationTests, RenderPipelineColorAttachmentBytesPerSample) {
if (testCase.success) {
device.CreateRenderPipeline(&descriptor);
} else {
EXPECT_DEPRECATION_ERROR_OR_WARNING(device.CreateRenderPipeline(&descriptor));
ASSERT_DEVICE_ERROR(device.CreateRenderPipeline(&descriptor));
}
}
}