Stop incrementing light_count once max number of lights are reached in 2D canvas renderer

This commit is contained in:
clayjohn 2023-01-20 17:04:00 -08:00
parent 9f74f0f6c5
commit d3c3fa32af
2 changed files with 2 additions and 2 deletions

View file

@ -803,7 +803,7 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend
light_count++;
if (light_count == data.max_lights_per_item) {
if (light_count == data.max_lights_per_item - 1) {
break;
}
}

View file

@ -455,7 +455,7 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend
light_count++;
if (light_count == MAX_LIGHTS_PER_ITEM) {
if (light_count == MAX_LIGHTS_PER_ITEM - 1) {
break;
}
}