mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-05 04:36:02 +00:00
Improve the dynamic binding OOB error message when binding.size is defaulted.
A common error when using dynamic offset bindings is to forget to set the size of the binding, which causes all offsets != 0 to produce an error. Make the error more explicit when that happens to guide developers. Bug: dawn:583 Change-Id: I38a5dfaf3f6756765c7e50cd470ac205b567d00c Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33784 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
parent
441f10a4db
commit
ce74d8256e
@ -180,7 +180,15 @@ namespace dawn_native {
|
||||
|
||||
if ((dynamicOffsets[i] > bufferBinding.buffer->GetSize() -
|
||||
bufferBinding.offset - bufferBinding.size)) {
|
||||
return DAWN_VALIDATION_ERROR("dynamic offset out of bounds");
|
||||
if ((bufferBinding.buffer->GetSize() - bufferBinding.offset) ==
|
||||
bufferBinding.size) {
|
||||
return DAWN_VALIDATION_ERROR(
|
||||
"Dynamic offset out of bounds. The binding goes to the end of the "
|
||||
"buffer even with a dynamic offset of 0. Did you forget to specify "
|
||||
"the binding's size?");
|
||||
} else {
|
||||
return DAWN_VALIDATION_ERROR("Dynamic offset out of bounds");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user