mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 06:26:49 +00:00
Code cleanup and added glPolygonOffset
This commit is contained in:
parent
e569de73d6
commit
b95667563f
3 changed files with 33 additions and 9 deletions
|
|
@ -581,7 +581,7 @@ void GLGSRender::WriteColourBufferD()
|
|||
checkForGlError("glReadPixels(GL_RGBA, GL_UNSIGNED_INT_8_8_8_8)");
|
||||
}
|
||||
|
||||
void GLGSRender::WriteBuffers()
|
||||
void GLGSRender::WriteColorBuffers()
|
||||
{
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 4);
|
||||
|
|
@ -641,7 +641,6 @@ void GLGSRender::OnInitThread()
|
|||
InitProcTable();
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
|
||||
#ifdef _WIN32
|
||||
glSwapInterval(Ini.GSVSyncEnable.GetValue() ? 1 : 0);
|
||||
|
|
@ -773,8 +772,10 @@ void GLGSRender::ExecCMD()
|
|||
}
|
||||
|
||||
m_fbo.Bind();
|
||||
|
||||
if(Ini.GSDumpDepthBuffer.GetValue())
|
||||
WriteDepthBuffer();
|
||||
|
||||
static const GLenum draw_buffers[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2, GL_COLOR_ATTACHMENT3 };
|
||||
|
||||
switch(m_surface_colour_target)
|
||||
|
|
@ -813,8 +814,6 @@ void GLGSRender::ExecCMD()
|
|||
checkForGlError("glColorMask");
|
||||
}
|
||||
|
||||
//glFrontFace(m_front_face);
|
||||
|
||||
if(m_set_viewport_horizontal && m_set_viewport_vertical)
|
||||
{
|
||||
//glViewport(m_viewport_x, m_viewport_y, m_viewport_w, m_viewport_h);
|
||||
|
|
@ -859,6 +858,7 @@ void GLGSRender::ExecCMD()
|
|||
Enable(m_set_blend, GL_BLEND);
|
||||
Enable(m_set_logic_op, GL_LOGIC_OP);
|
||||
Enable(m_set_cull_face_enable, GL_CULL_FACE);
|
||||
//Enable(m_set_front_face, GL_FRONT_FACE); // glEnable : OpenGL error 0x0500
|
||||
Enable(m_set_dither, GL_DITHER);
|
||||
Enable(m_set_stencil_test, GL_STENCIL_TEST);
|
||||
Enable(m_set_scissor_horizontal && m_set_scissor_vertical, GL_SCISSOR_TEST);
|
||||
|
|
@ -867,7 +867,7 @@ void GLGSRender::ExecCMD()
|
|||
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+
|
||||
//Enable(m_set_restart_index, GL_PRIMITIVE_RESTART); // Requires OpenGL 3.1+
|
||||
|
||||
if(m_set_clip_plane)
|
||||
{
|
||||
|
|
@ -896,6 +896,12 @@ void GLGSRender::ExecCMD()
|
|||
checkForGlError("glPolygonMode(Back)");
|
||||
}
|
||||
|
||||
if (m_set_poly_offset_scale_factor && m_set_poly_offset_bias)
|
||||
{
|
||||
glPolygonOffset(m_set_poly_offset_scale_factor, m_set_poly_offset_bias);
|
||||
checkForGlError("glPolygonOffset");
|
||||
}
|
||||
|
||||
if (m_set_logic_op)
|
||||
{
|
||||
glLogicOp(m_logic_op);
|
||||
|
|
@ -907,6 +913,7 @@ void GLGSRender::ExecCMD()
|
|||
glScissor(m_scissor_x, m_scissor_y, m_scissor_w, m_scissor_h);
|
||||
checkForGlError("glScissor");
|
||||
}
|
||||
|
||||
if(m_set_two_sided_stencil_test_enable)
|
||||
{
|
||||
if(m_set_stencil_fail && m_set_stencil_zfail && m_set_stencil_zpass)
|
||||
|
|
@ -1029,6 +1036,12 @@ void GLGSRender::ExecCMD()
|
|||
checkForGlError("glCullFace");
|
||||
}
|
||||
|
||||
if (m_set_front_face)
|
||||
{
|
||||
//glFrontFace(m_front_face); // glFrontFace : OpenGL error 0x0500
|
||||
checkForGlError("glFrontFace");
|
||||
}
|
||||
|
||||
if(m_set_alpha_func && m_set_alpha_ref)
|
||||
{
|
||||
glAlphaFunc(m_alpha_func, m_alpha_ref/255.0f);
|
||||
|
|
@ -1052,7 +1065,7 @@ void GLGSRender::ExecCMD()
|
|||
if(m_set_restart_index)
|
||||
{
|
||||
ConLog.Warning("m_set_restart_index requires glPrimitiveRestartIndex()");
|
||||
//glPrimitiveRestartIndex(m_restart_index); //Requires OpenGL 3.1+
|
||||
//glPrimitiveRestartIndex(m_restart_index); // Requires OpenGL 3.1+
|
||||
//checkForGlError("glPrimitiveRestartIndex");
|
||||
}
|
||||
|
||||
|
|
@ -1117,8 +1130,8 @@ void GLGSRender::ExecCMD()
|
|||
DisableVertexData();
|
||||
}
|
||||
|
||||
if(Ini.GSDumpColorBuffers.GetValue())
|
||||
WriteBuffers();
|
||||
if (Ini.GSDumpColorBuffers.GetValue())
|
||||
WriteColorBuffers();
|
||||
}
|
||||
|
||||
void GLGSRender::Flip()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue