diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-10-18 18:38:04 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-18 18:38:04 -0300 |
| commit | d512ce122cb1c9a7fe7cb40d3f85d642ee37f897 (patch) | |
| tree | bd20273250bf8066fa4df4b67c0de2ab9eac8092 /Ryujinx.Graphics.Shader/Translation/TranslatorContext.cs | |
| parent | 7603dbe3c8b45c8563f320f17ce784151cb1f0a8 (diff) | |
Initial tessellation shader support (#2534)
* Initial tessellation shader support
* Nits
* Re-arrange built-in table
* This is not needed anymore
* PR feedback
Diffstat (limited to 'Ryujinx.Graphics.Shader/Translation/TranslatorContext.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/Translation/TranslatorContext.cs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/TranslatorContext.cs b/Ryujinx.Graphics.Shader/Translation/TranslatorContext.cs index 3c7b3c2b..34b116d6 100644 --- a/Ryujinx.Graphics.Shader/Translation/TranslatorContext.cs +++ b/Ryujinx.Graphics.Shader/Translation/TranslatorContext.cs @@ -32,10 +32,13 @@ namespace Ryujinx.Graphics.Shader.Translation private static bool IsUserAttribute(Operand operand) { - return operand != null && - operand.Type == OperandType.Attribute && - operand.Value >= AttributeConsts.UserAttributeBase && - operand.Value < AttributeConsts.UserAttributeEnd; + if (operand != null && operand.Type.IsAttribute()) + { + int value = operand.Value & AttributeConsts.Mask; + return value >= AttributeConsts.UserAttributeBase && value < AttributeConsts.UserAttributeEnd; + } + + return false; } private static FunctionCode[] Combine(FunctionCode[] a, FunctionCode[] b, int aStart) @@ -133,14 +136,16 @@ namespace Ryujinx.Graphics.Shader.Translation { if (nextStage != null) { - _config.MergeOutputUserAttributes(nextStage._config.UsedInputAttributes); + _config.MergeOutputUserAttributes( + nextStage._config.UsedInputAttributes, + nextStage._config.UsedInputAttributesPerPatch); } FunctionCode[] code = EmitShader(_cfg, _config, initializeOutputs: other == null, out _); if (other != null) { - other._config.MergeOutputUserAttributes(_config.UsedOutputAttributes); + other._config.MergeOutputUserAttributes(_config.UsedOutputAttributes, 0); FunctionCode[] otherCode = EmitShader(other._cfg, other._config, initializeOutputs: true, out int aStart); |
