From a728610b4016e153fed670eddaa45909ab51f18b Mon Sep 17 00:00:00 2001 From: mageven <62494521+mageven@users.noreply.github.com> Date: Sat, 25 Apr 2020 18:30:43 +0530 Subject: 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 --- Ryujinx.Graphics.Gpu/Engine/Methods.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs') diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs index 2e6c9828..7bc85018 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs @@ -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(MethodOffset.BlendIndependent); + ColorF blendConstant = state.Get(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, -- cgit v1.2.3