[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.
This commit is contained in:
Bill Currie 2021-12-01 01:09:38 +09:00
parent 08721f7a21
commit 0c0fce2f03

View file

@ -969,9 +969,12 @@ Vulkan_LoadLights (model_t *model, const char *entity_data, vulkan_ctx_t *ctx)
qfv_light_t light = {};
parse_light (&light, entity, targets);
// 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++) {
lightingframe_t *lframe = &lctx->frames.a[i];
DARRAY_RESIZE (&lframe->lightvis, lctx->lights.size);