stage.content.visit(*this);
allocate_locations("in");
+ if(stage.type==Stage::VERTEX)
+ swap(used_locations["in"], used_vertex_attribs);
allocate_locations("out");
}
if(!alloc_new)
continue;
+ bool flat = ((*i)->interpolation=="flat" || ((*i)->linked_declaration && (*i)->linked_declaration->interpolation=="flat"));
+
set<unsigned> &used = used_locations[(*i)->interface];
unsigned size = LocationCounter().apply(**i);
{
int blocking = -1;
for(unsigned j=0; j<size; ++j)
- if(used.count(next+j))
+ if(used.count(next+j) || (flat && used_vertex_attribs.count(next+j)))
blocking = next+j;
if(blocking<0)
break;
bool StructuralFeatureConverter::supports_stage(Stage::Type st) const
{
- if(st==Stage::GEOMETRY)
+ if(st==Stage::TESS_CONTROL || st==Stage::TESS_EVAL)
+ {
+ if(features.target_api==OPENGL_ES)
+ return check_version(Version(3, 20));
+ else
+ return check_version(Version(4, 0));
+ }
+ else if(st==Stage::GEOMETRY)
{
if(features.target_api==OPENGL_ES)
return check_version(Version(3, 20));