mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-22 17:10:19 +00:00
Make more robust to shader compilation failure
- Don't freeze when GLSL compilation fails - Background SPIR-V pipeline compile failure results in skipped draws, similar to GLSL compilation failure.
This commit is contained in:
parent
d45b28f6b7
commit
089fa6bd54
1 changed files with 19 additions and 1 deletions
|
@ -135,6 +135,13 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
await Task.WhenAll(_shaders.Select(shader => ((Shader)shader).CompileTask));
|
await Task.WhenAll(_shaders.Select(shader => ((Shader)shader).CompileTask));
|
||||||
|
|
||||||
|
if (_shaders.Any(shader => ((Shader)shader).CompileStatus == ProgramLinkStatus.Failure))
|
||||||
|
{
|
||||||
|
LinkStatus = ProgramLinkStatus.Failure;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_isCompute)
|
if (_isCompute)
|
||||||
|
@ -149,6 +156,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
catch (VulkanException e)
|
catch (VulkanException e)
|
||||||
{
|
{
|
||||||
Logger.Error?.PrintMsg(LogClass.Gpu, $"Background Compilation failed: {e.Message}");
|
Logger.Error?.PrintMsg(LogClass.Gpu, $"Background Compilation failed: {e.Message}");
|
||||||
|
|
||||||
|
LinkStatus = ProgramLinkStatus.Failure;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +181,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
_infos[i] = shader.GetInfo();
|
_infos[i] = shader.GetInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
LinkStatus = resultStatus;
|
// If the link status was already set as failure by background compilation, prefer that decision.
|
||||||
|
if (LinkStatus != ProgramLinkStatus.Failure)
|
||||||
|
{
|
||||||
|
LinkStatus = resultStatus;
|
||||||
|
}
|
||||||
|
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
}
|
}
|
||||||
|
@ -265,6 +278,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
if (blocking)
|
if (blocking)
|
||||||
{
|
{
|
||||||
_compileTask.Wait();
|
_compileTask.Wait();
|
||||||
|
|
||||||
|
if (LinkStatus == ProgramLinkStatus.Failure)
|
||||||
|
{
|
||||||
|
return ProgramLinkStatus.Failure;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue