libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
9.77k stars 1.77k forks source link

Errors building latest release on X-less GNU/Linux #8770

Closed vanfanel closed 2 years ago

vanfanel commented 5 years ago

Hi there,

My current RA enviroment is GNU/Linux on ARM, using GLES2 on KMS/DRM. It has been like this for years now, but I can not build the latest release, v1.7.7. My configuration line has been like this for a long while: CFLAGS="-O3 -march=armv8-a+crc -mtune=cortex-a53 -flto" CXXFLAGS="-O3 -march=armv8-a+crc -mtune=cortex-a53 -flto" LDFLAGS="-flto" ./configure --disable-ibxm --disable-vg --disable-x11 --disable-wayland --disable-sdl2 --disable-al --disable-cheevos --disable-ffmpeg --disable-networking --disable-libretrodb --enable-udev --disable-sdl --disable-pulse --disable-oss --disable-freetype --disable-7zip --disable-imageviewer --disable-rjpeg --disable-rbmp --disable-rtga --enable-opengl --enable-opengles --enable-egl --disable-flac --disable-qt --disable-materialui --disable-xmb --enable-rgui --disable-ozone --disable-easteregg

The configure script does NOT give any error regarding GLESv2, KMS/DRM libs, etc:

pi@raspberrypi:~/src/RetroArch-1.7.7$ CFLAGS="-O3 -march=armv8-a+crc -mtune=cortex-a53 -flto" CXXFLAGS="-O3 -march=armv8-a+crc -mtune=cortex-a53 -flto" LDFLAGS="-flto" ./configure --disable-ibxm --disable-vg --disable-x11  --disable-wayland --disable-sdl2 --disable-al --disable-cheevos --disable-ffmpeg --disable-networking --disable-libretrodb --enable-udev --disable-sdl --disable-pulse --disable-oss --disable-freetype --disable-7zip --disable-imageviewer --disable-rjpeg --disable-rbmp --disable-rtga --enable-opengl --enable-opengles --enable-egl --disable-flac --disable-qt --disable-materialui --disable-xmb --enable-rgui --disable-ozone --disable-easteregg
Checking operating system ... Linux 
Checking for suitable working C compiler ... /usr/bin/gcc works
Checking for suitable working C++ compiler ... /usr/bin/g++ works
Checking for pkg-config ... /usr/bin/pkg-config
Checking for availability of switch -std=gnu99 in /usr/bin/gcc ... yes
Checking for availability of switch -Wno-unused-result in /usr/bin/gcc ... yes
Checking for availability of switch -Wno-unused-variable in /usr/bin/gcc ... yes
Checking function sd_get_machine_names in -lsystemd ... no
Checking presence of package bcm_host ... no
Checking function bcm_host_init in -lbcm_host ... no
Checking presence of package egl ... 19.0.3
Checking function ass_library_init in -lass ... no
Checking function pthread_create in -lpthread ... yes
Checking function pthread_key_create in -lpthread ... yes
Checking function dlopen in -ldl ... yes
Warning: All networking features have been disabled.
Checking function fcntl in -lc ... yes
Checking function getopt_long in -lc ... yes
Checking presence of package alsa ... 1.1.3
Checking presence of predefined macro AUDIO_SETINFO in sys/audioio.h ... no
Checking presence of package rsound >= 1.1 ... no
Checking presence of package libroar >= 1.0.12 ... no
Checking presence of package jack >= 0.120.1 ... no
Checking presence of package libusb-1.0 >= 1.0.13 ... no
Checking presence of package zlib ... 1.2.8
Checking function dlopen in -ldl ... yes
Checking presence of package gbm >= 9.0 ... 19.0.3
Checking presence of package libdrm ... 2.4.98
Checking presence of package glesv2 ... 19.0.3
Checking presence of package libv4l2 ... no
Checking presence of package xcb ... 1.12
Checking presence of package wayland-cursor >= 1.12 ... no
Checking presence of package wayland-protocols >= 1.15 ... no
Checking presence of package wayland-scanner >= 1.12 ... no
Checking presence of package xkbcommon >= 0.3.2 ... no
Checking presence of package xext ... 1.3.3
Checking presence of package xxf86vm ... no
Notice: wayland libraries not found, disabling wayland support.
Notice: X11, Xext or xf86vm not present. Skipping X11 code paths.
Checking presence of package libudev ... 232
Checking presence of header file linux/parport.h ... yes
Checking presence of header file linux/ppdev.h ... yes
Checking function strcasestr in -lc ... yes
Checking function mmap in -lc ... yes
Checking function vkCreateInstance in -lvulkan ... no
Creating make config: config.mk
Creating config header: config.h

However, compilation fails because it is missing some GL defines:


gfx/drivers/gl_core.c: In function 'gl_core_deinit_fences':
gfx/drivers/gl_core.c:62:10: warning: implicit declaration of function 'glDeleteSync' [-Wimplicit-function-declaration]
          glDeleteSync(gl->fences[i]);
          ^~~~~~~~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_init_pbo_readback':
gfx/drivers/gl_core.c:77:20: error: 'GL_PIXEL_PACK_BUFFER' undeclared (first use in this function)
       glBindBuffer(GL_PIXEL_PACK_BUFFER, gl->pbo_readback[i]);
                    ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:77:20: note: each undeclared identifier is reported only once for each function it appears in
gfx/drivers/gl_core.c:78:97: error: 'GL_STREAM_READ' undeclared (first use in this function)
       glBufferData(GL_PIXEL_PACK_BUFFER, gl->vp.width * gl->vp.height * sizeof(uint32_t), NULL, GL_STREAM_READ);
                                                                                                 ^~~~~~~~~~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_slow_readback':
gfx/drivers/gl_core.c:144:18: error: 'GL_PACK_ROW_LENGTH' undeclared (first use in this function)
    glPixelStorei(GL_PACK_ROW_LENGTH, 0);
                  ^~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:145:17: error: 'GL_PIXEL_PACK_BUFFER' undeclared (first use in this function)
    glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
                 ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_pbo_async_readback':
gfx/drivers/gl_core.c:157:17: error: 'GL_PIXEL_PACK_BUFFER' undeclared (first use in this function)
    glBindBuffer(GL_PIXEL_PACK_BUFFER, gl->pbo_readback[gl->pbo_readback_index++]);
                 ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:159:18: error: 'GL_PACK_ROW_LENGTH' undeclared (first use in this function)
    glPixelStorei(GL_PACK_ROW_LENGTH, 0);
                  ^~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_fence_iterate':
gfx/drivers/gl_core.c:187:39: warning: implicit declaration of function 'glFenceSync' [-Wimplicit-function-declaration]
       gl->fences[gl->fence_count++] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
                                       ^~~~~~~~~~~
gfx/drivers/gl_core.c:187:51: error: 'GL_SYNC_GPU_COMMANDS_COMPLETE' undeclared (first use in this function)
       gl->fences[gl->fence_count++] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:192:7: warning: implicit declaration of function 'glClientWaitSync' [-Wimplicit-function-declaration]
       glClientWaitSync(gl->fences[0], GL_SYNC_FLUSH_COMMANDS_BIT, 1000000000);
       ^~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:192:39: error: 'GL_SYNC_FLUSH_COMMANDS_BIT' undeclared (first use in this function)
       glClientWaitSync(gl->fences[0], GL_SYNC_FLUSH_COMMANDS_BIT, 1000000000);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_destroy_resources':
gfx/drivers/gl_core.c:351:4: warning: implicit declaration of function 'glBindVertexArray' [-Wimplicit-function-declaration]
    glBindVertexArray(0);
    ^~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:353:7: warning: implicit declaration of function 'glDeleteVertexArrays' [-Wimplicit-function-declaration]
       glDeleteVertexArrays(1, &gl->vao);
       ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_init_hw_render':
gfx/drivers/gl_core.c:416:4: warning: implicit declaration of function 'glTexStorage2D' [-Wimplicit-function-declaration]
    glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, width, height);
    ^~~~~~~~~~~~~~
gfx/drivers/gl_core.c:416:37: error: 'GL_RGBA8' undeclared (first use in this function)
    glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, width, height);
                                     ^~~~~~~~
gfx/drivers/gl_core.c:425:61: error: 'GL_DEPTH24_STENCIL8' undeclared (first use in this function)
       glRenderbufferStorage(GL_RENDERBUFFER, hwr->stencil ? GL_DEPTH24_STENCIL8 : GL_DEPTH_COMPONENT16,
                                                             ^~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:430:52: error: 'GL_DEPTH_STENCIL_ATTACHMENT' undeclared (first use in this function)
          glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, gl->hw_render_rb_ds);
                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
CXX gfx/drivers_shader/shader_gl_core.cpp
gfx/drivers_font/gl_core_raster_font.c: In function 'gl_core_raster_font_upload_atlas':
gfx/drivers_font/gl_core_raster_font.c:83:18: error: 'GL_UNPACK_ROW_LENGTH' undeclared (first use in this function)
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
                  ^~~~~~~~~~~~~~~~~~~~
gfx/drivers_font/gl_core_raster_font.c:83:18: note: each undeclared identifier is reported only once for each function it appears in
gfx/drivers_font/gl_core_raster_font.c:84:17: error: 'GL_PIXEL_UNPACK_BUFFER' undeclared (first use in this function)
    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
                 ^~~~~~~~~~~~~~~~~~~~~~
gfx/drivers_font/gl_core_raster_font.c:85:4: warning: implicit declaration of function 'glTexStorage2D' [-Wimplicit-function-declaration]
    glTexStorage2D(GL_TEXTURE_2D, 1, GL_R8, font->atlas->width, font->atlas->height);
    ^~~~~~~~~~~~~~
gfx/drivers_font/gl_core_raster_font.c:85:37: error: 'GL_R8' undeclared (first use in this function)
    glTexStorage2D(GL_TEXTURE_2D, 1, GL_R8, font->atlas->width, font->atlas->height);
                                     ^~~~~
gfx/drivers_font/gl_core_raster_font.c:87:61: error: 'GL_RED' undeclared (first use in this function)
                    font->atlas->width, font->atlas->height, GL_RED, GL_UNSIGNED_BYTE, font->atlas->buffer);
                                                             ^~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_init':
gfx/drivers/gl_core.c:1091:4: warning: implicit declaration of function 'glGenVertexArrays' [-Wimplicit-function-declaration]
    glGenVertexArrays(1, &gl->vao);
    ^~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c: In function 'video_texture_load_gl_core':
gfx/drivers/gl_core.c:1135:42: error: 'GL_RGBA8' undeclared (first use in this function)
    glTexStorage2D(GL_TEXTURE_2D, levels, GL_RGBA8, ti->width, ti->height);
                                          ^~~~~~~~
gfx/drivers/gl_core.c:1166:18: error: 'GL_UNPACK_ROW_LENGTH' undeclared (first use in this function)
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
                  ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1172:35: error: 'GL_TEXTURE_SWIZZLE_R' undeclared (first use in this function)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
                                   ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1172:57: error: 'GL_BLUE' undeclared (first use in this function)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
                                                         ^~~~~~~
gfx/drivers/gl_core.c:1173:35: error: 'GL_TEXTURE_SWIZZLE_B' undeclared (first use in this function)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
                                   ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1173:57: error: 'GL_RED' undeclared (first use in this function)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
                                                         ^~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_read_viewport':
