From f1faf9e1f5f3cca954002c9fb3c654498957f149 Mon Sep 17 00:00:00 2001
From: Dan Goodliffe <dan@randomdan.homeip.net>
Date: Thu, 17 Oct 2024 18:13:27 +0100
Subject: Don't assume size of stencil texture

---
 gfx/gl/shadowStenciller.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'gfx')

diff --git a/gfx/gl/shadowStenciller.cpp b/gfx/gl/shadowStenciller.cpp
index 30a67a7..68b12ae 100644
--- a/gfx/gl/shadowStenciller.cpp
+++ b/gfx/gl/shadowStenciller.cpp
@@ -58,7 +58,8 @@ ShadowStenciller::renderStencil(const glTexture & stencil, const MeshBase & mesh
 	}
 	glUseProgram(shadowCaster);
 	glClear(GL_DEPTH_BUFFER_BIT);
-	glViewport(0, 0, 256, 256);
+	const auto stencilSize = Texture::getSize(stencil);
+	glViewport(0, 0, stencilSize.x, stencilSize.y);
 	const auto & centre = mesh.getDimensions().centre;
 	const auto & size = mesh.getDimensions().size;
 	glUniform(viewProjectionLoc,
-- 
cgit v1.2.3