Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qssgrendershadertokenizer_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSSGRENDERSHADERTOKENIZER_P_H
6#define QSSGRENDERSHADERTOKENIZER_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "qtquick3druntimerenderexports.h"
20
21#include <QtCore/qbytearray.h>
22
24
25// A minimal tokenizer for the GLSL-ish shader snippets used by the custom
26// material, effect, quad texture provider and user render pass APIs. It does not
27// try to be a full GLSL lexer; it only classifies the tokens these code paths
28// need (identifiers, comments, braces, parens, brackets and semicolons) so that
29// keyword detection/replacement can be done without re-implementing comment
30// skipping and identifier boundary handling in each caller.
31//
32// This is based on the Qt Quick shader rewriter (with fixes).
34{
35public:
36 enum Token {
37 Token_Comment,
38 Token_OpenBrace,
39 Token_CloseBrace,
40 Token_OpenParen,
41 Token_CloseParen,
42 Token_SemiColon,
43 Token_Identifier,
44 Token_OpenBraket,
45 Token_CloseBraket,
46 Token_Unspecified,
47
48 Token_EOF
49 };
50
51 void initialize(const char *input);
52 Token next();
53
54 const char *stream = nullptr;
55 const char *pos = nullptr;
56 const char *identifier = nullptr;
57};
58
59QT_END_NAMESPACE
60
61#endif // QSSGRENDERSHADERTOKENIZER_P_H
Combined button and popup list for selecting options.