Browse Source

remove debug code from parseAttributes function

main
cinnaboot 5 years ago
parent
commit
a636a3182e
  1. 16
      src/shader.cpp

16
src/shader.cpp

@ -517,14 +517,8 @@ getAttribComponentType(GLenum type)
bool bool
parseAttributes(memory_arena* arena, shader_program* s, GLContext* gl_ctx) parseAttributes(memory_arena* arena, shader_program* s, GLContext* gl_ctx)
{ {
printf("\n---------------------------------\n");
printf("%s(), FIXME: dumping attrib info for program: %s\n",
__FUNCTION__, s->name);
GLint num_attribs; GLint num_attribs;
glGetProgramiv(s->prog_id, GL_ACTIVE_ATTRIBUTES, &num_attribs); glGetProgramiv(s->prog_id, GL_ACTIVE_ATTRIBUTES, &num_attribs);
printf("active attributes: %d\n", num_attribs);
s->num_vertex_attribs = num_attribs; s->num_vertex_attribs = num_attribs;
s->vertex_attribs = ARENA_ALLOC(arena, GLVertexAttrib, num_attribs); s->vertex_attribs = ARENA_ALLOC(arena, GLVertexAttrib, num_attribs);
@ -537,9 +531,6 @@ parseAttributes(memory_arena* arena, shader_program* s, GLContext* gl_ctx)
glGetActiveAttrib(s->prog_id, i, sizeof(attrib_name), glGetActiveAttrib(s->prog_id, i, sizeof(attrib_name),
&length, &size, &type, attrib_name); &length, &size, &type, attrib_name);
GLint location = glGetAttribLocation(s->prog_id, attrib_name); GLint location = glGetAttribLocation(s->prog_id, attrib_name);
printf("attrib idx: %d, location: %d, type: %s, name: %s \n",
i, location, glEnumToString(type), attrib_name);
GLVertexAttrib* attrib = &s->vertex_attribs[i]; GLVertexAttrib* attrib = &s->vertex_attribs[i];
attrib->data_type = type; attrib->data_type = type;
attrib->location = location; attrib->location = location;
@ -548,15 +539,8 @@ parseAttributes(memory_arena* arena, shader_program* s, GLContext* gl_ctx)
attrib->component_type = getAttribComponentType(type); attrib->component_type = getAttribComponentType(type);
assert(attrib->component_type > 0); assert(attrib->component_type > 0);
attrib->name = arenaCopyCStr(arena, attrib_name, sizeof(attrib_name)); attrib->name = arenaCopyCStr(arena, attrib_name, sizeof(attrib_name));
// TODO: replace POSITION, NORMAL, UV... etc enums in loadGLMesh()
// with extra logic to detect mesh to shader mapping
// TODO: we still need a way to map the shader attribute name to a
// vertex buffer object... could maybe pass in an array of mappings to
// loadGLMesh? ie) [{ "position", gm.vert_buf_id }, ...]
} }
printf("---------------------------------\n\n");
return true; return true;
} }

Loading…
Cancel
Save