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, D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF,
}; };
prop.Rasterization = CD3D12_RASTERIZER_DESC; prop.Rasterization = CD3D12_RASTERIZER_DESC;
switch (m_set_cull_face) if (rsx::method_registers[NV4097_SET_CULL_FACE_ENABLE])
{ {
case CELL_GCM_FRONT: switch (rsx::method_registers[NV4097_SET_CULL_FACE])
prop.Rasterization.CullMode = D3D12_CULL_MODE_FRONT; {
break; case CELL_GCM_FRONT:
case CELL_GCM_BACK: prop.Rasterization.CullMode = D3D12_CULL_MODE_FRONT;
prop.Rasterization.CullMode = D3D12_CULL_MODE_BACK; break;
break; case CELL_GCM_BACK:
default: prop.Rasterization.CullMode = D3D12_CULL_MODE_BACK;
prop.Rasterization.CullMode = D3D12_CULL_MODE_NONE; break;
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: case CELL_GCM_CW:
prop.Rasterization.FrontCounterClockwise = FALSE; 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_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);
// Enable(m_set_logic_op, GL_LOGIC_OP); // 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_dither, GL_DITHER);
// Enable(m_set_stencil_test, GL_STENCIL_TEST); // Enable(m_set_stencil_test, GL_STENCIL_TEST);
Enable(m_set_line_smooth, GL_LINE_SMOOTH); Enable(m_set_line_smooth, GL_LINE_SMOOTH);
@ -1865,15 +1865,15 @@ void GLGSRender::end()
checkForGlError("glBlendColor"); checkForGlError("glBlendColor");
} }
if (m_set_cull_face) // if (m_set_cull_face)
{ {
glCullFace(m_cull_face); // glCullFace(m_cull_face);
checkForGlError("glCullFace"); checkForGlError("glCullFace");
} }
if (m_set_front_face) // if (m_set_front_face)
{ {
glFrontFace(m_front_face); // glFrontFace(m_front_face);
checkForGlError("glFrontFace"); checkForGlError("glFrontFace");
} }

View File

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

View File

@ -348,10 +348,6 @@ public:
u8 m_swizzle_height; u8 m_swizzle_height;
u32 m_swizzle_offset; u32 m_swizzle_offset;
// Cull face
bool m_set_cull_face;
u32 m_cull_face;
// Shader // Shader
u16 m_shader_window_height; u16 m_shader_window_height;
u8 m_shader_window_origin; u8 m_shader_window_origin;
@ -361,10 +357,6 @@ public:
u32 m_vertex_data_base_offset; u32 m_vertex_data_base_offset;
u32 m_vertex_data_base_index; u32 m_vertex_data_base_index;
// Front face
bool m_set_front_face;
u32 m_front_face;
// Frequency divider // Frequency divider
u32 m_set_frequency_divider_operation; u32 m_set_frequency_divider_operation;
@ -397,7 +389,6 @@ protected:
m_set_depth_bounds_test = false; m_set_depth_bounds_test = false;
rsx::method_registers[NV4097_SET_BLEND_ENABLE_MRT] = 0; rsx::method_registers[NV4097_SET_BLEND_ENABLE_MRT] = 0;
rsx::method_registers[NV4097_SET_BLEND_ENABLE] = false; rsx::method_registers[NV4097_SET_BLEND_ENABLE] = false;
m_set_cull_face = false;
m_set_dither = false; m_set_dither = false;
m_set_scissor_horizontal = false; m_set_scissor_horizontal = false;
m_set_scissor_vertical = false; m_set_scissor_vertical = false;
@ -424,8 +415,8 @@ protected:
m_restart_index = 0xffffffff; m_restart_index = 0xffffffff;
m_front_polygon_mode = 0x1b02; // GL_FILL m_front_polygon_mode = 0x1b02; // GL_FILL
m_back_polygon_mode = 0x1b02; // GL_FILL m_back_polygon_mode = 0x1b02; // GL_FILL
m_front_face = 0x0901; // GL_CCW rsx::method_registers[NV4097_SET_FRONT_FACE] = 0x0901; // GL_CCW
m_cull_face = 0x0405; // GL_BACK 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_FUNC] = 0x0207; // GL_ALWAYS
rsx::method_registers[NV4097_SET_ALPHA_REF] = 0.0f; rsx::method_registers[NV4097_SET_ALPHA_REF] = 0.0f;
m_shade_mode = 0x1D01; // GL_SMOOTH m_shade_mode = 0x1D01; // GL_SMOOTH
@ -496,8 +487,7 @@ protected:
m_set_context_dma_color_c = false; m_set_context_dma_color_c = false;
m_set_context_dma_color_d = false; m_set_context_dma_color_d = false;
m_set_context_dma_z = false; m_set_context_dma_z = false;
m_set_cull_face = false; rsx::method_registers[NV4097_SET_CULL_FACE_ENABLE] = false;
m_set_front_face = false;
rsx::method_registers[NV4097_SET_ALPHA_TEST_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_FUNC] = false;
rsx::method_registers[NV4097_SET_ALPHA_REF] = 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] = false;
rsx::method_registers[NV4097_SET_BLEND_ENABLE_MRT] = false; rsx::method_registers[NV4097_SET_BLEND_ENABLE_MRT] = false;
// r.m_set_logic_op = 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; r.m_set_depth_bounds_test = false;
rsx::method_registers[NV4097_SET_DEPTH_TEST_ENABLE] = false; rsx::method_registers[NV4097_SET_DEPTH_TEST_ENABLE] = false;
r.m_set_poly_offset_fill = 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("Alpha test", rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE]);
LIST_FLAGS_ADD("Blend", rsx::method_registers[NV4097_SET_BLEND_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("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 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);
@ -653,7 +653,7 @@ void RSXDebugger::SetFlags(wxListEvent& event)
{ {
case 0: rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE] ^= true; break; case 0: rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE] ^= true; break;
case 1: rsx::method_registers[NV4097_SET_BLEND_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 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;