Wrong loadMipmaps flag in ddsTextureLoader

I don’t know if I have to create additional playground, but comparing 1 with info.width >> (info.mipmapCount - 1) instead of something like Math.max(info.width, info.height) >> (info.mipmapCount - 1) === 1 disables mipmap loading for the texture with height bigger than width. Additionally, it makes possible reassignment here

which when value is set to opposite duplicates entry in texture cache (noMipmap will be the same as generateMipMaps and thus textures will be compared as different) and will try to reupload it (or create duplicate if buffer is passed):

UPD: For some reason post was flagged as spam by community, I don’t know why :melting_face:

i’ll CC @Deltakosh for his opinion. Gut feeling is that we can remove this check, but I didn’t dive too deep into the code.

Would it be OK for me to initiate PR meanwhile until it is decided should this parameter be present at all?

1 Like

good by me


Also I am confused why this (and my another older post where bug was resolved) was hidden by community flag and flagged as spam :melting_face:

The system marks posts as spam sometimes, when they contain links from a new user. I am reviewing those once or twice a day, so it might take a few minutes until it is freed. Sorry about that!

Ah, thanks, makes much more sense :saluting_face:

1 Like

Do you mind sending a PR so we can run tests. I’m with you, this should be fine but let’s run tests to be sure

PR was submitted here - Wrong loadMipmaps flag in ddsTextureLoader by Nikys · Pull Request #15259 · BabylonJS/Babylon.js (github.com), playground snapshot:


wonderful! I merged it! it is all good

1 Like