mirror of
https://github.com/libretro/RetroArch
synced 2025-03-17 10:21:26 +00:00
Merge pull request #11815 from libretro/vita_hw
[VITA] Fixes for GL HW renderer
This commit is contained in:
commit
44a600a00c
@ -696,9 +696,10 @@ static bool gl1_gfx_frame(void *data, const void *frame,
|
||||
const void *frame_to_copy = NULL;
|
||||
unsigned mode_width = 0;
|
||||
unsigned mode_height = 0;
|
||||
unsigned width = 0;
|
||||
unsigned height = 0;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
bool draw = true;
|
||||
bool do_swap = false;
|
||||
gl1_t *gl1 = (gl1_t*)data;
|
||||
unsigned bits = gl1->video_bits;
|
||||
unsigned pot_width = 0;
|
||||
@ -745,6 +746,7 @@ static bool gl1_gfx_frame(void *data, const void *frame,
|
||||
)
|
||||
draw = false;
|
||||
|
||||
do_swap = frame || draw;
|
||||
|
||||
if ( gl1->video_width != frame_width ||
|
||||
gl1->video_height != frame_height ||
|
||||
@ -826,6 +828,8 @@ static bool gl1_gfx_frame(void *data, const void *frame,
|
||||
pot_width = get_pot(width);
|
||||
pot_height = get_pot(height);
|
||||
|
||||
do_swap = true;
|
||||
|
||||
if (gl1->menu_size_changed)
|
||||
{
|
||||
gl1->menu_size_changed = false;
|
||||
@ -860,8 +864,20 @@ static bool gl1_gfx_frame(void *data, const void *frame,
|
||||
}
|
||||
}
|
||||
|
||||
if (gl1->menu_texture_enable)
|
||||
if (gl1->menu_texture_enable){
|
||||
do_swap = true;
|
||||
#ifdef VITA
|
||||
glUseProgram(0);
|
||||
bool enabled = glIsEnabled(GL_DEPTH_TEST);
|
||||
if(enabled)
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
#endif
|
||||
menu_driver_frame(menu_is_alive, video_info);
|
||||
#ifdef VITA
|
||||
if(enabled)
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (video_info->statistics_show)
|
||||
@ -903,7 +919,7 @@ static bool gl1_gfx_frame(void *data, const void *frame,
|
||||
gl1->readback_buffer_screenshot);
|
||||
|
||||
|
||||
if (gl1->ctx_driver->swap_buffers)
|
||||
if (do_swap && gl1->ctx_driver->swap_buffers)
|
||||
gl1->ctx_driver->swap_buffers(gl1->ctx_data);
|
||||
|
||||
/* Emscripten has to do black frame insertion in its main loop */
|
||||
@ -939,9 +955,11 @@ static bool gl1_gfx_frame(void *data, const void *frame,
|
||||
glFinish();
|
||||
}
|
||||
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
if(draw){
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
gl1_context_bind_hw_render(gl1, true);
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user