Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qt6-shadertools for openSUSE:Factory checked in at 2023-10-13 23:14:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qt6-shadertools (Old) and /work/SRC/openSUSE:Factory/.qt6-shadertools.new.20540 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qt6-shadertools" Fri Oct 13 23:14:31 2023 rev:26 rq:1116954 version:6.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/qt6-shadertools/qt6-shadertools.changes 2023-10-02 20:07:51.821819465 +0200 +++ /work/SRC/openSUSE:Factory/.qt6-shadertools.new.20540/qt6-shadertools.changes 2023-10-13 23:15:18.540403589 +0200 @@ -1,0 +2,6 @@ +Tue Oct 10 09:40:00 UTC 2023 - Christophe Marin <christo...@krop.fr> + +- Update to 6.6.0 + * https://www.qt.io/blog/qt-6.6-released + +------------------------------------------------------------------- Old: ---- qtshadertools-everywhere-src-6.5.3.tar.xz New: ---- qtshadertools-everywhere-src-6.6.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qt6-shadertools.spec ++++++ --- /var/tmp/diff_new_pack.mzTieT/_old 2023-10-13 23:15:19.368433622 +0200 +++ /var/tmp/diff_new_pack.mzTieT/_new 2023-10-13 23:15:19.372433768 +0200 @@ -16,8 +16,8 @@ # -%define real_version 6.5.3 -%define short_version 6.5 +%define real_version 6.6.0 +%define short_version 6.6 %define tar_name qtshadertools-everywhere-src %define tar_suffix %{nil} # @@ -27,7 +27,7 @@ %endif # Name: qt6-shadertools%{?pkg_suffix} -Version: 6.5.3 +Version: 6.6.0 Release: 0 Summary: Qt 6 ShaderTools library License: GPL-3.0-or-later ++++++ qtshadertools-everywhere-src-6.5.3.tar.xz -> qtshadertools-everywhere-src-6.6.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/.cmake.conf new/qtshadertools-everywhere-src-6.6.0/.cmake.conf --- old/qtshadertools-everywhere-src-6.5.3/.cmake.conf 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/.cmake.conf 2023-10-02 05:05:36.000000000 +0200 @@ -1,4 +1,4 @@ -set(QT_REPO_MODULE_VERSION "6.5.3") +set(QT_REPO_MODULE_VERSION "6.6.0") set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1") set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_LEAN_HEADERS=1") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/.tag new/qtshadertools-everywhere-src-6.6.0/.tag --- old/qtshadertools-everywhere-src-6.5.3/.tag 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/.tag 2023-10-02 05:05:36.000000000 +0200 @@ -1 +1 @@ -8354edb19012d4ffda1da8678a840659574f3f1c +ded671b8c17f2a6b2f03cde3b9dad4910adda3cc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/coin/axivion/ci_config_linux.json new/qtshadertools-everywhere-src-6.6.0/coin/axivion/ci_config_linux.json --- old/qtshadertools-everywhere-src-6.5.3/coin/axivion/ci_config_linux.json 1970-01-01 01:00:00.000000000 +0100 +++ new/qtshadertools-everywhere-src-6.6.0/coin/axivion/ci_config_linux.json 2023-10-02 05:05:36.000000000 +0200 @@ -0,0 +1,59 @@ +{ + "Project": { + "Git": { + "_active": true, + "sourceserver_gitdir": "/data/axivion/databases/$(env:TESTED_MODULE_COIN).git" + }, + "BuildSystemIntegration": { + "child_order": [ + "GCCSetup", + "CMake", + "LinkLibraries" + ] + }, + "CMake": { + "_active": true, + "_copy_from": "CMakeIntegration", + "build_environment": {}, + "build_options": "-j4", + "generate_options": "--fresh", + "generator": "Ninja" + }, + "GCCSetup": { + "_active": true, + "_copy_from": "Command", + "build_command": "gccsetup --cc gcc --cxx g++ --config ../../../axivion/" + }, + "LinkLibraries": { + "_active": true, + "_copy_from": "AxivionLinker", + "input_files": [ + "build/lib/lib*.so*.ir" + ], + "ir": "build/$(env:TESTED_MODULE_COIN).ir" + }, + "Project-GlobalOptions": { + "directory": "../work/qt/$(env:TESTED_MODULE_COIN)", + "ir": "build/$(env:TESTED_MODULE_COIN).ir", + "name": "qt_$(env:TESTED_MODULE_COIN)_dev_$(env:TARGET_OS_COIN)" + } + }, + "Results": { + "Dashboard": { + "dashboard_url": "https://axivion-srv.ci.qt.io/axivion/" + }, + "Database": { + "ci_mode": { + "directory": "/data/axivion/databases" + } + } + }, + "_Format": "1.0", + "_Version": "trunk-9e0ef9c5818", + "_VersionNum": [ + 7, + 6, + 9999, + 11489 + ] +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/dependencies.yaml new/qtshadertools-everywhere-src-6.6.0/dependencies.yaml --- old/qtshadertools-everywhere-src-6.5.3/dependencies.yaml 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/dependencies.yaml 2023-10-02 05:05:36.000000000 +0200 @@ -1,4 +1,4 @@ dependencies: ../qtbase: - ref: 372eaedc5b8c771c46acc4c96e91bbade4ca3624 + ref: 33f5e985e480283bb0ca9dea5f82643e825ba87c required: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/CMakeLists.txt new/qtshadertools-everywhere-src-6.6.0/src/shadertools/CMakeLists.txt --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/CMakeLists.txt 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/CMakeLists.txt 2023-10-02 05:05:36.000000000 +0200 @@ -10,7 +10,7 @@ qt_internal_add_module(ShaderTools EXCEPTIONS SOURCES - qshaderbaker.cpp qshaderbaker_p.h + qshaderbaker.cpp qshaderbaker.h qshaderrewriter.cpp qshaderrewriter_p.h qspirvcompiler.cpp qspirvcompiler_p.h qspirvshader.cpp qspirvshader_p.h @@ -38,6 +38,8 @@ Qt::GuiPrivate GENERATE_CPP_EXPORTS GENERATE_PRIVATE_CPP_EXPORTS + RHI_HEADER_FILTERS + "(^|/)qshaderbaker\\.h$" ) ## Scopes: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/snippets/color.frag new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/snippets/color.frag --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/snippets/color.frag 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/snippets/color.frag 2023-10-02 05:05:36.000000000 +0200 @@ -7,10 +7,10 @@ layout(std140, binding = 0) uniform buf { mat4 mvp; float opacity; -} ubuf; +}; void main() { - fragColor = vec4(v_color * ubuf.opacity, ubuf.opacity); + fragColor = vec4(v_color * opacity, opacity); } //! [0] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/snippets/color.vert new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/snippets/color.vert --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/snippets/color.vert 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/snippets/color.vert 2023-10-02 05:05:36.000000000 +0200 @@ -8,13 +8,11 @@ layout(std140, binding = 0) uniform buf { mat4 mvp; float opacity; -} ubuf; - -out gl_PerVertex { vec4 gl_Position; }; +}; void main() { v_color = color; - gl_Position = ubuf.mvp * position; + gl_Position = mvp * position; } //! [0] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/src/qtshadertools-index.qdoc new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/src/qtshadertools-index.qdoc --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/src/qtshadertools-index.qdoc 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/src/qtshadertools-index.qdoc 2023-10-02 05:05:36.000000000 +0200 @@ -18,18 +18,28 @@ tool) \endlist -\note As of Qt \QtVer, the C++ APIs are considered private. They are not -recommended for direct usage from applications. Rather, use the \c qsb -command-line tool either directly, or indirectly from CMake projects. - \section1 Articles and Guides \list \li \l {Qt Shader Tools Overview} \li \l {QSB Manual} - \li \l {Qt Shader Tools Build System Integration} + \li \l {Qt Shader Tools Build System Integration} (CMake) \endlist +\section2 C++ API + +\generatelist classesbymodule QtShaderTools + +\note Applications and libraries should avoid using the C++ API directly, unless +they have a good reason to do so. Rather, prefer relying on offline +pre-processing by invoking the \c qsb command-line tool at build time via CMake, +or manually if invoking via CMake is not feasible. The \c qsb tool uses +QShaderBaker and writes the serialized version of the generated QShader into a +file. The usage of the C++ API should be restricted to cases where run time +processing and translation cannot be avoided, and the performance implications +are understood. An example of this are applications that work with user-provided +or dynamically generated shader source strings. + \section1 Licenses and Attributions Qt Shader Tools runtime library is available under commercial licenses from diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/src/qtshadertools-overview.qdoc new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/src/qtshadertools-overview.qdoc --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/src/qtshadertools-overview.qdoc 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/src/qtshadertools-overview.qdoc 2023-10-02 05:05:36.000000000 +0200 @@ -68,10 +68,6 @@ tool) \endlist - \note As of Qt \QtVer, the C++ APIs are considered private. They are not - recommended for direct usage from applications. Rather, use the \c qsb - command-line tool either directly, or indirectly from CMake projects. - \section1 Typical Usage with Qt Quick Application developers typically work with custom shader code in Qt Quick diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/src/qtshadertools-qsb.qdoc new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/src/qtshadertools-qsb.qdoc --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/doc/src/qtshadertools-qsb.qdoc 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/doc/src/qtshadertools-qsb.qdoc 2023-10-02 05:05:36.000000000 +0200 @@ -453,7 +453,6 @@ layout(std140, binding = 0) uniform buf { mat4 mvp; } ubuf; -out gl_PerVertex { vec4 gl_Position; }; void main() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qshaderbaker.cpp new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qshaderbaker.cpp --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qshaderbaker.cpp 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qshaderbaker.cpp 2023-10-02 05:05:36.000000000 +0200 @@ -1,7 +1,7 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#include "qshaderbaker_p.h" +#include "qshaderbaker.h" #include "qspirvcompiler_p.h" #include "qspirvshader_p.h" #include <QFileInfo> @@ -12,12 +12,23 @@ /*! \class QShaderBaker - \internal \inmodule QtShaderTools + \since 6.6 \brief Compiles a GLSL/Vulkan shader into SPIR-V, translates into other shading languages, and gathers reflection metadata. + \warning QShaderBaker, just like the QRhi family of classes in the Qt Gui + module, including QShader and QShaderDescription, offers limited + compatibility guarantees. There are no source or binary compatibility + guarantees for these classes, meaning the API is only guaranteed to work + with the Qt version the application was developed against. Source + incompatible changes are however aimed to be kept at a minimum and will only + be made in minor releases (6.7, 6.8, and so on). To use this class in an + application, link to \c{Qt::ShaderToolsPrivate} (if using CMake), and + include the headers with the \c rhi prefix, for example + \c{#include <rhi/qshaderbaker.h>}. + QShaderBaker takes a graphics (vertex, fragment, etc.) or compute shader, and produces multiple - either source or bytecode - variants of it, together with reflection information. The results are represented by a @@ -25,12 +36,12 @@ and deserialization. \note Applications and libraries are recommended to avoid using this class - directly. Rather, all Qt users are encouraged to rely on offline - compilation by invoking the \c qsb command-line tool at build time. This - tool uses QShaderBaker itself and writes the serialized version of the - generated QShader into a file. The usage of this class should be - restricted to cases where run time compilation cannot be avoided, such as - when working with user-provided shader source strings. + directly. Rather, all Qt users are encouraged to rely on offline compilation + by invoking the \c qsb command-line tool at build time via CMake. The \c qsb + tool uses QShaderBaker and writes the serialized version of the generated + QShader into a file. The usage of this class should be restricted to cases + where run time compilation cannot be avoided, such as when working with + user-provided or dynamically generated shader source strings. The input format is always assumed to be Vulkan-flavored GLSL at the moment. See the @@ -403,9 +414,9 @@ /*! When generating MSL shader code for a tessellation control shader, the - tessellation mode (triangles or quads) must be known upfront. In GLSL this - is declared in the tessellation evaluation shader typically, but for Metal - it must be known also when generating the compute shader from the + tessellation \a mode (triangles or quads) must be known upfront. In GLSL + this is declared in the tessellation evaluation shader typically, but for + Metal it must be known also when generating the compute shader from the tessellation control shader. When not set, the default is triangles. @@ -417,7 +428,7 @@ /*! When generating MSL shader code for a tessellation evaluation shader, the - output vertex count of the tessellation control shader must be known + output vertex \a count of the tessellation control shader must be known upfront. in GLSL this would be declared in the tessellation control shader typically, but for Metal it must be known also when generating the vertex shader from the teselation evaluation shader. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qshaderbaker.h new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qshaderbaker.h --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qshaderbaker.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qshaderbaker.h 2023-10-02 05:05:36.000000000 +0200 @@ -0,0 +1,71 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QSHADERBAKER_H +#define QSHADERBAKER_H + +// +// W A R N I N G +// ------------- +// +// This file is part of the RHI API, with limited compatibility guarantees. +// Usage of this API may make your code source and binary incompatible with +// future versions of Qt. +// + +#include <QtShaderTools/qtshadertoolsglobal.h> +#include <rhi/qshader.h> + +QT_BEGIN_NAMESPACE + +struct QShaderBakerPrivate; +class QIODevice; + +class Q_SHADERTOOLS_EXPORT QShaderBaker +{ +public: + enum class SpirvOption { + GenerateFullDebugInfo = 0x01, + StripDebugAndVarInfo = 0x02 + }; + Q_DECLARE_FLAGS(SpirvOptions, SpirvOption) + + QShaderBaker(); + ~QShaderBaker(); + + void setSourceFileName(const QString &fileName); + void setSourceFileName(const QString &fileName, QShader::Stage stage); + + void setSourceDevice(QIODevice *device, QShader::Stage stage, + const QString &fileName = QString()); + + void setSourceString(const QByteArray &sourceString, QShader::Stage stage, + const QString &fileName = QString()); + + typedef QPair<QShader::Source, QShaderVersion> GeneratedShader; + void setGeneratedShaders(const QList<GeneratedShader> &v); + void setGeneratedShaderVariants(const QList<QShader::Variant> &v); + + void setPreamble(const QByteArray &preamble); + void setBatchableVertexShaderExtraInputLocation(int location); + void setPerTargetCompilation(bool enable); + void setBreakOnShaderTranslationError(bool enable); + void setTessellationMode(QShaderDescription::TessellationMode mode); + void setTessellationOutputVertexCount(int count); + + void setSpirvOptions(SpirvOptions options); + + QShader bake(); + + QString errorMessage() const; + +private: + Q_DISABLE_COPY(QShaderBaker) + QShaderBakerPrivate *d = nullptr; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderBaker::SpirvOptions) + +QT_END_NAMESPACE + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qshaderbaker_p.h new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qshaderbaker_p.h --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qshaderbaker_p.h 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qshaderbaker_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,73 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -#ifndef QSHADERBAKER_P_H -#define QSHADERBAKER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of a number of Qt sources files. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// - -#include <QtShaderTools/private/qtshadertoolsglobal_p.h> -#include <QtGui/private/qshader_p.h> - -QT_BEGIN_NAMESPACE - -struct QShaderBakerPrivate; -class QIODevice; - -class Q_SHADERTOOLS_PRIVATE_EXPORT QShaderBaker -{ -public: - enum class SpirvOption { - GenerateFullDebugInfo = 0x01, - StripDebugAndVarInfo = 0x02 - }; - Q_DECLARE_FLAGS(SpirvOptions, SpirvOption) - - QShaderBaker(); - ~QShaderBaker(); - - void setSourceFileName(const QString &fileName); - void setSourceFileName(const QString &fileName, QShader::Stage stage); - - void setSourceDevice(QIODevice *device, QShader::Stage stage, - const QString &fileName = QString()); - - void setSourceString(const QByteArray &sourceString, QShader::Stage stage, - const QString &fileName = QString()); - - typedef QPair<QShader::Source, QShaderVersion> GeneratedShader; - void setGeneratedShaders(const QList<GeneratedShader> &v); - void setGeneratedShaderVariants(const QList<QShader::Variant> &v); - - void setPreamble(const QByteArray &preamble); - void setBatchableVertexShaderExtraInputLocation(int location); - void setPerTargetCompilation(bool enable); - void setBreakOnShaderTranslationError(bool enable); - void setTessellationMode(QShaderDescription::TessellationMode mode); - void setTessellationOutputVertexCount(int count); - - void setSpirvOptions(SpirvOptions options); - - QShader bake(); - - QString errorMessage() const; - -private: - Q_DISABLE_COPY(QShaderBaker) - QShaderBakerPrivate *d = nullptr; -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderBaker::SpirvOptions) - -QT_END_NAMESPACE - -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qspirvcompiler_p.h new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qspirvcompiler_p.h --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qspirvcompiler_p.h 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qspirvcompiler_p.h 2023-10-02 05:05:36.000000000 +0200 @@ -16,7 +16,7 @@ // #include <QtShaderTools/private/qtshadertoolsglobal_p.h> -#include <QtGui/private/qshader_p.h> +#include <rhi/qshader.h> #include <QtCore/QString> QT_BEGIN_NAMESPACE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qspirvshader.cpp new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qspirvshader.cpp --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qspirvshader.cpp 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qspirvshader.cpp 2023-10-02 05:05:36.000000000 +0200 @@ -3,8 +3,8 @@ #include "qspirvshader_p.h" #include "qspirvshaderremap_p.h" -#include <QtGui/private/qshaderdescription_p_p.h> -#include <QtGui/private/qshader_p_p.h> +#include <private/qshaderdescription_p.h> +#include <private/qshader_p.h> #include <spirv_cross_c.h> @@ -238,6 +238,16 @@ spvc_compiler_has_decoration(glslGen, r.id, SpvDecorationNonWritable)); } + if (v.type == QShaderDescription::Struct) { + const unsigned count = spvc_type_get_num_member_types(baseTypeHandle); + const spvc_type_id id = spvc_type_get_base_type_id(baseTypeHandle); + + for (unsigned idx = 0; idx < count; ++idx) { + v.structMembers.append(blockVar(id, idx)); + v.perPatch |= bool(spvc_compiler_has_member_decoration(glslGen, id, idx, SpvDecorationPatch)); + } + } + return v; } @@ -250,6 +260,7 @@ spvc_type_id memberTypeId = spvc_type_get_member_type(t, memberIdx); spvc_type memberType = spvc_compiler_get_type_handle(glslGen, memberTypeId); v.type = varType(memberType); + v.offset = -1; unsigned offset = 0; if (spvc_compiler_type_struct_member_offset(glslGen, t, memberIdx, &offset) == SPVC_SUCCESS) @@ -384,6 +395,15 @@ if (spvc_compiler_has_active_builtin(glslGen, builtinResourceList[i].builtin, SpvStorageClassInput)) { QShaderDescription::BuiltinVariable v; v.type = QShaderDescription::BuiltinType(builtinResourceList[i].builtin); + + spvc_type type = spvc_compiler_get_type_handle( + glslGen, builtinResourceList[i].value_type_id); + v.varType = varType(type); + + for (unsigned i = 0, dimCount = spvc_type_get_num_array_dimensions(type); + i < dimCount; ++i) + v.arrayDims.append(int(spvc_type_get_array_dimension(type, i))); + dd->inBuiltins.append(v); } } @@ -401,6 +421,15 @@ if (spvc_compiler_has_active_builtin(glslGen, builtinResourceList[i].builtin, SpvStorageClassOutput)) { QShaderDescription::BuiltinVariable v; v.type = QShaderDescription::BuiltinType(builtinResourceList[i].builtin); + + spvc_type type = spvc_compiler_get_type_handle( + glslGen, builtinResourceList[i].value_type_id); + v.varType = varType(type); + + for (unsigned i = 0, dimCount = spvc_type_get_num_array_dimensions(type); + i < dimCount; ++i) + v.arrayDims.append(int(spvc_type_get_array_dimension(type, i))); + dd->outBuiltins.append(v); } } @@ -871,6 +900,10 @@ spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_SHADER_OUTPUT_BUFFER_INDEX, spvOutBufferIndex); spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_INDIRECT_PARAMS_BUFFER_INDEX, spvIndirectParamsBufferIndex); + // for buffer size buffer; matches defaults + uint spvBufferSizeBufferIndex = 25; + spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_MSL_BUFFER_SIZE_BUFFER_INDEX, spvBufferSizeBufferIndex); + if (stage == QShader::TessellationControlStage) { // required to get the kind of tess.control inputs we need spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_MSL_MULTI_PATCH_WORKGROUP, 1); @@ -987,7 +1020,7 @@ qWarning("Translated Metal shader needs swizzle buffer, this is unexpected"); if (spvc_compiler_msl_needs_buffer_size_buffer(d->mslGen)) - qWarning("Translated Metal shader needs buffer size buffer, this is unexpected"); + shaderInfo->extraBufferBindings[QShaderPrivate::MslBufferSizeBufferBinding] = spvBufferSizeBufferIndex; // (Aim to) only store extraBufferBindings entries for things that really // are present, because the presence of a key can already trigger certain diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qspirvshader_p.h new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qspirvshader_p.h --- old/qtshadertools-everywhere-src-6.5.3/src/shadertools/qspirvshader_p.h 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/src/shadertools/qspirvshader_p.h 2023-10-02 05:05:36.000000000 +0200 @@ -16,7 +16,7 @@ // #include <QtShaderTools/private/qtshadertoolsglobal_p.h> -#include <QtGui/private/qshader_p.h> +#include <rhi/qshader.h> QT_BEGIN_NAMESPACE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/sync.profile new/qtshadertools-everywhere-src-6.6.0/sync.profile --- old/qtshadertools-everywhere-src-6.5.3/sync.profile 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/sync.profile 2023-10-02 05:05:36.000000000 +0200 @@ -12,3 +12,4 @@ %dependencies = ( "qtbase" => "", ); +@rhi_headers = ( "qshaderbaker.h"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/tests/auto/buildtimeqsb/tst_buildtimeqsb.cpp new/qtshadertools-everywhere-src-6.6.0/tests/auto/buildtimeqsb/tst_buildtimeqsb.cpp --- old/qtshadertools-everywhere-src-6.5.3/tests/auto/buildtimeqsb/tst_buildtimeqsb.cpp 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/tests/auto/buildtimeqsb/tst_buildtimeqsb.cpp 2023-10-02 05:05:36.000000000 +0200 @@ -3,17 +3,8 @@ #include <QtTest/QtTest> #include <QFile> -#include <QtGui/private/qshader_p.h> - -#include <QtGui/private/qrhi_p.h> - -#ifdef Q_OS_WIN -#include <QtGui/private/qrhid3d11_p.h> -#endif - -#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) -#include <QtGui/private/qrhimetal_p.h> -#endif +#include <rhi/qshader.h> +#include <rhi/qrhi.h> class tst_BuildTimeQsb : public QObject { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/tests/auto/qshaderbaker/tst_qshaderbaker.cpp new/qtshadertools-everywhere-src-6.6.0/tests/auto/qshaderbaker/tst_qshaderbaker.cpp --- old/qtshadertools-everywhere-src-6.5.3/tests/auto/qshaderbaker/tst_qshaderbaker.cpp 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/tests/auto/qshaderbaker/tst_qshaderbaker.cpp 2023-10-02 05:05:36.000000000 +0200 @@ -3,9 +3,9 @@ #include <QtTest/QtTest> #include <QFile> -#include <QtShaderTools/private/qshaderbaker_p.h> -#include <QtGui/private/qshaderdescription_p.h> -#include <QtGui/private/qshader_p_p.h> +#include <rhi/qshaderbaker.h> +#include <rhi/qshaderdescription.h> +#include <private/qshader_p.h> class tst_QShaderBaker : public QObject { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/tools/qsb/Qt6ShaderToolsMacros.cmake new/qtshadertools-everywhere-src-6.6.0/tools/qsb/Qt6ShaderToolsMacros.cmake --- old/qtshadertools-everywhere-src-6.5.3/tools/qsb/Qt6ShaderToolsMacros.cmake 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/tools/qsb/Qt6ShaderToolsMacros.cmake 2023-10-02 05:05:36.000000000 +0200 @@ -90,6 +90,7 @@ endforeach() endif() + _qt_internal_expose_source_file_to_ide(${target} ${file}) set(output_file "${file}.qsb") if(arg_OUTPUTS) list(GET arg_OUTPUTS ${file_index} output_file) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtshadertools-everywhere-src-6.5.3/tools/qsb/qsb.cpp new/qtshadertools-everywhere-src-6.6.0/tools/qsb/qsb.cpp --- old/qtshadertools-everywhere-src-6.5.3/tools/qsb/qsb.cpp 2023-09-24 09:06:37.000000000 +0200 +++ new/qtshadertools-everywhere-src-6.6.0/tools/qsb/qsb.cpp 2023-10-02 05:05:36.000000000 +0200 @@ -9,8 +9,8 @@ #include <QtCore/qtemporarydir.h> #include <QtCore/qdebug.h> #include <QtCore/qlibraryinfo.h> -#include <QtShaderTools/private/qshaderbaker_p.h> -#include <QtGui/private/qshader_p_p.h> +#include <QtGui/private/qshader_p.h> +#include <rhi/qshaderbaker.h> #if QT_CONFIG(process) #include <QtCore/qprocess.h> @@ -242,7 +242,8 @@ { QShaderPrivate::MslTessTescTessLevelBufferBinding, "tessellation(tesc)-level-buffer-binding" }, { QShaderPrivate::MslTessTescPatchOutputBufferBinding, "tessellation(tesc)-patch-output-buffer-binding" }, { QShaderPrivate::MslTessTescParamsBufferBinding, "tessellation(tesc)-params-buffer-binding" }, - { QShaderPrivate::MslTessTescInputBufferBinding, "tessellation(tesc)-input-buffer-binding" } + { QShaderPrivate::MslTessTescInputBufferBinding, "tessellation(tesc)-input-buffer-binding" }, + { QShaderPrivate::MslBufferSizeBufferBinding, "buffer-size-buffer-binding" } }; bool known = false; for (size_t i = 0; i < sizeof(ebbNames) / sizeof(ebbNames[0]); ++i) { @@ -493,6 +494,9 @@ QObject::tr("Comma separated list of Metal Shading Language versions to generate. F.ex. 12 is 1.2, 20 is 2.0."), QObject::tr("versions")); cmdLineParser.addOption(mslOption); + QCommandLineOption shortcutDefaultOption("qt6", QObject::tr("Equivalent to --glsl \"100 es,120,150\" --hlsl 50 --msl 12. " + "This set is commonly used with shaders for Qt Quick materials and effects.")); + cmdLineParser.addOption(shortcutDefaultOption); QCommandLineOption tessOption("msltess", QObject::tr("Indicates that a vertex shader is going to be used in a pipeline with tessellation. " "Mandatory for vertex shaders planned to be used with tessellation when targeting Metal (--msl).")); cmdLineParser.addOption(tessOption); @@ -662,7 +666,7 @@ QList<QShaderBaker::GeneratedShader> genShaders; - genShaders << qMakePair(QShader::SpirvShader, QShaderVersion(100)); + genShaders << std::make_pair(QShader::SpirvShader, QShaderVersion(100)); if (cmdLineParser.isSet(glslOption)) { const QStringList versions = cmdLineParser.value(glslOption).trimmed().split(','); @@ -678,7 +682,7 @@ bool ok = false; int v = version.toInt(&ok); if (ok) - genShaders << qMakePair(QShader::GlslShader, QShaderVersion(v, flags)); + genShaders << std::make_pair(QShader::GlslShader, QShaderVersion(v, flags)); else printError("Ignoring invalid GLSL version %s", qPrintable(version)); } @@ -690,7 +694,7 @@ bool ok = false; int v = version.toInt(&ok); if (ok) { - genShaders << qMakePair(QShader::HlslShader, QShaderVersion(v)); + genShaders << std::make_pair(QShader::HlslShader, QShaderVersion(v)); } else { printError("Ignoring invalid HLSL (Shader Model) version %s", qPrintable(version)); @@ -704,12 +708,27 @@ bool ok = false; int v = version.toInt(&ok); if (ok) - genShaders << qMakePair(QShader::MslShader, QShaderVersion(v)); + genShaders << std::make_pair(QShader::MslShader, QShaderVersion(v)); else printError("Ignoring invalid MSL version %s", qPrintable(version)); } } + if (cmdLineParser.isSet(shortcutDefaultOption)) { + for (const QShaderBaker::GeneratedShader &genShaderEntry : + { + std::make_pair(QShader::GlslShader, QShaderVersion(100, QShaderVersion::GlslEs)), + std::make_pair(QShader::GlslShader, QShaderVersion(120)), + std::make_pair(QShader::GlslShader, QShaderVersion(150)), + std::make_pair(QShader::HlslShader, QShaderVersion(50)), + std::make_pair(QShader::MslShader, QShaderVersion(12)) + }) + { + if (!genShaders.contains(genShaderEntry)) + genShaders << genShaderEntry; + } + } + baker.setGeneratedShaders(genShaders); if (cmdLineParser.isSet(defineOption)) {