Remove depth

This commit is contained in:
Vincent Lejeune 2015-10-10 00:28:28 +02:00
parent ed61023dd3
commit 529efd6ac8
6 changed files with 22 additions and 47 deletions

View file

@ -232,9 +232,9 @@ bool D3D12GSRender::LoadProgram()
LOG_ERROR(RSX, "Bad surface color target: %d", m_surface_color_target); LOG_ERROR(RSX, "Bad surface color target: %d", m_surface_color_target);
} }
prop.DepthStencil.DepthEnable = m_set_depth_test; prop.DepthStencil.DepthEnable = !!(rsx::method_registers[NV4097_SET_DEPTH_TEST_ENABLE]);
prop.DepthStencil.DepthWriteMask = m_depth_mask ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO; prop.DepthStencil.DepthWriteMask = !!(rsx::method_registers[NV4097_SET_DEPTH_MASK]) ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO;
prop.DepthStencil.DepthFunc = getCompareFunc(m_depth_func); prop.DepthStencil.DepthFunc = getCompareFunc(rsx::method_registers[NV4097_SET_DEPTH_FUNC]);
prop.DepthStencil.StencilEnable = m_set_stencil_test; prop.DepthStencil.StencilEnable = m_set_stencil_test;
prop.DepthStencil.StencilReadMask = m_stencil_func_mask; prop.DepthStencil.StencilReadMask = m_stencil_func_mask;
prop.DepthStencil.StencilWriteMask = m_stencil_mask; prop.DepthStencil.StencilWriteMask = m_stencil_mask;

View file

@ -1662,7 +1662,7 @@ void GLGSRender::end()
draw_array_first = 0; draw_array_first = 0;
} }
Enable(m_set_depth_test, GL_DEPTH_TEST); // Enable(m_set_depth_test, GL_DEPTH_TEST);
Enable(m_set_alpha_test, GL_ALPHA_TEST); Enable(m_set_alpha_test, GL_ALPHA_TEST);
Enable(m_set_blend || m_set_blend_mrt1 || m_set_blend_mrt2 || m_set_blend_mrt3, GL_BLEND); Enable(m_set_blend || m_set_blend_mrt1 || m_set_blend_mrt2 || m_set_blend_mrt3, GL_BLEND);
Enable(m_set_scissor_horizontal && m_set_scissor_vertical, GL_SCISSOR_TEST); Enable(m_set_scissor_horizontal && m_set_scissor_vertical, GL_SCISSOR_TEST);
@ -1805,15 +1805,15 @@ void GLGSRender::end()
checkForGlError("glShadeModel"); checkForGlError("glShadeModel");
} }
if (m_set_depth_mask) // if (m_set_depth_mask)
{ {
glDepthMask(m_depth_mask); // glDepthMask(m_depth_mask);
checkForGlError("glDepthMask"); checkForGlError("glDepthMask");
} }
if (m_set_depth_func) // if (m_set_depth_func)
{ {
glDepthFunc(m_depth_func); // glDepthFunc(m_depth_func);
checkForGlError("glDepthFunc"); checkForGlError("glDepthFunc");
} }

View file

