mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +00:00
Adding multiple of 4 validation on indirect draws and dispatches
Bug: dawn:538 Change-Id: I6f4d8fb73a9fff910bdcd105f66299dc6afb61cd Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29761 Commit-Queue: Enrico Galli <enrico.galli@intel.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
793a07e366
commit
1c25198384
@@ -70,6 +70,10 @@ namespace dawn_native {
|
||||
mEncodingContext->TryEncode(this, [&](CommandAllocator* allocator) -> MaybeError {
|
||||
DAWN_TRY(GetDevice()->ValidateObject(indirectBuffer));
|
||||
|
||||
if (indirectOffset % 4 != 0) {
|
||||
return DAWN_VALIDATION_ERROR("Indirect offset must be a multiple of 4");
|
||||
}
|
||||
|
||||
if (indirectOffset >= indirectBuffer->GetSize() ||
|
||||
indirectOffset + kDispatchIndirectSize > indirectBuffer->GetSize()) {
|
||||
return DAWN_VALIDATION_ERROR("Indirect offset out of bounds");
|
||||
|
||||
Reference in New Issue
Block a user