From 0c0fce2f037424add8dfdcdcb44f37496ad6a36b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 1 Dec 2021 01:09:38 +0900 Subject: [PATCH] [vulkan] Drop lights with size 0 They can't contribute any light, so no point in keeping them. Fixes the erroneous size-0 shadow maps in the second nq demo. --- libs/video/renderer/vulkan/vulkan_lighting.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/video/renderer/vulkan/vulkan_lighting.c b/libs/video/renderer/vulkan/vulkan_lighting.c index 755e7d919..d2fcd5f5a 100644 --- a/libs/video/renderer/vulkan/vulkan_lighting.c +++ b/libs/video/renderer/vulkan/vulkan_lighting.c @@ -969,7 +969,10 @@ Vulkan_LoadLights (model_t *model, const char *entity_data, vulkan_ctx_t *ctx) qfv_light_t light = {}; parse_light (&light, entity, targets); - DARRAY_APPEND (&lctx->lights, light); + // some lights have 0 output, so drop them + if (light.light) { + DARRAY_APPEND (&lctx->lights, light); + } } } for (size_t i = 0; i < ctx->frames.size; i++) {