From 7e967d796cf572377f21af3817a22755c5b01cb1 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Fri, 21 Jan 2022 12:35:21 -0300 Subject: Stop using glTransformFeedbackVaryings and use explicit layout on the shader (#3012) * Stop using glTransformFeedbackVarying and use explicit layout on the shader * This is no longer needed * Shader cache version bump * Fix gl_PerVertex output for tessellation control shaders --- Ryujinx.Graphics.OpenGL/Program.cs | 50 +------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) (limited to 'Ryujinx.Graphics.OpenGL/Program.cs') diff --git a/Ryujinx.Graphics.OpenGL/Program.cs b/Ryujinx.Graphics.OpenGL/Program.cs index 785f2f00..95902990 100644 --- a/Ryujinx.Graphics.OpenGL/Program.cs +++ b/Ryujinx.Graphics.OpenGL/Program.cs @@ -29,7 +29,7 @@ namespace Ryujinx.Graphics.OpenGL private ProgramLinkStatus _status = ProgramLinkStatus.Incomplete; private IShader[] _shaders; - public Program(IShader[] shaders, TransformFeedbackDescriptor[] transformFeedbackDescriptors) + public Program(IShader[] shaders) { Handle = GL.CreateProgram(); @@ -42,54 +42,6 @@ namespace Ryujinx.Graphics.OpenGL GL.AttachShader(Handle, shaderHandle); } - if (transformFeedbackDescriptors != null) - { - List varyings = new List(); - - int cbi = 0; - - foreach (var tfd in transformFeedbackDescriptors.OrderBy(x => x.BufferIndex)) - { - if (tfd.VaryingLocations.Length == 0) - { - continue; - } - - while (cbi < tfd.BufferIndex) - { - varyings.Add("gl_NextBuffer"); - - cbi++; - } - - int stride = Math.Min(128 * 4, (tfd.Stride + 3) & ~3); - - int j = 0; - - for (; j < tfd.VaryingLocations.Length && j * 4 < stride; j++) - { - byte location = tfd.VaryingLocations[j]; - - varyings.Add(Varying.GetName(location) ?? "gl_SkipComponents1"); - - j += Varying.GetSize(location) - 1; - } - - int feedbackBytes = j * 4; - - while (feedbackBytes < stride) - { - int bytes = Math.Min(16, stride - feedbackBytes); - - varyings.Add($"gl_SkipComponents{(bytes / 4)}"); - - feedbackBytes += bytes; - } - } - - GL.TransformFeedbackVaryings(Handle, varyings.Count, varyings.ToArray(), TransformFeedbackMode.InterleavedAttribs); - } - GL.LinkProgram(Handle); _shaders = shaders; -- cgit v1.2.3