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:
parent
894459fcd7
commit
72317d7777
8 changed files with 63 additions and 12 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue