supoort of experimental Qt5/RHI dropped ( use Qt6 for RHI ). Building

the qsb files from the makefiles. See https://github.com/uwerat/qskinny/issues/356
This commit is contained in:
Uwe Rathmann 2024-01-08 16:06:43 +01:00
parent f9c08c34fb
commit 81cecb6ec4
18 changed files with 71 additions and 27 deletions

View File

@ -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`

View File

@ -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

View File

@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/common>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/controls>

View File

@ -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();

View File

@ -2,33 +2,21 @@
<RCC version="1.0">
<qresource prefix="/qskinny/">
<file>shaders/arcshadow.frag</file>
<file>shaders/arcshadow.vert</file>
<file>shaders/arcshadow.frag.qsb</file>
<file>shaders/arcshadow.vert.qsb</file>
<file>shaders/arcshadow.frag</file>
<file>shaders/boxshadow.vert.qsb</file>
<file>shaders/boxshadow.frag.qsb</file>
<file>shaders/boxshadow.vert</file>
<file>shaders/boxshadow.frag</file>
<file>shaders/gradientconic.vert.qsb</file>
<file>shaders/gradientconic.frag.qsb</file>
<file>shaders/gradientconic.vert</file>
<file>shaders/gradientconic.frag</file>
<file>shaders/gradientradial.vert.qsb</file>
<file>shaders/gradientradial.frag.qsb</file>
<file>shaders/gradientradial.vert</file>
<file>shaders/gradientradial.frag</file>
<file>shaders/gradientlinear.vert.qsb</file>
<file>shaders/gradientlinear.frag.qsb</file>
<file>shaders/gradientlinear.vert</file>
<file>shaders/gradientlinear.frag</file>
<file>shaders/crisplines.vert.qsb</file>
<file>shaders/crisplines.frag.qsb</file>
<file>shaders/crisplines.vert</file>
</qresource>

Binary file not shown.

Binary file not shown.

View File

@ -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

Binary file not shown.

Binary file not shown.