mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-29 12:03:04 +00:00
support fragment coord as an input to a shader
This commit is contained in:
parent
e638172753
commit
6295153a28
2 changed files with 7 additions and 0 deletions
|
@ -133,6 +133,12 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
|
|
||||||
context.EnterScope();
|
context.EnterScope();
|
||||||
|
|
||||||
|
if (context.Definitions.Stage == ShaderStage.Fragment)
|
||||||
|
{
|
||||||
|
// TODO: check if it's needed
|
||||||
|
context.AppendLine("float4 position [[position]];");
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var ioDefinition in inputs.OrderBy(x => x.Location))
|
foreach (var ioDefinition in inputs.OrderBy(x => x.Location))
|
||||||
{
|
{
|
||||||
string type = GetVarTypeName(context, context.Definitions.GetUserDefinedType(ioDefinition.Location, isOutput: false));
|
string type = GetVarTypeName(context, context.Definitions.GetUserDefinedType(ioDefinition.Location, isOutput: false));
|
||||||
|
|
|
@ -30,6 +30,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
||||||
IoVariable.UserDefined => GetUserDefinedVariableName(definitions, location, component, isOutput, isPerPatch),
|
IoVariable.UserDefined => GetUserDefinedVariableName(definitions, location, component, isOutput, isPerPatch),
|
||||||
IoVariable.VertexId => ("vertex_id", AggregateType.S32),
|
IoVariable.VertexId => ("vertex_id", AggregateType.S32),
|
||||||
IoVariable.ViewportIndex => ("viewport_array_index", AggregateType.S32),
|
IoVariable.ViewportIndex => ("viewport_array_index", AggregateType.S32),
|
||||||
|
IoVariable.FragmentCoord => ("in.position", AggregateType.Vector4 | AggregateType.FP32),
|
||||||
_ => (null, AggregateType.Invalid),
|
_ => (null, AggregateType.Invalid),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue