@@ -32,9 +32,9 @@ void LatteTexture_setEffectiveTextureScale(LatteConst::ShaderType shaderType, si
32
32
t[1 ] = v;
33
33
}
34
34
35
- void LatteTextureLoader_UpdateTextureSliceData (LatteTexture* tex, sint32 textureUnit, uint32 sliceIndex, uint32 mipIndex, MPTR physImagePtr, MPTR physMipPtr, Latte::E_DIM dim, uint32 width, uint32 height, uint32 depth, uint32 mipLevels, uint32 pitch, Latte::E_HWTILEMODE tileMode, uint32 swizzle, bool dumpTex);
35
+ void LatteTextureLoader_UpdateTextureSliceData (LatteTexture* tex, uint32 sliceIndex, uint32 mipIndex, MPTR physImagePtr, MPTR physMipPtr, Latte::E_DIM dim, uint32 width, uint32 height, uint32 depth, uint32 mipLevels, uint32 pitch, Latte::E_HWTILEMODE tileMode, uint32 swizzle, bool dumpTex);
36
36
37
- void LatteTexture_ReloadData (LatteTexture* tex, uint32 textureUnit )
37
+ void LatteTexture_ReloadData (LatteTexture* tex)
38
38
{
39
39
tex->reloadCount ++;
40
40
for (sint32 mip=0 ; mip<tex->mipLevels ; mip++)
@@ -44,35 +44,35 @@ void LatteTexture_ReloadData(LatteTexture* tex, uint32 textureUnit)
44
44
{
45
45
sint32 numSlices = std::max (tex->depth , 1 );
46
46
for (sint32 s=0 ; s<numSlices; s++)
47
- LatteTextureLoader_UpdateTextureSliceData (tex, textureUnit, s, mip, tex->physAddress , tex->physMipAddress , tex->dim , tex->width , tex->height , tex->depth , tex->mipLevels , tex->pitch , tex->tileMode , tex->swizzle , true );
47
+ LatteTextureLoader_UpdateTextureSliceData (tex, s, mip, tex->physAddress , tex->physMipAddress , tex->dim , tex->width , tex->height , tex->depth , tex->mipLevels , tex->pitch , tex->tileMode , tex->swizzle , true );
48
48
}
49
49
else if ( tex->dim == Latte::E_DIM::DIM_CUBEMAP )
50
50
{
51
51
cemu_assert_debug ((tex->depth % 6 ) == 0 );
52
52
sint32 numFullCubeMaps = tex->depth /6 ; // number of cubemaps (if numFullCubeMaps is >1 then this texture is a cubemap array)
53
53
for (sint32 s=0 ; s<numFullCubeMaps*6 ; s++)
54
- LatteTextureLoader_UpdateTextureSliceData (tex, textureUnit, s, mip, tex->physAddress , tex->physMipAddress , tex->dim , tex->width , tex->height , tex->depth , tex->mipLevels , tex->pitch , tex->tileMode , tex->swizzle , true );
54
+ LatteTextureLoader_UpdateTextureSliceData (tex, s, mip, tex->physAddress , tex->physMipAddress , tex->dim , tex->width , tex->height , tex->depth , tex->mipLevels , tex->pitch , tex->tileMode , tex->swizzle , true );
55
55
}
56
56
else if ( tex->dim == Latte::E_DIM::DIM_3D )
57
57
{
58
58
sint32 mipDepth = std::max (tex->depth >>mip, 1 );
59
59
for (sint32 s=0 ; s<mipDepth; s++)
60
60
{
61
- LatteTextureLoader_UpdateTextureSliceData (tex, textureUnit, s, mip, tex->physAddress , tex->physMipAddress , tex->dim , tex->width , tex->height , tex->depth , tex->mipLevels , tex->pitch , tex->tileMode , tex->swizzle , true );
61
+ LatteTextureLoader_UpdateTextureSliceData (tex, s, mip, tex->physAddress , tex->physMipAddress , tex->dim , tex->width , tex->height , tex->depth , tex->mipLevels , tex->pitch , tex->tileMode , tex->swizzle , true );
62
62
}
63
63
}
64
64
else
65
65
{
66
66
// load slice 0
67
- LatteTextureLoader_UpdateTextureSliceData (tex, textureUnit, 0 , mip, tex->physAddress , tex->physMipAddress , tex->dim , tex->width , tex->height , tex->depth , tex->mipLevels , tex->pitch , tex->tileMode , tex->swizzle , true );
67
+ LatteTextureLoader_UpdateTextureSliceData (tex, 0 , mip, tex->physAddress , tex->physMipAddress , tex->dim , tex->width , tex->height , tex->depth , tex->mipLevels , tex->pitch , tex->tileMode , tex->swizzle , true );
68
68
}
69
69
}
70
70
tex->lastUpdateEventCounter = LatteTexture_getNextUpdateEventCounter ();
71
71
}
72
72
73
- LatteTextureView* LatteTexture_CreateTexture (uint32 textureUnit, 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)
73
+ LatteTextureView* LatteTexture_CreateTexture (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)
74
74
{
75
- const auto tex = g_renderer->texture_createTextureEx (textureUnit, dim, physAddress, physMipAddress, format, width, height, depth, pitch, mipLevels, swizzle, tileMode, isDepth);
75
+ const auto tex = g_renderer->texture_createTextureEx (dim, physAddress, physMipAddress, format, width, height, depth, pitch, mipLevels, swizzle, tileMode, isDepth);
76
76
// init slice/mip info array
77
77
LatteTexture_InitSliceAndMipInfo (tex);
78
78
LatteTexture_RegisterTextureMemoryOccupancy (tex);
@@ -110,7 +110,7 @@ LatteTextureView* LatteTexture_CreateTexture(uint32 textureUnit, Latte::E_DIM di
110
110
}
111
111
}
112
112
}
113
- LatteTexture_ReloadData (tex, textureUnit );
113
+ LatteTexture_ReloadData (tex);
114
114
LatteTC_MarkTextureStillInUse (tex);
115
115
LatteTC_RegisterTexture (tex);
116
116
// create initial view that maps to the whole texture
@@ -247,7 +247,7 @@ void LatteTexture_updateTexturesForStage(LatteDecompilerShader* shaderContext, u
247
247
textureView->lastTextureBindIndex = LatteGPUState.textureBindCounter ;
248
248
rendererGL->renderstate_updateTextureSettingsGL (shaderContext, textureView, textureIndex + glBackendBaseTexUnit, word4, textureIndex, isDepthSampler);
249
249
}
250
- g_renderer->texture_bindOnly (textureView, textureIndex + glBackendBaseTexUnit);
250
+ g_renderer->texture_setLatteTexture (textureView, textureIndex + glBackendBaseTexUnit);
251
251
// update if data changed
252
252
bool swizzleChanged = false ;
253
253
if (textureView->baseTexture ->swizzle != swizzle)
@@ -285,9 +285,8 @@ void LatteTexture_updateTexturesForStage(LatteDecompilerShader* shaderContext, u
285
285
textureView->baseTexture ->physMipAddress = physMipAddr;
286
286
}
287
287
}
288
- g_renderer->texture_bindAndActivateRawTex (textureView->baseTexture , textureIndex + glBackendBaseTexUnit);
289
288
debug_printf (" Reload reason: Data-change when bound as texture (new hash 0x%08x)\n " , textureView->baseTexture ->texDataHash2 );
290
- LatteTexture_ReloadData (textureView->baseTexture , textureIndex + glBackendBaseTexUnit );
289
+ LatteTexture_ReloadData (textureView->baseTexture );
291
290
}
292
291
LatteTexture* baseTexture = textureView->baseTexture ;
293
292
if (baseTexture->reloadFromDynamicTextures )
0 commit comments