X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fmodule.cpp;h=72a6abca43781a20e84f07abc8dbb1373f2eb295;hp=6f7fbdb93e9799dc488b7b10646c48cf2bc0c4ac;hb=9f6bb77743014e4321e783aae5e84af1c925e572;hpb=36569927a57a59bf0bfadb653c97395dbf8356f7 diff --git a/source/core/module.cpp b/source/core/module.cpp index 6f7fbdb9..72a6abca 100644 --- a/source/core/module.cpp +++ b/source/core/module.cpp @@ -127,6 +127,18 @@ void SpirVModule::load_code(IO::Base &io) code.insert(code.end(), buffer, buffer+len); } + reflect(); +} + +void SpirVModule::compile(SL::Compiler &compiler) +{ + compiler.compile(SL::Compiler::SPIRV); + code = compiler.get_combined_spirv(); + reflect(); +} + +void SpirVModule::reflect() +{ if(code.empty()) throw invalid_module("Empty SPIR-V code"); @@ -216,11 +228,6 @@ void SpirVModule::load_code(IO::Base &io) spec_constants.push_back(i->second); } -void SpirVModule::compile(SL::Compiler &) -{ - throw logic_error("Not implemented yet"); -} - SpirVModule::EntryPoint::EntryPoint(): stage(VERTEX)