From 05f76e8efdd89978a36dc0b7cd2b97b0bf67d72e Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Fri, 4 Feb 2022 13:02:40 -0500 Subject: [PATCH] fix bug setting the wrong address offset in initLights() the first offset should have been the entire size of the 'header', aka) the LightsBuffer structure --- src/tangerine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tangerine.cpp b/src/tangerine.cpp index 44baf73..b8d9214 100644 --- a/src/tangerine.cpp +++ b/src/tangerine.cpp @@ -307,7 +307,7 @@ initLights(MemoryArena* arena, GLContext* gl_ctx, u32 max_lights) lb->max_d_lights = max_lights; // NOTE: set offsets for array pointers - lb->pl_positions = (glm::vec4*) arenaGetAddressOffset(lb, 8 * sizeof(u32)); + lb->pl_positions = (glm::vec4*) arenaGetAddressOffset(lb, sizeof(*lb)); u32 arr_size = max_lights * sizeof(glm::vec4); lb->pl_colors = (glm::vec4*) arenaGetAddressOffset(lb->pl_positions, arr_size);