1
0
mirror of https://github.com/libretro/RetroArch synced 2025-02-24 09:40:07 +00:00

(EGL) Cleanups

(GLSL) Buildfix
This commit is contained in:
libretroadmin 2023-02-21 21:09:47 +01:00
parent d47bbe5cc1
commit cc85d7fd6d
2 changed files with 36 additions and 36 deletions
gfx
common
drivers_shader

@ -125,11 +125,9 @@ bool egl_init_dll(void)
{
#if defined(HAVE_DYLIB) && defined(HAVE_DYNAMIC_EGL)
static dylib_t egl_dll;
if (!egl_dll)
{
egl_dll = dylib_load("libEGL.dll");
if (egl_dll)
if ((egl_dll = dylib_load("libEGL.dll")))
{
/* Setup function callbacks once */
_egl_query_surface = (PFN_EGL_QUERY_SURFACE)dylib_proc(
@ -329,9 +327,9 @@ void egl_bind_hw_render(egl_ctx_data_t *egl, bool enable)
void egl_swap_buffers(void *data)
{
egl_ctx_data_t *egl = (egl_ctx_data_t*)data;
if ( egl &&
egl->dpy != EGL_NO_DISPLAY &&
egl->surf != EGL_NO_SURFACE
if ( (egl)
&& (egl->dpy != EGL_NO_DISPLAY)
&& (egl->surf != EGL_NO_SURFACE)
)
_egl_swap_buffers(egl->dpy, egl->surf);
}
@ -344,7 +342,7 @@ void egl_set_swap_interval(egl_ctx_data_t *egl, int interval)
*/
egl->interval = interval;
if (egl->dpy == EGL_NO_DISPLAY)
if (egl->dpy == EGL_NO_DISPLAY)
return;
if (!_egl_get_current_context())
return;
@ -372,51 +370,54 @@ void egl_get_video_size(egl_ctx_data_t *egl, unsigned *width, unsigned *height)
}
}
#if defined(EGL_VERSION_1_5)
static bool check_egl_version(int min_major_version, int min_minor_version)
{
int major, minor;
const char *str = _egl_query_string(EGL_NO_DISPLAY, EGL_VERSION);
if (!str)
return false;
if (sscanf(str, "%d.%d", &major, &minor) != 2)
return false;
if (major < min_major_version)
return false;
if (major > min_major_version)
return true;
if (minor >= min_minor_version)
return true;
if (str)
{
int major, minor;
if (sscanf(str, "%d.%d", &major, &minor) == 2)
{
if (major >= min_major_version)
{
if (major > min_major_version)
return true;
else if (minor >= min_minor_version)
return true;
}
}
}
return false;
}
#endif
#if defined(EGL_EXT_platform_base)
static bool check_egl_client_extension(const char *name, size_t name_len)
{
const char *str = _egl_query_string(EGL_NO_DISPLAY, EGL_EXTENSIONS);
/* The EGL implementation doesn't support client extensions at all. */
if (!str)
return false;
while (*str != '\0')
if (str)
{
/* Use strspn and strcspn to find the start position and length of each
* token in the extension string. Using strtok could also work, but
* that would require allocating a copy of the string. */
size_t len = strcspn(str, " ");
if (len == name_len && strncmp(str, name, name_len) == 0)
return true;
str += len;
str += strspn(str, " ");
while (*str != '\0')
{
/* Use strspn and strcspn to find the start position and length of each
* token in the extension string. Using strtok could also work, but
* that would require allocating a copy of the string. */
size_t len = strcspn(str, " ");
if (len == name_len && strncmp(str, name, name_len) == 0)
return true;
str += len;
str += strspn(str, " ");
}
}
return false;
}
#endif
static EGLDisplay get_egl_display(EGLenum platform, void *native)
{

@ -37,6 +37,7 @@
#include "../../state_manager.h"
#endif
#include "../../core.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#if defined(ORBIS)
@ -1332,9 +1333,7 @@ static void gl_glsl_set_params(void *dat, void *shader_data)
}
if (uni->rotation >= 0)
{
glUniform1i(uni->rotation, retroarch_get_rotation());
}
/* Set lookup textures. */
for (i = 0; i < glsl->shader->luts; i++)