mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-08 16:01:19 +12:00
stringify utility shader source
This commit is contained in:
parent
d48de5b56f
commit
c4688e1ad1
2 changed files with 63 additions and 51 deletions
|
@ -57,9 +57,17 @@ MetalRenderer::MetalRenderer()
|
|||
}
|
||||
}
|
||||
|
||||
// Utility shader source
|
||||
// Utility shader library
|
||||
|
||||
// Process the source first
|
||||
std::string processedUtilityShaderSource = utilityShaderSource;
|
||||
processedUtilityShaderSource.pop_back();
|
||||
processedUtilityShaderSource.erase(processedUtilityShaderSource.begin());
|
||||
processedUtilityShaderSource = "#include <metal_stdlib>\n" + processedUtilityShaderSource;
|
||||
|
||||
// Create the library
|
||||
NS::Error* error = nullptr;
|
||||
MTL::Library* utilityLibrary = m_device->newLibrary(NS::String::string(utilityShaderSource, NS::ASCIIStringEncoding), nullptr, &error);
|
||||
MTL::Library* utilityLibrary = m_device->newLibrary(NS::String::string(processedUtilityShaderSource.c_str(), NS::ASCIIStringEncoding), nullptr, &error);
|
||||
if (error)
|
||||
{
|
||||
debug_printf("failed to create utility library (error: %s)\n", error->localizedDescription()->utf8String());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue