Add support for saturation on some shader instructions, fix ReadTexture alignment and add ColorMask support (#451)
* Add support for saturation on some shader instructions, fix ReadTexture alignment * Add ColorMask support, other tweaks
This commit is contained in:
@ -2,6 +2,9 @@ namespace Ryujinx.Graphics.Gal.Shader
|
||||
{
|
||||
static class ShaderDecodeHelper
|
||||
{
|
||||
private static readonly ShaderIrOperImmf ImmfZero = new ShaderIrOperImmf(0);
|
||||
private static readonly ShaderIrOperImmf ImmfOne = new ShaderIrOperImmf(1);
|
||||
|
||||
public static ShaderIrNode GetAluFabsFneg(ShaderIrNode Node, bool Abs, bool Neg)
|
||||
{
|
||||
return GetAluFneg(GetAluFabs(Node, Abs), Neg);
|
||||
@ -17,6 +20,11 @@ namespace Ryujinx.Graphics.Gal.Shader
|
||||
return Neg ? new ShaderIrOp(ShaderIrInst.Fneg, Node) : Node;
|
||||
}
|
||||
|
||||
public static ShaderIrNode GetAluFsat(ShaderIrNode Node, bool Sat)
|
||||
{
|
||||
return Sat ? new ShaderIrOp(ShaderIrInst.Fclamp, Node, ImmfZero, ImmfOne) : Node;
|
||||
}
|
||||
|
||||
public static ShaderIrNode GetAluIabsIneg(ShaderIrNode Node, bool Abs, bool Neg)
|
||||
{
|
||||
return GetAluIneg(GetAluIabs(Node, Abs), Neg);
|
||||
|
Reference in New Issue
Block a user