move filtering check to gfx_pc.c for those sweet realtime updates

This commit is contained in:
fgsfds 2020-05-16 16:13:54 +03:00
parent a259cd15a1
commit 9ae444d2b5
2 changed files with 4 additions and 3 deletions

View File

@ -26,7 +26,6 @@
#include "gfx_cc.h"
#include "gfx_rendering_api.h"
#include "../configfile.h"
struct ShaderProgram {
uint32_t shader_id;
@ -409,7 +408,7 @@ static uint32_t gfx_cm_to_opengl(uint32_t val) {
}
static void gfx_opengl_set_sampler_parameters(int tile, bool linear_filter, uint32_t cms, uint32_t cmt) {
const GLenum filter = (linear_filter && (configFiltering == 1)) ? GL_LINEAR : GL_NEAREST;
const GLenum filter = linear_filter ? GL_LINEAR : GL_NEAREST;
glActiveTexture(GL_TEXTURE0 + tile);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);

View File

@ -18,6 +18,8 @@
#include "gfx_rendering_api.h"
#include "gfx_screen_config.h"
#include "../configfile.h"
#define SUPPORT_CHECK(x) assert(x)
// SCALE_M_N: upscale/downscale M-bit integer to N-bit
@ -763,7 +765,7 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx) {
import_texture(i);
rdp.textures_changed[i] = false;
}
bool linear_filter = (rdp.other_mode_h & (3U << G_MDSFT_TEXTFILT)) != G_TF_POINT;
bool linear_filter = configFiltering && ((rdp.other_mode_h & (3U << G_MDSFT_TEXTFILT)) != G_TF_POINT);
if (linear_filter != rendering_state.textures[i]->linear_filter || rdp.texture_tile.cms != rendering_state.textures[i]->cms || rdp.texture_tile.cmt != rendering_state.textures[i]->cmt) {
gfx_flush();
gfx_rapi->set_sampler_parameters(i, linear_filter, rdp.texture_tile.cms, rdp.texture_tile.cmt);