mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 23:26:24 +00:00
Remove several compile-time constants in favor of limits
Bug: dawn:685 Change-Id: Ifac25116c741fdab7b6a8093b4230065beca4773 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65483 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
@@ -57,27 +57,30 @@ TEST_F(ComputeValidationTest, PerDimensionDispatchSizeLimits_SmallestValid) {
|
||||
|
||||
// Check that the largest allowed dispatch is OK.
|
||||
TEST_F(ComputeValidationTest, PerDimensionDispatchSizeLimits_LargestValid) {
|
||||
constexpr uint32_t kMax = kMaxComputePerDimensionDispatchSize;
|
||||
TestDispatch(kMax, kMax, kMax);
|
||||
const uint32_t max = GetSupportedLimits().limits.maxComputeWorkgroupsPerDimension;
|
||||
TestDispatch(max, max, max);
|
||||
}
|
||||
|
||||
// Check that exceeding the maximum on the X dimension results in validation failure.
|
||||
TEST_F(ComputeValidationTest, PerDimensionDispatchSizeLimits_InvalidX) {
|
||||
ASSERT_DEVICE_ERROR(TestDispatch(kMaxComputePerDimensionDispatchSize + 1, 1, 1));
|
||||
const uint32_t max = GetSupportedLimits().limits.maxComputeWorkgroupsPerDimension;
|
||||
ASSERT_DEVICE_ERROR(TestDispatch(max + 1, 1, 1));
|
||||
}
|
||||
|
||||
// Check that exceeding the maximum on the Y dimension results in validation failure.
|
||||
TEST_F(ComputeValidationTest, PerDimensionDispatchSizeLimits_InvalidY) {
|
||||
ASSERT_DEVICE_ERROR(TestDispatch(1, kMaxComputePerDimensionDispatchSize + 1, 1));
|
||||
const uint32_t max = GetSupportedLimits().limits.maxComputeWorkgroupsPerDimension;
|
||||
ASSERT_DEVICE_ERROR(TestDispatch(1, max + 1, 1));
|
||||
}
|
||||
|
||||
// Check that exceeding the maximum on the Z dimension results in validation failure.
|
||||
TEST_F(ComputeValidationTest, PerDimensionDispatchSizeLimits_InvalidZ) {
|
||||
ASSERT_DEVICE_ERROR(TestDispatch(1, 1, kMaxComputePerDimensionDispatchSize + 1));
|
||||
const uint32_t max = GetSupportedLimits().limits.maxComputeWorkgroupsPerDimension;
|
||||
ASSERT_DEVICE_ERROR(TestDispatch(1, 1, max + 1));
|
||||
}
|
||||
|
||||
// Check that exceeding the maximum on all dimensions results in validation failure.
|
||||
TEST_F(ComputeValidationTest, PerDimensionDispatchSizeLimits_InvalidAll) {
|
||||
constexpr uint32_t kMax = kMaxComputePerDimensionDispatchSize;
|
||||
ASSERT_DEVICE_ERROR(TestDispatch(kMax + 1, kMax + 1, kMax + 1));
|
||||
const uint32_t max = GetSupportedLimits().limits.maxComputeWorkgroupsPerDimension;
|
||||
ASSERT_DEVICE_ERROR(TestDispatch(max + 1, max + 1, max + 1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user