Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rendergraph: use opengl node and add shaders #14021

Merged
merged 21 commits into from
Jan 18, 2025

Conversation

m0dB
Copy link
Contributor

@m0dB m0dB commented Dec 14, 2024

This is a follow up for #14007

With this PR, the allshader waveformwidget and allshader waveformrenderer classes use rendergraph at the highest level: each waveformrenderXX class is derived from a rendergraph node, and all nodes are added to as children to a top node in the waveformwidget. Rendering is that done using the rendergraph engine.

At this point all allshader waveformrenderer classes are derived from a rendergraph::OpenGLNode, and the actual rendering code is still OpenGL, and not yet using the rendergraph render functionality. So effectively the change is that the paintGL functions are called through the rendergraph engine, traversing the nodes, rather than by iterating over them directly in the waveformwidget.

The subsequent PRs will derive each of the allshader waveformrenderer classes from rendergraph::GeometryNode (or of a rendergraph::Node containing a tree of GeometryNodes).

This PR also adds the rendergraph shaders, which will be needed by these PRs.

Copy link
Member

@acolombier acolombier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just need to make a quick manual testing.

src/rendergraph/shaders/generate_shaders_gl.pl Outdated Show resolved Hide resolved
@acolombier
Copy link
Member

I'm getting a segfault at startup

