mirror of
				https://github.com/ryujinx-mirror/ryujinx.git
				synced 2025-11-04 03:29:01 -06:00 
			
		
		
		
	GPU: Ensure all clip distances are initialized when used (#7363)
* GPU: Ensure all clip distances are initialized when used * Shader cache version
This commit is contained in:
		@@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
 | 
			
		||||
        private const ushort FileFormatVersionMajor = 1;
 | 
			
		||||
        private const ushort FileFormatVersionMinor = 2;
 | 
			
		||||
        private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
 | 
			
		||||
        private const uint CodeGenVersion = 7331;
 | 
			
		||||
        private const uint CodeGenVersion = 7353;
 | 
			
		||||
 | 
			
		||||
        private const string SharedTocFileName = "shared.toc";
 | 
			
		||||
        private const string SharedDataFileName = "shared.data";
 | 
			
		||||
 
 | 
			
		||||
@@ -190,7 +190,7 @@ namespace Ryujinx.Graphics.Shader.Translation
 | 
			
		||||
 | 
			
		||||
            if (stage == ShaderStage.Vertex)
 | 
			
		||||
            {
 | 
			
		||||
                InitializePositionOutput(context);
 | 
			
		||||
                InitializeVertexOutputs(context);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            UInt128 usedAttributes = context.TranslatorContext.AttributeUsage.NextInputAttributesComponents;
 | 
			
		||||
@@ -236,12 +236,20 @@ namespace Ryujinx.Graphics.Shader.Translation
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private static void InitializePositionOutput(EmitterContext context)
 | 
			
		||||
        private static void InitializeVertexOutputs(EmitterContext context)
 | 
			
		||||
        {
 | 
			
		||||
            for (int c = 0; c < 4; c++)
 | 
			
		||||
            {
 | 
			
		||||
                context.Store(StorageKind.Output, IoVariable.Position, null, Const(c), ConstF(c == 3 ? 1f : 0f));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (context.Program.ClipDistancesWritten != 0)
 | 
			
		||||
            {
 | 
			
		||||
                for (int i = 0; i < 8; i++)
 | 
			
		||||
                {
 | 
			
		||||
                    context.Store(StorageKind.Output, IoVariable.ClipDistance, null, Const(i), ConstF(0f));
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private static void InitializeOutput(EmitterContext context, int location, bool perPatch)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user