Browse Source

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
main
cinnaboot 4 years ago
parent
commit
05f76e8efd
  1. 2
      src/tangerine.cpp

2
src/tangerine.cpp

@ -307,7 +307,7 @@ initLights(MemoryArena* arena, GLContext* gl_ctx, u32 max_lights)
lb->max_d_lights = max_lights; lb->max_d_lights = max_lights;
// NOTE: set offsets for array pointers // 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); u32 arr_size = max_lights * sizeof(glm::vec4);
lb->pl_colors = lb->pl_colors =
(glm::vec4*) arenaGetAddressOffset(lb->pl_positions, arr_size); (glm::vec4*) arenaGetAddressOffset(lb->pl_positions, arr_size);

Loading…
Cancel
Save