Implement Constant Color blends (#1119)

* Implement Constant Color blends and init blend states

* Address gdkchan's comments

Also adds Set methods to GpuState

* Fix descriptions of QueryModified
This commit is contained in:
mageven 2020-04-25 18:30:43 +05:30 committed by GitHub
parent 75ec30c962
commit a728610b40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 140 additions and 16 deletions

View file

@ -229,6 +229,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
}
if (state.QueryModified(MethodOffset.BlendIndependent,
MethodOffset.BlendConstant,
MethodOffset.BlendStateCommon,
MethodOffset.BlendEnableCommon,
MethodOffset.BlendEnable,
@ -749,8 +750,9 @@ namespace Ryujinx.Graphics.Gpu.Engine
private void UpdateBlendState(GpuState state)
{
bool blendIndependent = state.Get<Boolean32>(MethodOffset.BlendIndependent);
ColorF blendConstant = state.Get<ColorF>(MethodOffset.BlendConstant);
for (int index = 0; index < 8; index++)
for (int index = 0; index < Constants.TotalRenderTargets; index++)
{
BlendDescriptor descriptor;
@ -761,6 +763,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
descriptor = new BlendDescriptor(
enable,
blendConstant,
blend.ColorOp,
blend.ColorSrcFactor,
blend.ColorDstFactor,
@ -775,6 +778,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
descriptor = new BlendDescriptor(
enable,
blendConstant,
blend.ColorOp,
blend.ColorSrcFactor,
blend.ColorDstFactor,