@ -807,26 +807,15 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
// Depth testing // Depth testing
case NV4097_SET_DEPTH_TEST_ENABLE: case NV4097_SET_DEPTH_TEST_ENABLE:
{
m_set_depth_test = ARGS(0) ? true : false;
break; break;
}
case NV4097_SET_DEPTH_FUNC: case NV4097_SET_DEPTH_FUNC:
{
m_set_depth_func = true;
m_depth_func = ARGS(0);
notifyDepthStencilStateChange(); notifyDepthStencilStateChange();
break; break;
}
case NV4097_SET_DEPTH_MASK: case NV4097_SET_DEPTH_MASK:
{
m_set_depth_mask = true;
m_depth_mask = ARGS(0);
notifyDepthStencilStateChange(); notifyDepthStencilStateChange();
break; break;
}
// Polygon mode/offset // Polygon mode/offset
case NV4097_SET_FRONT_POLYGON_MODE: case NV4097_SET_FRONT_POLYGON_MODE:
@ -863,7 +852,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
case NV4097_SET_POLYGON_OFFSET_SCALE_FACTOR: case NV4097_SET_POLYGON_OFFSET_SCALE_FACTOR:
{ {
m_set_depth_test = true; //m_set_depth_test = true;
m_set_poly_offset_mode = true; m_set_poly_offset_mode = true;
const u32 a0 = ARGS(0); const u32 a0 = ARGS(0);
@ -879,7 +868,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
case NV4097_SET_POLYGON_OFFSET_BIAS: case NV4097_SET_POLYGON_OFFSET_BIAS:
{ {
m_set_depth_test = true; //m_set_depth_test = true;
m_set_poly_offset_mode = true; m_set_poly_offset_mode = true;
const u32 a0 = ARGS(0); const u32 a0 = ARGS(0);
@ -1780,14 +1769,8 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
// Zcull // Zcull
case NV4097_SET_ZCULL_EN: case NV4097_SET_ZCULL_EN:
{
const u32 a0 = ARGS(0);
m_set_depth_test = a0 & 0x1 ? true : false;
m_set_stencil_test = a0 & 0x2 ? true : false;
notifyDepthStencilStateChange(); notifyDepthStencilStateChange();
break; break;
}
case NV4097_SET_ZCULL_CONTROL0: case NV4097_SET_ZCULL_CONTROL0:
{ {

View file

@ -191,13 +191,6 @@ public:
float m_clip_min; float m_clip_min;
float m_clip_max; float m_clip_max;
// Depth test
bool m_set_depth_test;
bool m_set_depth_func;
int m_depth_func;
bool m_set_depth_mask;
u32 m_depth_mask;
// Depth bound test // Depth bound test
bool m_set_depth_bounds_test; bool m_set_depth_bounds_test;
bool m_set_depth_bounds; bool m_set_depth_bounds;
@ -467,7 +460,6 @@ protected:
flip_handler.set(0); flip_handler.set(0);
vblank_handler.set(0); vblank_handler.set(0);
user_handler.set(0); user_handler.set(0);
m_set_depth_test = false;
m_set_alpha_test = false; m_set_alpha_test = false;
m_set_depth_bounds_test = false; m_set_depth_bounds_test = false;
m_set_blend = false; m_set_blend = false;
@ -510,8 +502,7 @@ protected:
m_alpha_ref = 0.0f; m_alpha_ref = 0.0f;
m_logic_op = 0x1503; // GL_COPY m_logic_op = 0x1503; // GL_COPY
m_shade_mode = 0x1D01; // GL_SMOOTH m_shade_mode = 0x1D01; // GL_SMOOTH
m_depth_mask = 1;
m_depth_func = 0x0201; // GL_LESS
m_depth_bounds_min = 0.0; m_depth_bounds_min = 0.0;
m_depth_bounds_max = 1.0; m_depth_bounds_max = 1.0;
m_clip_min = 0.0; m_clip_min = 0.0;
@ -552,12 +543,13 @@ protected:
void Reset() void Reset()
{ {
rsx::method_registers[NV4097_SET_DEPTH_TEST_ENABLE] = false;
rsx::method_registers[NV4097_SET_DEPTH_MASK] = 1;
rsx::method_registers[NV4097_SET_DEPTH_FUNC] = 0x0201;
m_set_dither = false; m_set_dither = false;
m_set_color_mask = false; m_set_color_mask = false;
m_set_clip = false; m_set_clip = false;
m_set_depth_test = false;
m_set_depth_func = false;
m_set_depth_mask = false;
m_set_depth_bounds_test = false; m_set_depth_bounds_test = false;
m_set_depth_bounds = false; m_set_depth_bounds = false;
m_set_viewport_horizontal = false; m_set_viewport_horizontal = false;

View file

@ -469,14 +469,14 @@ void SetupRsxRenderingStates(vm::ptr<CellGcmContextData>& cntxt)
//TODO: use cntxt //TODO: use cntxt
GSRender& r = Emu.GetGSManager().GetRender(); 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; 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;
r.m_set_depth_mask = true; r.m_depth_mask = 0; rsx::method_registers[NV4097_SET_DEPTH_MASK] = 0;
r.m_set_alpha_test = false; r.m_set_alpha_test = false;
r.m_set_blend = false; r.m_set_blend = false;
r.m_set_blend_mrt1 = r.m_set_blend_mrt2 = r.m_set_blend_mrt3 = false; r.m_set_blend_mrt1 = r.m_set_blend_mrt2 = r.m_set_blend_mrt3 = false;
r.m_set_logic_op = false; r.m_set_logic_op = false;
r.m_set_cull_face = false; r.m_set_cull_face = false;
r.m_set_depth_bounds_test = false; r.m_set_depth_bounds_test = false;
r.m_set_depth_test = false; rsx::method_registers[NV4097_SET_DEPTH_TEST_ENABLE] = false;
r.m_set_poly_offset_fill = false; r.m_set_poly_offset_fill = false;
r.m_set_stencil_test = false; r.m_set_stencil_test = false;
r.m_set_two_sided_stencil_test_enable = false; r.m_set_two_sided_stencil_test_enable = false;

View file

@ -498,7 +498,7 @@ void RSXDebugger::GetFlags()
LIST_FLAGS_ADD("Scissor", render.m_set_scissor_horizontal && render.m_set_scissor_vertical); LIST_FLAGS_ADD("Scissor", render.m_set_scissor_horizontal && render.m_set_scissor_vertical);
LIST_FLAGS_ADD("Cull face", render.m_set_cull_face); LIST_FLAGS_ADD("Cull face", render.m_set_cull_face);
LIST_FLAGS_ADD("Depth bounds test", render.m_set_depth_bounds_test); LIST_FLAGS_ADD("Depth bounds test", render.m_set_depth_bounds_test);
LIST_FLAGS_ADD("Depth test", render.m_set_depth_test); // LIST_FLAGS_ADD("Depth test", render.m_set_depth_test);
LIST_FLAGS_ADD("Dither", render.m_set_dither); LIST_FLAGS_ADD("Dither", render.m_set_dither);
LIST_FLAGS_ADD("Line smooth", render.m_set_line_smooth); LIST_FLAGS_ADD("Line smooth", render.m_set_line_smooth);
LIST_FLAGS_ADD("Logic op", render.m_set_logic_op); LIST_FLAGS_ADD("Logic op", render.m_set_logic_op);
@ -612,9 +612,9 @@ void RSXDebugger::GetSettings()
LIST_SETTINGS_ADD("Context DMA Color D", wxString::Format("0x%x", render.m_context_dma_color_d)); LIST_SETTINGS_ADD("Context DMA Color D", wxString::Format("0x%x", render.m_context_dma_color_d));
LIST_SETTINGS_ADD("Context DMA Zeta", wxString::Format("0x%x", render.m_context_dma_z)); LIST_SETTINGS_ADD("Context DMA Zeta", wxString::Format("0x%x", render.m_context_dma_z));
LIST_SETTINGS_ADD("Depth bounds", wxString::Format("Min:%f, Max:%f", render.m_depth_bounds_min, render.m_depth_bounds_max)); LIST_SETTINGS_ADD("Depth bounds", wxString::Format("Min:%f, Max:%f", render.m_depth_bounds_min, render.m_depth_bounds_max));
LIST_SETTINGS_ADD("Depth func", !(render.m_set_depth_func) ? "(none)" : wxString::Format("0x%x (%s)", // LIST_SETTINGS_ADD("Depth func", !(render.m_set_depth_func) ? "(none)" : wxString::Format("0x%x (%s)",
render.m_depth_func, // render.m_depth_func,
ParseGCMEnum(render.m_depth_func, CELL_GCM_ENUM))); // ParseGCMEnum(render.m_depth_func, CELL_GCM_ENUM)));
LIST_SETTINGS_ADD("Draw mode", wxString::Format("%d (%s)", LIST_SETTINGS_ADD("Draw mode", wxString::Format("%d (%s)",
render.draw_mode, render.draw_mode,
ParseGCMEnum(render.draw_mode, CELL_GCM_PRIMITIVE_ENUM))); ParseGCMEnum(render.draw_mode, CELL_GCM_PRIMITIVE_ENUM)));
@ -655,7 +655,7 @@ void RSXDebugger::SetFlags(wxListEvent& event)
case 1: render.m_set_blend ^= true; break; case 1: render.m_set_blend ^= true; break;
case 2: render.m_set_cull_face ^= true; break; case 2: render.m_set_cull_face ^= true; break;
case 3: render.m_set_depth_bounds_test ^= true; break; case 3: render.m_set_depth_bounds_test ^= true; break;
case 4: render.m_set_depth_test ^= true; break; // case 4: render.m_set_depth_test ^= true; break;
case 5: render.m_set_dither ^= true; break; case 5: render.m_set_dither ^= true; break;
case 6: render.m_set_line_smooth ^= true; break; case 6: render.m_set_line_smooth ^= true; break;
case 7: render.m_set_logic_op ^= true; break; case 7: render.m_set_logic_op ^= true; break;