LeviLamina
Loading...
Searching...
No Matches
RenderChunkGeometry.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/renderer/block/BakedBlockLightType.h"
7#include "mc/common/SubClientId.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/deps/ecs/EntityId.h"
10#include "mc/deps/minecraft_renderer/game/RangeIndices.h"
11#include "mc/util/Bounds.h"
12#include "mc/world/level/BlockPos.h"
13#include "mc/world/level/Tick.h"
14
15// auto generated forward declare list
16// clang-format off
22class TerrainLayer;
23class TerrainTextures;
24class TextureAtlas;
25class Vec3;
26struct BlockQueueEntry;
30namespace dragon { struct RenderMetadata; }
31namespace mce { class IndexBufferContainer; }
32namespace mce { class Mesh; }
33namespace mce { class TextureGroup; }
34namespace mce { class TexturePtr; }
35namespace mce { struct BufferResourceService; }
36namespace mce { struct ServerTexture; }
37namespace mce::framebuilder { struct FrameLightingModelCapabilities; }
38// clang-format on
39
41public:
42 // RenderChunkGeometry inner types define
43 enum class Bit : uchar {
44 CanRender = 0,
45 Built = 1,
46 RayTracingModeOnAtBuildStart = 2,
47 RayTracingModeOnAtBuildEnd = 3,
48 HasSortedLayers = 4,
49 ImmediateChange = 5,
50 BlendCanRenderAsOpaque = 6,
51 Count = 7,
52 };
53
54public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<8, 8, ::Tick> mLastChangeTick;
58 ::ll::TypedStorage<8, 8, ::Tick> mFirstChangeTick;
59 ::ll::TypedStorage<
60 8,
61 24,
62 ::std::
63 variant<::std::monostate, ::std::shared_ptr<::mce::Mesh>, ::std::shared_ptr<::RenderChunkDirectVertexData>>>
64 mMeshData;
65 ::ll::TypedStorage<4, 4, ::std::bitset<7>> mFlags;
66 ::ll::TypedStorage<4, 4, float> mReadyTime;
67 ::ll::TypedStorage<4, 4, int> mBuildIterationCount;
68 ::ll::TypedStorage<4, 12, ::BlockPos> mPosition;
69 ::ll::TypedStorage<4, 12, ::BlockPos> mCenter;
70 ::ll::TypedStorage<4, 48, ::Bounds> mDataBounds;
71 ::ll::TypedStorage<4, 192, ::std::array<::RangeIndices, 24>> mUnsortedIndexRange;
72 ::ll::TypedStorage<4, 4, ::EntityId> mEntityId;
73 ::ll::TypedStorage<8, 112, ::std::array<::std::shared_ptr<::FaceSortingMetaDataBase>, 7>> mFaceSortingMetaData;
74 ::ll::TypedStorage<4, 176, ::std::array<::RangeIndices, 22>> mRenderLayerIndexRanges;
75 ::ll::TypedStorage<4, 4, float> mAverageSkyLight;
76 ::ll::TypedStorage<4, 4, ::std::bitset<6>> mInterlockBitField;
77 ::ll::TypedStorage<1, 6, ::std::array<uchar, 6>> mInterlockNeighborVersionNumbers;
78 ::ll::TypedStorage<1, 1, uchar> mBuildVersionNumber;
79 ::ll::TypedStorage<8, 24, ::std::vector<::BlockQueueEntry>> mPointLightCandidates;
80 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::IRenderChunkGarbage>> mRenderChunkGarbage;
81 // NOLINTEND
82
83public:
84 // prevent constructor by default
85 RenderChunkGeometry();
86
87public:
88 // member functions
89 // NOLINTBEGIN
90 MCAPI RenderChunkGeometry(
91 ::BlockPos p,
92 bool immediateChangeRequested,
93 int buildIterationCount,
94 double overrideReadyTime,
95 uchar versionNum,
96 ::std::weak_ptr<::IRenderChunkGarbage> garbage,
97 ::EntityId entityId
98 );
99
100 MCAPI void _convertFaceMetaDataToFaceSortingMetaData(
101 ::std::array<::std::vector<::RenderChunkQuadInfo>, 7> const& faceMetadata,
102 bool hasSortedLayers
103 );
104
105 MCAPI void _resetFaceMetadata();
106
107 MCAPI bool didRayTracingModeChangeDuringBuild() const;
108
109 MCAPI uint64 endFaceSortOnly(
110 ::mce::BufferResourceService& bufferResourceService,
111 ::RenderChunkSorter& sorter,
112 ::std::variant<
113 ::std::monostate,
114 ::std::shared_ptr<::mce::IndexBufferContainer>,
115 ::std::shared_ptr<::RenderChunkDirectIndexData>>& nextIndices,
116 ::std::array<::RangeIndices, 24>& sortedIndexRange,
117 ::dragon::RenderMetadata const& renderMetadata
118 );
119
120 MCAPI void endRebuild(
121 ::RenderChunkBuilder& builder,
122 ::mce::BufferResourceService& bufferResourceService,
123 bool isBuilding,
124 ::dragon::RenderMetadata const& renderMetadata,
125 bool useSplitStream
126 );
127
128 MCAPI ::mce::TexturePtr const& getDiffuseTexture(::TerrainLayer const& layer) const;
129
130 MCFOLD ::std::variant<
131 ::std::monostate,
132 ::std::shared_ptr<::mce::Mesh>,
133 ::std::shared_ptr<::RenderChunkDirectVertexData>> const&
134 getMeshData() const;
135
136 MCFOLD ::std::vector<::BlockQueueEntry> const& getPointLightCandidates() const;
137
138 MCAPI bool isEmpty() const;
139
140 MCAPI bool isMeshValid() const;
141
142 MCAPI bool isReady() const;
143
144 MCAPI void prefetchMeshPtr() const;
145
146 MCAPI void rebuild(
147 ::RenderChunkBuilder& builder,
148 bool lightingType,
149 ::BakedBlockLightType forExport,
150 bool lightingModelCapabilities,
151 ::mce::framebuilder::FrameLightingModelCapabilities const&
152 );
153
154 MCAPI void reset();
155
156 MCAPI void startRebuild(::RenderChunkBuilder& builder, ::Vec3 const&);
157
158 MCAPI ~RenderChunkGeometry();
159 // NOLINTEND
160
161public:
162 // static functions
163 // NOLINTBEGIN
164 MCAPI static ::std::vector<::mce::ServerTexture> createTerrainTextureList(::SubClientId player);
165
166 MCAPI static void deinitTextures();
167
168 MCAPI static void initTextures(
169 ::Bedrock::NotNullNonOwnerPtr<::MinecraftGraphics> const& minecraftGraphics,
170 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
171 ::Bedrock::NotNullNonOwnerPtr<::TextureAtlas const> const& atlas
172 );
173 // NOLINTEND
174
175public:
176 // static variables
177 // NOLINTBEGIN
178 MCAPI static ::std::unique_ptr<::TerrainTextures>& mTerrainTextures();
179 // NOLINTEND
180
181public:
182 // constructor thunks
183 // NOLINTBEGIN
184 MCAPI void* $ctor(
185 ::BlockPos p,
186 bool immediateChangeRequested,
187 int buildIterationCount,
188 double overrideReadyTime,
189 uchar versionNum,
190 ::std::weak_ptr<::IRenderChunkGarbage> garbage,
191 ::EntityId entityId
192 );
193 // NOLINTEND
194
195public:
196 // destructor thunk
197 // NOLINTBEGIN
198 MCAPI void $dtor();
199 // NOLINTEND
200};
Definition FaceSortingMetaDataBase.h:5
Definition IRenderChunkGarbage.h:5
Definition MinecraftGraphics.h:5
Definition RenderChunkBuilder.h:5
Definition RenderChunkGeometry.h:5
Definition RenderChunkSorter.h:5
Definition TerrainLayer.h:5
Definition TerrainTextures.h:5
Definition TextureAtlas.h:5
Definition Vec3.h:10
Definition IndexBufferContainer.h:7
Definition Mesh.h:7
Definition TextureGroup.h:7
Definition TexturePtr.h:7
Definition BlockQueueEntry.h:5
Definition RenderChunkDirectIndexData.h:5
Definition RenderChunkDirectVertexData.h:5
Definition RenderChunkQuadInfo.h:5
Definition RenderMetadata.h:7
Definition BufferResourceService.h:7
Definition ServerTexture.h:7
Definition FrameLightingModelCapabilities.h:7