X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Ffinalize.cpp;h=d840648bbc3ec0135bbb02b4dc47350cf753f03f;hb=08d3b5a55fad7439b47fc93d8ba604cbeb7e19ca;hp=94052432296e2dc1dc629e68ad4618b595f4d63d;hpb=30c7ba8f7fd08c13562c86bf651bdc3ec8d30ab5;p=libs%2Fgl.git diff --git a/source/glsl/finalize.cpp b/source/glsl/finalize.cpp index 94052432..d840648b 100644 --- a/source/glsl/finalize.cpp +++ b/source/glsl/finalize.cpp @@ -75,7 +75,12 @@ void LocationAllocator::apply(Module &module, const Features &f, bool a) for(VariableDeclaration *b: unbound_blocks) bind_uniform(b->layout, b->block_declaration->block_name, features.uniform_binding_range); for(VariableDeclaration *t: unbound_textures) - bind_uniform(t->layout, t->name, features.texture_binding_range); + { + const TypeDeclaration *base_type = get_ultimate_base_type(t->type_declaration); + unsigned range = (static_cast(base_type)->sampled ? + features.texture_binding_range : features.storage_texture_binding_range); + bind_uniform(t->layout, t->name, range); + } } void LocationAllocator::apply(Stage &stage) @@ -466,7 +471,14 @@ void StructuralFeatureConverter::visit(RefPtr &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));