Refactoring of streamer code to integrate texture and vbo memory management in progress.
This commit is contained in:
@@ -334,8 +334,8 @@ void KRContext::getMemoryStats(long &free_memory)
|
||||
void KRContext::doStreaming()
|
||||
{
|
||||
if(m_streamingEnabled) {
|
||||
long memoryRemaining = KRENGINE_TARGET_TEXTURE_MEM_MAX;
|
||||
long memoryRemainingThisFrame = KRENGINE_MAX_TEXTURE_MEM - m_pTextureManager->getMemUsed() - m_pMeshManager->getMemUsed();
|
||||
long memoryRemaining = KRENGINE_TARGET_TEXTURE_MEM_MAX + KRENGINE_MAX_VBO_MEM;
|
||||
long memoryRemainingThisFrame = KRENGINE_MAX_TEXTURE_MEM + KRENGINE_MAX_VBO_MEM - m_pTextureManager->getMemUsed() - m_pMeshManager->getMemUsed();
|
||||
m_pMeshManager->doStreaming(memoryRemaining, memoryRemainingThisFrame);
|
||||
m_pTextureManager->doStreaming(memoryRemaining, memoryRemainingThisFrame);
|
||||
}
|
||||
|
||||
@@ -253,8 +253,9 @@ void KRMesh::render(const std::string &object_name, KRCamera *pCamera, std::vect
|
||||
|
||||
//fprintf(stderr, "Rendering model: %s\n", m_name.c_str());
|
||||
if(renderPass != KRNode::RENDER_PASS_ADDITIVE_PARTICLES && renderPass != KRNode::RENDER_PASS_PARTICLE_OCCLUSION && renderPass != KRNode::RENDER_PASS_VOLUMETRIC_EFFECTS_ADDITIVE) {
|
||||
if(getStreamLevel() == kraken_stream_level::STREAM_LEVEL_OUT) {
|
||||
preStream(lod_coverage);
|
||||
if(getStreamLevel() == kraken_stream_level::STREAM_LEVEL_OUT) {
|
||||
|
||||
} else {
|
||||
|
||||
getSubmeshes();
|
||||
|
||||
@@ -606,13 +606,12 @@ void KRMeshManager::KRVBOData::load()
|
||||
GLDEBUG(glGenBuffers(1, &m_vbo_handle_indexes));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
#if GL_OES_vertex_array_object
|
||||
if(m_type == CONSTANT) {
|
||||
GLDEBUG(glGenVertexArraysOES(1, &m_vao_handle));
|
||||
GLDEBUG(glBindVertexArrayOES(m_vao_handle));
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
|
||||
GLDEBUG(glBindBuffer(GL_ARRAY_BUFFER, m_vbo_handle));
|
||||
#if GL_OES_mapbuffer
|
||||
|
||||
Reference in New Issue
Block a user