/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* 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.");
constauto& buffer = ValidateBufferSelection(target); if (!buffer) returnfalse;
constauto byteLen = dest.length(); if (!buffer->ValidateRange(srcByteOffset, byteLen)) returnfalse;
////
if (!CheckedInt<GLintptr>(srcByteOffset).isValid() ||
!CheckedInt<GLsizeiptr>(byteLen).isValid()) {
ErrorOutOfMemory("offset or size too large for platform."); returnfalse;
} const GLsizeiptr glByteLen(byteLen);
////
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.