Remove color mask

This commit is contained in:
Vincent Lejeune 2015-10-10 01:25:54 +02:00
parent 8dd19d1446
commit 403f585a19
6 changed files with 18 additions and 37 deletions

View File

@ -297,16 +297,13 @@ bool D3D12GSRender::LoadProgram()
break;
}
if (m_set_color_mask)
{
UINT8 mask = 0;
mask |= m_color_mask_r ? D3D12_COLOR_WRITE_ENABLE_RED : 0;
mask |= m_color_mask_g ? D3D12_COLOR_WRITE_ENABLE_GREEN : 0;
mask |= m_color_mask_b ? D3D12_COLOR_WRITE_ENABLE_BLUE : 0;
mask |= m_color_mask_a ? D3D12_COLOR_WRITE_ENABLE_ALPHA : 0;
for (unsigned i = 0; i < prop.numMRT; i++)
prop.Blend.RenderTarget[i].RenderTargetWriteMask = mask;
}
UINT8 mask = 0;
mask |= (rsx::method_registers[NV4097_SET_COLOR_MASK] >> 16) & 0xFF ? D3D12_COLOR_WRITE_ENABLE_RED : 0;
mask |= (rsx::method_registers[NV4097_SET_COLOR_MASK] >> 8) & 0xFF ? D3D12_COLOR_WRITE_ENABLE_GREEN : 0;
mask |= rsx::method_registers[NV4097_SET_COLOR_MASK] & 0xFF ? D3D12_COLOR_WRITE_ENABLE_BLUE : 0;
mask |= (rsx::method_registers[NV4097_SET_COLOR_MASK] >> 24) & 0xFF ? D3D12_COLOR_WRITE_ENABLE_ALPHA : 0;
for (unsigned i = 0; i < prop.numMRT; i++)
prop.Blend.RenderTarget[i].RenderTargetWriteMask = mask;
prop.IASet = m_IASet;

View File

@ -1578,9 +1578,9 @@ void GLGSRender::clear_surface(u32 arg)
{
InitDrawBuffers();
if (m_set_color_mask)
// if (m_set_color_mask)
{
glColorMask(m_color_mask_r, m_color_mask_g, m_color_mask_b, m_color_mask_a);
// glColorMask(m_color_mask_r, m_color_mask_g, m_color_mask_b, m_color_mask_a);
checkForGlError("glColorMask");
}
@ -1638,9 +1638,9 @@ void GLGSRender::end()
InitDrawBuffers();
if (m_set_color_mask)
// if (m_set_color_mask)
{
glColorMask(m_color_mask_r, m_color_mask_g, m_color_mask_b, m_color_mask_a);
// glColorMask(m_color_mask_r, m_color_mask_g, m_color_mask_b, m_color_mask_a);
checkForGlError("glColorMask");
}

View File

@ -563,17 +563,8 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
// Color Mask
case NV4097_SET_COLOR_MASK:
{
const u32 a0 = ARGS(0);
m_set_color_mask = true;
m_color_mask_a = a0 & 0x1000000 ? true : false;
m_color_mask_r = a0 & 0x0010000 ? true : false;
m_color_mask_g = a0 & 0x0000100 ? true : false;
m_color_mask_b = a0 & 0x0000001 ? true : false;
notifyRasterizerStateChange();
break;
}
case NV4097_SET_COLOR_MASK_MRT:
{

View File

@ -179,13 +179,6 @@ public:
// Dither
bool m_set_dither;
// Color mask
bool m_set_color_mask;
bool m_color_mask_r;
bool m_color_mask_g;
bool m_color_mask_b;
bool m_color_mask_a;
// Clip
bool m_set_clip;
float m_clip_min;
@ -509,7 +502,7 @@ protected:
rsx::method_registers[NV4097_SET_DEPTH_FUNC] = 0x0201;
m_set_dither = false;
m_set_color_mask = false;
rsx::method_registers[NV4097_SET_COLOR_MASK] = -1;
m_set_clip = false;
m_set_depth_bounds_test = false;
m_set_depth_bounds = false;

View File

@ -468,7 +468,7 @@ void SetupRsxRenderingStates(vm::ptr<CellGcmContextData>& cntxt)
{
//TODO: use cntxt
GSRender& r = Emu.GetGSManager().GetRender();
r.m_set_color_mask = true; r.m_color_mask_a = r.m_color_mask_r = r.m_color_mask_g = r.m_color_mask_b = true;
rsx::method_registers[NV4097_SET_COLOR_MASK] = -1;
rsx::method_registers[NV4097_SET_DEPTH_MASK] = 0;
r.m_set_alpha_test = false;
r.m_set_blend = false;

View File

@ -601,11 +601,11 @@ void RSXDebugger::GetSettings()
render.m_blend_color_b,
render.m_blend_color_a));
LIST_SETTINGS_ADD("Clipping", wxString::Format("Min:%f, Max:%f", render.m_clip_min, render.m_clip_max));
LIST_SETTINGS_ADD("Color mask", !(render.m_set_color_mask) ? "(none)" : wxString::Format("R:%d, G:%d, B:%d, A:%d",
render.m_color_mask_r,
render.m_color_mask_g,
render.m_color_mask_b,
render.m_color_mask_a));
LIST_SETTINGS_ADD("Color mask", !(rsx::method_registers[NV4097_SET_COLOR_MASK]) ? "(none)" : wxString::Format("R:%d, G:%d, B:%d, A:%d",
(rsx::method_registers[NV4097_SET_COLOR_MASK] >> 16) & 0xff,
(rsx::method_registers[NV4097_SET_COLOR_MASK] >> 8) & 0xff,
(rsx::method_registers[NV4097_SET_COLOR_MASK]) & 0xff,
(rsx::method_registers[NV4097_SET_COLOR_MASK] >> 24) & 0xff));
LIST_SETTINGS_ADD("Context DMA Color A", wxString::Format("0x%x", render.m_context_dma_color_a));
LIST_SETTINGS_ADD("Context DMA Color B", wxString::Format("0x%x", render.m_context_dma_color_b));
LIST_SETTINGS_ADD("Context DMA Color C", wxString::Format("0x%x", render.m_context_dma_color_c));