From 4c6fa4f0599a3dc199f087e76273be04f82253f4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 2 Oct 2014 15:25:01 +0200 Subject: [PATCH] (Cg/GLSL) Cleanups to filter_type implementation --- gfx/shader/shader_gl_cg.c | 8 ++++---- gfx/shader/shader_glsl.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gfx/shader/shader_gl_cg.c b/gfx/shader/shader_gl_cg.c index f8047fadc8..fba41ac68b 100644 --- a/gfx/shader/shader_gl_cg.c +++ b/gfx/shader/shader_gl_cg.c @@ -952,11 +952,11 @@ static unsigned gl_cg_num(void) static bool gl_cg_filter_type(unsigned index, bool *smooth) { - if (cg_active && index) + if (cg_active && index && + (cg_shader->pass[index - 1].filter != RARCH_FILTER_UNSPEC) + ) { - if (cg_shader->pass[index - 1].filter == RARCH_FILTER_UNSPEC) - return false; - *smooth = cg_shader->pass[index - 1].filter == RARCH_FILTER_LINEAR; + *smooth = (cg_shader->pass[index - 1].filter == RARCH_FILTER_LINEAR); return true; } diff --git a/gfx/shader/shader_glsl.c b/gfx/shader/shader_glsl.c index 63b71a0225..80a2ec4e6b 100644 --- a/gfx/shader/shader_glsl.c +++ b/gfx/shader/shader_glsl.c @@ -1190,11 +1190,11 @@ static unsigned gl_glsl_num(void) static bool gl_glsl_filter_type(unsigned index, bool *smooth) { - if (glsl_enable && index) + if (glsl_enable && index + && (glsl_shader->pass[index - 1].filter != RARCH_FILTER_UNSPEC) + ) { - if (glsl_shader->pass[index - 1].filter == RARCH_FILTER_UNSPEC) - return false; - *smooth = glsl_shader->pass[index - 1].filter == RARCH_FILTER_LINEAR; + *smooth = (glsl_shader->pass[index - 1].filter == RARCH_FILTER_LINEAR); return true; } return false;