SPIR-V: Functions must always end with a return

This commit is contained in:
gdk 2022-02-13 16:33:21 -03:00 committed by riperiperi
parent be36f6fa5b
commit a2e4b4b6d8

View file

@ -84,6 +84,12 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
Generate(context, function.MainBlock); Generate(context, function.MainBlock);
// Functions must always end with a return.
if (!(function.MainBlock.Last is AstOperation operation) || operation.Inst != Instruction.Return)
{
context.Return();
}
context.FunctionEnd(); context.FunctionEnd();
if (funcIndex == 0) if (funcIndex == 0)