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
qssgrendercommands.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 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
7
8QSSGCommand::~QSSGCommand()
9{
10
11}
12
13const char *QSSGCommand::typeAsString() const
14{
15 switch (m_type) {
16 case CommandType::AddShaderDefine:
17 return "AddShaderDefine";
18 case CommandType::DepthTextureAttachment:
19 return "DepthTextureAttachment";
20 case CommandType::ColorAttachment:
21 return "ColorAttachment";
22 case CommandType::AllocateTexture:
23 return "AllocateTexture";
24 case CommandType::RenderablesFilter:
25 return "RenderablesFilter";
26 case CommandType::Unknown:
27 return "Unknown";
28 case CommandType::AllocateBuffer:
29 return "AllocateBuffer";
30 case CommandType::BindTarget:
31 return "BindTarget";
32 case CommandType::BindBuffer:
33 return "BindBuffer";
34 case CommandType::BindShader:
35 return "BindShader";
36 case CommandType::ApplyInstanceValue:
37 return "ApplyInstanceValue";
38 case CommandType::ApplyBufferValue:
39 return "ApplyBufferValue";
40 case CommandType::Render:
41 return "Render";
42 case CommandType::ApplyValue:
43 return "ApplyValue";
44 case CommandType::PipelineStateOverride:
45 return "PipelineStateOverride";
46 case CommandType::DepthStencilAttachment:
47 return "DepthStencilAttachment";
48 case CommandType::SubRenderPass:
49 return "SubRenderPass";
50 }
51
52 Q_UNREACHABLE_RETURN("");
53}
54
55QString QSSGCommand::debugString() const
56{
57 QString result;
58 QDebug stream(&result);
59
60 switch (m_type) {
61 case CommandType::AllocateTexture:
62 static_cast<const QSSGAllocateTexture *>(this)->addDebug(stream);
63 break;
64 case CommandType::AllocateBuffer:
65 static_cast<const QSSGAllocateBuffer*>(this)->addDebug(stream);
66 break;
67 case CommandType::BindTarget:
68 static_cast<const QSSGBindTarget*>(this)->addDebug(stream);
69 break;
70 case CommandType::BindBuffer:
71 static_cast<const QSSGBindBuffer*>(this)->addDebug(stream);
72 break;
73 case CommandType::BindShader:
74 static_cast<const QSSGBindShader*>(this)->addDebug(stream);
75 break;
76 case CommandType::ApplyInstanceValue:
77 static_cast<const QSSGApplyInstanceValue*>(this)->addDebug(stream);
78 break;
79 case CommandType::ApplyBufferValue:
80 static_cast<const QSSGApplyBufferValue*>(this)->addDebug(stream);
81 break;
82 case CommandType::Render:
83 static_cast<const QSSGRender*>(this)->addDebug(stream);
84 break;
85 case CommandType::ApplyValue:
86 static_cast<const QSSGApplyValue*>(this)->addDebug(stream);
87 break;
88 case CommandType::Unknown:
89 default:
90 addDebug(stream);
91 break;
92 }
93
94 return result;
95}
96
97void QSSGCommand::addDebug(QDebug &stream) const
98{
99 stream << "No debug info for " << typeAsString();
100}