Emulator Issues #13588
openDolphin does not compile with glslang 14.2
0%
Description
I'm trying to compile Dolphin 2407 with system glslang 14.2.0. Previous build using 13.1.1 was successful.
cd /build/dolphin-emu-5.0-21264+dfsg/build/Source/Core/VideoCommon && /usr/bin/c++ -DAUTOUPDATE=1 -DDATA_DIR=\"/usr/share/games/dolphin-emu/\" -DFMT_SHARED -DHAS_LIBMGBA -DHAS_OPENGL -DHAS_VULKAN -DHAVE_EGL=1 -DHAVE_FFMPEG -DHAVE_LIBEVDEV=1 -DHAVE_LIBSYSTEMD -DHAVE_LIBUDEV=1 -DHAVE_SDL2=1 -DHAVE_X11=1 -DHAVE_XRANDR=1 -DUSE_ANALYTICS=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -DUSE_UPNP -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86_64=1 -D__LIBUSB__ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/build/dolphin-emu-5.0-21264+dfsg/Source/Core -I/build/dolphin-emu-5.0-21264+dfsg/Externals/soundtouch -I/build/dolphin-emu-5.0-21264+dfsg/Externals/picojson -I/build/dolphin-emu-5.0-21264+dfsg/build/Source/Core -I/usr/include/imgui -I/build/dolphin-emu-5.0-21264+dfsg/Externals/minizip/. -I/build/dolphin-emu-5.0-21264+dfsg/Externals/expr/include -I/build/dolphin-emu-5.0-21264+dfsg/Externals/implot/implot -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/glslang/glslang/Public -isystem /build/dolphin-emu-5.0-21264+dfsg/Source/Core/VideoCommon/SYSTEM -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/glslang/StandAlone -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/glslang/SPIRV -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/glslang -isystem /usr/include/libusb-1.0 -isystem /usr/include/hidapi -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/rangeset/include -g -O2 -ffile-prefix-map=/build/dolphin-emu-5.0-21264+dfsg=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++20 -I/usr/include -msse2 -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -Wno-stringop-truncation -Werror=format -MD -MT Source/Core/VideoCommon/CMakeFiles/videocommon.dir/TextureCacheBase.cpp.o -MF CMakeFiles/videocommon.dir/TextureCacheBase.cpp.o.d -o CMakeFiles/videocommon.dir/TextureCacheBase.cpp.o -c /build/dolphin-emu-5.0-21264+dfsg/Source/Core/VideoCommon/TextureCacheBase.cpp
/build/dolphin-emu-5.0-21264+dfsg/Source/Core/VideoCommon/Spirv.cpp: In function 'std::optional<std::vector<unsigned int> > {anonymous}::CompileShaderToSPV(EShLanguage, APIType, glslang::EShTargetLanguageVersion, const char*, std::string_view)':
/build/dolphin-emu-5.0-21264+dfsg/Source/Core/VideoCommon/Spirv.cpp:243:17: error: invalid use of incomplete type 'class glslang::TIntermediate'
243 | intermediate->setSourceFile(stage_filename);
| ^~
In file included from /build/dolphin-emu-5.0-21264+dfsg/Source/Core/VideoCommon/Spirv.h:11,
from /build/dolphin-emu-5.0-21264+dfsg/Source/Core/VideoCommon/Spirv.cpp:4:
/usr/include/glslang/Public/ShaderLang.h:414:7: note: forward declaration of 'class glslang::TIntermediate'
414 | class TIntermediate;
| ^~~~~~~~~~~~~
/build/dolphin-emu-5.0-21264+dfsg/Source/Core/VideoCommon/Spirv.cpp:244:17: error: invalid use of incomplete type 'class glslang::TIntermediate'
244 | intermediate->addSourceText(pass_source_code, pass_source_code_length);
| ^~
/usr/include/glslang/Public/ShaderLang.h:414:7: note: forward declaration of 'class glslang::TIntermediate'
414 | class TIntermediate;
| ^~~~~~~~~~~~~
[ 36%] Building CXX object Source/Core/VideoCommon/CMakeFiles/videocommon.dir/TextureConfig.cpp.o
cd /build/dolphin-emu-5.0-21264+dfsg/build/Source/Core/VideoCommon && /usr/bin/c++ -DAUTOUPDATE=1 -DDATA_DIR=\"/usr/share/games/dolphin-emu/\" -DFMT_SHARED -DHAS_LIBMGBA -DHAS_OPENGL -DHAS_VULKAN -DHAVE_EGL=1 -DHAVE_FFMPEG -DHAVE_LIBEVDEV=1 -DHAVE_LIBSYSTEMD -DHAVE_LIBUDEV=1 -DHAVE_SDL2=1 -DHAVE_X11=1 -DHAVE_XRANDR=1 -DUSE_ANALYTICS=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -DUSE_UPNP -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86_64=1 -D__LIBUSB__ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/build/dolphin-emu-5.0-21264+dfsg/Source/Core -I/build/dolphin-emu-5.0-21264+dfsg/Externals/soundtouch -I/build/dolphin-emu-5.0-21264+dfsg/Externals/picojson -I/build/dolphin-emu-5.0-21264+dfsg/build/Source/Core -I/usr/include/imgui -I/build/dolphin-emu-5.0-21264+dfsg/Externals/minizip/. -I/build/dolphin-emu-5.0-21264+dfsg/Externals/expr/include -I/build/dolphin-emu-5.0-21264+dfsg/Externals/implot/implot -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/glslang/glslang/Public -isystem /build/dolphin-emu-5.0-21264+dfsg/Source/Core/VideoCommon/SYSTEM -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/glslang/StandAlone -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/glslang/SPIRV -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/glslang -isystem /usr/include/libusb-1.0 -isystem /usr/include/hidapi -isystem /build/dolphin-emu-5.0-21264+dfsg/Externals/rangeset/include -g -O2 -ffile-prefix-map=/build/dolphin-emu-5.0-21264+dfsg=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++20 -I/usr/include -msse2 -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -Wno-stringop-truncation -Werror=format -MD -MT Source/Core/VideoCommon/CMakeFiles/videocommon.dir/TextureConfig.cpp.o -MF CMakeFiles/videocommon.dir/TextureConfig.cpp.o.d -o CMakeFiles/videocommon.dir/TextureConfig.cpp.o -c /build/dolphin-emu-5.0-21264+dfsg/Source/Core/VideoCommon/TextureConfig.cpp
make[3]: *** [Source/Core/VideoCommon/CMakeFiles/videocommon.dir/build.make:1003: Source/Core/VideoCommon/CMakeFiles/videocommon.dir/Spirv.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/build/dolphin-emu-5.0-21264+dfsg/build'
make[2]: *** [CMakeFiles/Makefile2:1096: Source/Core/VideoCommon/CMakeFiles/videocommon.dir/all] Error 2
make[2]: Leaving directory '/build/dolphin-emu-5.0-21264+dfsg/build'
make[1]: *** [Makefile:159: all] Error 2
make[1]: Leaving directory '/build/dolphin-emu-5.0-21264+dfsg/build'
dh_auto_build: error: cd build && make -j8 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:28: binary] Error 25
Updated by jordi 4 months ago
jordi wrote:
I'm trying to compile Dolphin 2407 with system glslang 14.2.0. Previous build using 13.1.1 was successful.
I can see some similar reports: https://github.com/OGRECave/ogre/issues/3011
And upstream doesn't seem to intend to fix it, so either all distributions repackage those headers, or Dolphin adapts somehow. https://github.com/KhronosGroup/glslang/issues/3491#issuecomment-2099331192
For reference, another Debian package worked around this in a crude way: https://salsa.debian.org/roehling/filament/-/commit/2a8a170bd479f04d6a4d98146d677a8009d1cea2
Updated by iwubcode 4 months ago
Thanks for raising this issue.
From eyeballing the code, it seems like there isn't an easy solution to attach the source information in the new public api. This is a bit different than the other use cases you mentioned. I've opened a question to the glslang group. Will see what they say.
Worse case scenario, if the issue drags on, we can simply remove the offending lines. The actual shader compilation seems usable (from what I have read at least, haven't tried to compile!).
Updated by jordi 4 months ago
iwubcode wrote in #note-2:
Thanks for raising this issue.
From eyeballing the code, it seems like there isn't an easy solution to attach the source information in the new public api. This is a bit different than the other use cases you mentioned. I've opened a question to the glslang group. Will see what they say.
Worse case scenario, if the issue drags on, we can simply remove the offending lines. The actual shader compilation seems usable (from what I have read at least, haven't tried to compile!).
Thanks for having a look. This is being tracked downstream as well in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1064753. For now, I will unvendor, but it's a step back of course.
I can test a patch, if you want.
Updated by jordi 3 months ago
iwubcode wrote in #note-4:
The glslang team has a PR and it has been approved. Once that gets merged, Dolphin team can look at making a build with the updated version.
That's great!
In the meantime, I have uploaded 2407 to Debian, building against vendored fmt and glslang. Looking forward to unvendor glslang as well.