Browse Source

add FIXME notes, and update global TODO list

remotes/bxxa/master
cinnaboot 4 years ago
parent
commit
774f04a0f7
  1. 3
      include/shader.h
  2. 12
      include/tangerine.h
  3. 7
      src/shader.cpp

3
include/shader.h

@ -162,6 +162,9 @@ GLContext* initGLContext(MemoryArena* arena,
u32 max_textures, u32 max_textures,
u32 max_ubos); u32 max_ubos);
// TODO: add more notes here describing the internals? This is the entry point
// to a complex process of programatically assigning properties to our notion
// of what a shader needs ie) uniforms, buffer block bindings, etc
// NOTE: every shader program is assumed to have one uniform block named // NOTE: every shader program is assumed to have one uniform block named
// "matrices" that contains the projection and view matrices, and one uniform // "matrices" that contains the projection and view matrices, and one uniform
// named "node_xform" for the node matrix // named "node_xform" for the node matrix

12
include/tangerine.h

@ -13,18 +13,19 @@
* gameplay. So, we need to extend MemoryArena to be a pool allocator * gameplay. So, we need to extend MemoryArena to be a pool allocator
* instead of an allocate only linear allocator * instead of an allocate only linear allocator
* - add libTangerine namespace? * - add libTangerine namespace?
* - merge back into libTangerine
* - make separate shaders for per vertex, and per pixel/fragment lighting
* see red book chapter 7
* - add a bloom/blur render to texture shader for light sources?
* https://learnopengl.com/Advanced-Lighting/Bloom
* - clean up examples with new asset system * - clean up examples with new asset system
* - merge render_group_fix branch back into master * - merge render_group_fix branch back into master
* - make a test case for overflowing default array sizes, rg->assets * - make a test case for overflowing default array sizes, rg->assets
* rg_info->groups, render_group->enitities, rg->textures * rg_info->groups, render_group->enitities, rg->textures
* - test for video memory leaking since we're not actually deleting GLBuffers
* anywhere
* - look for glm::mat4 in structs, and replace with pointers (easier debugging) * - look for glm::mat4 in structs, and replace with pointers (easier debugging)
* - resizable arrays for entities and asset system * - resizable arrays for entities and asset system
* - defaults include for various #defines * - defaults include for various #defines
* - make separate shaders for per vertex, and per pixel/fragment lighting
* see red book chapter 7
* - add a bloom/blur render to texture shader for light sources?
* https://learnopengl.com/Advanced-Lighting/Bloom
* *
* === TODONE: === * === TODONE: ===
* - don't allocate Asset structure on asset arena * - don't allocate Asset structure on asset arena
@ -61,6 +62,7 @@
* - add ambient light to LightsBuffer structure * - add ambient light to LightsBuffer structure
* - remember to update offsets in initLights() * - remember to update offsets in initLights()
* - use rg_arena for store GLMeshes, see initGLMesh() * - use rg_arena for store GLMeshes, see initGLMesh()
* - merge back into libTangerine
*/ */

7
src/shader.cpp

@ -85,6 +85,8 @@ addShaderProgram(MemoryArena* arena,
snprintf(input_str, max_len, "%s%s", vs, fs); snprintf(input_str, max_len, "%s%s", vs, fs);
u64 hash = utilFNV64a_str(input_str); u64 hash = utilFNV64a_str(input_str);
// FIXME: replace with utilCStrMatch, and remove getShaderByHash, we don't
// need a hashing function if we're not storing in a hash table
if (getShaderByHash(gl_ctx, hash)) { if (getShaderByHash(gl_ctx, hash)) {
LOGF(Error, "shader is already loaded\n"); LOGF(Error, "shader is already loaded\n");
return false; return false;
@ -319,11 +321,13 @@ initGLAttribBuffer(GLBuffer* buf, GLenum target, GLVertexAttrib* attrib)
buf->target = target; buf->target = target;
buf->data_type = attrib->data_type; buf->data_type = attrib->data_type;
buf->location = attrib->location; buf->location = attrib->location;
// FIXME: this should be allocated on the same arena as the parent GLBuffer
// with utilAllocateCStr
buf->name = utilAllocateCStr(attrib->name); buf->name = utilAllocateCStr(attrib->name);
} }
// TODO: might as well pass in pointer to GLMesh, since that's how we're // TODO: might as well pass in pointer to GLMesh, since that's how we're
// going to use this, can void copying GLMesh twice that way // going to use this, can avoid copying GLMesh twice that way
GLMesh GLMesh
loadGLMesh(MemoryArena* arena, loadGLMesh(MemoryArena* arena,
const Mesh& m, const Mesh& m,
@ -363,6 +367,7 @@ loadGLMesh(MemoryArena* arena,
glEnableVertexAttribArray(attrib->location); glEnableVertexAttribArray(attrib->location);
} }
// FIXME: should we be re-using initGLAttribBuffer here?
glGenBuffers(1, &glm.element_buf->id); glGenBuffers(1, &glm.element_buf->id);
glm.element_buf->target = GL_ELEMENT_ARRAY_BUFFER; glm.element_buf->target = GL_ELEMENT_ARRAY_BUFFER;
glm.element_buf->data_type = GL_UNSIGNED_SHORT; glm.element_buf->data_type = GL_UNSIGNED_SHORT;

Loading…
Cancel
Save