mirror of https://github.com/PCSX2/pcsx2.git
GSdx-d3d: Mask alpha channel on 24bit format.
dfmt is not supported but we can use the variable to select the frame buffer format and later disable writting to the alpha channel. MGS3 sees an improvement, and possibly other games as well. So far didn't spot any regressions.
This commit is contained in:
parent
f3d738d771
commit
8acc319a4a
|
@ -172,6 +172,7 @@ public:
|
||||||
// *** Word 1
|
// *** Word 1
|
||||||
// Format
|
// Format
|
||||||
uint32 fmt:4;
|
uint32 fmt:4;
|
||||||
|
uint32 dfmt:2;
|
||||||
// Alpha extension/Correction
|
// Alpha extension/Correction
|
||||||
uint32 aem:1;
|
uint32 aem:1;
|
||||||
uint32 fba:1;
|
uint32 fba:1;
|
||||||
|
@ -203,7 +204,7 @@ public:
|
||||||
uint32 tcoffsethack:1;
|
uint32 tcoffsethack:1;
|
||||||
uint32 point_sampler:1;
|
uint32 point_sampler:1;
|
||||||
|
|
||||||
uint32 _free:32;
|
uint32 _free:30;
|
||||||
};
|
};
|
||||||
|
|
||||||
uint64 key;
|
uint64 key;
|
||||||
|
|
|
@ -475,6 +475,12 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
|
||||||
|
|
||||||
EmulateTextureShuffleAndFbmask();
|
EmulateTextureShuffleAndFbmask();
|
||||||
|
|
||||||
|
if(m_ps_sel.dfmt == 1)
|
||||||
|
{
|
||||||
|
// Disable writing of the alpha channel
|
||||||
|
om_bsel.wa = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if(DATE)
|
if(DATE)
|
||||||
{
|
{
|
||||||
if(dev->HasStencil())
|
if(dev->HasStencil())
|
||||||
|
|
|
@ -50,7 +50,7 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask()
|
||||||
// Note: D3D1011 is limited and can't read the current framebuffer so we can't have PS_FBMASK and PS_WRITE_RG shaders ported and working.
|
// Note: D3D1011 is limited and can't read the current framebuffer so we can't have PS_FBMASK and PS_WRITE_RG shaders ported and working.
|
||||||
if (m_texture_shuffle) {
|
if (m_texture_shuffle) {
|
||||||
m_ps_sel.shuffle = 1;
|
m_ps_sel.shuffle = 1;
|
||||||
m_ps_sel.fmt = 0;
|
m_ps_sel.dfmt = 0;
|
||||||
|
|
||||||
const GIFRegXYOFFSET& o = m_context->XYOFFSET;
|
const GIFRegXYOFFSET& o = m_context->XYOFFSET;
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask()
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//m_ps_sel.fmt = 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();
|
om_bsel.wrgba = ~GSVector4i::load((int)m_context->FRAME.FBMSK).eq8(GSVector4i::xffffffff()).mask();
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,11 +58,16 @@ bool GSRendererDX9::CreateDevice(GSDevice* dev)
|
||||||
|
|
||||||
void GSRendererDX9::EmulateTextureShuffleAndFbmask()
|
void GSRendererDX9::EmulateTextureShuffleAndFbmask()
|
||||||
{
|
{
|
||||||
if (m_texture_shuffle) {
|
if (m_texture_shuffle)
|
||||||
|
{
|
||||||
// We can do a partial port for D3D9 that skips the draw call to give it a slight improvement.
|
// We can do a partial port for D3D9 that skips the draw call to give it a slight improvement.
|
||||||
// It's still broken but more bearable. Broken effect is on the screen but fully instead of vertical lines.
|
// It's still broken but more bearable. Broken effect is on the screen but fully instead of vertical lines.
|
||||||
throw GSDXRecoverableError();
|
throw GSDXRecoverableError();
|
||||||
} else {
|
}
|
||||||
|
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();
|
om_bsel.wrgba = ~GSVector4i::load((int)m_context->FRAME.FBMSK).eq8(GSVector4i::xffffffff()).mask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue