1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Correct TextureCache::activateTexture

This commit is contained in:
Sergey Lipskiy 2021-12-06 23:03:43 +07:00
parent f4fce5608f
commit 7b507e74d4

View File

@ -1616,6 +1616,11 @@ void TextureCache::activateTexture(u32 _t, CachedTexture *_pTexture)
} else { } else {
params.target = textureTarget::TEXTURE_2D; params.target = textureTarget::TEXTURE_2D;
params.textureUnitIndex = textureIndices::Tex[_t]; params.textureUnitIndex = textureIndices::Tex[_t];
params.minFilter = textureParameters::FILTER_NEAREST;
params.magFilter = textureParameters::FILTER_NEAREST;
params.maxMipmapLevel = Parameter(0);
if (config.generalEmulation.enableInaccurateTextureCoordinates != 0) {
const bool bUseBilinear = gDP.otherMode.textureFilter != G_TF_POINT && config.texture.bilinearMode != BILINEAR_3POINT; const bool bUseBilinear = gDP.otherMode.textureFilter != G_TF_POINT && config.texture.bilinearMode != BILINEAR_3POINT;
const bool bUseLOD = currentCombiner()->usesLOD(); const bool bUseLOD = currentCombiner()->usesLOD();
@ -1637,9 +1642,6 @@ void TextureCache::activateTexture(u32 _t, CachedTexture *_pTexture)
params.minFilter = textureParameters::FILTER_NEAREST; params.minFilter = textureParameters::FILTER_NEAREST;
params.magFilter = textureParameters::FILTER_NEAREST; params.magFilter = textureParameters::FILTER_NEAREST;
} }
} else { // Don't use texture filter. Texture will be filtered by filter shader
params.minFilter = textureParameters::FILTER_NEAREST;
params.magFilter = textureParameters::FILTER_NEAREST;
} }
// Set clamping modes // Set clamping modes
@ -1647,6 +1649,7 @@ void TextureCache::activateTexture(u32 _t, CachedTexture *_pTexture)
_pTexture->mirrorS ? textureParameters::WRAP_MIRRORED_REPEAT : textureParameters::WRAP_REPEAT; _pTexture->mirrorS ? textureParameters::WRAP_MIRRORED_REPEAT : textureParameters::WRAP_REPEAT;
params.wrapT = _pTexture->clampT ? textureParameters::WRAP_CLAMP_TO_EDGE : params.wrapT = _pTexture->clampT ? textureParameters::WRAP_CLAMP_TO_EDGE :
_pTexture->mirrorT ? textureParameters::WRAP_MIRRORED_REPEAT : textureParameters::WRAP_REPEAT; _pTexture->mirrorT ? textureParameters::WRAP_MIRRORED_REPEAT : textureParameters::WRAP_REPEAT;
}
if (config.texture.anisotropy != 0) { if (config.texture.anisotropy != 0) {
switch (dwnd().getDrawer().getDrawingState()) { switch (dwnd().getDrawer().getDrawingState()) {