Debian Codegraph @

Sources/nCine/Graphics/RHI/D3D11/D3D11Debug.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::D3D11
15 {
16 /**
17 @brief Debug-output and object-labelling stub of the Direct3D 11 backend
18
19 The backend has no device-side debug facility wired up, so every entry point is a no-op. The class
20 exists to satisfy the `RHI::Debug` contract alias (debug groups, message insertion and object labels
21 used by the render pipeline). These could later route to `ID3DUserDefinedAnnotation`.
22 */
23 class D3D11Debug
24 {
25 public:
26 /** @brief Object types that can be labelled (values are irrelevant for the Direct3D 11 backend) */
27 enum class LabelTypes
28 {
29 Buffer,
30 Shader,
31 Program,
32 VertexArray,
33 Query,
34 ProgramPipeline,
35 TransformFeedback,
36 Sampler,
37 Texture,
38 RenderBuffer,
39 FrameBuffer
40 };
41
42 /**
43 @brief RAII scope for a debug message group (a no-op for the Direct3D 11 backend)
44 */
45 class ScopedGroup
46 {
47 public:
48 explicit ScopedGroup(StringView message) {
49 static_cast<void>(message);
50 }
51 };
52
53 static void Init(const IRhiCapabilities& caps) {
54 static_cast<void>(caps);
55 }
56 static inline void Reset() {}
57
58 static inline bool IsAvailable() {
59 return false;
60 }
61
62 static void PushGroup(StringView message) {
63 static_cast<void>(message);
64 }
65 static void PopGroup() {}
66 static void MessageInsert(StringView message) {
67 static_cast<void>(message);
68 }
69
70 static void SetObjectLabel(LabelTypes identifier, std::uint32_t name, StringView label) {
71 static_cast<void>(identifier);
72 static_cast<void>(name);
73 static_cast<void>(label);
74 }
75 static void GetObjectLabel(LabelTypes identifier, std::uint32_t name, std::int32_t bufSize, std::int32_t* length, char* label) {
76 static_cast<void>(identifier);
77 static_cast<void>(name);
78 static_cast<void>(bufSize);
79 if (length != nullptr) {
80 *length = 0;
81 }
82 if (label != nullptr && bufSize > 0) {
83 label[0] = '\0';
84 }
85 }
86
87 static inline std::int32_t GetMaxLabelLength() {
88 return 0;
89 }
90 };
91 }