From 16cb4407a420018a8d1f3f8fff024bd973221cb6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 3 Nov 2015 23:55:16 +0100 Subject: [PATCH] - disabled 'isVisibleToPlayerClass' check for dynamic lights affecting sprites. Calling this function in the inner loop of a time critical rendering function apparently wreaks havoc with the CPU instruction cache - even though the function doesn't do anything substantial. This needs some more in-depth investigation why just having that call can increase sprite rendering time by a factor of 10 and more if there's many lights in view. --- src/gl/scene/gl_spritelight.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/scene/gl_spritelight.cpp b/src/gl/scene/gl_spritelight.cpp index e669412830..97f326844f 100644 --- a/src/gl/scene/gl_spritelight.cpp +++ b/src/gl/scene/gl_spritelight.cpp @@ -75,7 +75,7 @@ void gl_SetDynSpriteLight(AActor *self, fixed_t x, fixed_t y, fixed_t z, subsect while (node) { light=node->lightsource; - if (!light->owned || light->target == NULL || light->target->IsVisibleToPlayer()) + //if (!light->owned || light->target == NULL || light->target->IsVisibleToPlayer()) { if (!(light->flags2&MF2_DORMANT) && (!(light->flags4&MF4_DONTLIGHTSELF) || light->target != self))