diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.h b/plugins/GSdx/Renderers/DX11/GSDevice11.h index d8ea9a07b7..fb309f85d0 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.h +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.h @@ -309,29 +309,27 @@ public: { struct { - uint32 abe:1; - uint32 a:2; - uint32 b:2; - uint32 c:2; - uint32 d:2; + // Color mask uint32 wr:1; uint32 wg:1; uint32 wb:1; uint32 wa:1; + // Alpha blending + uint32 blend_index:7; + uint32 abe:1; uint32 accu_blend:1; }; struct { - uint32 _pad:1; - uint32 abcd:8; + // Color mask uint32 wrgba:4; }; uint32 key; }; - operator uint32() {return key & 0x3fff;} + operator uint32() {return key & 0x1fff;} OMBlendSelector() : key(0) {} }; diff --git a/plugins/GSdx/Renderers/DX11/GSRendererDX11.cpp b/plugins/GSdx/Renderers/DX11/GSRendererDX11.cpp index a285640fec..4745b5dab7 100644 --- a/plugins/GSdx/Renderers/DX11/GSRendererDX11.cpp +++ b/plugins/GSdx/Renderers/DX11/GSRendererDX11.cpp @@ -505,29 +505,22 @@ void GSRendererDX11::EmulateBlending() return; m_om_bsel.abe = 1; - m_om_bsel.a = ALPHA.A; - m_om_bsel.b = ALPHA.B; - m_om_bsel.c = ALPHA.C; - m_om_bsel.d = ALPHA.D; if (m_env.PABE.PABE) { - if (m_om_bsel.a == 0 && m_om_bsel.b == 1 && m_om_bsel.c == 0 && m_om_bsel.d == 1) + if (ALPHA.A == 0 && ALPHA.B == 1 && ALPHA.C == 0 && ALPHA.D == 1) { // this works because with PABE alpha blending is on when alpha >= 0x80, but since the pixel shader // cannot output anything over 0x80 (== 1.0) blending with 0x80 or turning it off gives the same result m_om_bsel.abe = 0; } - else - { - // Breath of Fire Dragon Quarter, Strawberry Shortcake, Super Robot Wars. - //ASSERT(0); - } + + // Breath of Fire Dragon Quarter, Strawberry Shortcake, Super Robot Wars. } - const uint8 blend_index = uint8(((ALPHA.A * 3 + ALPHA.B) * 3 + ALPHA.C) * 3 + ALPHA.D); - const int blend_flag = m_dev->GetBlendFlags(blend_index); + m_om_bsel.blend_index = uint8(((ALPHA.A * 3 + ALPHA.B) * 3 + ALPHA.C) * 3 + ALPHA.D); + const int blend_flag = m_dev->GetBlendFlags(m_om_bsel.blend_index); // Do the multiplication in shader for blending accumulation: Cs*As + Cd or Cs*Af + Cd const bool accumulation_blend = !!(blend_flag & BLEND_ACCU); diff --git a/plugins/GSdx/Renderers/DX11/GSTextureFX11.cpp b/plugins/GSdx/Renderers/DX11/GSTextureFX11.cpp index b7f1aab6db..fdf5b51c83 100644 --- a/plugins/GSdx/Renderers/DX11/GSTextureFX11.cpp +++ b/plugins/GSdx/Renderers/DX11/GSTextureFX11.cpp @@ -351,9 +351,7 @@ void GSDevice11::SetupOM(OMDepthStencilSelector dssel, OMBlendSelector bsel, uin if(bsel.abe) { - int i = ((bsel.a * 3 + bsel.b) * 3 + bsel.c) * 3 + bsel.d; - - HWBlend blend = GetBlend(i); + HWBlend blend = GetBlend(bsel.blend_index); bd.RenderTarget[0].BlendOp = (D3D11_BLEND_OP)blend.op; bd.RenderTarget[0].SrcBlend = (D3D11_BLEND)blend.src; bd.RenderTarget[0].DestBlend = (D3D11_BLEND)blend.dst;