mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 02:15:43 +00:00
Generate an error if scissor rect is empty
We need to change related tests in end2end_tests and unittests. Bug=dawn:127 TEST=dawn_end2end_tests, dawn_unittests Change-Id: I523d4eeb930990b5db381544b228d2f11912049b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6240 Commit-Queue: Yunchao He <yunchao.he@intel.com> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
8e50ba19ba
commit
2a30e14074
@@ -30,17 +30,35 @@ TEST_F(SetScissorRectTest, Success) {
|
||||
encoder.Finish();
|
||||
}
|
||||
|
||||
// Test to check that an empty scissor is allowed
|
||||
// Test to check that an empty scissor is not allowed
|
||||
TEST_F(SetScissorRectTest, EmptyScissor) {
|
||||
DummyRenderPass renderPass(device);
|
||||
|
||||
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
|
||||
// Width of scissor rect is zero.
|
||||
{
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
pass.SetScissorRect(0, 0, 0, 1);
|
||||
pass.EndPass();
|
||||
}
|
||||
ASSERT_DEVICE_ERROR(encoder.Finish());
|
||||
|
||||
// Height of scissor rect is zero.
|
||||
{
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
pass.SetScissorRect(0, 0, 1, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
ASSERT_DEVICE_ERROR(encoder.Finish());
|
||||
|
||||
// Both width and height of scissor rect are zero.
|
||||
{
|
||||
dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
pass.SetScissorRect(0, 0, 0, 0);
|
||||
pass.EndPass();
|
||||
}
|
||||
encoder.Finish();
|
||||
ASSERT_DEVICE_ERROR(encoder.Finish());
|
||||
}
|
||||
|
||||
// Test to check that a scissor larger than the framebuffer is allowed
|
||||
|
||||
Reference in New Issue
Block a user