LeviLamina
Loading...
Searching...
No Matches
RenderDragonRenderingBackend.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/oreui/debug/FrameDebugData.h"
7#include "mc/client/gui/oreui/interface/IRenderingBackend.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/deps/minecraft_renderer/framebuilder/GamefaceBatchDraw.h"
10#include "mc/deps/minecraft_renderer/framebuilder/GamefaceBatchDrawMesh.h"
11#include "mc/deps/minecraft_renderer/framebuilder/GamefacePipelineState.h"
12#include "mc/external/gameface/renoir/CBType.h"
13#include "mc/external/gameface/renoir/ConstantBufferObject.h"
14#include "mc/external/gameface/renoir/IndexBufferObject.h"
15#include "mc/external/gameface/renoir/IndexBufferType.h"
16#include "mc/external/gameface/renoir/PipelineStateObject.h"
17#include "mc/external/gameface/renoir/RendererBackend.h"
18#include "mc/external/gameface/renoir/ResourcesCommandsStage.h"
19#include "mc/external/gameface/renoir/VertexBufferObject.h"
20#include "mc/external/gameface/renoir/VertexType.h"
21#include "mc/external/render_dragon/mesh/VertexFormat.h"
22#include "mc/external/render_dragon/resources/ServerResourcePointer.h"
23
24// auto generated forward declare list
25// clang-format off
26namespace Gameface { class IRenderingBackendTextureStorage; }
27namespace Gameface { class TemporaryTextureHolder; }
28namespace OreUI { struct FrameDebugData; }
29namespace dragon { struct ResolvedIndexBufferResource; }
30namespace dragon { struct ResolvedVertexBufferResource; }
31namespace mce { class ShaderGroup; }
32namespace renoir { struct DepthStencilTexture; }
33namespace renoir { struct DepthStencilTextureObject; }
34namespace renoir { struct PipelineState; }
35namespace renoir { struct RendererCaps; }
36namespace renoir { struct Sampler2D; }
37namespace renoir { struct Sampler2DObject; }
38namespace renoir { struct Texture2D; }
39namespace renoir { struct Texture2DObject; }
40namespace renoir { struct TextureObject; }
41namespace renoir { struct UpdateBox; }
42namespace renoir { struct float2; }
43// clang-format on
44
45namespace OreUI {
46
47class RenderDragonRenderingBackend : public ::OreUI::IRenderingBackend {
48public:
49 // RenderDragonRenderingBackend inner types declare
50 // clang-format off
51 struct VertexBuffer;
52 struct GetGamefaceStride;
53 struct IndexBuffer;
54 struct ConstantBuffer;
55 // clang-format on
56
57 // RenderDragonRenderingBackend inner types define
58 struct VertexBuffer {
59 public:
60 // VertexBuffer inner types declare
61 // clang-format off
62 struct DragonVertexBuffer;
63 struct DragonInstanceData;
64 // clang-format on
65
66 // VertexBuffer inner types define
67 struct DragonVertexBuffer {
68 public:
69 // member variables
70 // NOLINTBEGIN
71 ::ll::TypedStorage<8, 136, ::dragon::mesh::VertexFormat> dragonFormat;
72 ::ll::TypedStorage<8, 24, ::mce::ServerResourcePointer<::dragon::ResolvedVertexBufferResource>>
73 dragonVertexBuffer;
74 // NOLINTEND
75 };
76
77 struct DragonInstanceData {
78 public:
79 // DragonInstanceData inner types define
80 using BufferConvert = void (*)(::std::vector<uchar> const&, ::std::vector<uchar>&, uint64);
81
82 public:
83 // member variables
84 // NOLINTBEGIN
85 ::ll::TypedStorage<
86 8,
87 8,
88 ::gsl::not_null<void (*)(::std::vector<uchar> const&, ::std::vector<uchar>&, uint64)>>
89 mGamefaceToDragon;
90 ::ll::TypedStorage<8, 24, ::std::vector<uchar>> mDragonInstanceBuffer;
91 ::ll::TypedStorage<1, 1, uchar> mGamefaceStride;
92 // NOLINTEND
93 };
94
95 using DragonStorage = ::std::variant<
96 ::OreUI::RenderDragonRenderingBackend::VertexBuffer::DragonVertexBuffer,
97 ::OreUI::RenderDragonRenderingBackend::VertexBuffer::DragonInstanceData>;
98
99 public:
100 // member variables
101 // NOLINTBEGIN
102 ::ll::TypedStorage<4, 4, uint> count;
103 ::ll::TypedStorage<8, 24, ::std::vector<uchar>> data;
104 ::ll::TypedStorage<
105 8,
106 168,
107 ::std::variant<
108 ::OreUI::RenderDragonRenderingBackend::VertexBuffer::DragonVertexBuffer,
109 ::OreUI::RenderDragonRenderingBackend::VertexBuffer::DragonInstanceData>>
110 mDragonStorage;
111 // NOLINTEND
112 };
113
114 struct GetGamefaceStride {};
115
116 struct IndexBuffer {
117 public:
118 // member variables
119 // NOLINTBEGIN
120 ::ll::TypedStorage<4, 4, uint> count;
121 ::ll::TypedStorage<1, 1, uchar> mStride;
122 ::ll::TypedStorage<8, 24, ::std::vector<uchar>> data;
123 ::ll::TypedStorage<8, 24, ::mce::ServerResourcePointer<::dragon::ResolvedIndexBufferResource>>
124 dragonIndexBuffer;
125 // NOLINTEND
126 };
127
128 struct ConstantBuffer {
129 public:
130 // member variables
131 // NOLINTBEGIN
132 ::ll::TypedStorage<4, 4, ::renoir::CBType> type;
133 ::ll::TypedStorage<4, 2048, ::glm::vec4[128]> data;
134 ::ll::TypedStorage<8, 8, uint64> size;
135 // NOLINTEND
136 };
137
138 using PipelineStateData = ::mce::framebuilder::GamefacePipelineState;
139
140 using BatchDraw = ::mce::framebuilder::GamefaceBatchDraw;
141
142public:
143 // member variables
144 // NOLINTBEGIN
145 ::ll::TypedStorage<8, 8, ::OreUI::FrameDebugData&> mFrameDebugData;
146 ::ll::TypedStorage<
147 8,
148 64,
149 ::std::unordered_map<::renoir::PipelineStateObject, ::mce::framebuilder::GamefacePipelineState>>
150 mPipelineStates;
151 ::ll::TypedStorage<
152 8,
153 64,
154 ::std::unordered_map<::renoir::VertexBufferObject, ::OreUI::RenderDragonRenderingBackend::VertexBuffer>>
155 mVertexBuffers;
156 ::ll::TypedStorage<4, 8, ::std::array<::renoir::VertexBufferObject, 2>> mCurrentVertexBuffers;
157 ::ll::TypedStorage<4, 4, int> mNumVertexBuffersActive;
158 ::ll::TypedStorage<
159 8,
160 64,
161 ::std::unordered_map<::renoir::IndexBufferObject, ::OreUI::RenderDragonRenderingBackend::IndexBuffer>>
162 mIndexBuffers;
163 ::ll::TypedStorage<4, 4, ::renoir::IndexBufferObject> mCurrentIndexBuffer;
164 ::ll::TypedStorage<
165 8,
166 64,
167 ::std::unordered_map<::renoir::ConstantBufferObject, ::OreUI::RenderDragonRenderingBackend::ConstantBuffer>>
168 mConstantBuffers;
169 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::Gameface::IRenderingBackendTextureStorage>>> mTextures;
170 ::ll::TypedStorage<8, 144, ::mce::framebuilder::GamefacePipelineState> mCurrentPipelineState;
171 ::ll::TypedStorage<8, 424, ::mce::framebuilder::GamefaceBatchDrawMesh> mMesh;
172 ::ll::TypedStorage<8, 24, ::mce::framebuilder::GamefaceBatchDraw> mBatch;
173 // NOLINTEND
174
175public:
176 // prevent constructor by default
177 RenderDragonRenderingBackend& operator=(RenderDragonRenderingBackend const&);
178 RenderDragonRenderingBackend(RenderDragonRenderingBackend const&);
179 RenderDragonRenderingBackend();
180
181public:
182 // virtual functions
183 // NOLINTBEGIN
184 virtual ~RenderDragonRenderingBackend() /*override*/ = default;
185
186 virtual void initializeStaticResources(::Bedrock::NonOwnerPointer<::mce::ShaderGroup> const&) /*override*/;
187
188 virtual void onAppPreSuspended() /*override*/;
189
190 virtual void BeginCommands() /*override*/;
191
192 virtual void FillCaps(::renoir::RendererCaps& outCaps) /*override*/;
193
194 virtual void WrapUserRenderTarget(
195 void* userObject,
196 ::renoir::Texture2D const& description,
197 ::renoir::Texture2DObject object,
198 void* depthStencil,
199 ::renoir::DepthStencilTexture const& dsDescription,
200 ::renoir::DepthStencilTextureObject dsObject
201 ) /*override*/;
202
203 virtual void WrapUserTexture(
204 void* userObject,
205 ::renoir::Texture2D const& description,
206 ::renoir::Texture2DObject object
207 ) /*override*/;
208
209 virtual bool
210 CreatePipelineState(::renoir::PipelineState const& state, ::renoir::PipelineStateObject object) /*override*/;
211
212 virtual void DestroyPipelineState(::renoir::PipelineStateObject object) /*override*/;
213
214 virtual bool
215 CreateVertexBuffer(::renoir::VertexType type, uint count, ::renoir::VertexBufferObject object, bool) /*override*/;
216
217 virtual void DestroyVertexBuffer(::renoir::VertexBufferObject object) /*override*/;
218
219 virtual void* MapVertexBuffer(::renoir::VertexBufferObject object) /*override*/;
220
221 virtual void UnmapVertexBuffer(::renoir::VertexBufferObject object, uint count) /*override*/;
222
223 virtual bool CreateIndexBuffer(
224 ::renoir::IndexBufferType format,
225 uint count,
226 ::renoir::IndexBufferObject object,
227 bool
228 ) /*override*/;
229
230 virtual void DestroyIndexBuffer(::renoir::IndexBufferObject object) /*override*/;
231
232 virtual void* MapIndexBuffer(::renoir::IndexBufferObject object) /*override*/;
233
234 virtual void UnmapIndexBuffer(::renoir::IndexBufferObject object, uint elemCount) /*override*/;
235
236 virtual bool
237 CreateConstantBuffer(::renoir::CBType type, ::renoir::ConstantBufferObject object, uint size) /*override*/;
238
239 virtual void DestroyConstantBuffer(::renoir::ConstantBufferObject object) /*override*/;
240
241 virtual bool CreateTexture(
242 ::renoir::Texture2DObject object,
243 ::renoir::Texture2D const& description,
244 void const* data,
245 uint dataLen
246 ) /*override*/;
247
248 virtual void DestroyTexture(::renoir::Texture2DObject object) /*override*/;
249
250 virtual void UpdateTexture(
251 ::renoir::Texture2DObject object,
252 ::renoir::Texture2D const& description,
253 ::renoir::UpdateBox* boxes,
254 void const** newBytes,
255 uint count,
256 bool
257 ) /*override*/;
258
259 virtual bool CreateDepthStencilTexture(
260 ::renoir::DepthStencilTextureObject object,
261 ::renoir::DepthStencilTexture const& description
262 ) /*override*/;
263
264 virtual void DestroyDepthStencilTexture(::renoir::DepthStencilTextureObject object) /*override*/;
265
266 virtual void CopyTextureToTexture(
267 ::renoir::Texture2DObject,
268 ::renoir::Texture2DObject,
269 ::renoir::UpdateBox,
270 ::renoir::float2
271 ) /*override*/;
272
273 virtual bool CreateSampler2D(::renoir::Sampler2DObject object, ::renoir::Sampler2D const& description) /*override*/;
274
275 virtual void DestroySampler2D(::renoir::Sampler2DObject object) /*override*/;
276
277 virtual bool ReadTexture(::renoir::TextureObject, ::renoir::UpdateBox const&, void*) /*override*/;
278
279 virtual void ExecuteRendering(
280 ::renoir::RendererBackend::BackendCommandsBuffer const* buffers,
281 uint buffersCount,
282 ::renoir::RendererBackend::ConstantBufferUpdateData const* cboUpdates,
283 uint numCboUpdates
284 ) /*override*/;
285
286 virtual void ExecuteResourceCommands(
287 ::renoir::RendererBackend::BackendResourceCommandsBuffer const* buffers,
288 uint buffersCount,
289 ::renoir::ResourcesCommandsStage
290 ) /*override*/;
291
292 virtual void EndCommands() /*override*/;
293 // NOLINTEND
294
295public:
296 // member functions
297 // NOLINTBEGIN
298 MCAPI RenderDragonRenderingBackend(
299 ::OreUI::FrameDebugData& frameDebugData,
300 ::Gameface::TemporaryTextureHolder& temporaryTextureHolder
301 );
302
303 MCAPI void _drawIndexedInstanced(uint indexCount, uint indexOffset, uint instanceCount, uint instanceOffset);
304
305 MCAPI void _flush(::OreUI::FrameDebugData::FlushTrigger trigger);
306 // NOLINTEND
307
308public:
309 // constructor thunks
310 // NOLINTBEGIN
311 MCAPI void*
312 $ctor(::OreUI::FrameDebugData& frameDebugData, ::Gameface::TemporaryTextureHolder& temporaryTextureHolder);
313 // NOLINTEND
314
315public:
316 // virtual function thunks
317 // NOLINTBEGIN
318 MCFOLD void $initializeStaticResources(::Bedrock::NonOwnerPointer<::mce::ShaderGroup> const&);
319
320 MCFOLD void $onAppPreSuspended();
321
322 MCFOLD void $BeginCommands();
323
324 MCAPI void $FillCaps(::renoir::RendererCaps& outCaps);
325
326 MCAPI void $WrapUserRenderTarget(
327 void* userObject,
328 ::renoir::Texture2D const& description,
329 ::renoir::Texture2DObject object,
330 void* depthStencil,
331 ::renoir::DepthStencilTexture const& dsDescription,
332 ::renoir::DepthStencilTextureObject dsObject
333 );
334
335 MCAPI void
336 $WrapUserTexture(void* userObject, ::renoir::Texture2D const& description, ::renoir::Texture2DObject object);
337
338 MCAPI bool $CreatePipelineState(::renoir::PipelineState const& state, ::renoir::PipelineStateObject object);
339
340 MCAPI void $DestroyPipelineState(::renoir::PipelineStateObject object);
341
342 MCAPI bool $CreateVertexBuffer(::renoir::VertexType type, uint count, ::renoir::VertexBufferObject object, bool);
343
344 MCAPI void $DestroyVertexBuffer(::renoir::VertexBufferObject object);
345
346 MCAPI void* $MapVertexBuffer(::renoir::VertexBufferObject object);
347
348 MCAPI void $UnmapVertexBuffer(::renoir::VertexBufferObject object, uint count);
349
350 MCAPI bool
351 $CreateIndexBuffer(::renoir::IndexBufferType format, uint count, ::renoir::IndexBufferObject object, bool);
352
353 MCAPI void $DestroyIndexBuffer(::renoir::IndexBufferObject object);
354
355 MCAPI void* $MapIndexBuffer(::renoir::IndexBufferObject object);
356
357 MCAPI void $UnmapIndexBuffer(::renoir::IndexBufferObject object, uint elemCount);
358
359 MCAPI bool $CreateConstantBuffer(::renoir::CBType type, ::renoir::ConstantBufferObject object, uint size);
360
361 MCAPI void $DestroyConstantBuffer(::renoir::ConstantBufferObject object);
362
363 MCAPI bool $CreateTexture(
364 ::renoir::Texture2DObject object,
365 ::renoir::Texture2D const& description,
366 void const* data,
367 uint dataLen
368 );
369
370 MCAPI void $DestroyTexture(::renoir::Texture2DObject object);
371
372 MCAPI void $UpdateTexture(
373 ::renoir::Texture2DObject object,
374 ::renoir::Texture2D const& description,
375 ::renoir::UpdateBox* boxes,
376 void const** newBytes,
377 uint count,
378 bool
379 );
380
381 MCAPI bool $CreateDepthStencilTexture(
382 ::renoir::DepthStencilTextureObject object,
383 ::renoir::DepthStencilTexture const& description
384 );
385
386 MCAPI void $DestroyDepthStencilTexture(::renoir::DepthStencilTextureObject object);
387
388 MCFOLD void $CopyTextureToTexture(
389 ::renoir::Texture2DObject,
390 ::renoir::Texture2DObject,
391 ::renoir::UpdateBox,
392 ::renoir::float2
393 );
394
395 MCAPI bool $CreateSampler2D(::renoir::Sampler2DObject object, ::renoir::Sampler2D const& description);
396
397 MCAPI void $DestroySampler2D(::renoir::Sampler2DObject object);
398
399 MCFOLD bool $ReadTexture(::renoir::TextureObject, ::renoir::UpdateBox const&, void*);
400
401 MCAPI void $ExecuteRendering(
402 ::renoir::RendererBackend::BackendCommandsBuffer const* buffers,
403 uint buffersCount,
404 ::renoir::RendererBackend::ConstantBufferUpdateData const* cboUpdates,
405 uint numCboUpdates
406 );
407
408 MCAPI void $ExecuteResourceCommands(
409 ::renoir::RendererBackend::BackendResourceCommandsBuffer const* buffers,
410 uint buffersCount,
411 ::renoir::ResourcesCommandsStage
412 );
413
414 MCAPI void $EndCommands();
415 // NOLINTEND
416};
417
418} // namespace OreUI
Definition IRenderingBackendTextureStorage.h:7
Definition TemporaryTextureHolder.h:7
Definition RenderDragonRenderingBackend.h:7
Definition ShaderGroup.h:7
Definition FrameDebugData.h:7
Definition RenderDragonRenderingBackend.h:36
Definition RenderDragonRenderingBackend.h:32
Definition RenderDragonRenderingBackend.h:34
Definition RenderDragonRenderingBackend.h:18
Definition ResolvedIndexBufferResource.h:7
Definition ResolvedVertexBufferResource.h:7
Definition DepthStencilTextureObject.h:7
Definition DepthStencilTexture.h:7
Definition PipelineState.h:7
Definition RendererCaps.h:7
Definition Sampler2DObject.h:7
Definition Sampler2D.h:7
Definition Texture2DObject.h:7
Definition Texture2D.h:7
Definition TextureObject.h:7
Definition UpdateBox.h:7
Definition float2.h:7