Skip to content

Commit

Permalink
Part: reduce memory usage in SoBrepFaceSet
Browse files Browse the repository at this point in the history
Can we further reduce it to num_triangles = num_indices/4*3?
  • Loading branch information
realthunder authored and wwmayer committed Nov 21, 2019
1 parent 95f20b9 commit df0366a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Mod/Part/Gui/SoBrepFaceSet.cpp
Expand Up @@ -1452,7 +1452,7 @@ void SoBrepFaceSet::VBO::render(SoGLRenderAction * action,
}

if ((buf.vertex_array_size != (sizeof(float) * num_indices * 10)) ||
(buf.index_array_size != (sizeof(GLuint) * num_indices * 3))) {
(buf.index_array_size != (sizeof(GLuint) * num_indices))) {
if ((buf.vertex_array_size != 0 ) && ( buf.index_array_size != 0))
buf.updateVbo = true;
}
Expand All @@ -1478,9 +1478,9 @@ void SoBrepFaceSet::VBO::render(SoGLRenderAction * action,
glDeleteBuffersARB(2, buf.myvbo);
glGenBuffersARB(2, buf.myvbo);
vertex_array = ( float * ) malloc ( sizeof(float) * num_indices * 10 );
index_array = ( GLuint *) malloc ( sizeof(GLuint) * num_indices * 3 );
index_array = ( GLuint *) malloc ( sizeof(GLuint) * num_indices );
buf.vertex_array_size = sizeof(float) * num_indices * 10;
buf.index_array_size = sizeof(GLuint) * num_indices * 3;
buf.index_array_size = sizeof(GLuint) * num_indices;
this->vbomap[contextId] = buf;
this->indice_array = 0;

Expand Down

0 comments on commit df0366a

Please sign in to comment.