Thread 1 "mixxx" received signal SIGSEGV, Segmentation fault.
0x00005555563430eb in allshader::WaveformWidget::WaveformWidget (this=0x55558e6fcca0, parent=<optimised out>, type=WaveformWidgetType::RGB, group=..., options=...) at /home/antoine/dev/mixxx/src/waveform/widgets/allshader/waveformwidget.cpp:52
52	    if (m_pWaveformRendererSignal && m_pWaveformRendererSignal->supportsSlip()) {
(gdb) bt
#0  0x00005555563430eb in allshader::WaveformWidget::WaveformWidget(QWidget*, WaveformWidgetType::Type, QString const&, QFlags<allshader::WaveformRendererSignalBase::Option>)
    (this=0x55558e6fcca0, parent=<optimised out>, type=WaveformWidgetType::RGB, group=<optimised out>, options=...) at /home/antoine/dev/mixxx/src/waveform/widgets/allshader/waveformwidget.cpp:52
#1  0x0000555556268a56 in WaveformWidgetFactory::createAllshaderWaveformWidget(WaveformWidgetType::Type, WWaveformViewer*) (this=this@entry=0x55555c230cc0, type=type@entry=WaveformWidgetType::RGB, viewer=viewer@entry=0x55558abbef60)
    at /home/antoine/dev/mixxx/src/waveform/waveformwidgetfactory.cpp:1005
#2  0x0000555556268eb6 in WaveformWidgetFactory::createRGBWaveformWidget(WWaveformViewer*) (this=this@entry=0x55555c230cc0, viewer=viewer@entry=0x55558abbef60) at /home/antoine/dev/mixxx/src/waveform/waveformwidgetfactory.cpp:1063
#3  0x0000555556267305 in WaveformWidgetFactory::createWaveformWidget(WaveformWidgetType::Type, WWaveformViewer*) (this=this@entry=0x55555c230cc0, type=WaveformWidgetType::RGB, viewer=viewer@entry=0x55558abbef60)
    at /home/antoine/dev/mixxx/src/waveform/waveformwidgetfactory.cpp:1141
#4  0x0000555556267a90 in WaveformWidgetFactory::setWidgetTypeFromHandle(int, bool) (this=this@entry=0x55555c230cc0, handleIndex=handleIndex@entry=0, force=<optimised out>) at /home/antoine/dev/mixxx/src/waveform/waveformwidgetfactory.cpp:617
#5  0x0000555556266df4 in WaveformWidgetFactory::setWidgetTypeFromConfig() (this=0x55555c230cc0) at /home/antoine/dev/mixxx/src/waveform/waveformwidgetfactory.cpp:583
#6  0x00007ffff17ac023 in  () at /lib/x86_64-linux-gnu/libQt6Core.so.6
#7  0x000055555603e6f4 in MixxxMainWindow::skinLoaded() (this=0x7fffffffd6b0) at mixxx-lib_autogen/include/moc_mixxxmainwindow.cpp:272
#8  MixxxMainWindow::loadConfiguredSkin() (this=this@entry=0x7fffffffd6b0) at /home/antoine/dev/mixxx/src/mixxxmainwindow.cpp:1234
#9  0x000055555603b66a in MixxxMainWindow::initialize() (this=0x7fffffffd6b0) at /home/antoine/dev/mixxx/src/mixxxmainwindow.cpp:324
#10 0x00007ffff17ac023 in  () at /lib/x86_64-linux-gnu/libQt6Core.so.6
#11 0x00007ffff4677ada in QOpenGLWindow::resizeEvent(QResizeEvent*) () at /lib/x86_64-linux-gnu/libQt6OpenGL.so.6
#12 0x00007ffff1e10858 in QWindow::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt6Gui.so.6
#13 0x0000555556344557 in OpenGLWindow::event(QEvent*) (this=0x353167223d646920, pEv=0x0) at /home/antoine/dev/mixxx/src/widget/openglwindow.cpp:70
#14 0x00007ffff4f7fd36 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt6Widgets.so.6
#15 0x000055555602bfcf in MixxxApplication::notify(QObject*, QEvent*) (this=0x7fffffffd630, pTarget=0x55555baf1d40, pEvent=0x7fffffffd2f0) at /home/antoine/dev/mixxx/src/mixxxapplication.cpp:201
#16 0x00007ffff1753a58 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt6Core.so.6
#17 0x00007ffff1dd0300 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () at /lib/x86_64-linux-gnu/libQt6Gui.so.6
#18 0x00007ffff1e13c8c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt6Gui.so.6
#19 0x00007fffe925c86e in  () at /usr/lib/x86_64-linux-gnu/qt6/plugins/platforms/../../../libQt6XcbQpa.so.6
#20 0x00007ffff5d1bd3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007ffff5d712b8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007ffff5d193e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007ffff197beae in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt6Core.so.6
#24 0x00007ffff1760adb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt6Core.so.6
#25 0x00007ffff175c0f3 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt6Core.so.6
#26 0x0000555555b427e4 in (anonymous namespace)::runMixxx(MixxxApplication*, CmdlineArgs const&) (pApp=<optimised out>, args=<optimised out>) at /home/antoine/dev/mixxx/src/main.cpp:108
#27 main(int, char**) (argc=<optimised out>, argv=<optimised out>) at /home/antoine/dev/mixxx/src/main.cpp:243

@m0dB
Copy link
Contributor Author

m0dB commented Dec 20, 2024

Strange. I’ll look into this tomorrow.

@acolombier
Copy link
Member

I had a look and this patch seems to fix the crash

diff --git a/src/waveform/widgets/allshader/waveformwidget.cpp b/src/waveform/widgets/allshader/waveformwidget.cpp
index e6f5536a71..fed38fae1e 100644
--- a/src/waveform/widgets/allshader/waveformwidget.cpp
+++ b/src/waveform/widgets/allshader/waveformwidget.cpp
@@ -25,7 +25,7 @@ WaveformWidget::WaveformWidget(QWidget* parent,
         WaveformWidgetType::Type type,
         const QString& group,
         WaveformRendererSignalBase::Options options)
-        : WGLWidget(parent), WaveformWidgetAbstract(group) {
+        : WGLWidget(parent), WaveformWidgetAbstract(group), m_pWaveformRendererSignal(nullptr) {
     auto pTopNode = std::make_unique<rendergraph::Node>();
     auto pOpacityNode = std::make_unique<rendergraph::OpacityNode>();

Once applied, everything looks great!

@m0dB
Copy link
Contributor Author

m0dB commented Dec 22, 2024

Thanks, @acolombier , a stupid omission on my side indeed.

Edit: actually, it is not so simple. m_pWaveformRendererSignal is never set, that is the bug. Fixing this correctly now.

Edit 2: never mind, your fix is correct, it's set in the header.

@m0dB
Copy link
Contributor Author

m0dB commented Dec 22, 2024

@Holzhaus This is failing through precommit. In fact, I am not sure if it is a good idea to use precommit for this. It seems overkill. I'll remove it from precommit.

@m0dB
Copy link
Contributor Author

m0dB commented Dec 22, 2024

When executing manually, the script fails with:

Traceback (most recent call last):
  File "/Users/maarten/git/mixxx/src/rendergraph/tools/./generate_shaders_gl.py", line 23, in <module>
    executable_name: str, additional_paths: list[str] | None = None
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'

@Holzhaus
Copy link
Member

When executing manually, the script fails with:

Traceback (most recent call last):
  File "/Users/maarten/git/mixxx/src/rendergraph/tools/./generate_shaders_gl.py", line 23, in <module>
    executable_name: str, additional_paths: list[str] | None = None
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'

Your Python version is very old apparently.

@m0dB
Copy link
Contributor Author

m0dB commented Dec 22, 2024

Your Python version is very old apparently.

3.9 which is what is shipped with macOS.

@Holzhaus
Copy link
Member

Exactly, union type expessions are supported since 3.10 (https://docs.python.org/3/library/stdtypes.html#types-union) from October 2021. I will quickly make another PR to use the old style syntax.

@Holzhaus
Copy link
Member

m0dB#19

@Holzhaus
Copy link
Member

@Holzhaus This is failing through precommit. In fact, I am not sure if it is a good idea to use precommit for this. It seems overkill. I'll remove it from precommit.

Why? It ensures that the shaders are regenerated if you touch the source files. It won't run if you don't modify the files.

src/rendergraph/tools/generate_shaders_gl.py Outdated Show resolved Hide resolved
@m0dB
Copy link
Contributor Author

m0dB commented Dec 22, 2024

Why? It ensures that the shaders are regenerated if you touch the source files. It won't run if you don't modify the files.

There is no need to touch these files, or very sporadically.

But also it requires qsb and spirv to be installed in the build agents, as precommit is run there too. And this is clearly not the case.

@Holzhaus
Copy link
Member

Why? It ensures that the shaders are regenerated if you touch the source files. It won't run if you don't modify the files.

There is no need to touch these files, or very sporadically.

But also it requires qsb and spirv to be installed in the build agents, as precommit is run there too. And this is clearly not the case.

Ah, in that case we can add it to the SKIP list in the github action or update the docker container: https://github.com/mixxxdj/mixxx/blob/main/.github/workflows/pre-commit.yml#L18

But anyway, if you don't think it's needed we can also remove it.

@m0dB
Copy link
Contributor Author

m0dB commented Dec 22, 2024

Moved it back and edited documentation (in python and readme). Sorry for the noise, I should have discussed this before starting moving things around. I hope it's all okay now and we can merge this soon, so I can rebased by branches that port the allshader/waveformrenderers to rendergraph and create the corresponding MRs.

@Holzhaus Holzhaus dismissed their stale review December 22, 2024 20:57

requested changes done

src/waveform/renderers/allshader/waveformrendermark.cpp Outdated Show resolved Hide resolved
src/rendergraph/tools/generate_shaders_gl.py Outdated Show resolved Hide resolved
tools/rg_generate_shaders_gl.py Outdated Show resolved Hide resolved
src/waveform/widgets/allshader/waveformwidget.cpp Outdated Show resolved Hide resolved
m_rendererStack.clear();
m_pEngine.reset();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the explicit .reset needed for correctness/safety? If so please add a comment explaining why. If not, then the reset should be safe to remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember, I will give it a try.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the destruction needs to happen inside the OpenGL context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the context is gone after the end of the user-defined constructor? Or what exactly is the problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The context is gone after the call to doneCurrent() (the last line of the destructor).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Well then a comment would be justified why the special ordering is needed.

src/waveform/widgets/allshader/waveformwidget.cpp Outdated Show resolved Hide resolved
src/waveform/widgets/allshader/waveformwidget.h Outdated Show resolved Hide resolved
src/waveform/renderers/allshader/waveformrendermark.cpp Outdated Show resolved Hide resolved
@m0dB
Copy link
Contributor Author

m0dB commented Jan 6, 2025

I think I have addressed all issues, either with code changes, added comments, or explanations. I would really like to see this merged so I create the PRs that migrate all waveformrenderers to rendergraph.

@Swiftb0y
Copy link
Member

Swiftb0y commented Jan 7, 2025

Yup I agree. I resolved everything addressed and added responses to the still open topics.

@m0dB m0dB force-pushed the rg-use-opengl-node-and-add-shaders branch from 0fdb5fb to 2635bc2 Compare January 18, 2025 20:22
@m0dB
Copy link
Contributor Author

m0dB commented Jan 18, 2025

There are no unresolved issues left and this should be ready to be merged. But main did change quite a bit in the meantime and there were conflicts, so I have rebased this on main. I know it's not ideal for the review history but I hope it's okay in this case.

After rebasing everything still seems to work as expected, but it might be good if you (@acolombier ?) can give it a smoke test before merging.

Copy link
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this breaks the build for me. I'm using CMake 3.31.4 and Qt 6.8.1.

CMake log
$ cmake -DQT6=ON -DWARNINGS_FATAL=ON -DDEBUG_ASSERTIONS_FATAL=ON .. && cmake --build . -j $(nproc) && ctest -j $(nproc)
-- CMAKE_VERSION: 3.31.4
-- Setting CMAKE_BUILD_TYPE to 'Debug' as none was specified.
-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Optimization level: portable
-- Enabling SSE2 CPU optimizations (>= Pentium 4)
-- Found ccache: /usr/bin/ccache
-- Support for ccache: ON
-- Selecting mold as linker
-- Enabling QML Debugging! This poses a security risk as Mixxx will open a TCP port for debugging
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found Chromaprint: /usr/lib/libchromaprint.so (found version "1.5.1")
-- Found SQLite3: /usr/include (found version "3.48.0")
-- Could NOT find DjInterop (missing: DjInterop_DIR)
-- Could NOT find DjInterop (missing: DjInterop_LIBRARY DjInterop_INCLUDE_DIR DjInterop_VERSION) (Required is exact version "0.22.1")
-- Building libdjinterop sources (with system SQLite) fetched from GitHub
-- Found ZLIB: /usr/lib/libz.so (found suitable version "1.3.1", minimum required is "1.2.8")
-- Found Ebur128: /usr/lib/libebur128.so (found version "1.2.6")
-- Found KeyFinder: /usr/lib/libkeyfinder.so (Required is at least version "2.2.4")
-- Found FLAC: /usr/lib/libFLAC.so (found version "1.4.3")
-- Found mp3lame: /usr/lib/libmp3lame.so
-- Found OpenGL: /usr/lib/libOpenGL.so
-- Found Ogg: /usr/lib/libogg.so (found version "1.3.5")
-- Found Vorbis: /usr/include  found components: vorbis vorbisenc vorbisfile
-- Found PortAudio: /usr/lib/libportaudio.so (found version "19")
-- Found PortMidi: /usr/lib/libportmidi.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib/libxkbcommon.so (found suitable version "1.7.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Found Cups: /usr/lib/libcups.so (found version "2.4.11")
rgbsignal_qml.frag -> rgbsignal_qml.frag.qsb exposed as :/shaders/rgbsignal_qml.frag.qsb
CMake Warning (dev) at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:3353 (message):
  Qt policy QTP0004 is not set: You need qmldir files for each extra
  directory that contains .qml files for your module.  Check
  https://doc.qt.io/qt-6/qt-cmake-policy-qtp0004.html for policy details.
  Use the qt_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  /usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:3299 (__qt_internal_setup_policy)
  /usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:896 (qt6_target_qml_sources)
  /usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:1232 (qt6_add_qml_module)
  CMakeLists.txt:3205 (qt_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:3353 (message):
  Qt policy QTP0004 is not set: You need qmldir files for each extra
  directory that contains .qml files for your module.  Check
  https://doc.qt.io/qt-6/qt-cmake-policy-qtp0004.html for policy details.
  Use the qt_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  /usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:3299 (__qt_internal_setup_policy)
  /usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:896 (qt6_target_qml_sources)
  /usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:1232 (qt6_add_qml_module)
  CMakeLists.txt:3239 (qt_add_qml_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found rubberband: /usr/lib/librubberband.so (found version "4.0.0")
-- Found SndFile: /usr/lib/libsndfile.so (found version "1.2.2")
-- Found SoundTouch: /usr/lib/libSoundTouch.so (found suitable version "2.3.3", minimum required is "2.1.2")
-- Found TagLib: /usr/lib/taglib1/libtag.so (found suitable version "1.13.1", minimum required is "1.11")
-- Found Upower: /usr/lib/libupower-glib.so (found version "1.90.7")
-- Found GLIB: /usr/include/glib-2.0;/usr/lib/glib-2.0/include (found version "2.82.4")
-- Could NOT find MP4 (missing: MP4_LIBRARY MP4_INCLUDE_DIR)
-- Found MP4v2: /usr/lib/libmp4v2.so (found version "2.1.3")
-- Searching for FFMPEG components
--   - libavcodec 61.19.100 found.
--   - libavformat 61.7.100 found.
--   - libavdevice 61.3.100 found.
--   - libavutil 59.39.100 found.
--   - libavfilter 10.4.100 found.
--   - libswscale 8.3.100 found.
--   - libswresample 5.3.100 found.
-- Found FFMPEG: /usr/lib/libavcodec.so;/usr/lib/libavformat.so;/usr/lib/libavutil.so;/usr/lib/libswresample.so
-- Found lilv: /usr/lib/liblilv-0.so
-- Could NOT find Shoutidjc (missing: Shoutidjc_LIBRARY Shoutidjc_INCLUDE_DIR)
-- Using internal libshout-idjc
-- Found OpenSSL: /usr/lib/libcrypto.so (found version "3.4.0")
-- Looking for __GNU_LIBRARY__
-- Looking for __GNU_LIBRARY__ - found
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for sys/select.h
-- Looking for sys/select.h - found
-- Looking for sys/socket.h
-- Looking for sys/socket.h - found
-- Looking for winsock2.h
-- Looking for winsock2.h - not found
-- Looking for sys/uio.h
-- Looking for sys/uio.h - found
-- Looking for writev
-- Looking for writev - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for sys/timeb.h
-- Looking for sys/timeb.h - found
-- Looking for ftime
-- Looking for ftime - found
-- Looking for time.h
-- Looking for time.h - found
-- Looking for pthread_spin_init
-- Looking for pthread_spin_init - not found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for poll
-- Looking for poll - not found
-- Looking for endhostent
-- Looking for endhostent - found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - found
-- Looking for getnameinfo
-- Looking for getnameinfo - found
-- Looking for inet_aton
-- Looking for inet_aton - found
-- Looking for inet_pton
-- Looking for inet_pton - found
-- Looking for sethostent
-- Looking for sethostent - found
-- Looking for strcasestr
-- Looking for strcasestr - found
-- Looking for X509_check_host
-- Looking for X509_check_host - not found
-- Found OpusFile: /usr/lib/libopusfile.so (found version "0.12")
-- Found Opus: /usr/lib/libopus.so (found version "1.5.2")
-- Found MAD: /usr/lib/libmad.so (found version "0.15.1b")
-- Found ID3Tag: /usr/lib/libid3tag.so (found version "0.16.3")
-- Found Modplug: /usr/lib/libmodplug.so (found version "0.8.9.0")
-- Found LibUSB: /usr/lib/libusb-1.0.so (found version "1.0.27")
-- Found hidapi: /usr/lib/libhidapi-libusb.so (found suitable version "0.14.0", minimum required is "0.14.0")
-- Found Libudev: /usr/lib/libudev.so
-- Qt version 6.8
-- Using QShader to load qsb shaders for opengl
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


pattern.frag -> pattern.frag.qsb exposed as :/shaders/rendergraph/pattern.frag.qsb
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


pattern.vert -> pattern.vert.qsb exposed as :/shaders/rendergraph/pattern.vert.qsb
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


rgb.frag -> rgb.frag.qsb exposed as :/shaders/rendergraph/rgb.frag.qsb
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


rgb.vert -> rgb.vert.qsb exposed as :/shaders/rendergraph/rgb.vert.qsb
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


rgba.frag -> rgba.frag.qsb exposed as :/shaders/rendergraph/rgba.frag.qsb
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


rgba.vert -> rgba.vert.qsb exposed as :/shaders/rendergraph/rgba.vert.qsb
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


texture.frag -> texture.frag.qsb exposed as :/shaders/rendergraph/texture.frag.qsb
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


texture.vert -> texture.vert.qsb exposed as :/shaders/rendergraph/texture.vert.qsb
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


unicolor.frag -> unicolor.frag.qsb exposed as :/shaders/rendergraph/unicolor.frag.qsb
CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2127 (get_target_property):
  get_target_property() called with non-existent target "rendergraph_sg".
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:103 (_qt_internal_expose_source_file_to_ide)
  /usr/lib/cmake/Qt6ShaderToolsTools/Qt6ShaderToolsMacros.cmake:354 (_qt_internal_add_shaders_impl)
  src/rendergraph/shaders/CMakeLists.txt:17 (qt6_add_shaders)


unicolor.vert -> unicolor.vert.qsb exposed as :/shaders/rendergraph/unicolor.vert.qsb
-- Adding qsb shaders to rendergraph_gl
pattern.frag -> pattern.frag.qsb exposed as :/shaders/rendergraph/pattern.frag.qsb
pattern.vert -> pattern.vert.qsb exposed as :/shaders/rendergraph/pattern.vert.qsb
rgb.frag -> rgb.frag.qsb exposed as :/shaders/rendergraph/rgb.frag.qsb
rgb.vert -> rgb.vert.qsb exposed as :/shaders/rendergraph/rgb.vert.qsb
rgba.frag -> rgba.frag.qsb exposed as :/shaders/rendergraph/rgba.frag.qsb
rgba.vert -> rgba.vert.qsb exposed as :/shaders/rendergraph/rgba.vert.qsb
texture.frag -> texture.frag.qsb exposed as :/shaders/rendergraph/texture.frag.qsb
texture.vert -> texture.vert.qsb exposed as :/shaders/rendergraph/texture.vert.qsb
unicolor.frag -> unicolor.frag.qsb exposed as :/shaders/rendergraph/unicolor.frag.qsb
unicolor.vert -> unicolor.vert.qsb exposed as :/shaders/rendergraph/unicolor.vert.qsb
-- Found wavpack: /usr/lib/libwavpack.so (found version "5.7.0")
-- Configuring incomplete, errors occurred!

Comment on lines -42 to +45
add_subdirectory(scenegraph)
#################################
# TODO: uncomment in follow-up PR
# add_subdirectory(scenegraph)
#################################
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is the culprit that breaks it for me. WIthout scenegraph, the calls that reference the non-existing rendergraph_sg target fail.

Side note: Splitting the CMake code over multiple small CMakeLists.txt files that reference targets and variables defined elsewhere makes the control flow quite difficult to follow. Have you considered just using a single CMakeLists.txt inside the rendergraph directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, for now the calls that reference the non-existing rendergraph_sg target fail should be commented out. I will do that.

I obsoletely prefer splitting cmake over multiple files, one per target.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please try again, @Holzhaus ? I added conditionals to only add the shaders for the targets that were added.
(It looks like this is a change in Qt, being more strict about this in more recent versions)

Copy link
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build error is fixed now.

Copy link
Member

@acolombier acolombier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran a smoke test and LGTM! Can't wait to have the rendergraph all out, thanks for your continuous efforts!

@m0dB m0dB merged commit 60c2587 into mixxxdj:main Jan 18, 2025
12 checks passed
@m0dB
Copy link
Contributor Author

m0dB commented Jan 18, 2025

Below a list of the follow-up PRs that port the waveformrenderer code to use the rendergraph API. These can be reviewed and merged in parallel. (There will be one minor conflict to resolve in mark if markrange has been merged first and vice versa)

When these have all been merged, we can also compile the scenegraph backend (rendergraph_sg) and @acolombier can use the above from QML.

stem waveformrenderer using rendergraph
#14192

slip waveformrenderer using rendergraph
#14191

preroll waveformrenderer using rendergraph
#14190

markrange waveformrenderer using rendergraph
#14189

mark waveformrenderer using rendergraph
#14188

endoftrack waveformrenderer using rendergraph
#14187

signal waveformrenderer using rendergraph
#14186

beat waveformrenderer using rendergraph
#14185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants