diff --git a/src/tangerine.cpp b/src/tangerine.cpp index e1c1d07..e6aaa91 100644 --- a/src/tangerine.cpp +++ b/src/tangerine.cpp @@ -313,7 +313,6 @@ initLights(MemoryArena* arena, GLContext* gl_ctx, u32 max_lights) { // FIXME: revisit for 'Scene' abstraction - // TODO: we need a way to do this automatically somehow LightsBuffer* lb = ARENA_ALLOC(arena, LightsBuffer, 1); lb->buf_size = 8 * sizeof(u32) // NOTE: 'header' + 6 * max_lights * sizeof(glm::vec4); // NOTE: vector arrays diff --git a/src/tangerine.h b/src/tangerine.h index 0863491..3e38f6b 100644 --- a/src/tangerine.h +++ b/src/tangerine.h @@ -120,6 +120,10 @@ struct GLClearColor // pointers are required to start on 16 byte boundaries as per layout std140, // so there may be some padding added between the 'header', and the start of // the arrays +// NOTE: this is also very fragile. Since c/c++ doesn't support reflection, we +// need to manually update 'initLights()' if we ever update this structure. +// And remember to update the 'padding' if the number of 'header' attributes +// change struct LightsBuffer { u32 buf_size;