Debian Codegraph @

Sources/nCine/Graphics/RHI/GS/GsDebug.h

raw
1 #pragma once
2
3 #include <cstdint>
4
5 #include <Containers/StringView.h>
6
7 using namespace Death::Containers;
8
9 namespace nCine::RHI
10 {
11 class IRhiCapabilities;
12 }
13
14 namespace nCine::RHI::GS
15 {
16 /**
17 @brief Debug-output and object-labelling stub of the GS backend
18
19 The Graphics Synthesizer is driven by raw GIF packets and has no device-side debug facility of any
20 kind - not even an error register a draw could be checked against - so every entry point is a no-op.
21 The class exists only to satisfy the `RHI::Debug` contract alias (debug groups, message insertion and
22 object labels used by the render pipeline). What debugging there is comes from outside: PCSX2's GS
23 dumps and its EE console, which the engine reaches through the ordinary logger.
24 */
25 class GsDebug
26 {
27 public:
28 /** @brief Object types that can be labelled (values are irrelevant for the GS backend) */
29 enum class LabelTypes
30 {
31 Buffer,
32 Shader,
33 Program,
34 VertexArray,
35 Query,
36 ProgramPipeline,
37 TransformFeedback,
38 Sampler,
39 Texture,
40 RenderBuffer,
41 FrameBuffer
42 };
43
44 /**
45 @brief RAII scope for a debug message group (a no-op for the GS backend)
46 */
47 class ScopedGroup
48 {
49 public:
50 explicit ScopedGroup(StringView message) {
51 static_cast<void>(message);
52 }
53 };
54
55 static void Init(const IRhiCapabilities& caps) {
56 static_cast<void>(caps);
57 }
58 static inline void Reset() {}
59
60 static inline bool IsAvailable() {
61 return false;
62 }
63
64 static void PushGroup(StringView message) {
65 static_cast<void>(message);
66 }
67 static void PopGroup() {}
68 static void MessageInsert(StringView message) {
69 static_cast<void>(message);
70 }
71
72 static void SetObjectLabel(LabelTypes identifier, std::uint32_t name, StringView label) {
73 static_cast<void>(identifier);
74 static_cast<void>(name);
75 static_cast<void>(label);
76 }
77 static void GetObjectLabel(LabelTypes identifier, std::uint32_t name, std::int32_t bufSize, std::int32_t* length, char* label) {
78 static_cast<void>(identifier);
79 static_cast<void>(name);
80 static_cast<void>(bufSize);
81 if (length != nullptr) {
82 *length = 0;
83 }
84 if (label != nullptr && bufSize > 0) {
85 label[0] = '\0';
86 }
87 }
88
89 static inline std::int32_t GetMaxLabelLength() {
90 return 0;
91 }
92 };
93 }