Skip to content

Commit

Permalink
std::unordered_map in vbos for #257
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Oct 22, 2023
1 parent ca47964 commit 8cc8c24
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/engine/render/vacollect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ struct vboinfo
uchar *data;
};

hashtable<GLuint, vboinfo> vbos;
std::unordered_map<GLuint, vboinfo> vbos;

VARFN(vbosize, maxvbosize, 0, 1<<14, 1<<16, rootworld.allchanged());

Expand All @@ -190,12 +190,12 @@ int vbosize[VBO_NumVBOs];

void destroyvbo(GLuint vbo)
{
vboinfo *exists = vbos.access(vbo);
if(!exists)
auto exists = vbos.find(vbo);
if(exists == vbos.end())
{
return;
}
vboinfo &vbi = *exists;
vboinfo &vbi = (*exists).second;
if(vbi.uses <= 0)
{
return;
Expand All @@ -208,7 +208,7 @@ void destroyvbo(GLuint vbo)
{
delete[] vbi.data;
}
vbos.remove(vbo);
vbos.erase(vbo);
}
}

Expand Down

0 comments on commit 8cc8c24

Please sign in to comment.