fix(rendering): add warnings for silent texture fallbacks

M2 particle/ribbon/batch, terrain layer, and WMO material texture
resolution paths were silently falling back to white textures when
indices were out of range — making missing texture issues hard to
diagnose. Add LOG_WARNING at each silent failure point with model
name, index details, and array sizes.
This commit is contained in:
Kelsi 2026-04-03 16:11:45 -07:00
parent 791ea1919e
commit 81a9970c91
3 changed files with 36 additions and 0 deletions

View file

@ -344,6 +344,9 @@ bool TerrainRenderer::loadTerrain(const pipeline::TerrainMesh& mesh,
if (baseTexId < texturePaths.size()) {
gpuChunk.baseTexture = loadTexture(texturePaths[baseTexId]);
} else {
LOG_WARNING("Terrain[", tileX, ",", tileY, "] chunk[", x, ",", y,
"] base textureId ", baseTexId, " >= texturePaths size ",
texturePaths.size(), " — white fallback");
gpuChunk.baseTexture = whiteTexture.get();
}
@ -354,6 +357,11 @@ bool TerrainRenderer::loadTerrain(const pipeline::TerrainMesh& mesh,
VkTexture* layerTex = whiteTexture.get();
if (layer.textureId < texturePaths.size()) {
layerTex = loadTexture(texturePaths[layer.textureId]);
} else {
LOG_WARNING("Terrain[", tileX, ",", tileY, "] chunk[", x, ",", y,
"] layer[", i, "] textureId ", layer.textureId,
" >= texturePaths size ", texturePaths.size(),
" — white fallback");
}
gpuChunk.layerTextures[li] = layerTex;
@ -445,6 +453,9 @@ bool TerrainRenderer::loadTerrainIncremental(const pipeline::TerrainMesh& mesh,
if (baseTexId < texturePaths.size()) {
gpuChunk.baseTexture = loadTexture(texturePaths[baseTexId]);
} else {
LOG_WARNING("Terrain[", tileX, ",", tileY, "] chunk[", cx, ",", cy,
"] base textureId ", baseTexId, " >= texturePaths size ",
texturePaths.size(), " — white fallback");
gpuChunk.baseTexture = whiteTexture.get();
}
@ -455,6 +466,11 @@ bool TerrainRenderer::loadTerrainIncremental(const pipeline::TerrainMesh& mesh,
VkTexture* layerTex = whiteTexture.get();
if (layer.textureId < texturePaths.size()) {
layerTex = loadTexture(texturePaths[layer.textureId]);
} else {
LOG_WARNING("Terrain[", tileX, ",", tileY, "] chunk[", cx, ",", cy,
"] layer[", i, "] textureId ", layer.textureId,
" >= texturePaths size ", texturePaths.size(),
" — white fallback");
}
gpuChunk.layerTextures[li] = layerTex;