save compiled functions

This commit is contained in:
Samuliak 2024-10-04 16:30:28 +02:00
parent 3a51a8de2e
commit 909a4290d1
1 changed files with 4 additions and 4 deletions

View File

@ -272,7 +272,7 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
std::cout << code << std::endl;
MTL::CompileOptions* compile_options = MTL::CompileOptions::alloc()->init();
NS::Error* error = nullptr;
[[maybe_unused]] MTL::Library* library = device.GetDevice()->newLibrary(
MTL::Library* library = device.GetDevice()->newLibrary(
NS::String::string(code.c_str(), NS::ASCIIStringEncoding), compile_options, &error);
if (error) {
LOG_ERROR(Render_Metal, "failed to create library: {}",
@ -280,11 +280,11 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
// HACK
std::cout << error->description()->cString(NS::ASCIIStringEncoding) << std::endl;
// HACK
// throw;
throw;
}
// functions[stage_index] =
// library->newFunction(NS::String::string("main_", NS::ASCIIStringEncoding));
functions[stage_index] =
library->newFunction(NS::String::string("main_", NS::ASCIIStringEncoding));
previous_stage = &program;
}