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/interface/IRenderingBackend.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/deps/minecraft_renderer/framebuilder/GamefaceBatchDraw.h"
9#include "mc/deps/minecraft_renderer/framebuilder/GamefaceBatchDrawMesh.h"
10#include "mc/deps/minecraft_renderer/framebuilder/GamefacePipelineState.h"
11#include "mc/external/gameface/renoir/CBType.h"
12#include "mc/external/gameface/renoir/ConstantBufferObject.h"
13#include "mc/external/gameface/renoir/IndexBufferObject.h"
14#include "mc/external/gameface/renoir/IndexBufferType.h"
15#include "mc/external/gameface/renoir/PipelineStateObject.h"
16#include "mc/external/gameface/renoir/RendererBackend.h"
17#include "mc/external/gameface/renoir/ResourcesCommandsStage.h"
18#include "mc/external/gameface/renoir/VertexBufferObject.h"
19#include "mc/external/gameface/renoir/VertexType.h"
20#include "mc/external/render_dragon/mesh/VertexFormat.h"
21#include "mc/external/render_dragon/resources/ServerResourcePointer.h"
22
23// auto generated forward declare list
24// clang-format off
25namespace Gameface { class IRenderingBackendTextureStorage; }
26namespace Gameface { class TemporaryTextureHolder; }
27namespace OreUI { struct FrameDebugData; }
28namespace dragon { struct ResolvedIndexBufferResource; }
29namespace dragon { struct ResolvedVertexBufferResource; }
30namespace mce { class ShaderGroup; }
31namespace renoir { struct DepthStencilTexture; }
32namespace renoir { struct DepthStencilTextureObject; }
33namespace renoir { struct PipelineState; }
34namespace renoir { struct RendererCaps; }
35namespace renoir { struct Sampler2D; }
36namespace renoir { struct Sampler2DObject; }
37namespace renoir { struct SetPipelineStateCmd; }
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, 184, ::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 216,
107 ::std::variant<
108 ::OreUI::RenderDragonRenderingBackend::VertexBuffer::DragonVertexBuffer,
109 ::OreUI::RenderDragonRenderingBackend::VertexBuffer::DragonInstanceData>>
110 mDragonStorage;
111 // NOLINTEND
112
113 public:
114 // prevent constructor by default
115 VertexBuffer& operator=(VertexBuffer const&);
116 VertexBuffer();
117
118 public:
119 // member functions
120 // NOLINTBEGIN
121 MCAPI VertexBuffer(::OreUI::RenderDragonRenderingBackend::VertexBuffer const&);
122
123 MCAPI ~VertexBuffer();
124 // NOLINTEND
125
126 public:
127 // constructor thunks
128 // NOLINTBEGIN
129 MCAPI void* $ctor(::OreUI::RenderDragonRenderingBackend::VertexBuffer const&);
130 // NOLINTEND
131
132 public:
133 // destructor thunk
134 // NOLINTBEGIN
135 MCAPI void $dtor();
136 // NOLINTEND
137 };
138
139 struct GetGamefaceStride {};
140
141 struct IndexBuffer {
142 public:
143 // member variables
144 // NOLINTBEGIN
145 ::ll::TypedStorage<4, 4, uint> count;
146 ::ll::TypedStorage<1, 1, uchar> mStride;
147 ::ll::TypedStorage<8, 24, ::std::vector<uchar>> data;
148 ::ll::TypedStorage<8, 24, ::mce::ServerResourcePointer<::dragon::ResolvedIndexBufferResource>>
149 dragonIndexBuffer;
150 // NOLINTEND
151
152 public:
153 // member functions
154 // NOLINTBEGIN
155 MCAPI ~IndexBuffer();
156 // NOLINTEND
157
158 public:
159 // destructor thunk
160 // NOLINTBEGIN
161 MCAPI void $dtor();
162 // NOLINTEND
163 };
164
165 struct ConstantBuffer {
166 public:
167 // member variables
168 // NOLINTBEGIN
169 ::ll::TypedStorage<4, 4, ::renoir::CBType> type;
170 ::ll::TypedStorage<4, 2048, ::glm::vec4[128]> data;
171 ::ll::TypedStorage<8, 8, uint64> size;
172 // NOLINTEND
173 };
174
175 using PipelineStateData = ::mce::framebuilder::GamefacePipelineState;
176
177 using BatchDraw = ::mce::framebuilder::GamefaceBatchDraw;
178
179public:
180 // member variables
181 // NOLINTBEGIN
182 ::ll::TypedStorage<8, 8, ::OreUI::FrameDebugData&> mFrameDebugData;
183 ::ll::TypedStorage<
184 8,
185 64,
186 ::std::unordered_map<::renoir::PipelineStateObject, ::mce::framebuilder::GamefacePipelineState>>
187 mPipelineStates;
188 ::ll::TypedStorage<
189 8,
190 64,
191 ::std::unordered_map<::renoir::VertexBufferObject, ::OreUI::RenderDragonRenderingBackend::VertexBuffer>>
192 mVertexBuffers;
193 ::ll::TypedStorage<4, 8, ::std::array<::renoir::VertexBufferObject, 2>> mCurrentVertexBuffers;
194 ::ll::TypedStorage<4, 4, int> mNumVertexBuffersActive;
195 ::ll::TypedStorage<
196 8,
197 64,
198 ::std::unordered_map<::renoir::IndexBufferObject, ::OreUI::RenderDragonRenderingBackend::IndexBuffer>>
199 mIndexBuffers;
200 ::ll::TypedStorage<4, 4, ::renoir::IndexBufferObject> mCurrentIndexBuffer;
201 ::ll::TypedStorage<
202 8,
203 64,
204 ::std::unordered_map<::renoir::ConstantBufferObject, ::OreUI::RenderDragonRenderingBackend::ConstantBuffer>>
205 mConstantBuffers;
206 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::Gameface::IRenderingBackendTextureStorage>>> mTextures;
207 ::ll::TypedStorage<8, 144, ::mce::framebuilder::GamefacePipelineState> mCurrentPipelineState;
208 ::ll::TypedStorage<8, 464, ::mce::framebuilder::GamefaceBatchDrawMesh> mMesh;
209 ::ll::TypedStorage<8, 24, ::mce::framebuilder::GamefaceBatchDraw> mBatch;
210 // NOLINTEND
211
212public:
213 // prevent constructor by default
214 RenderDragonRenderingBackend& operator=(RenderDragonRenderingBackend const&);
215 RenderDragonRenderingBackend(RenderDragonRenderingBackend const&);
216 RenderDragonRenderingBackend();
217
218public:
219 // virtual functions
220 // NOLINTBEGIN
221 virtual ~RenderDragonRenderingBackend() /*override*/;
222
223 virtual void initializeStaticResources(::Bedrock::NonOwnerPointer<::mce::ShaderGroup> const&) /*override*/;
224
225 virtual void onAppPreSuspended() /*override*/;
226
227 virtual void BeginCommands() /*override*/;
228
229 virtual void FillCaps(::renoir::RendererCaps& outCaps) /*override*/;
230
231 virtual void WrapUserRenderTarget(
232 void* userObject,
233 ::renoir::Texture2D const& description,
234 ::renoir::Texture2DObject object,
235 void* dsDescription,
236 ::renoir::DepthStencilTexture const& dsObject,
237 ::renoir::DepthStencilTextureObject
238 ) /*override*/;
239
240 virtual void WrapUserTexture(
241 void* userObject,
242 ::renoir::Texture2D const& description,
243 ::renoir::Texture2DObject object
244 ) /*override*/;
245
246 virtual bool
247 CreatePipelineState(::renoir::PipelineState const& state, ::renoir::PipelineStateObject object) /*override*/;
248
249 virtual void DestroyPipelineState(::renoir::PipelineStateObject object) /*override*/;
250
251 virtual bool
252 CreateVertexBuffer(::renoir::VertexType type, uint count, ::renoir::VertexBufferObject object, bool) /*override*/;
253
254 virtual void DestroyVertexBuffer(::renoir::VertexBufferObject object) /*override*/;
255
256 virtual void* MapVertexBuffer(::renoir::VertexBufferObject object) /*override*/;
257
258 virtual void UnmapVertexBuffer(::renoir::VertexBufferObject object, uint count) /*override*/;
259
260 virtual bool CreateIndexBuffer(
261 ::renoir::IndexBufferType format,
262 uint count,
263 ::renoir::IndexBufferObject object,
264 bool
265 ) /*override*/;
266
267 virtual void DestroyIndexBuffer(::renoir::IndexBufferObject object) /*override*/;
268
269 virtual void* MapIndexBuffer(::renoir::IndexBufferObject object) /*override*/;
270
271 virtual void UnmapIndexBuffer(::renoir::IndexBufferObject object, uint elemCount) /*override*/;
272
273 virtual bool
274 CreateConstantBuffer(::renoir::CBType type, ::renoir::ConstantBufferObject object, uint size) /*override*/;
275
276 virtual void DestroyConstantBuffer(::renoir::ConstantBufferObject object) /*override*/;
277
278 virtual bool CreateTexture(
279 ::renoir::Texture2DObject object,
280 ::renoir::Texture2D const& description,
281 void const* data,
282 uint dataLen
283 ) /*override*/;
284
285 virtual void DestroyTexture(::renoir::Texture2DObject object) /*override*/;
286
287 virtual void UpdateTexture(
288 ::renoir::Texture2DObject object,
289 ::renoir::Texture2D const& description,
290 ::renoir::UpdateBox* boxes,
291 void const** newBytes,
292 uint count,
293 bool
294 ) /*override*/;
295
296 virtual bool CreateDepthStencilTexture(
297 ::renoir::DepthStencilTextureObject object,
298 ::renoir::DepthStencilTexture const& description
299 ) /*override*/;
300
301 virtual void DestroyDepthStencilTexture(::renoir::DepthStencilTextureObject object) /*override*/;
302
303 virtual void CopyTextureToTexture(
304 ::renoir::Texture2DObject,
305 ::renoir::Texture2DObject,
306 ::renoir::UpdateBox,
307 ::renoir::float2
308 ) /*override*/;
309
310 virtual bool CreateSampler2D(::renoir::Sampler2DObject object, ::renoir::Sampler2D const& description) /*override*/;
311
312 virtual void DestroySampler2D(::renoir::Sampler2DObject object) /*override*/;
313
314 virtual bool ReadTexture(::renoir::TextureObject, ::renoir::UpdateBox const&, void*) /*override*/;
315
316 virtual void ExecuteRendering(
317 ::renoir::RendererBackend::BackendCommandsBuffer const* buffers,
318 uint buffersCount,
319 ::renoir::RendererBackend::ConstantBufferUpdateData const* cboUpdates,
320 uint numCboUpdates
321 ) /*override*/;
322
323 virtual void ExecuteResourceCommands(
324 ::renoir::RendererBackend::BackendResourceCommandsBuffer const* buffers,
325 uint buffersCount,
326 ::renoir::ResourcesCommandsStage
327 ) /*override*/;
328
329 virtual void EndCommands() /*override*/;
330 // NOLINTEND
331
332public:
333 // member functions
334 // NOLINTBEGIN
335 MCAPI RenderDragonRenderingBackend(
336 ::OreUI::FrameDebugData& frameDebugData,
337 ::Gameface::TemporaryTextureHolder& temporaryTextureHolder
338 );
339
340 MCAPI void _drawIndexedInstanced(uint indexCount, uint indexOffset, uint instanceCount, uint instanceOffset);
341
342 MCAPI void _flush();
343
344 MCAPI void _setPipelineState(::renoir::SetPipelineStateCmd const& cmd);
345 // NOLINTEND
346
347public:
348 // constructor thunks
349 // NOLINTBEGIN
350 MCAPI void*
351 $ctor(::OreUI::FrameDebugData& frameDebugData, ::Gameface::TemporaryTextureHolder& temporaryTextureHolder);
352 // NOLINTEND
353
354public:
355 // destructor thunk
356 // NOLINTBEGIN
357 MCAPI void $dtor();
358 // NOLINTEND
359
360public:
361 // virtual function thunks
362 // NOLINTBEGIN
363 MCFOLD void $initializeStaticResources(::Bedrock::NonOwnerPointer<::mce::ShaderGroup> const&);
364
365 MCFOLD void $onAppPreSuspended();
366
367 MCFOLD void $BeginCommands();
368
369 MCAPI void $FillCaps(::renoir::RendererCaps& outCaps);
370
371 MCAPI void $WrapUserRenderTarget(
372 void* userObject,
373 ::renoir::Texture2D const& description,
374 ::renoir::Texture2DObject object,
375 void* dsDescription,
376 ::renoir::DepthStencilTexture const& dsObject,
377 ::renoir::DepthStencilTextureObject
378 );
379
380 MCAPI void
381 $WrapUserTexture(void* userObject, ::renoir::Texture2D const& description, ::renoir::Texture2DObject object);
382
383 MCAPI bool $CreatePipelineState(::renoir::PipelineState const& state, ::renoir::PipelineStateObject object);
384
385 MCAPI void $DestroyPipelineState(::renoir::PipelineStateObject object);
386
387 MCAPI bool $CreateVertexBuffer(::renoir::VertexType type, uint count, ::renoir::VertexBufferObject object, bool);
388
389 MCAPI void $DestroyVertexBuffer(::renoir::VertexBufferObject object);
390
391 MCAPI void* $MapVertexBuffer(::renoir::VertexBufferObject object);
392
393 MCAPI void $UnmapVertexBuffer(::renoir::VertexBufferObject object, uint count);
394
395 MCAPI bool
396 $CreateIndexBuffer(::renoir::IndexBufferType format, uint count, ::renoir::IndexBufferObject object, bool);
397
398 MCAPI void $DestroyIndexBuffer(::renoir::IndexBufferObject object);
399
400 MCAPI void* $MapIndexBuffer(::renoir::IndexBufferObject object);
401
402 MCAPI void $UnmapIndexBuffer(::renoir::IndexBufferObject object, uint elemCount);
403
404 MCAPI bool $CreateConstantBuffer(::renoir::CBType type, ::renoir::ConstantBufferObject object, uint size);
405
406 MCAPI void $DestroyConstantBuffer(::renoir::ConstantBufferObject object);
407
408 MCAPI bool $CreateTexture(
409 ::renoir::Texture2DObject object,
410 ::renoir::Texture2D const& description,
411 void const* data,
412 uint dataLen
413 );
414
415 MCAPI void $DestroyTexture(::renoir::Texture2DObject object);
416
417 MCAPI void $UpdateTexture(
418 ::renoir::Texture2DObject object,
419 ::renoir::Texture2D const& description,
420 ::renoir::UpdateBox* boxes,
421 void const** newBytes,
422 uint count,
423 bool
424 );
425
426 MCAPI bool $CreateDepthStencilTexture(
427 ::renoir::DepthStencilTextureObject object,
428 ::renoir::DepthStencilTexture const& description
429 );
430
431 MCAPI void $DestroyDepthStencilTexture(::renoir::DepthStencilTextureObject object);
432
433 MCFOLD void $CopyTextureToTexture(
434 ::renoir::Texture2DObject,
435 ::renoir::Texture2DObject,
436 ::renoir::UpdateBox,
437 ::renoir::float2
438 );
439
440 MCAPI bool $CreateSampler2D(::renoir::Sampler2DObject object, ::renoir::Sampler2D const& description);
441
442 MCAPI void $DestroySampler2D(::renoir::Sampler2DObject object);
443
444 MCFOLD bool $ReadTexture(::renoir::TextureObject, ::renoir::UpdateBox const&, void*);
445
446 MCAPI void $ExecuteRendering(
447 ::renoir::RendererBackend::BackendCommandsBuffer const* buffers,
448 uint buffersCount,
449 ::renoir::RendererBackend::ConstantBufferUpdateData const* cboUpdates,
450 uint numCboUpdates
451 );
452
453 MCAPI void $ExecuteResourceCommands(
454 ::renoir::RendererBackend::BackendResourceCommandsBuffer const* buffers,
455 uint buffersCount,
456 ::renoir::ResourcesCommandsStage
457 );
458
459 MCAPI void $EndCommands();
460 // NOLINTEND
461
462public:
463 // vftables
464 // NOLINTBEGIN
465 MCNAPI static void** $vftable();
466 // NOLINTEND
467};
468
469} // namespace OreUI
Definition IRenderingBackendTextureStorage.h:7
Definition TemporaryTextureHolder.h:7
Definition RenderDragonRenderingBackend.h:7
static MCAPI void ** $vftable()
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 SetPipelineStateCmd.h:7
Definition Texture2DObject.h:7
Definition Texture2D.h:7
Definition TextureObject.h:7
Definition UpdateBox.h:7
Definition float2.h:7