зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1466001 - Index buffer must be non-null. - r=kvark
MozReview-Commit-ID: ConbNwht4Pp
This commit is contained in:
Родитель
dd2e67b482
Коммит
373a1ed449
|
@ -675,18 +675,19 @@ WebGLContext::DrawElements_check(const char* const funcName, const GLsizei rawIn
|
||||||
////
|
////
|
||||||
// Index fetching
|
// 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) {
|
if (!indexCount || !instanceCount) {
|
||||||
*out_lastVert = Nothing();
|
*out_lastVert = Nothing();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& indexBuffer = mBoundVertexArray->mElementArrayBuffer;
|
const size_t availBytes = indexBuffer->ByteLength();
|
||||||
|
|
||||||
size_t availBytes = 0;
|
|
||||||
if (indexBuffer) {
|
|
||||||
MOZ_ASSERT(!indexBuffer->IsBoundForTF(), "This should be impossible.");
|
|
||||||
availBytes = indexBuffer->ByteLength();
|
|
||||||
}
|
|
||||||
const auto availIndices = AvailGroups(availBytes, byteOffset, bytesPerIndex,
|
const auto availIndices = AvailGroups(availBytes, byteOffset, bytesPerIndex,
|
||||||
bytesPerIndex);
|
bytesPerIndex);
|
||||||
if (indexCount > availIndices) {
|
if (indexCount > availIndices) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче