mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Update
This commit is contained in:
parent
3e1f4defb8
commit
4f016b2c2c
@ -75,14 +75,6 @@
|
||||
#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
|
||||
#endif
|
||||
|
||||
#ifndef GL_SYNC_GPU_COMMANDS_COMPLETE
|
||||
#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
|
||||
#endif
|
||||
|
||||
#ifndef GL_SYNC_FLUSH_COMMANDS_BIT
|
||||
#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
|
||||
#endif
|
||||
|
||||
#define set_texture_coords(coords, xamt, yamt) \
|
||||
coords[2] = xamt; \
|
||||
coords[6] = xamt; \
|
||||
@ -1255,19 +1247,10 @@ static bool gl_frame(void *data, const void *frame,
|
||||
if (video_info->hard_sync && gl->have_sync)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
gl->fences[gl->fence_count++] =
|
||||
glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
|
||||
while (gl->fence_count > video_info->hard_sync_frames)
|
||||
{
|
||||
glClientWaitSync(gl->fences[0],
|
||||
GL_SYNC_FLUSH_COMMANDS_BIT, 1000000000);
|
||||
glDeleteSync(gl->fences[0]);
|
||||
|
||||
gl->fence_count--;
|
||||
memmove(gl->fences, gl->fences + 1,
|
||||
gl->fence_count * sizeof(GLsync));
|
||||
}
|
||||
if (gl->renderchain_driver->fence_iterate)
|
||||
gl->renderchain_driver->fence_iterate(gl,
|
||||
video_info->hard_sync_frames);
|
||||
}
|
||||
|
||||
if (gl->core_context_in_use &&
|
||||
@ -1318,15 +1301,8 @@ static void gl_free(void *data)
|
||||
|
||||
if (gl->have_sync)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < gl->fence_count; i++)
|
||||
{
|
||||
glClientWaitSync(gl->fences[i],
|
||||
GL_SYNC_FLUSH_COMMANDS_BIT, 1000000000);
|
||||
glDeleteSync(gl->fences[i]);
|
||||
}
|
||||
gl->fence_count = 0;
|
||||
if (gl->renderchain_driver->fence_free)
|
||||
gl->renderchain_driver->fence_free(gl);
|
||||
}
|
||||
|
||||
font_driver_free_osd();
|
||||
|
@ -73,6 +73,14 @@ typedef struct gl2_renderchain
|
||||
|
||||
#define gl2_bind_fb(id) glBindFramebuffer(RARCH_GL_FRAMEBUFFER, id)
|
||||
|
||||
#ifndef GL_SYNC_GPU_COMMANDS_COMPLETE
|
||||
#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
|
||||
#endif
|
||||
|
||||
#ifndef GL_SYNC_FLUSH_COMMANDS_BIT
|
||||
#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
|
||||
#endif
|
||||
|
||||
/* Prototypes */
|
||||
static void gl2_renderchain_bind_backbuffer(void)
|
||||
{
|
||||
@ -1388,7 +1396,50 @@ static void gl2_renderchain_readback(void *data,
|
||||
(GLenum)fmt, (GLenum)type, (GLvoid*)src);
|
||||
}
|
||||
|
||||
#ifndef HAVE_OPENGLES
|
||||
static void gl2_renderchain_fence_iterate(void *data, unsigned
|
||||
hard_sync_frames)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
gl->fences[gl->fence_count++] =
|
||||
glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
|
||||
while (gl->fence_count > hard_sync_frames)
|
||||
{
|
||||
glClientWaitSync(gl->fences[0],
|
||||
GL_SYNC_FLUSH_COMMANDS_BIT, 1000000000);
|
||||
glDeleteSync(gl->fences[0]);
|
||||
|
||||
gl->fence_count--;
|
||||
memmove(gl->fences, gl->fences + 1,
|
||||
gl->fence_count * sizeof(GLsync));
|
||||
}
|
||||
}
|
||||
|
||||
static void gl2_renderchain_fence_free(void *data)
|
||||
{
|
||||
unsigned i;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
for (i = 0; i < gl->fence_count; i++)
|
||||
{
|
||||
glClientWaitSync(gl->fences[i],
|
||||
GL_SYNC_FLUSH_COMMANDS_BIT, 1000000000);
|
||||
glDeleteSync(gl->fences[i]);
|
||||
}
|
||||
gl->fence_count = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
gl_renderchain_driver_t gl2_renderchain = {
|
||||
#ifdef HAVE_OPENGLES
|
||||
NULL,
|
||||
NULL,
|
||||
#else
|
||||
gl2_renderchain_fence_iterate,
|
||||
gl2_renderchain_fence_free,
|
||||
#endif
|
||||
gl2_renderchain_readback,
|
||||
gl2_renderchain_init_pbo,
|
||||
gl2_renderchain_bind_pbo,
|
||||
|
@ -827,6 +827,8 @@ typedef struct d3d_renderchain_driver
|
||||
|
||||
typedef struct gl_renderchain_driver
|
||||
{
|
||||
void (*fence_iterate)(void *data, unsigned hard_sync_frames);
|
||||
void (*fence_free)(void *data);
|
||||
void (*readback)(void *data,
|
||||
unsigned alignment,
|
||||
unsigned fmt, unsigned type,
|
||||
|
Loading…
x
Reference in New Issue
Block a user