From e007dc9d6bbd02f1fdfc8b9535243e3634e13be6 Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Sat, 4 Mar 2023 00:55:34 +0100 Subject: [PATCH] Log reserving texture units --- apps/openmw/mwrender/renderingmanager.cpp | 1 - components/shader/shadermanager.cpp | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index f92c08fd64..962d497a27 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -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()); } diff --git a/components/shader/shadermanager.cpp b/components/shader/shadermanager.cpp index 0c9b13a9b8..5b9b79e0f8 100644 --- a/components/shader/shadermanager.cpp +++ b/components/shader/shadermanager.cpp @@ -713,6 +713,27 @@ namespace Shader mReservedTextureUnitsBySlot[static_cast(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; }