1
0
forked from mirrors/0ad

Moves max texture size to backend device capabilities.

This was SVN commit r26409.
This commit is contained in:
vladislavbelov
2022-02-18 23:17:48 +00:00
parent 5eb21cbfbf
commit 36833d1df2
5 changed files with 12 additions and 25 deletions
+4 -3
View File
@@ -473,6 +473,8 @@ void ShadowMapInternals::CreateTexture()
Texture.reset();
DummyTexture.reset();
Renderer::Backend::GL::CDevice* backendDevice = g_VideoMode.GetBackendDevice();
CFG_GET_VAL("shadowquality", QualityLevel);
// Get shadow map size as next power of two up from view width/height.
@@ -498,7 +500,8 @@ void ShadowMapInternals::CreateTexture()
}
// Clamp to the maximum texture size.
shadowMapSize = std::min(shadowMapSize, static_cast<int>(ogl_max_tex_size));
shadowMapSize = std::min(
shadowMapSize, static_cast<int>(backendDevice->GetCapabilities().maxTextureSize));
Width = Height = shadowMapSize;
@@ -525,8 +528,6 @@ void ShadowMapInternals::CreateTexture()
LOGMESSAGE("Creating shadow texture (size %dx%d) (format = %s)",
Width, Height, formatName);
Renderer::Backend::GL::CDevice* backendDevice = g_VideoMode.GetBackendDevice();
if (g_RenderingOptions.GetShadowAlphaFix())
{
DummyTexture = backendDevice->CreateTexture2D("ShadowMapDummy",