LeviLamina
Loading...
Searching...
No Matches
RenderChunkInstanced.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/threading/MPMCQueue.h"
7
8// auto generated forward declare list
9// clang-format off
13class Vec3;
14struct RangeIndices;
16namespace mce { class IndexBufferContainer; }
17namespace mce { struct BufferResourceService; }
18// clang-format on
19
21public:
22 // RenderChunkInstanced inner types define
23 enum class SortState : uchar {
24 Sorting = 0,
25 Idle = 1,
26 };
27
28public:
29 // member variables
30 // NOLINTBEGIN
31 ::ll::TypedStorage<4, 4, float> mDistanceFromCamera2;
32 ::ll::TypedStorage<4, 4, float> mChunkBuildPriority;
33 bool mCanRender : 1;
34 bool mCameraMovedEnough : 1;
35 bool mFallbackToUnsorted : 1;
36 bool mNewSortData : 1;
37 bool mCurrentGeometryHasSortedLayers : 1;
38 bool mEmpty : 1;
39 ::ll::TypedStorage<1, 1, ::std::atomic<::RenderChunkInstanced::SortState>> mSortState;
40 ::ll::TypedStorage<1, 1, uchar> mLastSortRenderChunkGeometryVersion;
41 ::ll::TypedStorage<4, 4, float> mAverageBrightness;
42 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::RenderChunkShared>> mRenderChunkShared;
43 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::RenderChunkGeometry>> mCurrentRenderChunkGeometry;
44 ::ll::TypedStorage<
45 8,
46 24,
47 ::std::variant<
48 ::std::monostate,
49 ::std::shared_ptr<::mce::IndexBufferContainer>,
50 ::std::shared_ptr<::RenderChunkDirectIndexData>>>
51 mCurrentIndices;
52 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::std::array<::RangeIndices, 22>>> mCurrentIndexRanges;
53 ::ll::TypedStorage<8, 8, uint64> mIndexBufferSizeEstimate;
54 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::RenderChunkGeometry>> mSortingRenderChunkGeometry;
55 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::RenderChunkGeometry>> mNextRenderChunkGeometry;
56 ::ll::TypedStorage<
57 8,
58 24,
59 ::std::variant<
60 ::std::monostate,
61 ::std::shared_ptr<::mce::IndexBufferContainer>,
62 ::std::shared_ptr<::RenderChunkDirectIndexData>>>
63 mNextIndices;
64 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::std::array<::RangeIndices, 22>>> mNextIndexRanges;
65 ::ll::TypedStorage<4, 12, ::glm::ivec3> mLastSortCameraDelta;
66 ::ll::TypedStorage<4, 12, ::glm::ivec3> mCurrentIndexBufferCameraDelta;
67 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mGuaranteedPromoteTime;
68 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::mce::BufferResourceService>> mBufferResourceService;
69 // NOLINTEND
70
71public:
72 // member functions
73 // NOLINTBEGIN
74 MCAPI RenderChunkInstanced();
75
76 MCAPI void _startSortCommon(::RenderChunkSorter& sorter);
77
78 MCAPI void clearMeshData();
79
80 MCAPI void endSort(::RenderChunkSorter& sorter, ::mce::BufferResourceService& bufferResourceService);
81
82 MCAPI void onOrthographicCameraMoved(::Vec3 const& currentCameraForward);
83
84 MCAPI void onPerspectiveCameraMoved(::Vec3 const& currentCameraPos, bool forceAccurateSort);
85
86 MCAPI void promoteSortedGeometry();
87
88 MCAPI void setRenderChunkShared(::std::shared_ptr<::RenderChunkShared> renderChunkShared);
89
90 MCAPI ~RenderChunkInstanced();
91 // NOLINTEND
92
93public:
94 // static functions
95 // NOLINTBEGIN
96 MCAPI static void _resetIndices(
97 ::std::variant<
98 ::std::monostate,
99 ::std::shared_ptr<::mce::IndexBufferContainer>,
100 ::std::shared_ptr<::RenderChunkDirectIndexData>>& indices
101 );
102
103 MCAPI static void garbageCollectIndexBuffers();
104 // NOLINTEND
105
106public:
107 // static variables
108 // NOLINTBEGIN
109 MCAPI static ::MPMCQueue<::std::variant<
110 ::std::monostate,
111 ::std::shared_ptr<::mce::IndexBufferContainer>,
112 ::std::shared_ptr<::RenderChunkDirectIndexData>>>&
113 mIndexBufferGarbageList();
114 // NOLINTEND
115
116public:
117 // constructor thunks
118 // NOLINTBEGIN
119 MCAPI void* $ctor();
120 // NOLINTEND
121
122public:
123 // destructor thunk
124 // NOLINTBEGIN
125 MCAPI void $dtor();
126 // NOLINTEND
127};
Definition RenderChunkGeometry.h:5
Definition RenderChunkInstanced.h:5
Definition RenderChunkShared.h:5
Definition RenderChunkSorter.h:5
Definition Vec3.h:10
Definition IndexBufferContainer.h:7
Definition RangeIndices.h:5
Definition RenderChunkDirectIndexData.h:5
Definition BufferResourceService.h:7