1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 12:12:50 +01:00

New GCM commands implemented

- NV4097_SET_DEPTH_BOUNDS_MIN
- NV4097_SET_POLY_OFFSET_FILL_ENABLE
- NV4097_SET_POLY_OFFSET_LINE_ENABLE
- NV4097_SET_POLY_OFFSET_POINT_ENABLE
- NV4097_SET_RESTART_INDEX_ENABLE
- NV4097_SET_RESTART_INDEX
This commit is contained in:
Alexandro Sánchez Bach 2013-11-24 01:47:17 +01:00
parent c7ca4b996a
commit f43a324937
3 changed files with 59 additions and 5 deletions

View File

@ -812,6 +812,10 @@ void GLGSRender::ExecCMD()
Enable(m_set_stencil_test, GL_STENCIL_TEST);
Enable(m_set_line_smooth, GL_LINE_SMOOTH);
Enable(m_set_poly_smooth, GL_POLYGON_SMOOTH);
Enable(m_set_poly_offset_fill, GL_POLYGON_OFFSET_FILL);
Enable(m_set_poly_offset_line, GL_POLYGON_OFFSET_LINE);
Enable(m_set_poly_offset_point, GL_POLYGON_OFFSET_POINT);
Enable(m_set_restart_index, GL_PRIMITIVE_RESTART); //Requires OpenGL 3.1+
if(m_set_clip_plane)
{
@ -904,6 +908,12 @@ void GLGSRender::ExecCMD()
checkForGlError("glDepthFunc");
}
if(m_set_depth_bounds)
{
glDepthRange(m_depth_bounds_min, m_depth_bounds_max);
checkForGlError("glDepthRange");
}
if(m_set_clip)
{
glDepthRangef(m_clip_min, m_clip_max);
@ -960,6 +970,13 @@ void GLGSRender::ExecCMD()
checkForGlError("glFogf(GL_FOG_END)");
}
if(m_set_restart_index)
{
ConLog.Warning("m_set_restart_index requires glPrimitiveRestartIndex()");
//glPrimitiveRestartIndex(m_restart_index); //Requires OpenGL 3.1+
//checkForGlError("glPrimitiveRestartIndex");
}
if(m_indexed_array.m_count && m_draw_array_count)
{
ConLog.Warning("m_indexed_array.m_count && draw_array_count");

View File

@ -372,6 +372,19 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
m_set_depth_bounds_test = args[0] ? true : false;
break;
case NV4097_SET_DEPTH_BOUNDS_MIN:
{
m_set_depth_bounds = true;
const u32 depth_bounds_min = args[0];
m_depth_bounds_min = (float&)depth_bounds_min;
if (count > 1)
{
const u32 depth_bounds_max = args[1];
m_depth_bounds_max = (float&)depth_bounds_max;
}
}
break;
case NV4097_SET_ALPHA_FUNC:
m_set_alpha_func = true;
m_alpha_func = args[0];
@ -826,11 +839,19 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
break;
case NV4097_SET_POLY_OFFSET_FILL_ENABLE:
if(args[0]) ConLog.Error("NV4097_SET_POLY_OFFSET_FILL_ENABLE");
m_set_poly_offset_fill = args[0] ? true : false;
break;
case NV4097_SET_POLY_OFFSET_LINE_ENABLE:
m_set_poly_offset_line = args[0] ? true : false;
break;
case NV4097_SET_POLY_OFFSET_POINT_ENABLE:
m_set_poly_offset_point = args[0] ? true : false;
break;
case NV4097_SET_RESTART_INDEX_ENABLE:
if(args[0]) ConLog.Error("NV4097_SET_RESTART_INDEX_ENABLE");
m_set_restart_index = args[0] ? true : false;
break;
case NV4097_SET_POINT_PARAMS_ENABLE:
@ -943,9 +964,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
break;
case NV4097_SET_RESTART_INDEX:
{
//TODO
}
m_restart_index = args[0];
break;
case NV4097_INVALIDATE_L2:

View File

@ -290,6 +290,9 @@ public:
bool m_set_depth_func;
int m_depth_func;
bool m_set_depth_bounds;
float m_depth_bounds_min;
float m_depth_bounds_max;
bool m_set_alpha_test;
bool m_set_blend;
@ -301,6 +304,12 @@ public:
bool m_set_stencil_test;
bool m_set_line_smooth;
bool m_set_poly_smooth;
bool m_set_poly_offset_fill;
bool m_set_poly_offset_line;
bool m_set_poly_offset_point;
bool m_set_restart_index;
u32 m_restart_index;
bool m_set_viewport_horizontal;
bool m_set_viewport_vertical;
@ -536,6 +545,10 @@ protected:
m_clear_z = 0xffffff;
m_clear_s = 0;
m_depth_bounds_min = 0.0;
m_depth_bounds_max = 1.0;
m_restart_index = 0xffffffff;
Reset();
}
@ -544,6 +557,7 @@ protected:
m_set_color_mask = false;
m_set_clip = false;
m_set_depth_func = false;
m_set_depth_bounds = false;
m_set_viewport_horizontal = false;
m_set_viewport_vertical = false;
m_set_scissor_horizontal = false;
@ -584,6 +598,10 @@ protected:
m_set_cull_face = false;
m_set_alpha_func = false;
m_set_alpha_ref = false;
m_set_poly_offset_fill = false;
m_set_poly_offset_line = false;
m_set_poly_offset_point = false;
m_set_restart_index = false;
m_clear_surface_mask = 0;
m_begin_end = 0;