Add maximum limitation for query count in CreateQuerySet

- Limit the maximum query count to 8192 to fit Metal restriction.
- Add unittest tests of query count and remove the test of buffer
size overflow validation on 32-bits.

Bug: dawn:434
Change-Id: Ie573b715cc3f67ec158996119a8b4a49e493680a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36021
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Hao Li
2020-12-24 02:57:07 +00:00
committed by Commit Bot service account
parent 700809a7f7
commit c08276644f
4 changed files with 19 additions and 16 deletions

View File

@@ -43,6 +43,10 @@ namespace dawn_native {
return DAWN_VALIDATION_ERROR("nextInChain must be nullptr");
}
if (descriptor->count > kMaxQueryCount) {
return DAWN_VALIDATION_ERROR("Max query count exceeded");
}
DAWN_TRY(ValidateQueryType(descriptor->type));
switch (descriptor->type) {