Debian Codegraph @

Sources/nCine/Graphics/RHI/RSX/RsxDebug.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::RSX
15 {
16 /**
17 @brief Debug-output and object-labelling facade of the RSX backend
18
19 Entirely inert, and for a more basic reason than the sceGxm backend's - which at least maps the
20 pipeline's debug groups onto sceGxm's user markers. The RSX command set has no marker or annotation
21 packet at all: a command buffer is a stream of NV40 method writes with nowhere to carry a name, and
22 PSL1GHT's librsx exposes nothing for it either. Object labels have no counterpart for the same reason
23 (the backend's resources are plain structures in memory the GPU reads by offset, not driver-side
24 named objects), so both halves of this class are dropped rather than approximated.
25
26 The class is kept so the render pipeline's `RHI::Debug` calls compile unchanged; the compiler removes
27 the calls entirely, since every one of them is an empty inline function.
28 */
29 class RsxDebug
30 {
31 public:
32 /** @brief Object types that can be labelled (values are irrelevant for the RSX backend) */
33 enum class LabelTypes
34 {
35 Buffer,
36 Shader,
37 Program,
38 VertexArray,
39 Query,
40 ProgramPipeline,
41 TransformFeedback,
42 Sampler,
43 Texture,
44 RenderBuffer,
45 FrameBuffer
46 };
47
48 /** @brief RAII scope for a debug message group (inert on this backend) */
49 class ScopedGroup
50 {
51 public:
52 explicit ScopedGroup(StringView message) {
53 static_cast<void>(message);
54 }
55 ~ScopedGroup() {}
56
57 ScopedGroup(const ScopedGroup&) = delete;
58 ScopedGroup& operator=(const ScopedGroup&) = delete;
59 };
60
61 static inline void Init(const IRhiCapabilities& caps) {
62 static_cast<void>(caps);
63 }
64 static inline void Reset() {}
65
66 static inline bool IsAvailable() {
67 return false;
68 }
69
70 static inline void PushGroup(StringView message) {
71 static_cast<void>(message);
72 }
73 static inline void PopGroup() {}
74 static inline void MessageInsert(StringView message) {
75 static_cast<void>(message);
76 }
77
78 static inline void SetObjectLabel(LabelTypes identifier, std::uint32_t name, StringView label) {
79 static_cast<void>(identifier);
80 static_cast<void>(name);
81 static_cast<void>(label);
82 }
83 static inline void GetObjectLabel(LabelTypes identifier, std::uint32_t name, std::int32_t bufSize, std::int32_t* length, char* label) {
84 static_cast<void>(identifier);
85 static_cast<void>(name);
86 static_cast<void>(bufSize);
87 if (length != nullptr) {
88 *length = 0;
89 }
90 if (label != nullptr && bufSize > 0) {
91 label[0] = '\0';
92 }
93 }
94
95 static inline std::int32_t GetMaxLabelLength() {
96 return 0;
97 }
98 };
99 }