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:
parent
8525cdfca4
commit
f9719b7588
|
@ -519,9 +519,8 @@ MaybeError ValidateColorAttachmentBytesPerSample(DeviceBase* device,
|
||||||
}
|
}
|
||||||
uint32_t maxColorAttachmentBytesPerSample =
|
uint32_t maxColorAttachmentBytesPerSample =
|
||||||
device->GetLimits().v1.maxColorAttachmentBytesPerSample;
|
device->GetLimits().v1.maxColorAttachmentBytesPerSample;
|
||||||
// TODO(dawn:1522) Promote to DAWN_INVALID_IF after deprecation period.
|
DAWN_INVALID_IF(
|
||||||
DAWN_DEPRECATED_IF(
|
totalByteSize > maxColorAttachmentBytesPerSample,
|
||||||
device, totalByteSize > maxColorAttachmentBytesPerSample,
|
|
||||||
"Total color attachment bytes per sample (%u) exceeds maximum (%u) with formats (%s).",
|
"Total color attachment bytes per sample (%u) exceeds maximum (%u) with formats (%s).",
|
||||||
totalByteSize, maxColorAttachmentBytesPerSample, TextureFormatsToString(formats));
|
totalByteSize, maxColorAttachmentBytesPerSample, TextureFormatsToString(formats));
|
||||||
|
|
||||||
|
|
|
@ -1145,7 +1145,7 @@ TEST_F(RenderBundleValidationTest, TextureFormats) {
|
||||||
|
|
||||||
// Tests validation for per-pixel accounting for render targets. The tests currently assume that the
|
// Tests validation for per-pixel accounting for render targets. The tests currently assume that the
|
||||||
// default maxColorAttachmentBytesPerSample limit of 32 is used.
|
// default maxColorAttachmentBytesPerSample limit of 32 is used.
|
||||||
TEST_P(DeprecationTests, RenderBundleColorFormatsBytesPerSample) {
|
TEST_F(RenderBundleValidationTest, RenderBundleColorFormatsBytesPerSample) {
|
||||||
struct TestCase {
|
struct TestCase {
|
||||||
std::vector<wgpu::TextureFormat> formats;
|
std::vector<wgpu::TextureFormat> formats;
|
||||||
bool success;
|
bool success;
|
||||||
|
@ -1203,7 +1203,7 @@ TEST_P(DeprecationTests, RenderBundleColorFormatsBytesPerSample) {
|
||||||
if (testCase.success) {
|
if (testCase.success) {
|
||||||
device.CreateRenderBundleEncoder(&descriptor);
|
device.CreateRenderBundleEncoder(&descriptor);
|
||||||
} else {
|
} else {
|
||||||
EXPECT_DEPRECATION_ERROR_OR_WARNING(device.CreateRenderBundleEncoder(&descriptor));
|
ASSERT_DEVICE_ERROR(device.CreateRenderBundleEncoder(&descriptor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1450,7 +1450,7 @@ TEST_F(RenderPassDescriptorValidationTest, ValidateDepthStencilAllAspects) {
|
||||||
|
|
||||||
// Tests validation for per-pixel accounting for render targets. The tests currently assume that the
|
// Tests validation for per-pixel accounting for render targets. The tests currently assume that the
|
||||||
// default maxColorAttachmentBytesPerSample limit of 32 is used.
|
// default maxColorAttachmentBytesPerSample limit of 32 is used.
|
||||||
TEST_P(DeprecationTests, RenderPassColorAttachmentBytesPerSample) {
|
TEST_F(RenderPassDescriptorValidationTest, RenderPassColorAttachmentBytesPerSample) {
|
||||||
struct TestCase {
|
struct TestCase {
|
||||||
std::vector<wgpu::TextureFormat> formats;
|
std::vector<wgpu::TextureFormat> formats;
|
||||||
bool success;
|
bool success;
|
||||||
|
@ -1506,12 +1506,12 @@ TEST_P(DeprecationTests, RenderPassColorAttachmentBytesPerSample) {
|
||||||
}
|
}
|
||||||
utils::ComboRenderPassDescriptor descriptor(colorAttachmentInfo);
|
utils::ComboRenderPassDescriptor descriptor(colorAttachmentInfo);
|
||||||
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
|
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
|
||||||
if (testCase.success) {
|
|
||||||
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&descriptor);
|
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&descriptor);
|
||||||
renderPassEncoder.End();
|
renderPassEncoder.End();
|
||||||
|
if (testCase.success) {
|
||||||
commandEncoder.Finish();
|
commandEncoder.Finish();
|
||||||
} else {
|
} else {
|
||||||
EXPECT_DEPRECATION_WARNING_ONLY(commandEncoder.BeginRenderPass(&descriptor));
|
ASSERT_DEVICE_ERROR(commandEncoder.Finish());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1612,7 +1612,7 @@ TEST_F(RenderPipelineValidationTest, MaxFragmentCombinedOutputResources) {
|
||||||
|
|
||||||
// Tests validation for per-pixel accounting for render targets. The tests currently assume that the
|
// Tests validation for per-pixel accounting for render targets. The tests currently assume that the
|
||||||
// default maxColorAttachmentBytesPerSample limit of 32 is used.
|
// 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.
|
// Creates a fragment shader with maximum number of color attachments to enable testing.
|
||||||
auto CreateShader = [&](const std::vector<wgpu::TextureFormat>& formats) -> wgpu::ShaderModule {
|
auto CreateShader = [&](const std::vector<wgpu::TextureFormat>& formats) -> wgpu::ShaderModule {
|
||||||
// Default type to use when formats.size() < kMaxColorAttachments.
|
// Default type to use when formats.size() < kMaxColorAttachments.
|
||||||
|
@ -1690,10 +1690,7 @@ TEST_P(DeprecationTests, RenderPipelineColorAttachmentBytesPerSample) {
|
||||||
|
|
||||||
for (const TestCase& testCase : kTestCases) {
|
for (const TestCase& testCase : kTestCases) {
|
||||||
utils::ComboRenderPipelineDescriptor descriptor;
|
utils::ComboRenderPipelineDescriptor descriptor;
|
||||||
descriptor.vertex.module = utils::CreateShaderModule(device, R"(
|
descriptor.vertex.module = vsModule;
|
||||||
@vertex fn main() -> @builtin(position) vec4f {
|
|
||||||
return vec4f(0.0, 0.0, 0.0, 1.0);
|
|
||||||
})");
|
|
||||||
descriptor.vertex.entryPoint = "main";
|
descriptor.vertex.entryPoint = "main";
|
||||||
descriptor.cFragment.module = CreateShader(testCase.formats);
|
descriptor.cFragment.module = CreateShader(testCase.formats);
|
||||||
descriptor.cFragment.entryPoint = "main";
|
descriptor.cFragment.entryPoint = "main";
|
||||||
|
@ -1704,7 +1701,7 @@ TEST_P(DeprecationTests, RenderPipelineColorAttachmentBytesPerSample) {
|
||||||
if (testCase.success) {
|
if (testCase.success) {
|
||||||
device.CreateRenderPipeline(&descriptor);
|
device.CreateRenderPipeline(&descriptor);
|
||||||
} else {
|
} else {
|
||||||
EXPECT_DEPRECATION_ERROR_OR_WARNING(device.CreateRenderPipeline(&descriptor));
|
ASSERT_DEVICE_ERROR(device.CreateRenderPipeline(&descriptor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue