1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 19:45:40 +00:00

Merge branch 'reserve_texture_units' into 'master'

Log reserved texture units

See merge request OpenMW/openmw!2794
This commit is contained in:
psi29a 2023-03-04 12:41:51 +00:00
commit d1cf93e203
2 changed files with 21 additions and 1 deletions

View file

@ -568,7 +568,6 @@ namespace MWRender
{
int skyTextureUnit = mResourceSystem->getSceneManager()->getShaderManager().reserveGlobalTextureUnits(
Shader::ShaderManager::Slot::SkyTexture);
Log(Debug::Info) << "Reserving texture unit for sky RTT: " << skyTextureUnit;
mPerViewUniformStateUpdater->enableSkyRTT(skyTextureUnit, mSky->getSkyRTT());
}

View file

@ -713,6 +713,27 @@ namespace Shader
mReservedTextureUnitsBySlot[static_cast<int>(slot)] = unit;
std::string_view slotDescr;
switch (slot)
{
case Slot::OpaqueDepthTexture:
slotDescr = "opaque depth texture";
break;
case Slot::SkyTexture:
slotDescr = "sky RTT";
break;
case Slot::ShadowMaps:
slotDescr = "shadow maps";
break;
default:
slotDescr = "UNKNOWN";
}
if (unit.count == 1)
Log(Debug::Info) << "Reserving texture unit for " << slotDescr << ": " << unit.index;
else
Log(Debug::Info) << "Reserving texture units for " << slotDescr << ": " << unit.index << ".."
<< (unit.index + count - 1);
return unit.index;
}