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() void KRContext::doStreaming()
{ {
if(m_streamingEnabled) { if(m_streamingEnabled) {
long memoryRemaining = KRENGINE_TARGET_TEXTURE_MEM_MAX; long memoryRemaining = KRENGINE_TARGET_TEXTURE_MEM_MAX + KRENGINE_MAX_VBO_MEM;
long memoryRemainingThisFrame = KRENGINE_MAX_TEXTURE_MEM - m_pTextureManager->getMemUsed() - m_pMeshManager->getMemUsed(); long memoryRemainingThisFrame = KRENGINE_MAX_TEXTURE_MEM + KRENGINE_MAX_VBO_MEM - m_pTextureManager->getMemUsed() - m_pMeshManager->getMemUsed();
m_pMeshManager->doStreaming(memoryRemaining, memoryRemainingThisFrame); m_pMeshManager->doStreaming(memoryRemaining, memoryRemainingThisFrame);
m_pTextureManager->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()); //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(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); preStream(lod_coverage);
if(getStreamLevel() == kraken_stream_level::STREAM_LEVEL_OUT) {
} else { } else {
getSubmeshes(); getSubmeshes();

View File

@@ -606,13 +606,12 @@ void KRMeshManager::KRVBOData::load()
GLDEBUG(glGenBuffers(1, &m_vbo_handle_indexes)); GLDEBUG(glGenBuffers(1, &m_vbo_handle_indexes));
} }
/*
#if GL_OES_vertex_array_object #if GL_OES_vertex_array_object
if(m_type == CONSTANT) {
GLDEBUG(glGenVertexArraysOES(1, &m_vao_handle)); GLDEBUG(glGenVertexArraysOES(1, &m_vao_handle));
GLDEBUG(glBindVertexArrayOES(m_vao_handle)); GLDEBUG(glBindVertexArrayOES(m_vao_handle));
}
#endif #endif
*/
GLDEBUG(glBindBuffer(GL_ARRAY_BUFFER, m_vbo_handle)); GLDEBUG(glBindBuffer(GL_ARRAY_BUFFER, m_vbo_handle));
#if GL_OES_mapbuffer #if GL_OES_mapbuffer