mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-12-01 21:44:17 +01:00
hack: don't attempt to compile shaders with errors
This commit is contained in:
parent
a6c8d83436
commit
bbed00751f
@ -350,6 +350,12 @@ MTL::RenderPipelineState* MetalPipelineCache::GetRenderPipelineState(const Latte
|
||||
auto mtlVertexShader = static_cast<RendererShaderMtl*>(vertexShader->shader);
|
||||
auto mtlPixelShader = static_cast<RendererShaderMtl*>(pixelShader->shader);
|
||||
mtlVertexShader->CompileVertexFunction();
|
||||
// HACK
|
||||
if (!mtlVertexShader->GetFunction())
|
||||
{
|
||||
debug_printf("no vertex function, skipping draw\n");
|
||||
return nullptr;
|
||||
}
|
||||
mtlPixelShader->CompileFragmentFunction(activeFBO);
|
||||
|
||||
// Render pipeline state
|
||||
|
@ -218,12 +218,20 @@ void RendererShaderMtl::Compile(const std::string& mslCode)
|
||||
if (m_function)
|
||||
m_function->release();
|
||||
|
||||
// HACK
|
||||
if (m_hasError)
|
||||
return;
|
||||
|
||||
NS::Error* error = nullptr;
|
||||
MTL::Library* library = m_mtlr->GetDevice()->newLibrary(ToNSString(mslCode), nullptr, &error);
|
||||
if (error)
|
||||
{
|
||||
printf("failed to create library (error: %s) -> source:\n%s\n", error->localizedDescription()->utf8String(), mslCode.c_str());
|
||||
error->release();
|
||||
|
||||
// HACK
|
||||
m_hasError = true;
|
||||
|
||||
return;
|
||||
}
|
||||
m_function = library->newFunction(ToNSString("main0"));
|
||||
|
@ -63,5 +63,8 @@ private:
|
||||
std::vector<uint8> m_binary;
|
||||
std::string m_mslCode;
|
||||
|
||||
// HACK
|
||||
bool m_hasError = false;
|
||||
|
||||
void Compile(const std::string& mslCode);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user