From ef3802b67a84a69a4137722236e37bd40c530677 Mon Sep 17 00:00:00 2001 From: lightningterror Date: Tue, 13 Nov 2018 01:56:11 +0100 Subject: [PATCH] GSdx-d3d: Rename Blend Selector to better match opengl code. Use member name. om_bsel - > m_om_bsel --- plugins/GSdx/GSRendererDX.cpp | 52 ++++++++++++++++----------------- plugins/GSdx/GSRendererDX.h | 2 +- plugins/GSdx/GSRendererDX11.cpp | 16 +++++----- plugins/GSdx/GSRendererDX9.cpp | 4 +-- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/plugins/GSdx/GSRendererDX.cpp b/plugins/GSdx/GSRendererDX.cpp index d304d3862a..939c20a25a 100644 --- a/plugins/GSdx/GSRendererDX.cpp +++ b/plugins/GSdx/GSRendererDX.cpp @@ -370,7 +370,7 @@ void GSRendererDX::ResetStates() m_ps_sel.key = 0; m_ps_ssel.key = 0; - om_bsel.key = 0; + m_om_bsel.key = 0; m_om_dssel.key = 0; } @@ -406,21 +406,21 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc if (!IsOpaque()) { - om_bsel.abe = PRIM->ABE || PRIM->AA1 && m_vt.m_primclass == GS_LINE_CLASS; + m_om_bsel.abe = PRIM->ABE || PRIM->AA1 && m_vt.m_primclass == GS_LINE_CLASS; - om_bsel.a = m_context->ALPHA.A; - om_bsel.b = m_context->ALPHA.B; - om_bsel.c = m_context->ALPHA.C; - om_bsel.d = m_context->ALPHA.D; + m_om_bsel.a = m_context->ALPHA.A; + m_om_bsel.b = m_context->ALPHA.B; + m_om_bsel.c = m_context->ALPHA.C; + m_om_bsel.d = m_context->ALPHA.D; if (m_env.PABE.PABE) { - if (om_bsel.a == 0 && om_bsel.b == 1 && om_bsel.c == 0 && om_bsel.d == 1) + if (m_om_bsel.a == 0 && m_om_bsel.b == 1 && m_om_bsel.c == 0 && m_om_bsel.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 - om_bsel.abe = 0; + m_om_bsel.abe = 0; } else { @@ -441,7 +441,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc afix = 0x00000001; } // Disable writing of the alpha channel - om_bsel.wa = 0; + m_om_bsel.wa = 0; } if (DATE) @@ -545,7 +545,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc bool colclip_wrap = m_env.COLCLAMP.CLAMP == 0 && !tex && PRIM->PRIM != GS_POINTLIST; if (colclip_wrap) { - if ((m_context->ALPHA.A == m_context->ALPHA.B) || !om_bsel.abe) // Optimize-away colclip + if ((m_context->ALPHA.A == m_context->ALPHA.B) || !m_om_bsel.abe) // Optimize-away colclip { // No addition neither substraction so no risk of overflow the [0:255] range. colclip_wrap = false; @@ -557,7 +557,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc } } - m_ps_sel.clr1 = om_bsel.IsCLR1(); + m_ps_sel.clr1 = m_om_bsel.IsCLR1(); m_ps_sel.fba = m_context->FBA.FBA; m_ps_sel.aout = m_context->FRAME.PSM == PSM_PSMCT16 || m_context->FRAME.PSM == PSM_PSMCT16S || (m_context->FRAME.FBMSK & 0xff000000) == 0x7f000000 ? 1 : 0; m_ps_sel.aout &= !m_ps_sel.shuffle; @@ -611,7 +611,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc // Render RGB color but don't update depth/alpha // ATE is disabled here m_om_dssel.zwe = false; - om_bsel.wa = false; + m_om_bsel.wa = false; } else { @@ -622,7 +622,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc // to only draw pixels which would cause the destination alpha test to fail in the future once. // Unfortunately this also means only drawing those pixels at all, which is why this is a hack. // The interaction with FBA in D3D9 is probably less than ideal. - if (UserHacks_AlphaStencil && DATE && dev->HasStencil() && om_bsel.wa && !m_context->TEST.ATE) + if (UserHacks_AlphaStencil && DATE && dev->HasStencil() && m_om_bsel.wa && !m_context->TEST.ATE) { if (!m_context->FBA.FBA) { @@ -677,7 +677,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc SetupIA(sx, sy); - dev->SetupOM(m_om_dssel, om_bsel, afix); + dev->SetupOM(m_om_dssel, m_om_bsel, afix); dev->SetupVS(m_vs_sel, &vs_cb); dev->SetupGS(m_gs_sel, &gs_cb); dev->SetupPS(m_ps_sel, &ps_cb, m_ps_ssel); @@ -690,7 +690,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc if (colclip_wrap) { - GSDeviceDX::OMBlendSelector om_bselneg(om_bsel); + GSDeviceDX::OMBlendSelector om_bselneg(m_om_bsel); GSDeviceDX::PSSelector ps_selneg(m_ps_sel); om_bselneg.negative = 1; @@ -700,7 +700,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc dev->SetupPS(ps_selneg, &ps_cb, m_ps_ssel); dev->DrawIndexedPrimitive(); - dev->SetupOM(m_om_dssel, om_bsel, afix); + dev->SetupOM(m_om_dssel, m_om_bsel, afix); } } @@ -724,10 +724,10 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc dev->SetupPS(m_ps_sel, &ps_cb, m_ps_ssel); bool z = m_om_dssel.zwe; - bool r = om_bsel.wr; - bool g = om_bsel.wg; - bool b = om_bsel.wb; - bool a = om_bsel.wa; + bool r = m_om_bsel.wr; + bool g = m_om_bsel.wg; + bool b = m_om_bsel.wb; + bool a = m_om_bsel.wa; switch(m_context->TEST.AFAIL) { @@ -755,18 +755,18 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc if (z || r || g || b || a) { m_om_dssel.zwe = z; - om_bsel.wr = r; - om_bsel.wg = g; - om_bsel.wb = b; - om_bsel.wa = a; + m_om_bsel.wr = r; + m_om_bsel.wg = g; + m_om_bsel.wb = b; + m_om_bsel.wa = a; - dev->SetupOM(m_om_dssel, om_bsel, afix); + dev->SetupOM(m_om_dssel, m_om_bsel, afix); dev->DrawIndexedPrimitive(); if (colclip_wrap) { - GSDeviceDX::OMBlendSelector om_bselneg(om_bsel); + GSDeviceDX::OMBlendSelector om_bselneg(m_om_bsel); GSDeviceDX::PSSelector ps_selneg(m_ps_sel); om_bselneg.negative = 1; diff --git a/plugins/GSdx/GSRendererDX.h b/plugins/GSdx/GSRendererDX.h index 665ba71cc2..1964a133ce 100644 --- a/plugins/GSdx/GSRendererDX.h +++ b/plugins/GSdx/GSRendererDX.h @@ -53,7 +53,7 @@ protected: GSDeviceDX::PSSelector m_ps_sel; GSDeviceDX::PSSamplerSelector m_ps_ssel; - GSDeviceDX::OMBlendSelector om_bsel; + GSDeviceDX::OMBlendSelector m_om_bsel; GSDeviceDX::OMDepthStencilSelector m_om_dssel; GSDeviceDX::PSConstantBuffer ps_cb; diff --git a/plugins/GSdx/GSRendererDX11.cpp b/plugins/GSdx/GSRendererDX11.cpp index 02b4419d4d..9ecacd9fc5 100644 --- a/plugins/GSdx/GSRendererDX11.cpp +++ b/plugins/GSdx/GSRendererDX11.cpp @@ -133,24 +133,24 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask() // FIXME GSVector will be nice here uint8 rg_mask = fbmask & 0xFF; uint8 ba_mask = (fbmask >> 8) & 0xFF; - om_bsel.wrgba = 0; + m_om_bsel.wrgba = 0; // 2 Select the new mask (Please someone put SSE here) if (rg_mask != 0xFF) { if (write_ba) { - om_bsel.wb = 1; + m_om_bsel.wb = 1; } else { - om_bsel.wr = 1; + m_om_bsel.wr = 1; } } else if ((fbmask & 0xFF) != 0xFF) { #ifdef _DEBUG - fprintf(stderr, "Please fix me! wb %u wr %u\n", om_bsel.wb, om_bsel.wr); + fprintf(stderr, "Please fix me! wb %u wr %u\n", m_om_bsel.wb, m_om_bsel.wr); #endif //ASSERT(0); } @@ -159,17 +159,17 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask() { if (write_ba) { - om_bsel.wa = 1; + m_om_bsel.wa = 1; } else { - om_bsel.wg = 1; + m_om_bsel.wg = 1; } } else if ((fbmask & 0xFF) != 0xFF) { #ifdef _DEBUG - fprintf(stderr, "Please fix me! wa %u wg %u\n", om_bsel.wa, om_bsel.wg); + fprintf(stderr, "Please fix me! wa %u wg %u\n", m_om_bsel.wa, m_om_bsel.wg); #endif //ASSERT(0); } @@ -178,7 +178,7 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask() { m_ps_sel.dfmt = GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt; - om_bsel.wrgba = ~GSVector4i::load((int)m_context->FRAME.FBMSK).eq8(GSVector4i::xffffffff()).mask(); + m_om_bsel.wrgba = ~GSVector4i::load((int)m_context->FRAME.FBMSK).eq8(GSVector4i::xffffffff()).mask(); } } diff --git a/plugins/GSdx/GSRendererDX9.cpp b/plugins/GSdx/GSRendererDX9.cpp index e5df861376..68193e1364 100644 --- a/plugins/GSdx/GSRendererDX9.cpp +++ b/plugins/GSdx/GSRendererDX9.cpp @@ -61,13 +61,13 @@ void GSRendererDX9::EmulateTextureShuffleAndFbmask() if (m_texture_shuffle) { // Texture shuffle is not supported so make sure nothing is written on all channels. - om_bsel.wrgba = 0; + m_om_bsel.wrgba = 0; } else { m_ps_sel.dfmt = GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt; - om_bsel.wrgba = ~GSVector4i::load((int)m_context->FRAME.FBMSK).eq8(GSVector4i::xffffffff()).mask(); + m_om_bsel.wrgba = ~GSVector4i::load((int)m_context->FRAME.FBMSK).eq8(GSVector4i::xffffffff()).mask(); } }