mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 12:11:25 +00:00
- fixed binding issues in OpenGL when resetting the samplers due to a texture filter change.
This commit is contained in:
parent
6dd6df96e1
commit
2be5dc9238
1 changed files with 14 additions and 1 deletions
|
@ -109,7 +109,16 @@ uint8_t FSamplerManager::Bind(int texunit, int num, int lastval)
|
||||||
|
|
||||||
void FSamplerManager::SetTextureFilterMode()
|
void FSamplerManager::SetTextureFilterMode()
|
||||||
{
|
{
|
||||||
UnbindAll();
|
GLint bounds[IHardwareTexture::MAX_TEXTURES];
|
||||||
|
|
||||||
|
// Unbind all
|
||||||
|
for(int i = IHardwareTexture::MAX_TEXTURES-1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
glActiveTexture(GL_TEXTURE0 + i);
|
||||||
|
glGetIntegerv(GL_SAMPLER_BINDING, &bounds[i]);
|
||||||
|
glBindSampler(i, 0);
|
||||||
|
}
|
||||||
|
|
||||||
int filter = sysCallbacks && sysCallbacks->DisableTextureFilter && sysCallbacks->DisableTextureFilter() ? 0 : gl_texture_filter;
|
int filter = sysCallbacks && sysCallbacks->DisableTextureFilter && sysCallbacks->DisableTextureFilter() ? 0 : gl_texture_filter;
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
|
@ -122,6 +131,10 @@ void FSamplerManager::SetTextureFilterMode()
|
||||||
glSamplerParameteri(mSamplers[CLAMP_XY_NOMIP], GL_TEXTURE_MAG_FILTER, TexFilter[filter].magfilter);
|
glSamplerParameteri(mSamplers[CLAMP_XY_NOMIP], GL_TEXTURE_MAG_FILTER, TexFilter[filter].magfilter);
|
||||||
glSamplerParameteri(mSamplers[CLAMP_CAMTEX], GL_TEXTURE_MIN_FILTER, TexFilter[filter].magfilter);
|
glSamplerParameteri(mSamplers[CLAMP_CAMTEX], GL_TEXTURE_MIN_FILTER, TexFilter[filter].magfilter);
|
||||||
glSamplerParameteri(mSamplers[CLAMP_CAMTEX], GL_TEXTURE_MAG_FILTER, TexFilter[filter].magfilter);
|
glSamplerParameteri(mSamplers[CLAMP_CAMTEX], GL_TEXTURE_MAG_FILTER, TexFilter[filter].magfilter);
|
||||||
|
for(int i = 0; i < IHardwareTexture::MAX_TEXTURES; i++)
|
||||||
|
{
|
||||||
|
glBindSampler(i, bounds[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue