Bug 1755699 - Check alignments even if !buffer. r=gfx-reviewers,aosmond

Differential Revision: https://phabricator.services.mozilla.com/D140694
This commit is contained in:
Kelsey Gilbert 2022-03-14 18:11:39 +00:00
parent 01f2bd8214
commit 54251638cd

View File

@ -3015,15 +3015,13 @@ Maybe<webgl::ErrorInfo> CheckBindBufferRange(
return fnSome(LOCAL_GL_INVALID_VALUE, info);
}
if (isBuffer) {
if (offset % 4 != 0 || size % 4 != 0) {
const auto info =
nsPrintfCString("`offset` (%" PRIu64 ") and `size` (%" PRIu64
") must both be aligned to 4 for"
" TRANSFORM_FEEDBACK_BUFFER.",
offset, size);
return fnSome(LOCAL_GL_INVALID_VALUE, info);
}
if (offset % 4 != 0 || size % 4 != 0) {
const auto info =
nsPrintfCString("`offset` (%" PRIu64 ") and `size` (%" PRIu64
") must both be aligned to 4 for"
" TRANSFORM_FEEDBACK_BUFFER.",
offset, size);
return fnSome(LOCAL_GL_INVALID_VALUE, info);
}
break;
@ -3035,15 +3033,13 @@ Maybe<webgl::ErrorInfo> CheckBindBufferRange(
return fnSome(LOCAL_GL_INVALID_VALUE, info);
}
if (isBuffer) {
if (offset % limits.uniformBufferOffsetAlignment != 0) {
const auto info =
nsPrintfCString("`offset` (%" PRIu64
") must be aligned to "
"UNIFORM_BUFFER_OFFSET_ALIGNMENT (%u).",
offset, limits.uniformBufferOffsetAlignment);
return fnSome(LOCAL_GL_INVALID_VALUE, info);
}
if (offset % limits.uniformBufferOffsetAlignment != 0) {
const auto info =
nsPrintfCString("`offset` (%" PRIu64
") must be aligned to "
"UNIFORM_BUFFER_OFFSET_ALIGNMENT (%u).",
offset, limits.uniformBufferOffsetAlignment);
return fnSome(LOCAL_GL_INVALID_VALUE, info);
}
break;