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:
parent
75ec30c962
commit
a728610b40
10 changed files with 140 additions and 16 deletions
|
@ -35,6 +35,8 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
|
||||
private bool _scissor0Enable = false;
|
||||
|
||||
ColorF _blendConstant = new ColorF(0, 0, 0, 0);
|
||||
|
||||
internal Pipeline()
|
||||
{
|
||||
_rasterizerDiscard = false;
|
||||
|
@ -478,11 +480,6 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
}
|
||||
}
|
||||
|
||||
public void SetBlendColor(ColorF color)
|
||||
{
|
||||
GL.BlendColor(color.Red, color.Green, color.Blue, color.Alpha);
|
||||
}
|
||||
|
||||
public void SetBlendState(int index, BlendDescriptor blend)
|
||||
{
|
||||
if (!blend.Enable)
|
||||
|
@ -504,6 +501,17 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
(BlendingFactorSrc)blend.AlphaSrcFactor.Convert(),
|
||||
(BlendingFactorDest)blend.AlphaDstFactor.Convert());
|
||||
|
||||
if (_blendConstant != blend.BlendConstant)
|
||||
{
|
||||
_blendConstant = blend.BlendConstant;
|
||||
|
||||
GL.BlendColor(
|
||||
blend.BlendConstant.Red,
|
||||
blend.BlendConstant.Green,
|
||||
blend.BlendConstant.Blue,
|
||||
blend.BlendConstant.Alpha);
|
||||
}
|
||||
|
||||
GL.Enable(IndexedEnableCap.Blend, index);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue