use attrib pointers in nativeVertexFormat

This commit is contained in:
degasus 2013-01-14 22:59:08 +01:00
parent 2f78986e2c
commit ff889c0e65
7 changed files with 51 additions and 41 deletions

View file

@ -111,11 +111,21 @@ void ProgramShaderCache::SetProgramBindings ( ProgramShaderCache::PCacheEntry& e
// Need to set some attribute locations
glBindAttribLocation(entry.prog_id, SHADER_POSITION_ATTRIB, "rawpos");
glBindAttribLocation(entry.prog_id, SHADER_POSMTX_ATTRIB, "fposmtx");
glBindAttribLocation(entry.prog_id, SHADER_TEXTURE0_ATTRIB, "texture0");
glBindAttribLocation(entry.prog_id, SHADER_COLOR0_ATTRIB, "color0");
glBindAttribLocation(entry.prog_id, SHADER_COLOR1_ATTRIB, "color1");
glBindAttribLocation(entry.prog_id, SHADER_NORM0_ATTRIB, "rawnorm0");
glBindAttribLocation(entry.prog_id, SHADER_NORM1_ATTRIB, "rawnorm1");
glBindAttribLocation(entry.prog_id, SHADER_NORM2_ATTRIB, "rawnorm2");
for(int i=0; i<8; i++) {
char attrib_name[8];
snprintf(attrib_name, 8, "tex%d", i);
glBindAttribLocation(entry.prog_id, SHADER_TEXTURE0_ATTRIB+i, attrib_name);
}
}