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 mtlVertexShader = static_cast<RendererShaderMtl*>(vertexShader->shader);
|
||||||
auto mtlPixelShader = static_cast<RendererShaderMtl*>(pixelShader->shader);
|
auto mtlPixelShader = static_cast<RendererShaderMtl*>(pixelShader->shader);
|
||||||
mtlVertexShader->CompileVertexFunction();
|
mtlVertexShader->CompileVertexFunction();
|
||||||
|
// HACK
|
||||||
|
if (!mtlVertexShader->GetFunction())
|
||||||
|
{
|
||||||
|
debug_printf("no vertex function, skipping draw\n");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
mtlPixelShader->CompileFragmentFunction(activeFBO);
|
mtlPixelShader->CompileFragmentFunction(activeFBO);
|
||||||
|
|
||||||
// Render pipeline state
|
// Render pipeline state
|
||||||
|
@ -218,12 +218,20 @@ void RendererShaderMtl::Compile(const std::string& mslCode)
|
|||||||
if (m_function)
|
if (m_function)
|
||||||
m_function->release();
|
m_function->release();
|
||||||
|
|
||||||
|
// HACK
|
||||||
|
if (m_hasError)
|
||||||
|
return;
|
||||||
|
|
||||||
NS::Error* error = nullptr;
|
NS::Error* error = nullptr;
|
||||||
MTL::Library* library = m_mtlr->GetDevice()->newLibrary(ToNSString(mslCode), nullptr, &error);
|
MTL::Library* library = m_mtlr->GetDevice()->newLibrary(ToNSString(mslCode), nullptr, &error);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
printf("failed to create library (error: %s) -> source:\n%s\n", error->localizedDescription()->utf8String(), mslCode.c_str());
|
printf("failed to create library (error: %s) -> source:\n%s\n", error->localizedDescription()->utf8String(), mslCode.c_str());
|
||||||
error->release();
|
error->release();
|
||||||
|
|
||||||
|
// HACK
|
||||||
|
m_hasError = true;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_function = library->newFunction(ToNSString("main0"));
|
m_function = library->newFunction(ToNSString("main0"));
|
||||||
|
@ -63,5 +63,8 @@ private:
|
|||||||
std::vector<uint8> m_binary;
|
std::vector<uint8> m_binary;
|
||||||
std::string m_mslCode;
|
std::string m_mslCode;
|
||||||
|
|
||||||
|
// HACK
|
||||||
|
bool m_hasError = false;
|
||||||
|
|
||||||
void Compile(const std::string& mslCode);
|
void Compile(const std::string& mslCode);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user