mirror of https://github.com/PCSX2/pcsx2.git
GSdx-d3d: Rename Blend Selector to better match opengl code.
Use member name. om_bsel - > m_om_bsel
This commit is contained in:
parent
41459e6a2c
commit
ef3802b67a
|
@ -370,7 +370,7 @@ void GSRendererDX::ResetStates()
|
||||||
m_ps_sel.key = 0;
|
m_ps_sel.key = 0;
|
||||||
|
|
||||||
m_ps_ssel.key = 0;
|
m_ps_ssel.key = 0;
|
||||||
om_bsel.key = 0;
|
m_om_bsel.key = 0;
|
||||||
m_om_dssel.key = 0;
|
m_om_dssel.key = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,21 +406,21 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
|
||||||
|
|
||||||
if (!IsOpaque())
|
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;
|
m_om_bsel.a = m_context->ALPHA.A;
|
||||||
om_bsel.b = m_context->ALPHA.B;
|
m_om_bsel.b = m_context->ALPHA.B;
|
||||||
om_bsel.c = m_context->ALPHA.C;
|
m_om_bsel.c = m_context->ALPHA.C;
|
||||||
om_bsel.d = m_context->ALPHA.D;
|
m_om_bsel.d = m_context->ALPHA.D;
|
||||||
|
|
||||||
if (m_env.PABE.PABE)
|
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
|
// 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
|
// 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
|
else
|
||||||
{
|
{
|
||||||
|
@ -441,7 +441,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
|
||||||
afix = 0x00000001;
|
afix = 0x00000001;
|
||||||
}
|
}
|
||||||
// Disable writing of the alpha channel
|
// Disable writing of the alpha channel
|
||||||
om_bsel.wa = 0;
|
m_om_bsel.wa = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DATE)
|
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;
|
bool colclip_wrap = m_env.COLCLAMP.CLAMP == 0 && !tex && PRIM->PRIM != GS_POINTLIST;
|
||||||
if (colclip_wrap)
|
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.
|
// No addition neither substraction so no risk of overflow the [0:255] range.
|
||||||
colclip_wrap = false;
|
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.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_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;
|
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
|
// Render RGB color but don't update depth/alpha
|
||||||
// ATE is disabled here
|
// ATE is disabled here
|
||||||
m_om_dssel.zwe = false;
|
m_om_dssel.zwe = false;
|
||||||
om_bsel.wa = false;
|
m_om_bsel.wa = false;
|
||||||
}
|
}
|
||||||
else
|
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.
|
// 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.
|
// 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.
|
// 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)
|
if (!m_context->FBA.FBA)
|
||||||
{
|
{
|
||||||
|
@ -677,7 +677,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
|
||||||
|
|
||||||
SetupIA(sx, sy);
|
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->SetupVS(m_vs_sel, &vs_cb);
|
||||||
dev->SetupGS(m_gs_sel, &gs_cb);
|
dev->SetupGS(m_gs_sel, &gs_cb);
|
||||||
dev->SetupPS(m_ps_sel, &ps_cb, m_ps_ssel);
|
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)
|
if (colclip_wrap)
|
||||||
{
|
{
|
||||||
GSDeviceDX::OMBlendSelector om_bselneg(om_bsel);
|
GSDeviceDX::OMBlendSelector om_bselneg(m_om_bsel);
|
||||||
GSDeviceDX::PSSelector ps_selneg(m_ps_sel);
|
GSDeviceDX::PSSelector ps_selneg(m_ps_sel);
|
||||||
|
|
||||||
om_bselneg.negative = 1;
|
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->SetupPS(ps_selneg, &ps_cb, m_ps_ssel);
|
||||||
|
|
||||||
dev->DrawIndexedPrimitive();
|
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);
|
dev->SetupPS(m_ps_sel, &ps_cb, m_ps_ssel);
|
||||||
|
|
||||||
bool z = m_om_dssel.zwe;
|
bool z = m_om_dssel.zwe;
|
||||||
bool r = om_bsel.wr;
|
bool r = m_om_bsel.wr;
|
||||||
bool g = om_bsel.wg;
|
bool g = m_om_bsel.wg;
|
||||||
bool b = om_bsel.wb;
|
bool b = m_om_bsel.wb;
|
||||||
bool a = om_bsel.wa;
|
bool a = m_om_bsel.wa;
|
||||||
|
|
||||||
switch(m_context->TEST.AFAIL)
|
switch(m_context->TEST.AFAIL)
|
||||||
{
|
{
|
||||||
|
@ -755,18 +755,18 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
|
||||||
if (z || r || g || b || a)
|
if (z || r || g || b || a)
|
||||||
{
|
{
|
||||||
m_om_dssel.zwe = z;
|
m_om_dssel.zwe = z;
|
||||||
om_bsel.wr = r;
|
m_om_bsel.wr = r;
|
||||||
om_bsel.wg = g;
|
m_om_bsel.wg = g;
|
||||||
om_bsel.wb = b;
|
m_om_bsel.wb = b;
|
||||||
om_bsel.wa = a;
|
m_om_bsel.wa = a;
|
||||||
|
|
||||||
dev->SetupOM(m_om_dssel, om_bsel, afix);
|
dev->SetupOM(m_om_dssel, m_om_bsel, afix);
|
||||||
|
|
||||||
dev->DrawIndexedPrimitive();
|
dev->DrawIndexedPrimitive();
|
||||||
|
|
||||||
if (colclip_wrap)
|
if (colclip_wrap)
|
||||||
{
|
{
|
||||||
GSDeviceDX::OMBlendSelector om_bselneg(om_bsel);
|
GSDeviceDX::OMBlendSelector om_bselneg(m_om_bsel);
|
||||||
GSDeviceDX::PSSelector ps_selneg(m_ps_sel);
|
GSDeviceDX::PSSelector ps_selneg(m_ps_sel);
|
||||||
|
|
||||||
om_bselneg.negative = 1;
|
om_bselneg.negative = 1;
|
||||||
|
|
|
@ -53,7 +53,7 @@ protected:
|
||||||
GSDeviceDX::PSSelector m_ps_sel;
|
GSDeviceDX::PSSelector m_ps_sel;
|
||||||
|
|
||||||
GSDeviceDX::PSSamplerSelector m_ps_ssel;
|
GSDeviceDX::PSSamplerSelector m_ps_ssel;
|
||||||
GSDeviceDX::OMBlendSelector om_bsel;
|
GSDeviceDX::OMBlendSelector m_om_bsel;
|
||||||
GSDeviceDX::OMDepthStencilSelector m_om_dssel;
|
GSDeviceDX::OMDepthStencilSelector m_om_dssel;
|
||||||
|
|
||||||
GSDeviceDX::PSConstantBuffer ps_cb;
|
GSDeviceDX::PSConstantBuffer ps_cb;
|
||||||
|
|
|
@ -133,24 +133,24 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask()
|
||||||
// FIXME GSVector will be nice here
|
// FIXME GSVector will be nice here
|
||||||
uint8 rg_mask = fbmask & 0xFF;
|
uint8 rg_mask = fbmask & 0xFF;
|
||||||
uint8 ba_mask = (fbmask >> 8) & 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)
|
// 2 Select the new mask (Please someone put SSE here)
|
||||||
if (rg_mask != 0xFF)
|
if (rg_mask != 0xFF)
|
||||||
{
|
{
|
||||||
if (write_ba)
|
if (write_ba)
|
||||||
{
|
{
|
||||||
om_bsel.wb = 1;
|
m_om_bsel.wb = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
om_bsel.wr = 1;
|
m_om_bsel.wr = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((fbmask & 0xFF) != 0xFF)
|
else if ((fbmask & 0xFF) != 0xFF)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
#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
|
#endif
|
||||||
//ASSERT(0);
|
//ASSERT(0);
|
||||||
}
|
}
|
||||||
|
@ -159,17 +159,17 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask()
|
||||||
{
|
{
|
||||||
if (write_ba)
|
if (write_ba)
|
||||||
{
|
{
|
||||||
om_bsel.wa = 1;
|
m_om_bsel.wa = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
om_bsel.wg = 1;
|
m_om_bsel.wg = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((fbmask & 0xFF) != 0xFF)
|
else if ((fbmask & 0xFF) != 0xFF)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
#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
|
#endif
|
||||||
//ASSERT(0);
|
//ASSERT(0);
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask()
|
||||||
{
|
{
|
||||||
m_ps_sel.dfmt = GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt;
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,13 +61,13 @@ void GSRendererDX9::EmulateTextureShuffleAndFbmask()
|
||||||
if (m_texture_shuffle)
|
if (m_texture_shuffle)
|
||||||
{
|
{
|
||||||
// Texture shuffle is not supported so make sure nothing is written on all channels.
|
// Texture shuffle is not supported so make sure nothing is written on all channels.
|
||||||
om_bsel.wrgba = 0;
|
m_om_bsel.wrgba = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ps_sel.dfmt = GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt;
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue