mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Avoid doing a full material compare if not even first texture does match
This commit is contained in:
parent
35ec3855f6
commit
334ec4bb1b
1 changed files with 37 additions and 30 deletions
|
@ -394,7 +394,14 @@ struct MeshBufListList
|
|||
for(std::list<MeshBufList>::iterator i = lists.begin();
|
||||
i != lists.end(); ++i){
|
||||
MeshBufList &l = *i;
|
||||
if(l.m == buf->getMaterial()){
|
||||
video::SMaterial &m = buf->getMaterial();
|
||||
|
||||
// comparing a full material is quite expensive so we don't do it if
|
||||
// not even first texture is equal
|
||||
if (l.m.TextureLayer[0].Texture != m.TextureLayer[0].Texture)
|
||||
continue;
|
||||
|
||||
if (l.m == m) {
|
||||
l.bufs.push_back(buf);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue