Skip to content

Commit

Permalink
Replicate speed optimization from Citra libretro
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Jun 10, 2017
1 parent 6927521 commit 3ea9f94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions core/libretro/libretro.cpp
Expand Up @@ -393,12 +393,16 @@ static void update_variables(void)
enable_purupuru = (strcmp("enabled", var.value) == 0);
}

bool doCleanFrame = false;

void retro_run (void)
{
bool updated = false;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
update_variables();

doCleanFrame = true;

if (first_run)
{
dc_init(co_argc,co_argv);
Expand Down
11 changes: 8 additions & 3 deletions core/rend/gles/gl_backend.cpp
Expand Up @@ -1770,6 +1770,7 @@ static void vertex_buffer_unmap(void)

extern bool update_zmax;
extern bool update_zmin;
extern bool doCleanFrame;

#ifdef MSB_FIRST
#define INDEX_GET(a) (a^3)
Expand Down Expand Up @@ -2201,11 +2202,15 @@ static bool RenderFrame(void)
BindRTT(FB_W_SOF1&VRAM_MASK,FB_X_CLIP.max-FB_X_CLIP.min+1,FB_Y_CLIP.max-FB_Y_CLIP.min+1,channels,format);
}

glClearColor(0, 0, 0, 1.0f);
glClearDepth(0.f);

glViewport(0, 0, gles_screen_width, gles_screen_height);
glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
if (doCleanFrame)
{
glClearColor(0, 0, 0, 1.0f);
glClearDepth(0.f);
glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
doCleanFrame = false;
}

if (UsingAutoSort())
GenSorted();
Expand Down

0 comments on commit 3ea9f94

Please sign in to comment.