Skip to content

Commit

Permalink
Merge pull request #3271 from Sonicadvance1/es_sampler_cache
Browse files Browse the repository at this point in the history
Enable Anisotropic filtering in ES.
  • Loading branch information
degasus committed Nov 19, 2015
2 parents 1f4b16d + ed5e3c0 commit 41f9d4f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions Source/Core/VideoBackends/OGL/Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ Renderer::Renderer()
g_ogl_config.bSupports2DTextureStorage = GLExtensions::Supports("GL_ARB_texture_storage_multisample");
g_ogl_config.bSupportsEarlyFragmentTests = GLExtensions::Supports("GL_ARB_shader_image_load_store");
g_ogl_config.bSupportsConservativeDepth = GLExtensions::Supports("GL_ARB_conservative_depth");
g_ogl_config.bSupportsAniso = GLExtensions::Supports("GL_EXT_texture_filter_anisotropic");

if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3)
{
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoBackends/OGL/Render.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct VideoConfig
bool bSupports3DTextureStorage;
bool bSupportsEarlyFragmentTests;
bool bSupportsConservativeDepth;
bool bSupportsAniso;

const char* gl_vendor;
const char* gl_renderer;
Expand Down
6 changes: 2 additions & 4 deletions Source/Core/VideoBackends/OGL/SamplerCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,10 @@ void SamplerCache::SetParameters(GLuint sampler_id, const Params& params)
glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_LOD, tm1.max_lod / 16.f);

if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
{
glSamplerParameterf(sampler_id, GL_TEXTURE_LOD_BIAS, (s32)tm0.lod_bias / 32.f);

if (g_ActiveConfig.iMaxAnisotropy > 0)
glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)(1 << g_ActiveConfig.iMaxAnisotropy));
}
if (g_ActiveConfig.iMaxAnisotropy > 0 && g_ogl_config.bSupportsAniso)
glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)(1 << g_ActiveConfig.iMaxAnisotropy));
}

void SamplerCache::Clear()
Expand Down

0 comments on commit 41f9d4f

Please sign in to comment.