/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
constauto& readBuffer = ValidateBufferSelection(readTarget); if (!readBuffer) return;
constauto& writeBuffer = ValidateBufferSelection(writeTarget); if (!writeBuffer) return;
if (!CheckedInt<GLintptr>(readOffset).isValid() ||
!CheckedInt<GLintptr>(writeOffset).isValid() ||
!CheckedInt<GLsizeiptr>(size).isValid()) return ErrorOutOfMemory("offset or size too large for platform.");
// Update the destination index cache if needed. if (writeBuffer->mIndexCache) {
MOZ_ASSERT(readBuffer->mIndexCache); if (readBuffer->mIndexCache) { // The read and write ranges have been validated above by // fnValidateOffsetSize. If allocated, the size of mIndexCache is always // mByteLength. constauto* src = static_cast<const uint8_t*>(readBuffer->mIndexCache.get()) +
readOffset; auto* dst = static_cast<uint8_t*>(writeBuffer->mIndexCache.get()) + writeOffset;
memcpy(dst, src, size);
}
writeBuffer->InvalidateCacheRange(writeOffset, size);
}
if (!CheckedInt<GLintptr>(srcByteOffset).isValid() ||
!CheckedInt<GLsizeiptr>(srcLen).isValid()) {
ErrorOutOfMemory("Offset or size too large for platform."); returnfalse;
} const GLsizeiptr glByteLen(srcLen);
////
switch (buffer->mUsage) { case LOCAL_GL_STATIC_READ: case LOCAL_GL_STREAM_READ: case LOCAL_GL_DYNAMIC_READ: if (mCompletedFenceId < buffer->mLastUpdateFenceId) {
GenerateWarning( "Reading from a buffer without checking for previous" " command completion likely causes pipeline stalls." " Please use FenceSync.");
} break; default:
GenerateWarning( "Reading from a buffer with usage other than *_READ" " causes pipeline stalls. Copy through a STREAM_READ buffer."); break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.