check if shaders compiled successfully

This commit is contained in:
Samuliak 2025-01-15 19:30:46 +01:00
parent 371c089923
commit f5eb184969
No known key found for this signature in database
2 changed files with 11 additions and 4 deletions

View file

@ -29,7 +29,7 @@ public:
if (m_threadsActive.exchange(true))
return;
// create thread pool
const uint32 threadCount = 8;
const uint32 threadCount = 2;
for (uint32 i = 0; i < threadCount; ++i)
s_threads.emplace_back(&ShaderMtlThreadPool::CompilerThreadFunc, this);
}
@ -295,8 +295,10 @@ void RendererShaderMtl::CompileInternal()
mslFile.close();
// Compile
executeCommand("xcrun -sdk macosx metal -o {}.ir -c {}.metal -w", baseFilename, baseFilename);
executeCommand("xcrun -sdk macosx metallib -o {}.metallib {}.ir", baseFilename, baseFilename);
if (!executeCommand("xcrun -sdk macosx metal -o {}.ir -c {}.metal -w", baseFilename, baseFilename))
return;
if (!executeCommand("xcrun -sdk macosx metallib -o {}.metallib {}.ir", baseFilename, baseFilename))
return;
// Clean up
executeCommand("rm {}.metal", baseFilename);