Remove cull/front face

This commit is contained in:
Vincent Lejeune 2015-10-10 19:04:09 +02:00
parent dd1afe85ae
commit e086b7a522
6 changed files with 27 additions and 41 deletions

View File

@ -268,20 +268,25 @@ bool D3D12GSRender::LoadProgram()
D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF,
};
prop.Rasterization = CD3D12_RASTERIZER_DESC;
switch (m_set_cull_face)
if (rsx::method_registers[NV4097_SET_CULL_FACE_ENABLE])
{
case CELL_GCM_FRONT:
prop.Rasterization.CullMode = D3D12_CULL_MODE_FRONT;
break;
case CELL_GCM_BACK:
prop.Rasterization.CullMode = D3D12_CULL_MODE_BACK;
break;
default:
prop.Rasterization.CullMode = D3D12_CULL_MODE_NONE;
break;
switch (rsx::method_registers[NV4097_SET_CULL_FACE])
{
case CELL_GCM_FRONT:
prop.Rasterization.CullMode = D3D12_CULL_MODE_FRONT;
break;
case CELL_GCM_BACK:
prop.Rasterization.CullMode = D3D12_CULL_MODE_BACK;
break;
default:
prop.Rasterization.CullMode = D3D12_CULL_MODE_NONE;
break;
}
}
else
prop.Rasterization.CullMode = D3D12_CULL_MODE_NONE;
switch (m_front_face)
switch (rsx::method_registers[NV4097_SET_FRONT_FACE])
{
case CELL_GCM_CW:
prop.Rasterization.FrontCounterClockwise = FALSE;

View File

@ -1667,7 +1667,7 @@ void GLGSRender::end()
// 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_logic_op, GL_LOGIC_OP);
Enable(m_set_cull_face, GL_CULL_FACE);
// Enable(m_set_cull_face, GL_CULL_FACE);
Enable(m_set_dither, GL_DITHER);
// Enable(m_set_stencil_test, GL_STENCIL_TEST);
Enable(m_set_line_smooth, GL_LINE_SMOOTH);
@ -1865,15 +1865,15 @@ void GLGSRender::end()
checkForGlError("glBlendColor");
}
if (m_set_cull_face)
// if (m_set_cull_face)
{
glCullFace(m_cull_face);
// glCullFace(m_cull_face);
checkForGlError("glCullFace");
}
if (m_set_front_face)
// if (m_set_front_face)
{
glFrontFace(m_front_face);
// glFrontFace(m_front_face);
checkForGlError("glFrontFace");
}

View File

@ -574,26 +574,17 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
// Cull face
case NV4097_SET_CULL_FACE_ENABLE:
{
m_set_cull_face = ARGS(0) ? true : false;
notifyRasterizerStateChange();
break;
}
case NV4097_SET_CULL_FACE:
{
m_cull_face = ARGS(0);
notifyRasterizerStateChange();
break;
}
// Front face
case NV4097_SET_FRONT_FACE:
{
m_front_face = ARGS(0);
notifyRasterizerStateChange();
break;
}
// Blending
case NV4097_SET_BLEND_ENABLE:

View File

@ -348,10 +348,6 @@ public:
u8 m_swizzle_height;
u32 m_swizzle_offset;
// Cull face
bool m_set_cull_face;
u32 m_cull_face;
// Shader
u16 m_shader_window_height;
u8 m_shader_window_origin;
@ -361,10 +357,6 @@ public:
u32 m_vertex_data_base_offset;
u32 m_vertex_data_base_index;
// Front face
bool m_set_front_face;
u32 m_front_face;
// Frequency divider
u32 m_set_frequency_divider_operation;
@ -397,7 +389,6 @@ protected:
m_set_depth_bounds_test = false;
rsx::method_registers[NV4097_SET_BLEND_ENABLE_MRT] = 0;
rsx::method_registers[NV4097_SET_BLEND_ENABLE] = false;
m_set_cull_face = false;
m_set_dither = false;
m_set_scissor_horizontal = false;
m_set_scissor_vertical = false;
@ -424,8 +415,8 @@ protected:
m_restart_index = 0xffffffff;
m_front_polygon_mode = 0x1b02; // GL_FILL
m_back_polygon_mode = 0x1b02; // GL_FILL
m_front_face = 0x0901; // GL_CCW
m_cull_face = 0x0405; // GL_BACK
rsx::method_registers[NV4097_SET_FRONT_FACE] = 0x0901; // GL_CCW
rsx::method_registers[NV4097_SET_CULL_FACE] = 0x0405; // GL_BACK
rsx::method_registers[NV4097_SET_ALPHA_FUNC] = 0x0207; // GL_ALWAYS
rsx::method_registers[NV4097_SET_ALPHA_REF] = 0.0f;
m_shade_mode = 0x1D01; // GL_SMOOTH
@ -496,8 +487,7 @@ protected:
m_set_context_dma_color_c = false;
m_set_context_dma_color_d = false;
m_set_context_dma_z = false;
m_set_cull_face = false;
m_set_front_face = false;
rsx::method_registers[NV4097_SET_CULL_FACE_ENABLE] = false;
rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE] = false;
rsx::method_registers[NV4097_SET_ALPHA_FUNC] = false;
rsx::method_registers[NV4097_SET_ALPHA_REF] = false;

View File

@ -474,7 +474,7 @@ void SetupRsxRenderingStates(vm::ptr<CellGcmContextData>& cntxt)
rsx::method_registers[NV4097_SET_BLEND_ENABLE] = false;
rsx::method_registers[NV4097_SET_BLEND_ENABLE_MRT] = false;
// r.m_set_logic_op = false;
r.m_set_cull_face = false;
rsx::method_registers[NV4097_SET_CULL_FACE_ENABLE] = false;
r.m_set_depth_bounds_test = false;
rsx::method_registers[NV4097_SET_DEPTH_TEST_ENABLE] = false;
r.m_set_poly_offset_fill = false;

View File

@ -496,7 +496,7 @@ void RSXDebugger::GetFlags()
LIST_FLAGS_ADD("Alpha test", rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE]);
LIST_FLAGS_ADD("Blend", rsx::method_registers[NV4097_SET_BLEND_ENABLE]);
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", rsx::method_registers[NV4097_SET_CULL_FACE]);
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("Dither", render.m_set_dither);
@ -653,7 +653,7 @@ void RSXDebugger::SetFlags(wxListEvent& event)
{
case 0: rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE] ^= true; break;
case 1: rsx::method_registers[NV4097_SET_BLEND_ENABLE] ^= true; break;
case 2: render.m_set_cull_face ^= true; break;
case 2: rsx::method_registers[NV4097_SET_CULL_FACE] ^= true; break;
case 3: render.m_set_depth_bounds_test ^= true; break;
// case 4: render.m_set_depth_test ^= true; break;
case 5: render.m_set_dither ^= true; break;