fixed setting of texture parameters like lod bias and max and min lod.
as a nice result of this eliminate the nasty glubuild2dmipmaps. thanks to neobrain and orphis for discovering the error and the right values git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5475 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
2e12bd5e34
commit
99d0bd7762
|
@ -1418,8 +1418,9 @@ 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]);
|
||||
//just a test but it seems to work
|
||||
D3D::SetSamplerState(stage,D3DSAMP_MIPMAPLODBIAS,tm0.lod_bias/2.0f);
|
||||
D3D::SetSamplerState(stage,D3DSAMP_MAXMIPLEVEL,tm1.min_lod>>4);
|
||||
float lodbias = tm0.lod_bias / 32.0f;
|
||||
D3D::SetSamplerState(stage,D3DSAMP_MIPMAPLODBIAS,*(DWORD*)&lodbias);
|
||||
D3D::SetSamplerState(stage,D3DSAMP_MAXMIPLEVEL,tm1.min_lod>>5);
|
||||
}
|
||||
|
||||
void Renderer::SetInterlacingMode()
|
||||
|
|
|
@ -133,9 +133,9 @@ void TextureMngr::TCacheEntry::SetTextureParameters(TexMode0 &newmode,TexMode1 &
|
|||
mode.min_filter += 4; // take equivalent forced linear
|
||||
int filt = newmode.min_filter;
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, c_MinLinearFilter[filt & (((newmode1.max_lod >> 4) > 0)?7:4)]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, newmode1.min_lod >> 4);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, newmode1.max_lod >> 4);
|
||||
//glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, (newmode.lod_bias/2.0f));
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, newmode1.min_lod >> 5);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, newmode1.max_lod >> 5);
|
||||
glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, (newmode.lod_bias/32.0f));
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -460,7 +460,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
|
|||
{
|
||||
if(UseNativeMips)
|
||||
{
|
||||
gluBuild2DMipmaps(target, gl_iformat, width, height, gl_format, gl_type, temp);
|
||||
glTexImage2D(target, 0, gl_iformat, width, height, 0, gl_format, gl_type, temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -509,9 +509,14 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
|
|||
{
|
||||
if (expandedWidth != (int)currentWidth)
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, expandedWidth);
|
||||
|
||||
glTexSubImage2D(target, level,0,0,currentWidth, currentHeight, gl_format, gl_type, temp);
|
||||
|
||||
if(skip_texture_create)
|
||||
{
|
||||
glTexSubImage2D(target, level,0,0,currentWidth, currentWidth, gl_format, gl_type, temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexImage2D(target, level, gl_iformat, currentWidth, currentHeight, 0, gl_format, gl_type, temp);
|
||||
}
|
||||
if (expandedWidth != (int)currentWidth)
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue