mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug 1466001 - Index buffer must be non-null. - r=kvark
MozReview-Commit-ID: ConbNwht4Pp
This commit is contained in:
parent
dd2e67b482
commit
373a1ed449
@ -675,18 +675,19 @@ WebGLContext::DrawElements_check(const char* const funcName, const GLsizei rawIn
|
||||
////
|
||||
// Index fetching
|
||||
|
||||
const auto& indexBuffer = mBoundVertexArray->mElementArrayBuffer;
|
||||
if (!indexBuffer) {
|
||||
ErrorInvalidOperation("%s: Index buffer not bound.", funcName);
|
||||
return false;
|
||||
}
|
||||
MOZ_ASSERT(!indexBuffer->IsBoundForTF(), "This should be impossible.");
|
||||
|
||||
if (!indexCount || !instanceCount) {
|
||||
*out_lastVert = Nothing();
|
||||
return true;
|
||||
}
|
||||
|
||||
const auto& indexBuffer = mBoundVertexArray->mElementArrayBuffer;
|
||||
|
||||
size_t availBytes = 0;
|
||||
if (indexBuffer) {
|
||||
MOZ_ASSERT(!indexBuffer->IsBoundForTF(), "This should be impossible.");
|
||||
availBytes = indexBuffer->ByteLength();
|
||||
}
|
||||
const size_t availBytes = indexBuffer->ByteLength();
|
||||
const auto availIndices = AvailGroups(availBytes, byteOffset, bytesPerIndex,
|
||||
bytesPerIndex);
|
||||
if (indexCount > availIndices) {
|
||||
|
Loading…
Reference in New Issue
Block a user