aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-04-16 11:59:33 +0200
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-04-18 15:35:04 +0200
commit4194ab757e01909c8a7249fa184e6941eb1db7c5 (patch)
tree675554a72060d79e4bc56d61130356b64383a064 /sources/pyside6
parent83a93d243dbc1ef6679ee8ac3a35184a6edc43d9 (diff)
Tooling: Add pyside6-qsb
- Analogous to the qsb tool in Qt - Add pyside6-qsb tool to the documentation - Update developer documentation Pick-to: 6.7 6.6 6.5 Task-number: PYSIDE-2629 Change-Id: I93058ebb2864491e951f4f828d703d8893fbcbe7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6')
-rw-r--r--sources/pyside6/doc/developer/add_tool.rst6
-rw-r--r--sources/pyside6/doc/tools/index.rst13
-rw-r--r--sources/pyside6/doc/tools/pyside6-qsb.rst39
3 files changed, 56 insertions, 2 deletions
diff --git a/sources/pyside6/doc/developer/add_tool.rst b/sources/pyside6/doc/developer/add_tool.rst
index a894226c5..732e6b915 100644
--- a/sources/pyside6/doc/developer/add_tool.rst
+++ b/sources/pyside6/doc/developer/add_tool.rst
@@ -44,6 +44,8 @@ Add a Qt tool wrapper
- Add the tool in ``sources/pyside-tools/pyside_tool.py``.
- Add the tool in ``build_scripts/__init__.py`` to create the setuptools entry points
i.e. this enable using the tool from the console as "pyside6-<tool_name>"
-- Add an entry to ``sources/pyside6/doc/gettingstarted/package_details.rst``.
+- Add an entry to ``sources/pyside6/doc/tools/index.rst`` and the detailed
+ documentation to ``sources/pyside6/doc/tools/<tool_name>.rst``.
- Include the necessary Qt binaries explicitly on ``build_scripts/wheel_files.py``
-- Build with ``--standalone``, verify it is working.
+- Add the necessary files to ``build_scripts/wheel_files.py``.
+- Build with ``--standalone``, verify it is working. Also, check if the wheel bundles the tool.
diff --git a/sources/pyside6/doc/tools/index.rst b/sources/pyside6/doc/tools/index.rst
index dd51da65e..b82e3fd71 100644
--- a/sources/pyside6/doc/tools/index.rst
+++ b/sources/pyside6/doc/tools/index.rst
@@ -176,3 +176,16 @@ Deployment
to deploy PySide6 application as an Android app targeting different
Android platforms - aarch64, armv7a, i686, x86_64.
+
+Shader Tools
+~~~~~~~~~~~~
+
+.. grid:: 2
+ :gutter: 3 3 4 5
+
+ .. grid-item-card:: ``pyside6-qsb``
+ :link: pyside6-qsb
+ :link-type: ref
+
+ a command line tool provided by the Qt Shader Tools module to
+ generate and inspect .qsb files.
diff --git a/sources/pyside6/doc/tools/pyside6-qsb.rst b/sources/pyside6/doc/tools/pyside6-qsb.rst
new file mode 100644
index 000000000..f6f1847d4
--- /dev/null
+++ b/sources/pyside6/doc/tools/pyside6-qsb.rst
@@ -0,0 +1,39 @@
+.. _pyside6-qsb:
+
+pyside6-qsb
+===========
+
+``pyside6-qsb`` is a tool that wraps the `qsb <QSB Manual>`_ tool. qsb is a
+command line tool provided by the `Qt Shader Tools`_ module. It integrates
+third-party libraries such as `glslang`_ and `SPIRV-Cross`_, optionally invokes
+external tools, such as ``fxc`` or ``spirv-opt``, and generates .qsb files.
+Additionally, it can be used to inspect the contents of a .qsb package.
+
+For more information on how to use this tool, read Qt's documentation
+here: `QSB Manual`_.
+
+Usage
+-----
+
+To create a qsb file from a shader file, e.g., ``shader.frag``, use the
+following command:
+
+.. code-block:: bash
+
+ pyside6-qsb -o shader.frag.qsb shader.frag
+
+To inspect the file produced, i.e., ``shader.frag.qsb``, use the following
+command:
+
+.. code-block:: bash
+
+ pyside6-qsb -d shader.frag.qsb
+
+This will print the reflection metadata (in JSON form) and the included shaders.
+
+For other modes of operation, refer to the `QSB Manual`_.
+
+.. _`glslang`: https://github.com/KhronosGroup/glslang
+.. _`spirv-cross`: https://github.com/KhronosGroup/SPIRV-Cross
+.. _`QSB Manual`: https://doc.qt.io/qt-6/qtshadertools-qsb.html
+.. _`Qt Shader Tools`: https://doc.qt.io/qt-6/qtshadertools-index.html