X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Ffinalize.cpp;h=3b0909ac2a90949733577e0e3a22dc0383cca445;hb=abcd1fa06f9fab27c5934b4069523dd009862b18;hp=85a6b07adf8f00591348ed63d744299e8567ab39;hpb=6425fd2ec9c7e1e13c3afa7a79a9a2442d9e5c50;p=libs%2Fgl.git diff --git a/source/glsl/finalize.cpp b/source/glsl/finalize.cpp index 85a6b07a..3b0909ac 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) @@ -473,6 +478,13 @@ bool StructuralFeatureConverter::supports_stage(Stage::Type st) const else return check_version(Version(1, 50)); } + else if(st==Stage::COMPUTE) + { + if(features.target_api==OPENGL_ES) + return check_version(Version(3, 10)); + else + return check_version(Version(4, 30)); + } else return true; }