mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-02 09:03:37 +00:00
Correct TextureCache::activateTexture
This commit is contained in:
parent
f4fce5608f
commit
7b507e74d4
|
@ -1616,37 +1616,40 @@ 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);
|
||||||
|
|
||||||
const bool bUseBilinear = gDP.otherMode.textureFilter != G_TF_POINT && config.texture.bilinearMode != BILINEAR_3POINT;
|
if (config.generalEmulation.enableInaccurateTextureCoordinates != 0) {
|
||||||
const bool bUseLOD = currentCombiner()->usesLOD();
|
|
||||||
const s32 texLevel = bUseLOD ? _pTexture->max_level : 0;
|
|
||||||
params.maxMipmapLevel = Parameter(texLevel);
|
|
||||||
|
|
||||||
if (bUseLOD) {
|
const bool bUseBilinear = gDP.otherMode.textureFilter != G_TF_POINT && config.texture.bilinearMode != BILINEAR_3POINT;
|
||||||
if (bUseBilinear) {
|
const bool bUseLOD = currentCombiner()->usesLOD();
|
||||||
// Apply standard bilinear to mipmap textures
|
const s32 texLevel = bUseLOD ? _pTexture->max_level : 0;
|
||||||
if (texLevel > 0)
|
params.maxMipmapLevel = Parameter(texLevel);
|
||||||
params.minFilter = textureParameters::FILTER_LINEAR_MIPMAP_NEAREST;
|
|
||||||
else
|
if (bUseLOD) {
|
||||||
params.minFilter = textureParameters::FILTER_LINEAR;
|
if (bUseBilinear) {
|
||||||
params.magFilter = textureParameters::FILTER_LINEAR;
|
// Apply standard bilinear to mipmap textures
|
||||||
} else {
|
if (texLevel > 0)
|
||||||
if (texLevel > 0)
|
params.minFilter = textureParameters::FILTER_LINEAR_MIPMAP_NEAREST;
|
||||||
params.minFilter = textureParameters::FILTER_NEAREST_MIPMAP_NEAREST;
|
else
|
||||||
else
|
params.minFilter = textureParameters::FILTER_LINEAR;
|
||||||
params.minFilter = textureParameters::FILTER_NEAREST;
|
params.magFilter = textureParameters::FILTER_LINEAR;
|
||||||
params.magFilter = textureParameters::FILTER_NEAREST;
|
} else {
|
||||||
|
if (texLevel > 0)
|
||||||
|
params.minFilter = textureParameters::FILTER_NEAREST_MIPMAP_NEAREST;
|
||||||
|
else
|
||||||
|
params.minFilter = 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
|
||||||
params.wrapS = _pTexture->clampS ? textureParameters::WRAP_CLAMP_TO_EDGE :
|
params.wrapS = _pTexture->clampS ? textureParameters::WRAP_CLAMP_TO_EDGE :
|
||||||
_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()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user