mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-25 19:17:11 +02:00
Geometry shader emulation for macOS (#5551)
* Implement vertex and geometry shader conversion to compute * Call InitializeReservedCounts for compute too * PR feedback * Set clip distance mask for geometry and tessellation shaders too * Transform feedback emulation only for vertex
This commit is contained in:
parent
93d78f9ac4
commit
f09bba82b9
65 changed files with 3912 additions and 593 deletions
|
@ -60,6 +60,11 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
|||
_functionsWithId.Add(function);
|
||||
}
|
||||
|
||||
public IoUsage GetIoUsage()
|
||||
{
|
||||
return new IoUsage(UsedFeatures, ClipDistancesWritten, AttributeUsage.UsedOutputAttributes);
|
||||
}
|
||||
|
||||
public IEnumerator<DecodedFunction> GetEnumerator()
|
||||
{
|
||||
return _functions.Values.GetEnumerator();
|
||||
|
|
|
@ -297,6 +297,9 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
|||
case InstName.Ssy:
|
||||
block.AddPushOp(op);
|
||||
break;
|
||||
case InstName.Shfl:
|
||||
context.SetUsedFeature(FeatureFlags.Shuffle);
|
||||
break;
|
||||
case InstName.Ldl:
|
||||
case InstName.Stl:
|
||||
context.SetUsedFeature(FeatureFlags.LocalMemory);
|
||||
|
@ -307,8 +310,22 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
|||
case InstName.Sts:
|
||||
context.SetUsedFeature(FeatureFlags.SharedMemory);
|
||||
break;
|
||||
case InstName.Shfl:
|
||||
context.SetUsedFeature(FeatureFlags.Shuffle);
|
||||
case InstName.Atom:
|
||||
case InstName.AtomCas:
|
||||
case InstName.Red:
|
||||
case InstName.Stg:
|
||||
case InstName.Suatom:
|
||||
case InstName.SuatomB:
|
||||
case InstName.SuatomB2:
|
||||
case InstName.SuatomCas:
|
||||
case InstName.SuatomCasB:
|
||||
case InstName.Sured:
|
||||
case InstName.SuredB:
|
||||
case InstName.Sust:
|
||||
case InstName.SustB:
|
||||
case InstName.SustD:
|
||||
case InstName.SustDB:
|
||||
context.SetUsedFeature(FeatureFlags.Store);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -424,6 +441,12 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
|||
context.SetUsedFeature(FeatureFlags.RtLayer);
|
||||
}
|
||||
break;
|
||||
case AttributeConsts.ViewportIndex:
|
||||
if (definitions.Stage != ShaderStage.Fragment)
|
||||
{
|
||||
context.SetUsedFeature(FeatureFlags.ViewportIndex);
|
||||
}
|
||||
break;
|
||||
case AttributeConsts.ClipDistance0:
|
||||
case AttributeConsts.ClipDistance1:
|
||||
case AttributeConsts.ClipDistance2:
|
||||
|
@ -432,11 +455,17 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
|||
case AttributeConsts.ClipDistance5:
|
||||
case AttributeConsts.ClipDistance6:
|
||||
case AttributeConsts.ClipDistance7:
|
||||
if (definitions.Stage == ShaderStage.Vertex)
|
||||
if (definitions.Stage.IsVtg())
|
||||
{
|
||||
context.SetClipDistanceWritten((attr - AttributeConsts.ClipDistance0) / 4);
|
||||
}
|
||||
break;
|
||||
case AttributeConsts.ViewportMask:
|
||||
if (definitions.Stage != ShaderStage.Fragment)
|
||||
{
|
||||
context.SetUsedFeature(FeatureFlags.ViewportMask);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue