mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-08 08:10:30 -10:00
ui/companion, ui/drivers/qt: link with no shader stack (fixes the Linux-qt-companion CI job)
The new Linux-qt-companion job failed to link: the runner has no OpenGL/Vulkan dev packages, so with --disable-opengl/--disable-vulkan the build had no shader stack at all (HAVE_GLSL, HAVE_SLANG, HAVE_CG, HAVE_HLSL all off). menu_shader_get() is only compiled under one of those, but two places gated on HAVE_MENU alone: - ui/companion/companion_core.c called menu_shader_get() from its shader-parameter accessors -> undefined reference. Now under HAVE_MENU + a shader stack (COMPANION_HAVE_SHADERS); without one the accessors report no shader, which is the truth. - ui/drivers/ui_qt_widgets.h declared ShaderPass / ShaderParamsDialog under HAVE_MENU while ui_qt_widgets.cpp defines them under HAVE_MENU + shader stack, so moc emitted metaobject code for 40 methods nobody defined. The declaration now uses the same test; all use sites in ui_qt.cpp were already gated. Reproduced and re-checked at translation-unit level with the shader defines removed (config.h and -D): before, nm showed the 40 dangling ShaderParamsDialog references and menu_shader_get; after, none. The CI job now passes --disable-glsl --disable-slang --disable-cg --disable-glslang --disable-spirv_cross explicitly so it builds this configuration regardless of what the runner has installed - it is the one configuration no other job covers. The companion test scripts (core, win32, cocoa) stub menu_shader_get() and test the shader accessors, i.e. they emulate a build WITH a shader stack; they now say so with -DHAVE_GLSL. companion_core_test plain + asan OK; companion_win32_test OK under wine.
This commit is contained in:
1 parent
2d0341ce9c
commit
8cb5f8a08f
6 files changed
+27
-9
No files matched your search
@@ -21,6 +21,12 @@ jobs:
|
||||
# companion's window geometry and dock layout must reach
|
||||
# retroarch.cfg when RetroArch quits with the companion window still
|
||||
# open, and a saved layout must restore and re-save identically.
|
||||
#
|
||||
# The shader stacks are disabled explicitly: with no OpenGL/Vulkan
|
||||
# dev packages on the runner this is a Qt build with NO shader stack
|
||||
# at all, and it links (the shader-preset editor and the companion
|
||||
# core's shader accessors are compiled out). That is deliberate - it
|
||||
# is the one configuration the other jobs never build.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Dependencies
|
||||
@@ -55,7 +61,8 @@ jobs:
|
||||
--disable-roar --disable-al --disable-xvideo --disable-kms \
|
||||
--disable-egl --disable-dispmanx --disable-videocore \
|
||||
--disable-crtswitchres --disable-update_cores --disable-hid \
|
||||
--disable-dbus
|
||||
--disable-dbus --disable-glsl --disable-slang --disable-cg \
|
||||
--disable-glslang --disable-spirv_cross
|
||||
- name: Build
|
||||
run: make -j$(getconf _NPROCESSORS_ONLN)
|
||||
- name: Companion persistence regression
|
||||
|
||||
@@ -55,7 +55,7 @@ EOF
|
||||
|
||||
LC=libretro-common
|
||||
INC="-I$SHIM -I. -I$LC/include -Ideps -Igfx/include"
|
||||
DEFS="-DRARCH_INTERNAL -DLIBRETRO_STRL_CHECK_OVERLAP -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_THREADS -DHAVE_COCOA -DTARGET_OS_OSX=1 -DHAVE_RPNG -DHAVE_RTGA -DHAVE_COMPANION_WIMP -DCOMPANION_TEST_NO_MAIN -DCOMPANION_CORE_TESTING"
|
||||
DEFS="-DRARCH_INTERNAL -DLIBRETRO_STRL_CHECK_OVERLAP -DHAVE_MENU -DHAVE_GLSL -DHAVE_CONFIGFILE -DHAVE_THREADS -DHAVE_COCOA -DTARGET_OS_OSX=1 -DHAVE_RPNG -DHAVE_RTGA -DHAVE_COMPANION_WIMP -DCOMPANION_TEST_NO_MAIN -DCOMPANION_CORE_TESTING"
|
||||
SAN=""
|
||||
case "${1:-}" in
|
||||
asan) SAN="-fsanitize=address -fno-omit-frame-pointer" ;;
|
||||
|
||||
@@ -23,7 +23,9 @@ trap 'rm -rf "$OUT"' EXIT
|
||||
|
||||
LC=libretro-common
|
||||
INC="-I. -I$LC/include -Ideps -Igfx/include"
|
||||
DEFS="-DRARCH_INTERNAL -DLIBRETRO_STRL_CHECK_OVERLAP -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_THREADS -DHAVE_COMPANION_WIMP -DHAVE_RPNG -DHAVE_RTGA -DCOMPANION_CORE_TESTING"
|
||||
# HAVE_GLSL: the fixture stubs menu_shader_get(); the core only compiles
|
||||
# its shader accessors when some shader stack is present.
|
||||
DEFS="-DRARCH_INTERNAL -DLIBRETRO_STRL_CHECK_OVERLAP -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_THREADS -DHAVE_COMPANION_WIMP -DHAVE_RPNG -DHAVE_RTGA -DHAVE_GLSL -DCOMPANION_CORE_TESTING"
|
||||
SRCS="ui/companion/companion_core.c \
|
||||
ui/companion/companion_thumbs.c \
|
||||
gfx/gfx_anim_preview.c \
|
||||
|
||||
@@ -22,7 +22,7 @@ trap 'rm -rf "$OUT"' EXIT
|
||||
|
||||
LC=libretro-common
|
||||
INC="-I. -I$LC/include -Ideps -Igfx/include"
|
||||
DEFS="-DRARCH_INTERNAL -DLIBRETRO_STRL_CHECK_OVERLAP -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_THREADS -DHAVE_RPNG -DHAVE_RTGA -DHAVE_COMPANION_WIMP -DCOMPANION_TEST_NO_MAIN -DCOMPANION_CORE_TESTING"
|
||||
DEFS="-DRARCH_INTERNAL -DLIBRETRO_STRL_CHECK_OVERLAP -DHAVE_MENU -DHAVE_GLSL -DHAVE_CONFIGFILE -DHAVE_THREADS -DHAVE_RPNG -DHAVE_RTGA -DHAVE_COMPANION_WIMP -DCOMPANION_TEST_NO_MAIN -DCOMPANION_CORE_TESTING"
|
||||
|
||||
CSRCS="ui/companion/companion_core.c \
|
||||
ui/companion/companion_thumbs.c \
|
||||
|
||||
@@ -641,13 +641,16 @@ void companion_core_option_reset_all(companion_core_t *core)
|
||||
companion_core_option_reset(core, i);
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
/* menu_shader_get() is only compiled when a shader stack is; without
|
||||
* one the companions simply have no shader parameters to show. */
|
||||
#if defined(HAVE_MENU) && (defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL))
|
||||
#define COMPANION_HAVE_SHADERS 1
|
||||
#include "../../menu/menu_shader.h"
|
||||
#endif
|
||||
|
||||
static struct video_shader *companion_core_shader(void)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
#ifdef COMPANION_HAVE_SHADERS
|
||||
return menu_shader_get();
|
||||
#else
|
||||
return NULL;
|
||||
|
||||
@@ -744,8 +744,14 @@ protected:
|
||||
* and HAVE_CG/GLSL/SLANG/HLSL in the .cpp; gate the declarations to
|
||||
* match so moc does not emit metaobject code for a class that has
|
||||
* no defined methods. Forward declarations above keep external
|
||||
* pointer-typed members valid. */
|
||||
#ifdef HAVE_MENU
|
||||
* pointer-typed members valid.
|
||||
*
|
||||
* The shader-preset editor also needs a shader stack: its definitions
|
||||
* in ui_qt_widgets.cpp are under the same test, and so must this
|
||||
* declaration be, or moc emits metaobject code that references methods
|
||||
* no translation unit defines (a Qt build with no OpenGL/Vulkan dev
|
||||
* packages - the CI Qt companion job - failed to link this way). */
|
||||
#if defined(HAVE_MENU) && (defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL))
|
||||
|
||||
class ShaderPass
|
||||
{
|
||||
@@ -818,7 +824,7 @@ protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
};
|
||||
|
||||
#endif /* HAVE_MENU - shader-preset editor */
|
||||
#endif /* HAVE_MENU + shader stack - shader-preset editor */
|
||||
|
||||
class ViewOptionsWidget : public QWidget
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user