From 756ba0a533d93a6759759e19a9287f9808f2b17d Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 9 Jan 2025 21:46:41 +0100 Subject: [PATCH] Fix crash on shadows when using D3D10 --- Source/Engine/Renderer/ShadowsPass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Renderer/ShadowsPass.cpp b/Source/Engine/Renderer/ShadowsPass.cpp index 0487d7ce2..1b7131d9b 100644 --- a/Source/Engine/Renderer/ShadowsPass.cpp +++ b/Source/Engine/Renderer/ShadowsPass.cpp @@ -348,7 +348,7 @@ public: void InitStaticAtlas() { - const int32 atlasResolution = Resolution * 2; + const int32 atlasResolution = Math::Min(Resolution * 2, GPUDevice::Instance->Limits.MaximumTexture2DSize); if (StaticAtlas.Width == atlasResolution) return; StaticAtlas.Init(atlasResolution, atlasResolution); @@ -1120,6 +1120,7 @@ void ShadowsPass::SetupShadows(RenderContext& renderContext, RenderContextBatch& default: return; } + atlasResolution = Math::Min(atlasResolution, GPUDevice::Instance->Limits.MaximumTexture2DSize); if (shadows.Resolution != atlasResolution) { shadows.Reset();