require_type(i->second.type);
}
-void Program::require_type(GLenum t)
-{
- switch(t)
- {
- case GL_FLOAT_MAT2x3:
- case GL_FLOAT_MAT2x4:
- case GL_FLOAT_MAT3x2:
- case GL_FLOAT_MAT3x4:
- case GL_FLOAT_MAT4x2:
- case GL_FLOAT_MAT4x3:
- { static Require _req(NV_non_square_matrices); }
- break;
- }
-}
-
void Program::query_uniforms()
{
unsigned count = get_program_i(id, GL_ACTIVE_UNIFORMS);
UniformInfo &info = uniforms[name];
info.block = 0;
info.name = name;
- info.size = size;
+ info.array_size = size;
info.array_stride = 0;
info.matrix_stride = 0;
- info.type = type;
+ info.type = from_gl_type(type);
uniforms_by_index[i] = &info;
}
}
indices2.clear();
for(vector<int>::iterator j=indices.begin(); j!=indices.end(); ++j)
- if(uniforms_by_index[*j]->size>1)
+ if(uniforms_by_index[*j]->array_size>1)
indices2.push_back(*j);
if(!indices2.empty())
{
indices2.clear();
for(vector<int>::iterator j=indices.begin(); j!=indices.end(); ++j)
{
- GLenum t = uniforms_by_index[*j]->type;
- if(t==GL_FLOAT_MAT4 || t==GL_FLOAT_MAT3 || t==GL_FLOAT_MAT2 ||
- t==GL_FLOAT_MAT2x3 || t==GL_FLOAT_MAT2x4 || t==GL_FLOAT_MAT3x2 ||
- t==GL_FLOAT_MAT3x4 || t==GL_FLOAT_MAT4x2 || t==GL_FLOAT_MAT4x3)
+ DataType t = uniforms_by_index[*j]->type;
+ if(is_matrix(t))
indices2.push_back(*j);
}
if(!indices2.empty())
AttributeInfo &info = attributes[name];
info.name = name;
info.location = glGetAttribLocation(id, name);
- info.size = size;
- info.type = type;
+ info.array_size = size;
+ info.type = from_gl_type(type);
}
}
}
{
string layout_descriptor;
for(vector<const UniformInfo *>::const_iterator i = uniforms.begin(); i!=uniforms.end(); ++i)
- layout_descriptor += format("%d:%s:%x:%d\n", (*i)->location, (*i)->name, (*i)->type, (*i)->size);
+ layout_descriptor += format("%d:%s:%x:%d\n", (*i)->location, (*i)->name, (*i)->type, (*i)->array_size);
return hash32(layout_descriptor);
}