mirror of
https://github.com/minetest/minetest.git
synced 2024-12-02 12:33:45 +01:00
Avoid doing a full material compare if not even first texture does match
This commit is contained in:
parent
35ec3855f6
commit
334ec4bb1b
@ -394,7 +394,14 @@ struct MeshBufListList
|
|||||||
for(std::list<MeshBufList>::iterator i = lists.begin();
|
for(std::list<MeshBufList>::iterator i = lists.begin();
|
||||||
i != lists.end(); ++i){
|
i != lists.end(); ++i){
|
||||||
MeshBufList &l = *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);
|
l.bufs.push_back(buf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user