Fix error when dual source blend is used (#1610)
* Fix error when dual source blend is used * Ensure framebuffer
This commit is contained in:
parent
e4777717cd
commit
6a51b628f9
2 changed files with 57 additions and 0 deletions
|
@ -557,6 +557,32 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
(BlendingFactorSrc)blend.AlphaSrcFactor.Convert(),
|
||||
(BlendingFactorDest)blend.AlphaDstFactor.Convert());
|
||||
|
||||
static bool IsDualSource(BlendFactor factor)
|
||||
{
|
||||
switch (factor)
|
||||
{
|
||||
case BlendFactor.Src1Color:
|
||||
case BlendFactor.Src1ColorGl:
|
||||
case BlendFactor.Src1Alpha:
|
||||
case BlendFactor.Src1AlphaGl:
|
||||
case BlendFactor.OneMinusSrc1Color:
|
||||
case BlendFactor.OneMinusSrc1ColorGl:
|
||||
case BlendFactor.OneMinusSrc1Alpha:
|
||||
case BlendFactor.OneMinusSrc1AlphaGl:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
EnsureFramebuffer();
|
||||
|
||||
_framebuffer.SetDualSourceBlend(
|
||||
IsDualSource(blend.ColorSrcFactor) ||
|
||||
IsDualSource(blend.ColorDstFactor) ||
|
||||
IsDualSource(blend.AlphaSrcFactor) ||
|
||||
IsDualSource(blend.AlphaDstFactor));
|
||||
|
||||
if (_blendConstant != blend.BlendConstant)
|
||||
{
|
||||
_blendConstant = blend.BlendConstant;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue