mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-30 16:14:11 +00:00
Update filters on shader reload.
This commit is contained in:
parent
82a3e373c0
commit
20af7b858a
26
gfx/gl.c
26
gfx/gl.c
@ -561,10 +561,36 @@ void gl_deinit_fbo(void *data)
|
||||
}
|
||||
}
|
||||
|
||||
static void gl_update_tex_filter_frame(gl_t *gl)
|
||||
{
|
||||
bool smooth = false;
|
||||
if (!gl_shader_filter_type(gl, 1, &smooth))
|
||||
return;
|
||||
|
||||
GLuint new_filt = smooth ? GL_LINEAR : GL_NEAREST;
|
||||
if (new_filt == gl->tex_filter)
|
||||
return;
|
||||
|
||||
gl->tex_filter = new_filt;
|
||||
for (unsigned i = 0; i < TEXTURES; i++)
|
||||
{
|
||||
if (gl->texture[i])
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[i]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl->tex_filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl->tex_filter);
|
||||
}
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||
}
|
||||
|
||||
void gl_init_fbo(void *data, unsigned width, unsigned height)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
|
||||
gl_update_tex_filter_frame(gl);
|
||||
|
||||
// No need to use FBOs.
|
||||
#ifndef RARCH_CONSOLE
|
||||
/* we always want FBO to be at least initialized on startup for consoles */
|
||||
|
Loading…
x
Reference in New Issue
Block a user