aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/StructuredIr
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-01-21 12:35:21 -0300
committerGitHub <noreply@github.com>2022-01-21 12:35:21 -0300
commit7e967d796cf572377f21af3817a22755c5b01cb1 (patch)
tree3c05dfde7d6ddfa97b667649afa744a2eb25432f /Ryujinx.Graphics.Shader/StructuredIr
parent0e59573f2b55420c2c3fcfc3aaad56dba70e1492 (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.Shader/StructuredIr')
-rw-r--r--Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs18
-rw-r--r--Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramInfo.cs20
2 files changed, 38 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs
index 61cc167a..31c71f20 100644
--- a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs
+++ b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs
@@ -64,6 +64,24 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
context.LeaveFunction();
}
+ if (config.TransformFeedbackEnabled)
+ {
+ for (int tfbIndex = 0; tfbIndex < 4; tfbIndex++)
+ {
+ var locations = config.GpuAccessor.QueryTransformFeedbackVaryingLocations(tfbIndex);
+ var stride = config.GpuAccessor.QueryTransformFeedbackStride(tfbIndex);
+
+ for (int j = 0; j < locations.Length; j++)
+ {
+ byte location = locations[j];
+ if (location < 0x80)
+ {
+ context.Info.TransformFeedbackOutputs[location] = new TransformFeedbackOutput(tfbIndex, j * 4, stride);
+ }
+ }
+ }
+ }
+
return context.Info;
}
diff --git a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramInfo.cs b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramInfo.cs
index aeaa03ec..933f265f 100644
--- a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramInfo.cs
+++ b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramInfo.cs
@@ -2,15 +2,35 @@ using System.Collections.Generic;
namespace Ryujinx.Graphics.Shader.StructuredIr
{
+ struct TransformFeedbackOutput
+ {
+ public readonly bool Valid;
+ public readonly int Buffer;
+ public readonly int Offset;
+ public readonly int Stride;
+
+ public TransformFeedbackOutput(int buffer, int offset, int stride)
+ {
+ Valid = true;
+ Buffer = buffer;
+ Offset = offset;
+ Stride = stride;
+ }
+ }
+
class StructuredProgramInfo
{
public List<StructuredFunction> Functions { get; }
public HelperFunctionsMask HelperFunctionsMask { get; set; }
+ public TransformFeedbackOutput[] TransformFeedbackOutputs { get; }
+
public StructuredProgramInfo()
{
Functions = new List<StructuredFunction>();
+
+ TransformFeedbackOutputs = new TransformFeedbackOutput[0x80];
}
}
} \ No newline at end of file