mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-30 11:20:48 -07:00
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:
@ -97,7 +97,8 @@ namespace Ryujinx.Graphics
|
||||
SetCullFace(State);
|
||||
SetDepth(State);
|
||||
SetStencil(State);
|
||||
SetAlphaBlending(State);
|
||||
SetBlending(State);
|
||||
SetColorMask(State);
|
||||
SetPrimitiveRestart(State);
|
||||
|
||||
for (int FbIndex = 0; FbIndex < 8; FbIndex++)
|
||||
@ -403,7 +404,7 @@ namespace Ryujinx.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
private void SetAlphaBlending(GalPipelineState State)
|
||||
private void SetBlending(GalPipelineState State)
|
||||
{
|
||||
//TODO: Support independent blend properly.
|
||||
State.BlendEnabled = ReadRegisterBool(NvGpuEngine3dReg.IBlendNEnable);
|
||||
@ -421,6 +422,16 @@ namespace Ryujinx.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
private void SetColorMask(GalPipelineState State)
|
||||
{
|
||||
int ColorMask = ReadRegister(NvGpuEngine3dReg.ColorMask);
|
||||
|
||||
State.ColorMaskR = ((ColorMask >> 0) & 0xf) != 0;
|
||||
State.ColorMaskG = ((ColorMask >> 4) & 0xf) != 0;
|
||||
State.ColorMaskB = ((ColorMask >> 8) & 0xf) != 0;
|
||||
State.ColorMaskA = ((ColorMask >> 12) & 0xf) != 0;
|
||||
}
|
||||
|
||||
private void SetPrimitiveRestart(GalPipelineState State)
|
||||
{
|
||||
State.PrimitiveRestartEnabled = ReadRegisterBool(NvGpuEngine3dReg.PrimRestartEnable);
|
||||
|
Reference in New Issue
Block a user