]> git.tdb.fi Git - libs/gl.git/commitdiff
Compile SPIR-V modules from GLSL if needed
authorMikko Rasa <tdb@tdb.fi>
Sat, 24 Apr 2021 19:35:30 +0000 (22:35 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 24 Apr 2021 19:35:30 +0000 (22:35 +0300)
source/resources/resources.cpp

index c9db211b2172480300732c6106526c75e6070bbc..11dc2d329dd29cfca2ec9385b72361f6260e54b8 100644 (file)
@@ -210,6 +210,15 @@ Module *Resources::create_module(const string &name)
                        return module.release();
                }
        }
+       else if(ext==".spv")
+       {
+               if((io = open_raw(FS::basepart(name)+".glsl")))
+               {
+                       RefPtr<SpirVModule> module = new SpirVModule;
+                       module->load_source(*io, this, name);
+                       return module.release();
+               }
+       }
 
        return 0;
 }