diff --git a/README.md b/README.md index 070079fed..2b21d3c0f 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,11 @@ It might support all versions Qt >= 5.15, but you can rely on: - current long term supported ( LTS ) version of Qt ( at the moment Qt 6.5.x ) - current version of Qt -On debian bullseye these packages need to be installed for Qt5: `build-essential -qtbase5-dev qtbase5-private-dev qtdeclarative5-dev qtdeclarative5-private-dev libqt5svg5-dev`. -For Qt6 you need the corresponding ones. +On Debian these packages need to be installed for Qt6: `build-essential cmake +qtbase6-dev qtbase6-private-dev qtdeclarative6-dev qtdeclarative6-private-dev libqt6svg-dev qt6-shadertools` +For Qt5 you need: `build-essential cmake +qtbase5-dev qtbase5-private-dev qtdeclarative5-dev qtdeclarative5-private-dev libqt5svg-dev`. + > Optional: When enabling the `hunspell` feature the following package needs to be installed: `libhunspell-dev` diff --git a/cmake/QskFindMacros.cmake b/cmake/QskFindMacros.cmake index 2dbe7d002..0c9d8583f 100644 --- a/cmake/QskFindMacros.cmake +++ b/cmake/QskFindMacros.cmake @@ -15,6 +15,11 @@ macro(qsk_setup_Qt) endif() find_package(QT "5.15" NAMES ${QSK_QT_VERSION} REQUIRED COMPONENTS Quick) + if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6) + # we need the qsb tool for Qt6 + find_package(Qt6 REQUIRED COMPONENTS ShaderTools) + endif() + if ( QT_FOUND ) # Would like to have a status message about where the Qt installation diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3c6b49705..99386af73 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,7 +173,9 @@ list(APPEND SOURCES nodes/QskVertex.cpp ) -qt_add_resources(SOURCES nodes/shaders.qrc) +if (QT_VERSION_MAJOR VERSION_LESS 6) + qt_add_resources(SOURCES nodes/shaders.qrc) +endif() list(APPEND HEADERS controls/QskAbstractButton.h @@ -473,6 +475,49 @@ if(BUILD_QSKDLL) set_target_properties(${target} PROPERTIES DEFINE_SYMBOL QSK_MAKEDLL) endif() +if (QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6) + + qt6_add_shaders(${target} "qskshaders" + + BATCHABLE + PRECOMPILE + + #OPTIMIZED + QUIET + + PREFIX + "/qskinny/shaders" + + FILES + nodes/shaders/arcshadow-vulkan.vert + nodes/shaders/arcshadow-vulkan.frag + nodes/shaders/boxshadow-vulkan.vert + nodes/shaders/boxshadow-vulkan.frag + nodes/shaders/crisplines-vulkan.vert + nodes/shaders/crisplines-vulkan.frag + nodes/shaders/gradientconic-vulkan.vert + nodes/shaders/gradientconic-vulkan.frag + nodes/shaders/gradientlinear-vulkan.vert + nodes/shaders/gradientlinear-vulkan.frag + nodes/shaders/gradientradial-vulkan.vert + nodes/shaders/gradientradial-vulkan.frag + + OUTPUTS + arcshadow.vert.qsb + arcshadow.frag.qsb + boxshadow.vert.qsb + boxshadow.frag.qsb + crisplines.vert.qsb + crisplines.frag.qsb + gradientconic.vert.qsb + gradientconic.frag.qsb + gradientlinear.vert.qsb + gradientlinear.frag.qsb + gradientradial.vert.qsb + gradientradial.frag.qsb + ) +endif() + target_include_directories(${target} PUBLIC $ $ diff --git a/src/controls/QskWindow.cpp b/src/controls/QskWindow.cpp index f46c6da51..7955320a5 100644 --- a/src/controls/QskWindow.cpp +++ b/src/controls/QskWindow.cpp @@ -416,6 +416,20 @@ void QskWindow::keyReleaseEvent( QKeyEvent* event ) void QskWindow::exposeEvent( QExposeEvent* event ) { +#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) + if ( qskRenderingHardwareInterface( this ) ) + { + /* + Actually our code supports Qt5 RHI ( f9c08c34fb2cc64546bbe6ce9d359f416e934961 ), + but Qt5 does not come with the qsb tool out of the box. Then we run into + problems with compiling the shader code from the makefiles. + But why should anyone use the experimental Qt5 RHI implementations + instead of using Qt6 ... + */ + qFatal( "the experimental Qt5 RHI implementation is not supported:\n" + "\tuse Qt6 or run the default OpenGL backend." ); + } +#endif ensureFocus( Qt::OtherFocusReason ); layoutItems(); diff --git a/src/nodes/shaders.qrc b/src/nodes/shaders.qrc index 7d2d15a42..3919b702e 100644 --- a/src/nodes/shaders.qrc +++ b/src/nodes/shaders.qrc @@ -2,33 +2,21 @@ - shaders/arcshadow.frag shaders/arcshadow.vert - shaders/arcshadow.frag.qsb - shaders/arcshadow.vert.qsb + shaders/arcshadow.frag - shaders/boxshadow.vert.qsb - shaders/boxshadow.frag.qsb shaders/boxshadow.vert shaders/boxshadow.frag - shaders/gradientconic.vert.qsb - shaders/gradientconic.frag.qsb shaders/gradientconic.vert shaders/gradientconic.frag - shaders/gradientradial.vert.qsb - shaders/gradientradial.frag.qsb shaders/gradientradial.vert shaders/gradientradial.frag - shaders/gradientlinear.vert.qsb - shaders/gradientlinear.frag.qsb shaders/gradientlinear.vert shaders/gradientlinear.frag - shaders/crisplines.vert.qsb - shaders/crisplines.frag.qsb shaders/crisplines.vert diff --git a/src/nodes/shaders/arcshadow.frag.qsb b/src/nodes/shaders/arcshadow.frag.qsb deleted file mode 100644 index 1c9070330..000000000 Binary files a/src/nodes/shaders/arcshadow.frag.qsb and /dev/null differ diff --git a/src/nodes/shaders/arcshadow.vert.qsb b/src/nodes/shaders/arcshadow.vert.qsb deleted file mode 100644 index ae08a617e..000000000 Binary files a/src/nodes/shaders/arcshadow.vert.qsb and /dev/null differ diff --git a/src/nodes/shaders/arcshadow2qsb.sh b/src/nodes/shaders/arcshadow2qsb.sh deleted file mode 100755 index d78eed3bf..000000000 --- a/src/nodes/shaders/arcshadow2qsb.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/sh - -function qsbcompile { - qsbfile=`echo $1 | sed 's/-vulkan//'` - qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -o ${qsbfile}.qsb $1 - # qsb --qt6 -b -o ${qsbfile}.qsb $1 -} - -qsbcompile arcshadow-vulkan.vert -qsbcompile arcshadow-vulkan.frag diff --git a/src/nodes/shaders/boxshadow.frag.qsb b/src/nodes/shaders/boxshadow.frag.qsb deleted file mode 100644 index 3792962e6..000000000 Binary files a/src/nodes/shaders/boxshadow.frag.qsb and /dev/null differ diff --git a/src/nodes/shaders/boxshadow.vert.qsb b/src/nodes/shaders/boxshadow.vert.qsb deleted file mode 100644 index 2e1e841bb..000000000 Binary files a/src/nodes/shaders/boxshadow.vert.qsb and /dev/null differ diff --git a/src/nodes/shaders/crisplines.frag.qsb b/src/nodes/shaders/crisplines.frag.qsb deleted file mode 100644 index 274f8d554..000000000 Binary files a/src/nodes/shaders/crisplines.frag.qsb and /dev/null differ diff --git a/src/nodes/shaders/crisplines.vert.qsb b/src/nodes/shaders/crisplines.vert.qsb deleted file mode 100644 index 674b357c8..000000000 Binary files a/src/nodes/shaders/crisplines.vert.qsb and /dev/null differ diff --git a/src/nodes/shaders/gradientconic.frag.qsb b/src/nodes/shaders/gradientconic.frag.qsb deleted file mode 100644 index 8a7e83b9b..000000000 Binary files a/src/nodes/shaders/gradientconic.frag.qsb and /dev/null differ diff --git a/src/nodes/shaders/gradientconic.vert.qsb b/src/nodes/shaders/gradientconic.vert.qsb deleted file mode 100644 index f807bce7b..000000000 Binary files a/src/nodes/shaders/gradientconic.vert.qsb and /dev/null differ diff --git a/src/nodes/shaders/gradientlinear.frag.qsb b/src/nodes/shaders/gradientlinear.frag.qsb deleted file mode 100644 index be5fa92c5..000000000 Binary files a/src/nodes/shaders/gradientlinear.frag.qsb and /dev/null differ diff --git a/src/nodes/shaders/gradientlinear.vert.qsb b/src/nodes/shaders/gradientlinear.vert.qsb deleted file mode 100644 index 4a4a0b36b..000000000 Binary files a/src/nodes/shaders/gradientlinear.vert.qsb and /dev/null differ diff --git a/src/nodes/shaders/gradientradial.frag.qsb b/src/nodes/shaders/gradientradial.frag.qsb deleted file mode 100644 index 9759ed4ca..000000000 Binary files a/src/nodes/shaders/gradientradial.frag.qsb and /dev/null differ diff --git a/src/nodes/shaders/gradientradial.vert.qsb b/src/nodes/shaders/gradientradial.vert.qsb deleted file mode 100644 index b530364f6..000000000 Binary files a/src/nodes/shaders/gradientradial.vert.qsb and /dev/null differ