mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
Compact duplicate draw objects routine
This commit is contained in:
parent
d3cb97d4e9
commit
08c7ae64e3
1 changed files with 90 additions and 89 deletions
|
@ -1146,41 +1146,30 @@ void GLGSRender::ExecCMD()
|
|||
|
||||
void GLGSRender::Flip()
|
||||
{
|
||||
// Fast path for non-MRT using glBlitFramebuffer
|
||||
// TODO: check for MRT samples
|
||||
if (m_fbo.IsCreated() && (m_surface_colour_target == CELL_GCM_SURFACE_TARGET_0 || m_surface_colour_target == CELL_GCM_SURFACE_TARGET_1))
|
||||
switch (m_surface_colour_target)
|
||||
{
|
||||
case CELL_GCM_SURFACE_TARGET_0:
|
||||
case CELL_GCM_SURFACE_TARGET_1:
|
||||
{
|
||||
// Fast path for non-MRT using glBlitFramebuffer.
|
||||
GLfbo::Bind(GL_DRAW_FRAMEBUFFER, 0);
|
||||
// Renderbuffer is upside turn , swapped srcY0 and srcY1
|
||||
GLfbo::Blit(0, RSXThread::m_height, RSXThread::m_width, 0, 0, 0, RSXThread::m_width, RSXThread::m_height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
}
|
||||
break;
|
||||
|
||||
m_fbo.Bind();
|
||||
|
||||
for (uint i = 0; i<m_post_draw_objs.size(); ++i)
|
||||
case CELL_GCM_SURFACE_TARGET_NONE:
|
||||
case CELL_GCM_SURFACE_TARGET_MRT1:
|
||||
case CELL_GCM_SURFACE_TARGET_MRT2:
|
||||
case CELL_GCM_SURFACE_TARGET_MRT3:
|
||||
{
|
||||
m_post_draw_objs[i].Draw();
|
||||
}
|
||||
|
||||
m_frame->Flip(m_context);
|
||||
|
||||
m_fbo.Bind();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Slow path for MRT/None target using glReadPixels.
|
||||
if (m_set_scissor_horizontal && m_set_scissor_vertical)
|
||||
{
|
||||
glScissor(0, 0, RSXThread::m_width, RSXThread::m_height);
|
||||
checkForGlError("glScissor");
|
||||
}
|
||||
|
||||
for (uint i = 0; i<m_post_draw_objs.size(); ++i)
|
||||
{
|
||||
m_post_draw_objs[i].Draw();
|
||||
}
|
||||
|
||||
m_frame->Flip(m_context);
|
||||
|
||||
static u8* src_buffer = nullptr;
|
||||
static u32 width = 0;
|
||||
static u32 height = 0;
|
||||
|
@ -1269,6 +1258,18 @@ void GLGSRender::Flip()
|
|||
checkForGlError("glScissor");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Draw Objects
|
||||
for (uint i = 0; i<m_post_draw_objs.size(); ++i)
|
||||
{
|
||||
m_post_draw_objs[i].Draw();
|
||||
}
|
||||
|
||||
m_frame->Flip(m_context);
|
||||
|
||||
}
|
||||
|
||||
u32 LinearToSwizzleAddress(u32 x, u32 y, u32 z, u32 log2_width, u32 log2_height, u32 log2_depth)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue