Refactoring of streamer code to integrate texture and vbo memory management in progress.

This commit is contained in:
2014-05-28 23:13:14 -07:00
parent e6aec3a20b
commit 5bd97ed47e
3 changed files with 8 additions and 8 deletions

View File

@@ -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);
}

View File

@@ -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) {
preStream(lod_coverage);
if(getStreamLevel() == kraken_stream_level::STREAM_LEVEL_OUT) {
preStream(lod_coverage);
} else {
getSubmeshes();

View File

@@ -606,13 +606,12 @@ void KRMeshManager::KRVBOData::load()
GLDEBUG(glGenBuffers(1, &m_vbo_handle_indexes));
}
/*
#if GL_OES_vertex_array_object
GLDEBUG(glGenVertexArraysOES(1, &m_vao_handle));
GLDEBUG(glBindVertexArrayOES(m_vao_handle));
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