aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-07-15 00:01:10 -0300
committerGitHub <noreply@github.com>2020-07-15 13:01:10 +1000
commit788ca6a411762035a6a7a88100c4b582b47ee82d (patch)
treed48bfb91aecaead2906ec2d390357546f8c0611f /Ryujinx.Graphics.GAL
parent16dafe63166d065f40b57a9b7cf8017a6ba0b1ef (diff)
Initial transform feedback support (#1370)
* Initial transform feedback support * Some nits and fixes * Update ReportCounterType and Write method * Can't change shader or TFB bindings while TFB is active * Fix geometry shader input names with new naming
Diffstat (limited to 'Ryujinx.Graphics.GAL')
-rw-r--r--Ryujinx.Graphics.GAL/IPipeline.cs5
-rw-r--r--Ryujinx.Graphics.GAL/IRenderer.cs2
-rw-r--r--Ryujinx.Graphics.GAL/TransformFeedbackDescriptor.cs19
3 files changed, 25 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.GAL/IPipeline.cs b/Ryujinx.Graphics.GAL/IPipeline.cs
index 3eb778e0..7c67a172 100644
--- a/Ryujinx.Graphics.GAL/IPipeline.cs
+++ b/Ryujinx.Graphics.GAL/IPipeline.cs
@@ -7,6 +7,8 @@ namespace Ryujinx.Graphics.GAL
{
void Barrier();
+ void BeginTransformFeedback(PrimitiveTopology topology);
+
void ClearRenderTargetColor(int index, uint componentMask, ColorF color);
void ClearRenderTargetDepthStencil(
@@ -27,6 +29,8 @@ namespace Ryujinx.Graphics.GAL
int firstVertex,
int firstInstance);
+ void EndTransformFeedback();
+
void SetBlendState(int index, BlendDescriptor blend);
void SetDepthBias(PolygonModeMask enables, float factor, float units, float clamp);
@@ -73,6 +77,7 @@ namespace Ryujinx.Graphics.GAL
void SetTexture(int index, ShaderStage stage, ITexture texture);
+ void SetTransformFeedbackBuffer(int index, BufferRange buffer);
void SetUniformBuffer(int index, ShaderStage stage, BufferRange buffer);
void SetUserClipDistance(int index, bool enableClip);
diff --git a/Ryujinx.Graphics.GAL/IRenderer.cs b/Ryujinx.Graphics.GAL/IRenderer.cs
index 1052f147..6fd3feba 100644
--- a/Ryujinx.Graphics.GAL/IRenderer.cs
+++ b/Ryujinx.Graphics.GAL/IRenderer.cs
@@ -13,7 +13,7 @@ namespace Ryujinx.Graphics.GAL
BufferHandle CreateBuffer(int size);
- IProgram CreateProgram(IShader[] shaders);
+ IProgram CreateProgram(IShader[] shaders, TransformFeedbackDescriptor[] transformFeedbackDescriptors);
ISampler CreateSampler(SamplerCreateInfo info);
ITexture CreateTexture(TextureCreateInfo info, float scale);
diff --git a/Ryujinx.Graphics.GAL/TransformFeedbackDescriptor.cs b/Ryujinx.Graphics.GAL/TransformFeedbackDescriptor.cs
new file mode 100644
index 00000000..690b9108
--- /dev/null
+++ b/Ryujinx.Graphics.GAL/TransformFeedbackDescriptor.cs
@@ -0,0 +1,19 @@
+using System;
+
+namespace Ryujinx.Graphics.GAL
+{
+ public struct TransformFeedbackDescriptor
+ {
+ public int BufferIndex { get; }
+ public int Stride { get; }
+
+ public byte[] VaryingLocations { get; }
+
+ public TransformFeedbackDescriptor(int bufferIndex, int stride, byte[] varyingLocations)
+ {
+ BufferIndex = bufferIndex;
+ Stride = stride;
+ VaryingLocations = varyingLocations ?? throw new ArgumentNullException(nameof(varyingLocations));
+ }
+ }
+}