gfx/drivers/gl_core.c:1442:20: error: 'GL_PIXEL_PACK_BUFFER' undeclared (first use in this function)
       glBindBuffer(GL_PIXEL_PACK_BUFFER, gl->pbo_readback[gl->pbo_readback_index]);
                    ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1444:13: warning: implicit declaration of function 'glMapBufferRange' [-Wimplicit-function-declaration]
       ptr = glMapBufferRange(GL_PIXEL_PACK_BUFFER, 0, num_pixels * sizeof(uint32_t), GL_MAP_READ_BIT);
             ^~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1446:7: warning: implicit declaration of function 'glUnmapBuffer' [-Wimplicit-function-declaration]
       glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
       ^~~~~~~~~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_update_cpu_texture':
gfx/drivers/gl_core.c:1498:63: error: 'GL_RGBA8' undeclared (first use in this function)
       glTexStorage2D(GL_TEXTURE_2D, 1, gl->video_info.rgb32 ? GL_RGBA8 : GL_RGB565,
                                                               ^~~~~~~~
gfx/drivers/gl_core.c:1505:41: error: 'GL_TEXTURE_SWIZZLE_R' undeclared (first use in this function)
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
                                         ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1505:63: error: 'GL_BLUE' undeclared (first use in this function)
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
                                                               ^~~~~~~
gfx/drivers/gl_core.c:1506:41: error: 'GL_TEXTURE_SWIZZLE_B' undeclared (first use in this function)
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
                                         ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1506:63: error: 'GL_RED' undeclared (first use in this function)
          glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
                                                               ^~~~~~
gfx/drivers/gl_core.c:1512:17: error: 'GL_PIXEL_UNPACK_BUFFER' undeclared (first use in this function)
    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
                 ^~~~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1515:21: error: 'GL_UNPACK_ROW_LENGTH' undeclared (first use in this function)
       glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch >> 2);
                     ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_frame':
gfx/drivers/gl_core.c:1617:24: error: 'GL_RGBA8' undeclared (first use in this function)
       texture.format = GL_RGBA8;
                        ^~~~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_set_texture_frame':
gfx/drivers/gl_core.c:1898:45: error: 'GL_RGBA8' undeclared (first use in this function)
    glTexStorage2D(GL_TEXTURE_2D, 1, rgb32 ? GL_RGBA8 : GL_RGBA4, width, height);
                                             ^~~~~~~~
gfx/drivers/gl_core.c:1901:17: error: 'GL_PIXEL_UNPACK_BUFFER' undeclared (first use in this function)
    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
                 ^~~~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1902:18: error: 'GL_UNPACK_ROW_LENGTH' undeclared (first use in this function)
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
                  ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1912:38: error: 'GL_TEXTURE_SWIZZLE_R' undeclared (first use in this function)
       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
                                      ^~~~~~~~~~~~~~~~~~~~
gfx/drivers/gl_core.c:1912:60: error: 'GL_BLUE' undeclared (first use in this function)
       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
                                                            ^~~~~~~
gfx/drivers/gl_core.c:1913:38: error: 'GL_TEXTURE_SWIZZLE_B' undeclared (first use in this function)
       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
                                      ^~~~~~~~~~~~~~~~~~~~
Makefile:199: recipe for target 'obj-unix/release/gfx/drivers_font/gl_core_raster_font.o' failed
make: *** [obj-unix/release/gfx/drivers_font/gl_core_raster_font.o] Error 1
make: *** Waiting for unfinished jobs....
gfx/drivers/gl_core.c:1913:60: error: 'GL_RED' undeclared (first use in this function)
       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
                                                            ^~~~~~
gfx/drivers/gl_core.c: In function 'gl_core_wrap_type_to_enum':
gfx/drivers/gl_core.c:2017:17: error: 'GL_CLAMP_TO_BORDER' undeclared (first use in this function)
          return GL_CLAMP_TO_BORDER;
                 ^~~~~~~~~~~~~~~~~~
