mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:02:55 +02:00
Fixing pending transfer calculation
This commit is contained in:
parent
638364497d
commit
2cf7ba4119
1 changed files with 7 additions and 6 deletions
|
@ -88,11 +88,13 @@ TransferJob::TransferJob(const GL45VariableAllocationTexture& parent, uint16_t s
|
||||||
GLTexelFormat texelFormat = GLTexelFormat::evalGLTexelFormat(_parent._gpuObject.getTexelFormat(), _parent._gpuObject.getStoredMipFormat());
|
GLTexelFormat texelFormat = GLTexelFormat::evalGLTexelFormat(_parent._gpuObject.getTexelFormat(), _parent._gpuObject.getStoredMipFormat());
|
||||||
format = texelFormat.format;
|
format = texelFormat.format;
|
||||||
type = texelFormat.type;
|
type = texelFormat.type;
|
||||||
|
auto mipSize = _parent._gpuObject.getStoredMipFaceSize(sourceMip, face);
|
||||||
|
|
||||||
|
|
||||||
if (0 == lines) {
|
if (0 == lines) {
|
||||||
|
_transferSize = mipSize;
|
||||||
_bufferingLambda = [=] {
|
_bufferingLambda = [=] {
|
||||||
auto mipData = _parent._gpuObject.accessStoredMipFace(sourceMip, face);
|
auto mipData = _parent._gpuObject.accessStoredMipFace(sourceMip, face);
|
||||||
_transferSize = mipData->getSize();
|
|
||||||
_buffer.resize(_transferSize);
|
_buffer.resize(_transferSize);
|
||||||
memcpy(&_buffer[0], mipData->readData(), _transferSize);
|
memcpy(&_buffer[0], mipData->readData(), _transferSize);
|
||||||
_bufferingCompleted = true;
|
_bufferingCompleted = true;
|
||||||
|
@ -100,13 +102,12 @@ TransferJob::TransferJob(const GL45VariableAllocationTexture& parent, uint16_t s
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
transferDimensions.y = lines;
|
transferDimensions.y = lines;
|
||||||
|
auto dimensions = _parent._gpuObject.evalMipDimensions(sourceMip);
|
||||||
|
auto bytesPerLine = (uint32_t)mipSize / dimensions.y;
|
||||||
|
auto sourceOffset = bytesPerLine * lineOffset;
|
||||||
|
_transferSize = bytesPerLine * lines;
|
||||||
_bufferingLambda = [=] {
|
_bufferingLambda = [=] {
|
||||||
auto mipData = _parent._gpuObject.accessStoredMipFace(sourceMip, face);
|
auto mipData = _parent._gpuObject.accessStoredMipFace(sourceMip, face);
|
||||||
auto dimensions = _parent._gpuObject.evalMipDimensions(sourceMip);
|
|
||||||
auto mipSize = mipData->getSize();
|
|
||||||
auto bytesPerLine = (uint32_t)mipSize / dimensions.y;
|
|
||||||
_transferSize = bytesPerLine * lines;
|
|
||||||
auto sourceOffset = bytesPerLine * lineOffset;
|
|
||||||
_buffer.resize(_transferSize);
|
_buffer.resize(_transferSize);
|
||||||
memcpy(&_buffer[0], mipData->readData() + sourceOffset, _transferSize);
|
memcpy(&_buffer[0], mipData->readData() + sourceOffset, _transferSize);
|
||||||
_bufferingCompleted = true;
|
_bufferingCompleted = true;
|
||||||
|
|
Loading…
Reference in a new issue