return static_cast<T0*>(apiObject);
}
+// Maximum size of texture upload buffer.
+const uint32_t TEXTURE_UPLOAD_MAX_BUFER_SIZE_MB = 1;
+
} // namespace
EglGraphicsController::~EglGraphicsController() = default;
reinterpret_cast<char*>(source.memorySource.memory) + info.srcSize,
stagingBuffer);
+ mTextureUploadTotalCPUMemoryUsed += info.srcSize;
+
// store staging buffer
source.memorySource.memory = stagingBuffer;
break;
}
}
}
+
+ // If upload buffer exceeds maximum size, flush.
+ if( mTextureUploadTotalCPUMemoryUsed > TEXTURE_UPLOAD_MAX_BUFER_SIZE_MB*1024 )
+ {
+ Flush();
+ mTextureUploadTotalCPUMemoryUsed = 0;
+ }
}
Graphics::UniquePtr<Memory> EglGraphicsController::MapBufferRange(const MapBufferInfo& mapInfo)