[bugfix] Properly decode lod_bias.
This commit is contained in:
parent
6c8a22de24
commit
9d5fc3d7f0
|
@ -1427,7 +1427,7 @@ void Renderer::SetSamplerState(int stage, int texindex)
|
|||
// When mipfilter is set to "none", just disable mipmapping altogether
|
||||
gx_state.sampdc[stage].MaxLOD = (mip == TEXF_NONE) ? 0.0f : (float)tm1.max_lod/16.f;
|
||||
gx_state.sampdc[stage].MinLOD = (float)tm1.min_lod/16.f;
|
||||
gx_state.sampdc[stage].MipLODBias = (float)tm0.lod_bias/32.0f;
|
||||
gx_state.sampdc[stage].MipLODBias = (s32)tm0.lod_bias/32.0f;
|
||||
}
|
||||
|
||||
void Renderer::SetInterlacingMode()
|
||||
|
|
|
@ -1334,7 +1334,7 @@ void Renderer::SetSamplerState(int stage, int texindex)
|
|||
D3D::SetSamplerState(stage, D3DSAMP_ADDRESSU, d3dClamps[tm0.wrap_s]);
|
||||
D3D::SetSamplerState(stage, D3DSAMP_ADDRESSV, d3dClamps[tm0.wrap_t]);
|
||||
|
||||
float lodbias = (tm0.lod_bias / 32.0f);
|
||||
float lodbias = (s32)tm0.lod_bias / 32.0f;
|
||||
D3D::SetSamplerState(stage, D3DSAMP_MIPMAPLODBIAS, *(DWORD*)&lodbias);
|
||||
D3D::SetSamplerState(stage, D3DSAMP_MAXMIPLEVEL, tm1.max_lod >> 4);
|
||||
}
|
||||
|
|
|
@ -358,7 +358,7 @@ void TextureCache::TCacheEntry::SetTextureParameters(const TexMode0 &newmode, co
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, c_MinLinearFilter[filt & 7]);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, newmode1.min_lod / 16.f);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, newmode1.max_lod / 16.f);
|
||||
glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, newmode.lod_bias / 32.0f);
|
||||
glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, (s32)newmode.lod_bias / 32.0f);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, c_WrapSettings[newmode.wrap_s]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, c_WrapSettings[newmode.wrap_t]);
|
||||
|
|
Loading…
Reference in New Issue