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()
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
preStream(lod_coverage);
|
||||||
if(getStreamLevel() == kraken_stream_level::STREAM_LEVEL_OUT) {
|
if(getStreamLevel() == kraken_stream_level::STREAM_LEVEL_OUT) {
|
||||||
preStream(lod_coverage);
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
getSubmeshes();
|
getSubmeshes();
|
||||||
|
|||||||
@@ -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
|
||||||
GLDEBUG(glGenVertexArraysOES(1, &m_vao_handle));
|
if(m_type == CONSTANT) {
|
||||||
GLDEBUG(glBindVertexArrayOES(m_vao_handle));
|
GLDEBUG(glGenVertexArraysOES(1, &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
|
||||||
|
|||||||
Reference in New Issue
Block a user