@@ -854,9 +854,16 @@ void RenderDeviceGLImpl::InitAdapterInfo()
854854 TexProps.TextureView2DOn3DSupported = TexProps.TextureViewSupported ;
855855 ASSERT_SIZEOF (TexProps, 32 , " Did you add a new member to TextureProperites? Please initialize it here." );
856856
857- SamProps.BorderSamplingModeSupported = True;
858- SamProps.AnisotropicFilteringSupported = IsGL46OrAbove || CheckExtension (" GL_ARB_texture_filter_anisotropic" );
859- SamProps.LODBiasSupported = True;
857+ SamProps.BorderSamplingModeSupported = True;
858+ if (IsGL46OrAbove || CheckExtension (" GL_ARB_texture_filter_anisotropic" ))
859+ {
860+ GLint MaxAnisotropy = 0 ;
861+ glGetIntegerv (GL_MAX_TEXTURE_MAX_ANISOTROPY, &MaxAnisotropy);
862+ CHECK_GL_ERROR (" glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY)" );
863+ SamProps.MaxAnisotropy = static_cast <Uint8>(MaxAnisotropy);
864+ }
865+
866+ SamProps.LODBiasSupported = True;
860867 ASSERT_SIZEOF (SamProps, 3 , " Did you add a new member to SamplerProperites? Please initialize it here." );
861868
862869 m_GLCaps.FramebufferSRGB = IsGL40OrAbove || CheckExtension (" GL_ARB_framebuffer_sRGB" );
@@ -925,9 +932,15 @@ void RenderDeviceGLImpl::InitAdapterInfo()
925932 TexProps.TextureView2DOn3DSupported = TexProps.TextureViewSupported ;
926933 ASSERT_SIZEOF (TexProps, 32 , " Did you add a new member to TextureProperites? Please initialize it here." );
927934
928- SamProps.BorderSamplingModeSupported = GL_TEXTURE_BORDER_COLOR && (IsGLES32OrAbove || strstr (Extensions, " texture_border_clamp" ));
929- SamProps.AnisotropicFilteringSupported = GL_TEXTURE_MAX_ANISOTROPY_EXT && strstr (Extensions, " texture_filter_anisotropic" );
930- SamProps.LODBiasSupported = GL_TEXTURE_LOD_BIAS && IsGLES31OrAbove;
935+ SamProps.BorderSamplingModeSupported = GL_TEXTURE_BORDER_COLOR && (IsGLES32OrAbove || strstr (Extensions, " texture_border_clamp" ));
936+ if (strstr (Extensions, " texture_filter_anisotropic" ))
937+ {
938+ GLint MaxAnisotropy = 0 ;
939+ glGetIntegerv (GL_MAX_TEXTURE_MAX_ANISOTROPY, &MaxAnisotropy);
940+ CHECK_GL_ERROR (" glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY)" );
941+ SamProps.MaxAnisotropy = static_cast <Uint8>(MaxAnisotropy);
942+ }
943+ SamProps.LODBiasSupported = GL_TEXTURE_LOD_BIAS && IsGLES31OrAbove;
931944 ASSERT_SIZEOF (SamProps, 3 , " Did you add a new member to SamplerProperites? Please initialize it here." );
932945
933946 m_GLCaps.FramebufferSRGB = strstr (Extensions, " sRGB_write_control" );
0 commit comments