-
Notifications
You must be signed in to change notification settings - Fork 502
/
LatteTextureGL.cpp
497 lines (487 loc) · 16.4 KB
/
LatteTextureGL.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
#include "Cafe/HW/Latte/Renderer/OpenGL/LatteTextureGL.h"
#include "Cafe/HW/Latte/Renderer/OpenGL/LatteTextureViewGL.h"
#include "Cafe/HW/Latte/Renderer/OpenGL/OpenGLRenderer.h"
#include "Cafe/HW/Latte/Core/Latte.h"
#include "config/LaunchSettings.h"
LatteTextureGL::LatteTextureGL(Latte::E_DIM dim, MPTR physAddress, MPTR physMipAddress, Latte::E_GX2SURFFMT format, uint32 width, uint32 height, uint32 depth, uint32 pitch, uint32 mipLevels, uint32 swizzle,
Latte::E_HWTILEMODE tileMode, bool isDepth)
: LatteTexture(dim, physAddress, physMipAddress, format, width, height, depth, pitch, mipLevels, swizzle, tileMode, isDepth)
{
GenerateEmptyTextureFromGX2Dim(dim, this->glId_texture, this->glTexTarget, true);
// set format info
FormatInfoGL glFormatInfo;
GetOpenGLFormatInfo(isDepth, overwriteInfo.hasFormatOverwrite ? (Latte::E_GX2SURFFMT)overwriteInfo.format : format, dim, &glFormatInfo);
this->glInternalFormat = glFormatInfo.glInternalFormat;
this->isAlternativeFormat = glFormatInfo.isUsingAlternativeFormat;
// set debug name
bool useGLDebugNames = false;
#ifdef CEMU_DEBUG_ASSERT
useGLDebugNames = true;
#endif
if (LaunchSettings::NSightModeEnabled())
useGLDebugNames = true;
if (useGLDebugNames)
{
char textureDebugLabel[512];
sprintf(textureDebugLabel, "%08x_f%04x%s_p%04x_%dx%d", physAddress, (uint32)format, this->isDepth ? "_d" : "", pitch, width, height);
glObjectLabel(GL_TEXTURE, this->glId_texture, -1, textureDebugLabel);
}
}
LatteTextureGL::~LatteTextureGL()
{
glDeleteTextures(1, &glId_texture);
catchOpenGLError();
}
void LatteTextureGL::GenerateEmptyTextureFromGX2Dim(Latte::E_DIM dim, GLuint& texId, GLint& texTarget, bool createForTargetType)
{
if (dim == Latte::E_DIM::DIM_2D)
texTarget = GL_TEXTURE_2D;
else if (dim == Latte::E_DIM::DIM_1D)
texTarget = GL_TEXTURE_1D;
else if (dim == Latte::E_DIM::DIM_3D)
texTarget = GL_TEXTURE_3D;
else if (dim == Latte::E_DIM::DIM_2D_ARRAY)
texTarget = GL_TEXTURE_2D_ARRAY;
else if (dim == Latte::E_DIM::DIM_CUBEMAP)
texTarget = GL_TEXTURE_CUBE_MAP_ARRAY;
else if (dim == Latte::E_DIM::DIM_2D_MSAA)
texTarget = GL_TEXTURE_2D; // todo, GL_TEXTURE_2D_MULTISAMPLE ?
else
{
cemu_assert_unimplemented();
}
if(createForTargetType)
texId = glCreateTextureWrapper(texTarget); // initializes the texture to texTarget (equivalent to calling glGenTextures + glBindTexture)
else
glGenTextures(1, &texId);
}
LatteTextureView* LatteTextureGL::CreateView(Latte::E_DIM dim, Latte::E_GX2SURFFMT format, sint32 firstMip, sint32 mipCount, sint32 firstSlice, sint32 sliceCount)
{
return new LatteTextureViewGL(this, dim, format, firstMip, mipCount, firstSlice, sliceCount);
}
void LatteTextureGL::GetOpenGLFormatInfo(bool isDepth, Latte::E_GX2SURFFMT format, Latte::E_DIM dim, FormatInfoGL* formatInfoOut)
{
formatInfoOut->isUsingAlternativeFormat = false;
if (isDepth)
{
if (format == Latte::E_GX2SURFFMT::D24_S8_UNORM)
{
formatInfoOut->setFormat(GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8);
return;
}
else if (format == Latte::E_GX2SURFFMT::D24_S8_FLOAT)
{
formatInfoOut->setFormat(GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
formatInfoOut->markAsAlternativeFormat();
return;
}
else if (format == Latte::E_GX2SURFFMT::D32_S8_FLOAT)
{
formatInfoOut->setFormat(GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
return;
}
else if (format == Latte::E_GX2SURFFMT::D32_FLOAT)
{
formatInfoOut->setFormat(GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT);
return;
}
else if (format == Latte::E_GX2SURFFMT::D16_UNORM)
{
formatInfoOut->setFormat(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT);
return;
}
// unsupported depth format
cemuLog_log(LogType::Force, "OpenGL: Unsupported texture depth format 0x{:04x}", (uint32)format);
// use placeholder format
formatInfoOut->setFormat(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT);
formatInfoOut->markAsAlternativeFormat();
return;
}
bool glIsCompressed = false;
bool isUsingAlternativeFormat = false; // set to true if there is no bit-perfect matching OpenGL format
sint32 glInternalFormat;
sint32 glSuppliedFormat;
sint32 glSuppliedFormatType;
// get format information
if (format == Latte::E_GX2SURFFMT::R4_G4_UNORM)
{
formatInfoOut->setFormat(GL_RGBA4, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
formatInfoOut->markAsAlternativeFormat();
return;
}
else if (format == Latte::E_GX2SURFFMT::R4_G4_B4_A4_UNORM)
{
formatInfoOut->setFormat(GL_RGBA4, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
return;
}
else if (format == Latte::E_GX2SURFFMT::R16_G16_B16_A16_FLOAT)
{
formatInfoOut->setFormat(GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT);
return;
}
else if (format == Latte::E_GX2SURFFMT::R16_G16_FLOAT)
{
formatInfoOut->setFormat(GL_RG16F, GL_RG, GL_HALF_FLOAT);
return;
}
else if (format == Latte::E_GX2SURFFMT::R16_SNORM)
{
formatInfoOut->setFormat(GL_R16_SNORM, GL_RED, GL_SHORT);
return;
}
else if (format == Latte::E_GX2SURFFMT::R16_FLOAT)
{
formatInfoOut->setFormat(GL_R16F, GL_RED, GL_HALF_FLOAT);
return;
}
else if (format == Latte::E_GX2SURFFMT::BC1_UNORM ||
format == Latte::E_GX2SURFFMT::BC1_SRGB)
{
if (format == Latte::E_GX2SURFFMT::BC1_SRGB)
formatInfoOut->setCompressed(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, -1, -1);
else
formatInfoOut->setCompressed(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, -1, -1);
return;
}
else if (format == Latte::E_GX2SURFFMT::BC2_UNORM || format == Latte::E_GX2SURFFMT::BC2_SRGB)
{
// todo - use OpenGL BC2 format if available
formatInfoOut->setFormat(GL_RGBA16F, GL_RGBA, GL_FLOAT);
formatInfoOut->markAsAlternativeFormat();
return;
}
else if (format == Latte::E_GX2SURFFMT::BC3_UNORM || format == Latte::E_GX2SURFFMT::BC3_SRGB)
{
if (format == Latte::E_GX2SURFFMT::BC3_SRGB)
formatInfoOut->setCompressed(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, -1, -1);
else
formatInfoOut->setCompressed(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, -1, -1);
return;
}
else if (format == Latte::E_GX2SURFFMT::BC4_UNORM || format == Latte::E_GX2SURFFMT::BC4_SNORM)
{
bool allowCompressed = true;
if (dim != Latte::E_DIM::DIM_2D && dim != Latte::E_DIM::DIM_2D_ARRAY)
allowCompressed = false; // RGTC1 does not support non-2D textures
if (allowCompressed)
{
if (format == Latte::E_GX2SURFFMT::BC4_UNORM)
formatInfoOut->setCompressed(GL_COMPRESSED_RED_RGTC1, -1, -1);
else
formatInfoOut->setCompressed(GL_COMPRESSED_SIGNED_RED_RGTC1, -1, -1);
return;
}
else
{
formatInfoOut->setFormat(GL_RG16F, GL_RG, GL_FLOAT);
formatInfoOut->markAsAlternativeFormat();
return;
}
}
else if (format == Latte::E_GX2SURFFMT::BC5_UNORM || format == Latte::E_GX2SURFFMT::BC5_SNORM)
{
if (format == Latte::E_GX2SURFFMT::BC5_SNORM)
formatInfoOut->setCompressed(GL_COMPRESSED_SIGNED_RG_RGTC2, -1, -1);
else
formatInfoOut->setCompressed(GL_COMPRESSED_RG_RGTC2, -1, -1);
return;
}
else if (format == Latte::E_GX2SURFFMT::R32_FLOAT)
{
formatInfoOut->setFormat(GL_R32F, GL_RED, GL_FLOAT);
return;
}
else if (format == Latte::E_GX2SURFFMT::R32_G32_FLOAT)
{
formatInfoOut->setFormat(GL_RG32F, GL_RG, GL_FLOAT);
return;
}
else if (format == Latte::E_GX2SURFFMT::R32_G32_UINT)
{
formatInfoOut->setFormat(GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT);
return;
}
else if (format == Latte::E_GX2SURFFMT::R32_UINT)
{
formatInfoOut->setFormat(GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT);
return;
}
else if (format == Latte::E_GX2SURFFMT::R16_UINT)
{
// used by VC DS (New Super Mario Bros)
formatInfoOut->setFormat(GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT);
return;
}
else if (format == Latte::E_GX2SURFFMT::R8_UINT)
{
// used by VC DS (New Super Mario Bros)
formatInfoOut->setFormat(GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE);
return;
}
else if (format == Latte::E_GX2SURFFMT::R32_G32_B32_A32_FLOAT)
{
formatInfoOut->setFormat(GL_RGBA32F, GL_RGBA, GL_FLOAT);
return;
}
else if (format == Latte::E_GX2SURFFMT::R8_G8_B8_A8_UNORM || format == Latte::E_GX2SURFFMT::R8_G8_B8_A8_SRGB)
{
if (format == Latte::E_GX2SURFFMT::R8_G8_B8_A8_SRGB)
glInternalFormat = GL_SRGB8_ALPHA8;
else
glInternalFormat = GL_RGBA8;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_UNSIGNED_BYTE;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R8_G8_B8_A8_SNORM)
{
glInternalFormat = GL_RGBA8_SNORM;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_BYTE;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R8_UNORM)
{
glInternalFormat = GL_R8;
// supplied format
glSuppliedFormat = GL_RED;
glSuppliedFormatType = GL_UNSIGNED_BYTE;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R8_SNORM)
{
glInternalFormat = GL_R8_SNORM;
// supplied format
glSuppliedFormat = GL_RED;
glSuppliedFormatType = GL_BYTE;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R8_G8_UNORM)
{
glInternalFormat = GL_RG8;
// supplied format
glSuppliedFormat = GL_RG;
glSuppliedFormatType = GL_UNSIGNED_BYTE;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R8_G8_SNORM)
{
glInternalFormat = GL_RG8_SNORM;
// supplied format
glSuppliedFormat = GL_RG;
glSuppliedFormatType = GL_BYTE;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R16_UNORM)
{
glInternalFormat = GL_R16;
// supplied format
glSuppliedFormat = GL_RED;
glSuppliedFormatType = GL_UNSIGNED_SHORT;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R16_G16_B16_A16_UNORM)
{
glInternalFormat = GL_RGBA16;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_UNSIGNED_SHORT;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R16_G16_B16_A16_SNORM)
{
glInternalFormat = GL_RGBA16_SNORM;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_SHORT;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R16_G16_UNORM)
{
glInternalFormat = GL_RG16;
// supplied format
glSuppliedFormat = GL_RG;
glSuppliedFormatType = GL_UNSIGNED_SHORT;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R5_G6_B5_UNORM)
{
glInternalFormat = GL_RGB565;
// supplied format
glSuppliedFormat = GL_RGB;
glSuppliedFormatType = GL_UNSIGNED_SHORT_5_6_5_REV;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R5_G5_B5_A1_UNORM)
{
glInternalFormat = GL_RGB5_A1;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_UNSIGNED_SHORT_5_5_5_1;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::A1_B5_G5_R5_UNORM)
{
glInternalFormat = GL_RGB5_A1;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_UNSIGNED_SHORT_5_5_5_1;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R10_G10_B10_A2_UNORM)
{
glInternalFormat = GL_RGB10_A2;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_UNSIGNED_INT_2_10_10_10_REV;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R10_G10_B10_A2_SRGB) // used by Super Mario Maker
{
glInternalFormat = GL_RGB10_A2; // todo - how to handle SRGB for this format?
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_UNSIGNED_INT_2_10_10_10_REV;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::A2_B10_G10_R10_UNORM)
{
glInternalFormat = GL_RGB10_A2;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_UNSIGNED_INT_10_10_10_2;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R10_G10_B10_A2_SNORM)
{
glInternalFormat = GL_RGBA16_SNORM; // OpenGL has no signed version of GL_RGB10_A2
isUsingAlternativeFormat = true;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_SHORT;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R11_G11_B10_FLOAT)
{
glInternalFormat = GL_R11F_G11F_B10F;
// supplied format
glSuppliedFormat = GL_RGB;
glSuppliedFormatType = GL_UNSIGNED_INT_10F_11F_11F_REV;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R32_G32_B32_A32_UINT)
{
glInternalFormat = GL_RGBA32UI;
// supplied format
glSuppliedFormat = GL_RGBA_INTEGER;
glSuppliedFormatType = GL_UNSIGNED_INT;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R16_G16_B16_A16_UINT)
{
glInternalFormat = GL_RGBA16UI;
// supplied format
glSuppliedFormat = GL_RGBA_INTEGER;
glSuppliedFormatType = GL_UNSIGNED_SHORT;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R8_G8_B8_A8_UINT)
{
glInternalFormat = GL_RGBA8UI;
// supplied format
glSuppliedFormat = GL_RGBA_INTEGER;
glSuppliedFormatType = GL_UNSIGNED_BYTE;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R24_X8_UNORM)
{
// OpenGL has no color version of GL_DEPTH24_STENCIL8, therefore we use a 32-bit floating-point format instead
glInternalFormat = GL_R32F;
isUsingAlternativeFormat = true;
// supplied format
glSuppliedFormat = GL_RED;
glSuppliedFormatType = GL_FLOAT;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::X24_G8_UINT)
{
// OpenGL has no X24_G8 format, we use RGBA8UI instead and manually swizzle the channels
// this format is used in Resident Evil Revelations when scanning with the Genesis. It's also used in Cars 3: Driven to Win?
glInternalFormat = GL_RGBA8UI;
isUsingAlternativeFormat = true;
// supplied format
glSuppliedFormat = GL_RGBA;
glSuppliedFormatType = GL_FLOAT;
glIsCompressed = false;
}
else if (format == Latte::E_GX2SURFFMT::R32_X8_FLOAT)
{
// only available as depth format in OpenGL
// used by Cars 3: Driven to Win
// find a way to emulate this using a color format
glInternalFormat = GL_DEPTH32F_STENCIL8;
isUsingAlternativeFormat = false;
// supplied format
glSuppliedFormat = GL_DEPTH_STENCIL;
glSuppliedFormatType = GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
glIsCompressed = false;
cemu_assert_debug(false);
}
else
{
cemuLog_log(LogType::Force, "OpenGL: Unsupported texture format 0x{:04x}", (uint32)format);
cemu_assert_unimplemented();
}
formatInfoOut->glInternalFormat = glInternalFormat;
formatInfoOut->glSuppliedFormat = glSuppliedFormat;
formatInfoOut->glSuppliedFormatType = glSuppliedFormatType;
formatInfoOut->glIsCompressed = glIsCompressed;
formatInfoOut->isUsingAlternativeFormat = isUsingAlternativeFormat;
}
void LatteTextureGL::AllocateOnHost()
{
auto hostTexture = this;
cemu_assert_debug(hostTexture->isDataDefined == false);
sint32 effectiveBaseWidth = hostTexture->width;
sint32 effectiveBaseHeight = hostTexture->height;
sint32 effectiveBaseDepth = hostTexture->depth;
if (hostTexture->overwriteInfo.hasResolutionOverwrite)
{
effectiveBaseWidth = hostTexture->overwriteInfo.width;
effectiveBaseHeight = hostTexture->overwriteInfo.height;
effectiveBaseDepth = hostTexture->overwriteInfo.depth;
}
// calculate mip count
sint32 mipLevels = std::min(hostTexture->mipLevels, hostTexture->maxPossibleMipLevels);
mipLevels = std::max(mipLevels, 1);
// create immutable storage
if (hostTexture->dim == Latte::E_DIM::DIM_2D || hostTexture->dim == Latte::E_DIM::DIM_2D_MSAA)
{
cemu_assert_debug(effectiveBaseDepth == 1);
glTextureStorage2DWrapper(GL_TEXTURE_2D, hostTexture->glId_texture, mipLevels, hostTexture->glInternalFormat, effectiveBaseWidth, effectiveBaseHeight);
}
else if (hostTexture->dim == Latte::E_DIM::DIM_1D)
{
cemu_assert_debug(effectiveBaseHeight == 1);
cemu_assert_debug(effectiveBaseDepth == 1);
glTextureStorage1DWrapper(GL_TEXTURE_1D, hostTexture->glId_texture, mipLevels, hostTexture->glInternalFormat, effectiveBaseWidth);
}
else if (hostTexture->dim == Latte::E_DIM::DIM_2D_ARRAY || hostTexture->dim == Latte::E_DIM::DIM_2D_ARRAY_MSAA)
{
glTextureStorage3DWrapper(GL_TEXTURE_2D_ARRAY, hostTexture->glId_texture, mipLevels, hostTexture->glInternalFormat, effectiveBaseWidth, effectiveBaseHeight, std::max(1, effectiveBaseDepth));
}
else if (hostTexture->dim == Latte::E_DIM::DIM_3D)
{
glTextureStorage3DWrapper(GL_TEXTURE_3D, hostTexture->glId_texture, mipLevels, hostTexture->glInternalFormat, effectiveBaseWidth, effectiveBaseHeight, std::max(1, effectiveBaseDepth));
}
else if (hostTexture->dim == Latte::E_DIM::DIM_CUBEMAP)
{
glTextureStorage3DWrapper(GL_TEXTURE_CUBE_MAP_ARRAY, hostTexture->glId_texture, mipLevels, hostTexture->glInternalFormat, effectiveBaseWidth, effectiveBaseHeight, effectiveBaseDepth);
}
else
{
cemu_assert_unimplemented();
}
}