Makefile:199: recipe for target 'obj-unix/release/gfx/drivers/gl_core.o' failed
make: *** [obj-unix/release/gfx/drivers/gl_core.o] Error 1
gfx/drivers_shader/shader_gl_core.cpp: In function 'GLuint gl_core_cross_compile_program(const uint32_t*, size_t, const uint32_t*, size_t, gl_core_buffer_locations*, bool)':
gfx/drivers_shader/shader_gl_core.cpp:266:46: error: 'GL_INVALID_INDEX' was not declared in this scope
          loc->buffer_index_ubo_vertex      = GL_INVALID_INDEX;
                                              ^~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:278:96: error: 'glGetUniformBlockIndex' was not declared in this scope
             loc->buffer_index_ubo_vertex   = glGetUniformBlockIndex(program, "RARCH_UBO_VERTEX");
                                                                                                ^
gfx/drivers_shader/shader_gl_core.cpp: In function 'GLenum gl_core::address_to_gl(gl_core_filter_chain_address)':
gfx/drivers_shader/shader_gl_core.cpp:406:17: error: 'GL_CLAMP_TO_BORDER' was not declared in this scope
          return GL_CLAMP_TO_BORDER;
                 ^~~~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp: In function 'GLenum gl_core::convert_glslang_format(glslang_format)':
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_R8' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:451:7: note: in expansion of macro 'FMT'
       FMT(R8_UNORM, R8);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_R8I' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:452:7: note: in expansion of macro 'FMT'
       FMT(R8_SINT, R8I);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_R8UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:453:7: note: in expansion of macro 'FMT'
       FMT(R8_UINT, R8UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RG8' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:454:7: note: in expansion of macro 'FMT'
       FMT(R8G8_UNORM, RG8);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RG8I' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:455:7: note: in expansion of macro 'FMT'
       FMT(R8G8_SINT, RG8I);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RG8UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:456:7: note: in expansion of macro 'FMT'
       FMT(R8G8_UINT, RG8UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGBA8' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:457:7: note: in expansion of macro 'FMT'
       FMT(R8G8B8A8_UNORM, RGBA8);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGBA8I' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:458:7: note: in expansion of macro 'FMT'
       FMT(R8G8B8A8_SINT, RGBA8I);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGBA8UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:459:7: note: in expansion of macro 'FMT'
       FMT(R8G8B8A8_UINT, RGBA8UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_SRGB8_ALPHA8' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:460:7: note: in expansion of macro 'FMT'
       FMT(R8G8B8A8_SRGB, SRGB8_ALPHA8);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGB10_A2' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:462:7: note: in expansion of macro 'FMT'
       FMT(A2B10G10R10_UNORM_PACK32, RGB10_A2);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGB10_A2UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:463:7: note: in expansion of macro 'FMT'
       FMT(A2B10G10R10_UINT_PACK32, RGB10_A2UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_R16UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:465:7: note: in expansion of macro 'FMT'
       FMT(R16_UINT, R16UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_R16I' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:466:7: note: in expansion of macro 'FMT'
       FMT(R16_SINT, R16I);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_R16F' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:467:7: note: in expansion of macro 'FMT'
       FMT(R16_SFLOAT, R16F);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RG16UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:468:7: note: in expansion of macro 'FMT'
       FMT(R16G16_UINT, RG16UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RG16I' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:469:7: note: in expansion of macro 'FMT'
       FMT(R16G16_SINT, RG16I);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RG16F' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:470:7: note: in expansion of macro 'FMT'
       FMT(R16G16_SFLOAT, RG16F);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGBA16UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:471:7: note: in expansion of macro 'FMT'
       FMT(R16G16B16A16_UINT, RGBA16UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGBA16I' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:472:7: note: in expansion of macro 'FMT'
       FMT(R16G16B16A16_SINT, RGBA16I);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGBA16F' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:473:7: note: in expansion of macro 'FMT'
       FMT(R16G16B16A16_SFLOAT, RGBA16F);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_R32UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:475:7: note: in expansion of macro 'FMT'
       FMT(R32_UINT, R32UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_R32I' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:476:7: note: in expansion of macro 'FMT'
       FMT(R32_SINT, R32I);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_R32F' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:477:7: note: in expansion of macro 'FMT'
       FMT(R32_SFLOAT, R32F);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RG32UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:478:7: note: in expansion of macro 'FMT'
       FMT(R32G32_UINT, RG32UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RG32I' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:479:7: note: in expansion of macro 'FMT'
       FMT(R32G32_SINT, RG32I);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RG32F' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:480:7: note: in expansion of macro 'FMT'
       FMT(R32G32_SFLOAT, RG32F);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGBA32UI' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:481:7: note: in expansion of macro 'FMT'
       FMT(R32G32B32A32_UINT, RGBA32UI);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGBA32I' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:482:7: note: in expansion of macro 'FMT'
       FMT(R32G32B32A32_SINT, RGBA32I);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp:448:49: error: 'GL_RGBA32F' was not declared in this scope
 #define FMT(x, r) case SLANG_FORMAT_##x: return GL_##r
                                                 ^
gfx/drivers_shader/shader_gl_core.cpp:483:7: note: in expansion of macro 'FMT'
       FMT(R32G32B32A32_SFLOAT, RGBA32F);
       ^~~
gfx/drivers_shader/shader_gl_core.cpp: In constructor 'gl_core::Framebuffer::Framebuffer(GLenum, unsigned int)':
gfx/drivers_shader/shader_gl_core.cpp:669:16: error: 'GL_RGBA8' was not declared in this scope
       format = GL_RGBA8;
                ^~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp: In member function 'void gl_core::Framebuffer::init()':
gfx/drivers_shader/shader_gl_core.cpp:709:42: error: 'glTexStorage2D' was not declared in this scope
                   size.width, size.height);
                                          ^
gfx/drivers_shader/shader_gl_core.cpp:746:22: error: 'GL_RGBA8' was not declared in this scope
                      GL_RGBA8,
                      ^~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp: In function 'void gl_core::ubo_ring_update_and_bind(unsigned int, unsigned int, const void*, size_t, GLuint)':
gfx/drivers_shader/shader_gl_core.cpp:883:17: error: 'GL_UNIFORM_BUFFER' was not declared in this scope
    glBindBuffer(GL_UNIFORM_BUFFER, id);
                 ^~~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:886:26: error: 'GL_INVALID_INDEX' was not declared in this scope
    if (vertex_binding != GL_INVALID_INDEX)
                          ^~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:887:61: error: 'glBindBufferBase' was not declared in this scope
       glBindBufferBase(GL_UNIFORM_BUFFER, vertex_binding, id);
                                                             ^
gfx/drivers_shader/shader_gl_core.cpp:888:28: error: 'GL_INVALID_INDEX' was not declared in this scope
    if (fragment_binding != GL_INVALID_INDEX)
                            ^~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:889:63: error: 'glBindBufferBase' was not declared in this scope
       glBindBufferBase(GL_UNIFORM_BUFFER, fragment_binding, id);
                                                               ^
gfx/drivers_shader/shader_gl_core.cpp: In member function 'bool gl_core::Pass::init_pipeline()':
gfx/drivers_shader/shader_gl_core.cpp:1221:23: error: 'GL_UNIFORM_BUFFER' was not declared in this scope
          glBindBuffer(GL_UNIFORM_BUFFER, ubo_ring.buffers[i]);
                       ^~~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:1225:20: error: 'GL_UNIFORM_BUFFER' was not declared in this scope
       glBindBuffer(GL_UNIFORM_BUFFER, 0);
                    ^~~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp: In member function 'void gl_core::Pass::build_semantic_uint(uint8_t*, slang_semantic, uint32_t)':
gfx/drivers_shader/shader_gl_core.cpp:1403:57: error: 'glUniform1ui' was not declared in this scope
             glUniform1ui(refl.location.ubo_vertex, value);
                                                         ^
gfx/drivers_shader/shader_gl_core.cpp:1405:59: error: 'glUniform1ui' was not declared in this scope
             glUniform1ui(refl.location.ubo_fragment, value);
                                                           ^
gfx/drivers_shader/shader_gl_core.cpp:1416:58: error: 'glUniform1ui' was not declared in this scope
             glUniform1ui(refl.location.push_vertex, value);
                                                          ^
gfx/drivers_shader/shader_gl_core.cpp:1418:60: error: 'glUniform1ui' was not declared in this scope
             glUniform1ui(refl.location.push_fragment, value);
                                                            ^
gfx/drivers_shader/shader_gl_core.cpp: In member function 'void gl_core::Pass::build_commands(const gl_core::Texture&, const gl_core::Texture&, const gl_core_viewport&, const float*)':
gfx/drivers_shader/shader_gl_core.cpp:1681:55: error: 'GL_INVALID_INDEX' was not declared in this scope
    if (!(      locations.buffer_index_ubo_vertex   == GL_INVALID_INDEX
                                                       ^~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:1715:52: error: 'GL_SRGB8_ALPHA8' was not declared in this scope
    if (framebuffer && framebuffer->get_format() == GL_SRGB8_ALPHA8)
                                                    ^~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:1716:16: error: 'GL_FRAMEBUFFER_SRGB' was not declared in this scope
       glEnable(GL_FRAMEBUFFER_SRGB);
                ^~~~~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:1718:17: error: 'GL_FRAMEBUFFER_SRGB' was not declared in this scope
       glDisable(GL_FRAMEBUFFER_SRGB);
                 ^~~~~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:1723:14: error: 'GL_FRAMEBUFFER_SRGB' was not declared in this scope
    glDisable(GL_FRAMEBUFFER_SRGB);
              ^~~~~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp: In function 'std::unique_ptr<gl_core::StaticTexture> gl_core_filter_chain_load_lut(gl_core_filter_chain*, const video_shader_lut*)':
gfx/drivers_shader/shader_gl_core.cpp:2232:19: error: 'GL_RGBA8' was not declared in this scope
                   GL_RGBA8, image.width, image.height);
                   ^~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:2232:54: error: 'glTexStorage2D' was not declared in this scope
                   GL_RGBA8, image.width, image.height);
                                                      ^
gfx/drivers_shader/shader_gl_core.cpp:2234:18: error: 'GL_UNPACK_ROW_LENGTH' was not declared in this scope
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
                  ^~~~~~~~~~~~~~~~~~~~
gfx/drivers_shader/shader_gl_core.cpp:2236:17: error: 'GL_PIXEL_UNPACK_BUFFER' was not declared in this scope
    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
                 ^~~~~~~~~~~~~~~~~~~~~~
Makefile:204: recipe for target 'obj-unix/release/gfx/drivers_shader/shader_gl_core.o' failed
make: *** [obj-unix/release/gfx/drivers_shader/shader_gl_core.o] Error 1

So, any idea on what is going on?

inactive123 commented 5 years ago

@orbea Should your PR not have fixed these issues? Might want to see if you can figure out a solution based on @vanfanel's feedback.

ghost commented 5 years ago

Add --disable-opengl_core as the glcore driver requires GLES3 which you have not enabled (but glcore is forced on by default instead of support being autodetected)... I guess that's technically a bug on our end.

vanfanel commented 5 years ago

@bparker06 : Yes, I have just added the --disable-opengl_core configure option and it seems to build again. Thanks. I will leave this open because it seems to be a configuration bug anyway.

orbea commented 5 years ago

@twinaphex I fixed some of the issues, but I think it still needs work. Regardless I might of fixed enough for this issue.

@vanfanel Can you test the current master and see if its any better?

vanfanel commented 5 years ago

@orbea : I am going away from the computer for work. Will try tomorrow :)

kivutar commented 5 years ago

--disable-opengl_core fixed it for some platforms like allwinner or imx6, but it still fails on RPi.

orbea commented 5 years ago

@kivutar Please share more information like your configure arguments and your full configure and make output. I can't be expected to fix it for hardware I don't have without some help understanding why its failing. :)

vanfanel commented 5 years ago

@orbea : Just tested as you asked me to do. Current master builds fine without "--disable-opengl_core" on KMS/DRM + MESA GLES (standard GNU/Linux X-less graphics stack). I am on a Raspberry Pi, but it uses the VC4 open source graphics stack, so it is "standard". Many Pi users are still using the old, laggy, closed and propietary BMC graphics stack (that is the difference between @kivutar setup and mine, and that is why you have fixed it for me but not for him) -Standard GNU/Linux graphics stack: MESA GLES implementation on KMS/DRM. -Propietary stack: some closed GLES implementation on a propietary context (DispmanX) or an outdated and buggy context (like MALI on FBDev... eeeeww!). You have fixed the first case (and I wish the second would not even exist).

@kivutar : Lakka is great, but the Pi version should be moved to VC4. Keep away from the propietary BCM stuff: VC4 has a frame less of lag using the same max_swapchain value.

orbea commented 5 years ago

@vanfanel Would you mind checking if your build works without --enable-opengl as well? From my understanding of reading the configure scripts using both --enable-opengl and --enable-opengles will just give you GLESv2.

Also I suspect lot of those configure arguments don't do much, for example it shouldn't find wayland unless you have it installed.

vanfanel commented 5 years ago

@orbea : Of course! I tried without --enable-opengl and current master builds fine, too.

Building without --enable-opengles, however, fails. I suppose it is expected because then, gl1 support is enabled.

orbea commented 5 years ago

Does it build without --enable-opengles, but with --disable-opengl1? The problem is that there is no check for HAVE_OPENGL1 and it defaults to on unless HAVE_OPENGLES or HAVE_OPENGLES3 are enabled which I added recently after v1.7.7. Ideally I think it should build correctly without any configure arguments for you, but that may take some doing. :)

I have an idea for HAVE_OPENGL1, I'll hopefully be able to share a patch in a bit if you are willing to try it.

orbea commented 5 years ago

@vanfanel Would you mind trying this patch? I think this should improve the OpenGLES build, but I noticed now that HAVE_OPENGLES and HAVE_OPENGLES3 are disabled by default so you will need --enable-opengles. I'll have to look at how to improve that.

https://github.com/orbea/RetroArch/commit/271aef55a4dd3402c9730c43d23234f079e1cfe5.patch

vanfanel commented 5 years ago

@orbea

1) Current GIT master DOES build without --enable-opengles and with --disable-opengl1, but the resulting RA executable does not have GLES support, so there is no video. 2) With that patch a gainst current GIT master, RA builds and runs fine on GLES, but yes, I have to pass --enable-opengles

orbea commented 5 years ago

Thanks, that is a step in the right direction. I think having it automatically check for gles2 when opengl is disabled should work, but that will take more work to do correctly.

If you don't mind can you try to make your configure arguments more minimal and report back where it breaks? With that patch I hope it would build with GLES support using just --enable-gles.

vanfanel commented 5 years ago

@orbea: On what version do you want me to do that? Current GIT master or patched current GIT master?

orbea commented 5 years ago

Try with this patch.

https://patch-diff.githubusercontent.com/raw/libretro/RetroArch/pull/8776.patch

Or wait until PR https://github.com/libretro/RetroArch/pull/8776 is merged, master might work too?

vanfanel commented 5 years ago

@orbea With that latest patch applied on current GIT master, RA builds to a working version with only the --enable-opengles configure option :) Nothing else regarding GL/GLES/EGL is needed.

orbea commented 5 years ago

Great! Good to hear that. The next step will be to allow checking for gles automatically if desktop gl is not found, this I still need to consider how to best accomplish.

gouchi commented 2 years ago

@vanfanel This issue should be closed.

vanfanel commented 2 years ago

@gouchi sorry! Closing now