diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2022-01-21 12:35:21 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-21 12:35:21 -0300 |
| commit | 7e967d796cf572377f21af3817a22755c5b01cb1 (patch) | |
| tree | 3c05dfde7d6ddfa97b667649afa744a2eb25432f /Ryujinx.Graphics.OpenGL/Program.cs | |
| parent | 0e59573f2b55420c2c3fcfc3aaad56dba70e1492 (diff) | |
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
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Program.cs')
| -rw-r--r-- | Ryujinx.Graphics.OpenGL/Program.cs | 50 |
1 files changed, 1 insertions, 49 deletions
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<string> varyings = new List<string>(); - - 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; |
