X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Ffinalize.cpp;h=87e185024f3175c669a639dd14032b04e0cee79e;hp=3b0909ac2a90949733577e0e3a22dc0383cca445;hb=HEAD;hpb=569772f5aba5380a48002cd73b8d33eb25fd4048 diff --git a/source/glsl/finalize.cpp b/source/glsl/finalize.cpp index 3b0909ac..469cb92d 100644 --- a/source/glsl/finalize.cpp +++ b/source/glsl/finalize.cpp @@ -91,6 +91,8 @@ void LocationAllocator::apply(Stage &stage) stage.content.visit(*this); allocate_locations("in"); + if(stage.type==Stage::VERTEX) + swap(used_locations["in"], used_vertex_attribs); allocate_locations("out"); } @@ -121,6 +123,8 @@ void LocationAllocator::allocate_locations(const string &iface) if(!alloc_new) continue; + bool flat = ((*i)->interpolation=="flat" || ((*i)->linked_declaration && (*i)->linked_declaration->interpolation=="flat")); + set &used = used_locations[(*i)->interface]; unsigned size = LocationCounter().apply(**i); @@ -128,7 +132,7 @@ void LocationAllocator::allocate_locations(const string &iface) { int blocking = -1; for(unsigned j=0; j &expr) 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));