LeviLamina
Loading...
Searching...
No Matches
TextureStorageImpl.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/oreui/rendering/IRenderingBackendTextureStorage.h"
7#include "mc/deps/core/checked_resource_service/ClientResourcePointer.h"
8#include "mc/deps/minecraft_renderer/resources/ClientTexture.h"
9#include "mc/external/gameface/renoir/DepthStencilTextureObject.h"
10#include "mc/external/gameface/renoir/Sampler2DObject.h"
11#include "mc/external/gameface/renoir/Texture2DObject.h"
12#include "mc/external/render_dragon/resources/TextureDescription.h"
13#include "mc/platform/brstd/function_ref.h"
14#include "mc/util/BackendRenderConfig.h"
15
16// auto generated forward declare list
17// clang-format off
18namespace Gameface { class IRenderingBackendTextureService; }
19namespace Gameface { class TemporaryTextureHolder; }
20namespace Gameface { struct BackendTextureStorageDependencies; }
21namespace Gameface { struct VisitedRenderTarget; }
22namespace Gameface { struct VisitedSampler; }
23namespace Gameface { struct VisitedTexture; }
24namespace GeometryAtlas { class IAtlasTile; }
25namespace dragon { class ResolvedTextureResource; }
26namespace mce { class TexturePtr; }
27namespace mce { struct SamplerStateDescription; }
28namespace renoir { struct DepthStencilTexture; }
29namespace renoir { struct Sampler2D; }
30namespace renoir { struct SetPSSamplersCmd; }
31namespace renoir { struct SetPSTexturesCmd; }
32namespace renoir { struct SetRenderTargetCmd; }
33namespace renoir { struct Texture2D; }
34namespace renoir { struct UpdateBox; }
35// clang-format on
36
37namespace Gameface {
38
39class TextureStorageImpl : public ::Gameface::IRenderingBackendTextureStorage {
40public:
41 // TextureStorageImpl inner types declare
42 // clang-format off
44 struct TextureStorage;
45 // clang-format on
46
47 // TextureStorageImpl inner types define
48 struct WrapUserTextureArgs {
49 public:
50 // member variables
51 // NOLINTBEGIN
52 ::ll::TypedStorage<8, 8, ::renoir::Texture2D const&> mDescription;
53 ::ll::TypedStorage<8, 8, ::renoir::Texture2DObject const&> mObject;
54 // NOLINTEND
55
56 public:
57 // prevent constructor by default
58 WrapUserTextureArgs& operator=(WrapUserTextureArgs const&);
59 WrapUserTextureArgs(WrapUserTextureArgs const&);
60 WrapUserTextureArgs();
61 };
62
63 struct TextureStorage {
64 public:
65 // member variables
66 // NOLINTBEGIN
67 ::ll::TypedStorage<
68 8,
69 32,
70 ::std::variant<
71 ::std::monostate,
72 ::mce::ClientResourcePointer<::dragon::ResolvedTextureResource>,
73 ::mce::ClientTexture,
74 ::std::shared_ptr<::GeometryAtlas::IAtlasTile>>>
75 mTexture;
76 ::ll::TypedStorage<8, 64, ::dragon::TextureDescription> mDesc;
77 // NOLINTEND
78
79 public:
80 // prevent constructor by default
81 TextureStorage& operator=(TextureStorage const&);
82 TextureStorage();
83
84 public:
85 // member functions
86 // NOLINTBEGIN
87 MCAPI TextureStorage(::Gameface::TextureStorageImpl::TextureStorage const&);
88
89 MCAPI ~TextureStorage();
90 // NOLINTEND
91
92 public:
93 // constructor thunks
94 // NOLINTBEGIN
95 MCAPI void* $ctor(::Gameface::TextureStorageImpl::TextureStorage const&);
96 // NOLINTEND
97
98 public:
99 // destructor thunk
100 // NOLINTBEGIN
101 MCAPI void $dtor();
102 // NOLINTEND
103 };
104
105public:
106 // member variables
107 // NOLINTBEGIN
108 ::ll::TypedStorage<
109 8,
110 64,
111 ::std::unordered_map<::renoir::Texture2DObject, ::Gameface::TextureStorageImpl::TextureStorage>>
112 mTextures;
113 ::ll::TypedStorage<
114 8,
115 64,
116 ::std::unordered_map<::renoir::DepthStencilTextureObject, ::Gameface::TextureStorageImpl::TextureStorage>>
117 mDepthTextures;
118 ::ll::TypedStorage<8, 64, ::std::unordered_map<::renoir::Sampler2DObject, ::mce::SamplerStateDescription>>
119 mSamplers;
120 ::ll::TypedStorage<4, 20, ::std::array<::renoir::Texture2DObject, 5>> mRequestedTextures;
121 ::ll::TypedStorage<4, 20, ::std::array<::renoir::Sampler2DObject, 5>> mRequestedSamplers;
122 ::ll::TypedStorage<8, 8, ::Gameface::TemporaryTextureHolder&> mTemporaryTextureHolder;
123 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::Gameface::IRenderingBackendTextureService>>>
124 mTextureService;
125 ::ll::TypedStorage<1, 2, ::Gameface::RenderUtils::BackendRenderConfig const> mConfig;
126 // NOLINTEND
127
128public:
129 // prevent constructor by default
130 TextureStorageImpl& operator=(TextureStorageImpl const&);
131 TextureStorageImpl(TextureStorageImpl const&);
132 TextureStorageImpl();
133
134public:
135 // virtual functions
136 // NOLINTBEGIN
137 virtual void wrapUserRenderTarget(
138 ::mce::ClientTexture texture,
139 ::renoir::Texture2D const& description,
140 ::renoir::Texture2DObject const& object
141 ) /*override*/;
142
143 virtual void wrapUserTexture(
144 uint64 id,
145 ::renoir::Texture2D const& description,
146 ::renoir::Texture2DObject const object
147 ) /*override*/;
148
149 virtual void createTexture(
150 ::renoir::Texture2DObject const object,
151 ::renoir::Texture2D const& description,
152 void const* data,
153 uint const dataLen
154 ) /*override*/;
155
156 virtual void destroyTexture(::renoir::Texture2DObject const object) /*override*/;
157
158 virtual void updateTexture(
159 ::renoir::Texture2DObject const object,
160 ::renoir::Texture2D const& description,
161 ::renoir::UpdateBox* boxes,
162 void const** newBytes,
163 uint const count
164 ) /*override*/;
165
166 virtual void createDepthStencilTexture(
167 ::renoir::DepthStencilTextureObject const object,
168 ::renoir::DepthStencilTexture const& description
169 ) /*override*/;
170
171 virtual void destroyDepthStencilTexture(::renoir::DepthStencilTextureObject const object) /*override*/;
172
173 virtual void
174 createSampler2D(::renoir::Sampler2DObject const object, ::renoir::Sampler2D const& description) /*override*/;
175
176 virtual void destroySampler2D(::renoir::Sampler2DObject const object) /*override*/;
177
178 virtual void visitRenderTarget(
179 ::renoir::SetRenderTargetCmd const& cmd,
180 ::brstd::function_ref<
181 void(::Gameface::VisitedRenderTarget const&) const,
182 void(::Gameface::VisitedRenderTarget const&)> visitor
183 ) /*override*/;
184
185 virtual void
186 setPSSamplers(::renoir::SetPSSamplersCmd const& cmd, ::renoir::Sampler2DObject const* samplers) /*override*/;
187
188 virtual void
189 setPSTextures(::renoir::SetPSTexturesCmd const& cmd, ::renoir::Texture2DObject const* textures) /*override*/;
190
191 virtual void visitMeshTextures(
192 ::brstd::function_ref<void(::Gameface::VisitedTexture const&) const, void(::Gameface::VisitedTexture const&)>
193 visitor
194 ) /*override*/;
195
196 virtual void visitMeshSamplers(
197 ::brstd::function_ref<void(::Gameface::VisitedSampler const&) const, void(::Gameface::VisitedSampler const&)>
198 visitor
199 ) /*override*/;
200 // NOLINTEND
201
202public:
203 // member functions
204 // NOLINTBEGIN
205 MCAPI explicit TextureStorageImpl(::Gameface::BackendTextureStorageDependencies&& deps);
206
207 MCAPI void
208 _wrapUserTexture(::Gameface::TextureStorageImpl::WrapUserTextureArgs const& args, ::mce::TexturePtr texture);
209
210 MCAPI void _wrapUserTexture(
211 ::Gameface::TextureStorageImpl::WrapUserTextureArgs const& args,
212 ::std::shared_ptr<::GeometryAtlas::IAtlasTile> const& tile
213 );
214 // NOLINTEND
215
216public:
217 // constructor thunks
218 // NOLINTBEGIN
219 MCAPI void* $ctor(::Gameface::BackendTextureStorageDependencies&& deps);
220 // NOLINTEND
221
222public:
223 // virtual function thunks
224 // NOLINTBEGIN
225 MCAPI void $wrapUserRenderTarget(
226 ::mce::ClientTexture texture,
227 ::renoir::Texture2D const& description,
228 ::renoir::Texture2DObject const& object
229 );
230
231 MCAPI void
232 $wrapUserTexture(uint64 id, ::renoir::Texture2D const& description, ::renoir::Texture2DObject const object);
233
234 MCAPI void $createTexture(
235 ::renoir::Texture2DObject const object,
236 ::renoir::Texture2D const& description,
237 void const* data,
238 uint const dataLen
239 );
240
241 MCAPI void $destroyTexture(::renoir::Texture2DObject const object);
242
243 MCAPI void $updateTexture(
244 ::renoir::Texture2DObject const object,
245 ::renoir::Texture2D const& description,
246 ::renoir::UpdateBox* boxes,
247 void const** newBytes,
248 uint const count
249 );
250
251 MCAPI void $createDepthStencilTexture(
252 ::renoir::DepthStencilTextureObject const object,
253 ::renoir::DepthStencilTexture const& description
254 );
255
256 MCAPI void $destroyDepthStencilTexture(::renoir::DepthStencilTextureObject const object);
257
258 MCAPI void $createSampler2D(::renoir::Sampler2DObject const object, ::renoir::Sampler2D const& description);
259
260 MCAPI void $destroySampler2D(::renoir::Sampler2DObject const object);
261
262 MCAPI void $visitRenderTarget(
263 ::renoir::SetRenderTargetCmd const& cmd,
264 ::brstd::function_ref<
265 void(::Gameface::VisitedRenderTarget const&) const,
266 void(::Gameface::VisitedRenderTarget const&)> visitor
267 );
268
269 MCAPI void $setPSSamplers(::renoir::SetPSSamplersCmd const& cmd, ::renoir::Sampler2DObject const* samplers);
270
271 MCAPI void $setPSTextures(::renoir::SetPSTexturesCmd const& cmd, ::renoir::Texture2DObject const* textures);
272
273 MCAPI void $visitMeshTextures(
274 ::brstd::function_ref<void(::Gameface::VisitedTexture const&) const, void(::Gameface::VisitedTexture const&)>
275 visitor
276 );
277
278 MCAPI void $visitMeshSamplers(
279 ::brstd::function_ref<void(::Gameface::VisitedSampler const&) const, void(::Gameface::VisitedSampler const&)>
280 visitor
281 );
282 // NOLINTEND
283
284public:
285 // vftables
286 // NOLINTBEGIN
287 MCNAPI static void** $vftable();
288 // NOLINTEND
289};
290
291} // namespace Gameface
Definition IRenderingBackendTextureService.h:7
Definition TemporaryTextureHolder.h:7
Definition TextureStorageImpl.h:7
static MCAPI void ** $vftable()
Definition IAtlasTile.h:7
Definition ResolvedTextureResource.h:7
Definition TexturePtr.h:7
Definition BackendTextureStorageDependencies.h:7
Definition TextureStorageImpl.h:18
Definition TextureStorageImpl.h:16
Definition VisitedRenderTarget.h:7
Definition VisitedSampler.h:7
Definition VisitedTexture.h:7
Definition SamplerStateDescription.h:7
Definition DepthStencilTexture.h:7
Definition Sampler2D.h:7
Definition SetPSSamplersCmd.h:7
Definition SetPSTexturesCmd.h:7
Definition SetRenderTargetCmd.h:7
Definition Texture2D.h:7
Definition UpdateBox.h:7