mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-21 16:43:35 +00:00
SPIR-V: Don't OpReturn if we already OpExit'ed
Fixes spir-v parse failure and stack smashing in RADV (obviously you still need bolist)
This commit is contained in:
parent
c1517e5ee3
commit
cbeb40934f
1 changed files with 2 additions and 1 deletions
|
@ -137,7 +137,8 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||
Generate(context, function.MainBlock);
|
||||
|
||||
// Functions must always end with a return.
|
||||
if (!(function.MainBlock.Last is AstOperation operation) || operation.Inst != Instruction.Return)
|
||||
if (!(function.MainBlock.Last is AstOperation operation) ||
|
||||
(operation.Inst != Instruction.Return && operation.Inst != Instruction.Discard))
|
||||
{
|
||||
context.Return();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue