mesa: Implement GL_ARB_texture_filter_anisotropic
authorAdam Jackson <ajax@redhat.com>
Thu, 24 Aug 2017 18:40:32 +0000 (14:40 -0400)
committerAdam Jackson <ajax@redhat.com>
Fri, 25 Aug 2017 16:38:01 +0000 (12:38 -0400)
The only difference from the EXT version is bumping the minmax to 16, so
just hit all the drivers at once.

v2: Fix driver names, add to 17.3 release notes (Ilia Mirkin)

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 files changed:
docs/features.txt
docs/relnotes/17.3.0.html
src/glx/glxextensions.c
src/glx/glxextensions.h
src/mesa/drivers/dri/i965/intel_extensions.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/main/extensions.c
src/mesa/main/extensions_table.h
src/mesa/main/mtypes.h
src/mesa/main/version.c
src/mesa/state_tracker/st_extensions.c

index 6f57ec26fd18c0407ff5130f29d45f398076d03c..3f91c2daaea508358e57ecbc66b49db0970dbaa3 100644 (file)
@@ -231,10 +231,12 @@ GL 4.6, GLSL 4.60
   GL_ARB_shader_draw_parameters                         DONE (i965, nvc0, radeonsi)
   GL_ARB_shader_group_vote                              DONE (i965, nvc0, radeonsi)
   GL_ARB_spirv_extensions                               in progress (Nicolai Hähnle, Ian Romanick)
   GL_ARB_shader_draw_parameters                         DONE (i965, nvc0, radeonsi)
   GL_ARB_shader_group_vote                              DONE (i965, nvc0, radeonsi)
   GL_ARB_spirv_extensions                               in progress (Nicolai Hähnle, Ian Romanick)
-  GL_ARB_texture_filter_anisotropic                     not started
+  GL_ARB_texture_filter_anisotropic                     DONE (i965, nv50, nvc0, r600, radeonsi, softpipe (*), llvmpipe (*))
   GL_ARB_transform_feedback_overflow_query              DONE (i965/gen6+, radeonsi, llvmpipe, softpipe)
   GL_KHR_no_error                                       started (Timothy Arceri)
 
   GL_ARB_transform_feedback_overflow_query              DONE (i965/gen6+, radeonsi, llvmpipe, softpipe)
   GL_KHR_no_error                                       started (Timothy Arceri)
 
+(*) softpipe and llvmpipe advertise 16x anisotropy but simply ignore the setting
+
 These are the extensions cherry-picked to make GLES 3.1
 GLES3.1, GLSL ES 3.1 -- all DONE: i965/hsw+, nvc0, radeonsi
 
 These are the extensions cherry-picked to make GLES 3.1
 GLES3.1, GLSL ES 3.1 -- all DONE: i965/hsw+, nvc0, radeonsi
 
index 25d02cdca7160185d2a37c484c9a6a95e7752b91..8da43f22f02fa30f0cd3daf78b4b672af4119594 100644 (file)
@@ -45,6 +45,7 @@ Note: some of the new features are only available with certain drivers.
 
 <ul>
 <li>GL_ARB_transform_feedback_overflow_query on radeonsi</li>
 
 <ul>
 <li>GL_ARB_transform_feedback_overflow_query on radeonsi</li>
+<li>GL_ARB_texture_filter_anisotropic on i965, nv50, nvc0, r600, radeonsi</li>
 <li>GL_EXT_memory_object on radeonsi</li>
 <li>GL_EXT_memory_object_fd on radeonsi</li>
 </ul>
 <li>GL_EXT_memory_object on radeonsi</li>
 <li>GL_EXT_memory_object_fd on radeonsi</li>
 </ul>
index 22b078ce4841bae6a737d5e8060bb3a0d70a1186..88bf0de3e6170dda5b75d6f5660e35230361b3e0 100644 (file)
@@ -190,6 +190,7 @@ static const struct extension_info known_gl_extensions[] = {
    { GL(ARB_texture_env_combine),        VER(1,3), Y, N, N, N },
    { GL(ARB_texture_env_crossbar),       VER(1,4), Y, N, N, N },
    { GL(ARB_texture_env_dot3),           VER(1,3), Y, N, N, N },
    { GL(ARB_texture_env_combine),        VER(1,3), Y, N, N, N },
    { GL(ARB_texture_env_crossbar),       VER(1,4), Y, N, N, N },
    { GL(ARB_texture_env_dot3),           VER(1,3), Y, N, N, N },
+   { GL(ARB_texture_filter_anisotropic), VER(0,0), Y, N, N, N },
    { GL(ARB_texture_mirrored_repeat),    VER(1,4), Y, N, N, N },
    { GL(ARB_texture_non_power_of_two),   VER(1,5), Y, N, N, N },
    { GL(ARB_texture_rectangle),          VER(0,0), Y, N, N, N },
    { GL(ARB_texture_mirrored_repeat),    VER(1,4), Y, N, N, N },
    { GL(ARB_texture_non_power_of_two),   VER(1,5), Y, N, N, N },
    { GL(ARB_texture_rectangle),          VER(0,0), Y, N, N, N },
index 21ad02a44b44cda00be5cef3e7773a7757fc65f5..ff35dedd0b21c01686c78869c1e1a310b2aff636 100644 (file)
@@ -101,6 +101,7 @@ enum
    GL_ARB_texture_env_combine_bit,
    GL_ARB_texture_env_crossbar_bit,
    GL_ARB_texture_env_dot3_bit,
    GL_ARB_texture_env_combine_bit,
    GL_ARB_texture_env_crossbar_bit,
    GL_ARB_texture_env_dot3_bit,
+   GL_ARB_texture_filter_anisotropic_bit,
    GL_ARB_texture_mirrored_repeat_bit,
    GL_ARB_texture_non_power_of_two_bit,
    GL_ARB_texture_rectangle_bit,
    GL_ARB_texture_mirrored_repeat_bit,
    GL_ARB_texture_non_power_of_two_bit,
    GL_ARB_texture_rectangle_bit,
@@ -150,7 +151,6 @@ enum
    GL_EXT_texture_edge_clamp_bit,
    GL_EXT_texture_env_combine_bit,
    GL_EXT_texture_env_dot3_bit,
    GL_EXT_texture_edge_clamp_bit,
    GL_EXT_texture_env_combine_bit,
    GL_EXT_texture_env_dot3_bit,
-   GL_EXT_texture_filter_anisotropic_bit,
    GL_EXT_texture_integer_bit,
    GL_EXT_texture_lod_bit,
    GL_EXT_texture_lod_bias_bit,
    GL_EXT_texture_integer_bit,
    GL_EXT_texture_lod_bit,
    GL_EXT_texture_lod_bias_bit,
@@ -223,11 +223,10 @@ enum
 
    /* Alias extension bits.  These extensions exist in either vendor-specific
     * or EXT form and were later promoted to either EXT or ARB form.  In all
 
    /* Alias extension bits.  These extensions exist in either vendor-specific
     * or EXT form and were later promoted to either EXT or ARB form.  In all
-    * cases, the meaning is *exactly* the same.  That's why
+    * cases, the meaning (to GLX) is *exactly* the same.  That's why
     * EXT_texture_env_combine is *NOT* an alias of ARB_texture_env_combine and
     * EXT_texture_env_dot3 is *NOT* an alias of ARB_texture_env_dot3.  Be
     * EXT_texture_env_combine is *NOT* an alias of ARB_texture_env_combine and
     * EXT_texture_env_dot3 is *NOT* an alias of ARB_texture_env_dot3.  Be
-    * careful!  When in doubt, src/mesa/main/extensions.c in the Mesa tree
-    * is a great reference.
+    * careful!  When in doubt, src/mesa/main/extensions.c is a great reference.
     */
 
    GL_ATI_blend_equation_separate_bit = GL_EXT_blend_equation_separate_bit,
     */
 
    GL_ATI_blend_equation_separate_bit = GL_EXT_blend_equation_separate_bit,
@@ -235,6 +234,7 @@ enum
    GL_ATIX_texture_env_combine3_bit = GL_ATI_texture_env_combine3_bit,
    GL_EXT_point_parameters_bit = GL_ARB_point_parameters_bit,
    GL_EXT_texture_env_add_bit = GL_ARB_texture_env_add_bit,
    GL_ATIX_texture_env_combine3_bit = GL_ATI_texture_env_combine3_bit,
    GL_EXT_point_parameters_bit = GL_ARB_point_parameters_bit,
    GL_EXT_texture_env_add_bit = GL_ARB_texture_env_add_bit,
+   GL_EXT_texture_filter_anisotropic_bit = GL_ARB_texture_filter_anisotropic_bit,
    GL_EXT_texture_rectangle_bit = GL_ARB_texture_rectangle_bit,
    GL_IBM_texture_mirrored_repeat_bit = GL_ARB_texture_mirrored_repeat_bit,
    GL_INGR_blend_func_separate_bit = GL_EXT_blend_func_separate_bit,
    GL_EXT_texture_rectangle_bit = GL_ARB_texture_rectangle_bit,
    GL_IBM_texture_mirrored_repeat_bit = GL_ARB_texture_mirrored_repeat_bit,
    GL_INGR_blend_func_separate_bit = GL_EXT_blend_func_separate_bit,
index b91bbdc8d9540486f79d7fbbdc23379ca419cc6a..c3cd8004a1243ec529e597d47cca656ab66c7452 100644 (file)
@@ -80,6 +80,7 @@ intelInitExtensions(struct gl_context *ctx)
    ctx->Extensions.ARB_texture_env_combine = true;
    ctx->Extensions.ARB_texture_env_crossbar = true;
    ctx->Extensions.ARB_texture_env_dot3 = true;
    ctx->Extensions.ARB_texture_env_combine = true;
    ctx->Extensions.ARB_texture_env_crossbar = true;
    ctx->Extensions.ARB_texture_env_dot3 = true;
+   ctx->Extensions.ARB_texture_filter_anisotropic = true;
    ctx->Extensions.ARB_texture_float = true;
    ctx->Extensions.ARB_texture_mirror_clamp_to_edge = true;
    ctx->Extensions.ARB_texture_non_power_of_two = true;
    ctx->Extensions.ARB_texture_float = true;
    ctx->Extensions.ARB_texture_mirror_clamp_to_edge = true;
    ctx->Extensions.ARB_texture_non_power_of_two = true;
index ca1023c5c38f5f32b22503cca84f055ff812e8d1..0a27985de72541cd5071786a3c4e2b04d9acc6a7 100644 (file)
@@ -339,6 +339,7 @@ GLboolean r200CreateContext( gl_api api,
    ctx->Extensions.ARB_texture_env_combine = true;
    ctx->Extensions.ARB_texture_env_dot3 = true;
    ctx->Extensions.ARB_texture_env_crossbar = true;
    ctx->Extensions.ARB_texture_env_combine = true;
    ctx->Extensions.ARB_texture_env_dot3 = true;
    ctx->Extensions.ARB_texture_env_crossbar = true;
+   ctx->Extensions.ARB_texture_filter_anisotropic = true;
    ctx->Extensions.ARB_texture_mirror_clamp_to_edge = true;
    ctx->Extensions.ARB_vertex_program = true;
    ctx->Extensions.ATI_fragment_shader = (ctx->Const.MaxTextureUnits == 6);
    ctx->Extensions.ARB_texture_mirror_clamp_to_edge = true;
    ctx->Extensions.ARB_vertex_program = true;
    ctx->Extensions.ATI_fragment_shader = (ctx->Const.MaxTextureUnits == 6);
index 0c016b4da44a38de45320d1de037080e62537bc6..28a79860d721aaf7ddcb6b18f965a3acb1aa71ff 100644 (file)
@@ -300,6 +300,7 @@ r100CreateContext( gl_api api,
    ctx->Extensions.ARB_texture_env_combine = true;
    ctx->Extensions.ARB_texture_env_crossbar = true;
    ctx->Extensions.ARB_texture_env_dot3 = true;
    ctx->Extensions.ARB_texture_env_combine = true;
    ctx->Extensions.ARB_texture_env_crossbar = true;
    ctx->Extensions.ARB_texture_env_dot3 = true;
+   ctx->Extensions.ARB_texture_filter_anisotropic = true;
    ctx->Extensions.ARB_texture_mirror_clamp_to_edge = true;
    ctx->Extensions.ATI_texture_env_combine3 = true;
    ctx->Extensions.ATI_texture_mirror_once = true;
    ctx->Extensions.ARB_texture_mirror_clamp_to_edge = true;
    ctx->Extensions.ATI_texture_env_combine3 = true;
    ctx->Extensions.ATI_texture_mirror_once = true;
index 62a731675d75415e111a95ad03834dd5f0684a1a..5a5fdd247f3e6e1a3e2410993e2c2a829ac0fc0a 100644 (file)
@@ -130,6 +130,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
    ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
    ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
    ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
    ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
    ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
    ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
+   ctx->Extensions.ARB_texture_filter_anisotropic = GL_TRUE;
 #ifdef TEXTURE_FLOAT_ENABLED
    ctx->Extensions.ARB_texture_float = GL_TRUE;
 #endif
 #ifdef TEXTURE_FLOAT_ENABLED
    ctx->Extensions.ARB_texture_float = GL_TRUE;
 #endif
index 347a6197ed8a76e370a2455a8b7a92e1e6149a43..d096260891c40c935af4c696d5e0b9b5cfd14f75 100644 (file)
@@ -144,6 +144,7 @@ EXT(ARB_texture_env_add                     , dummy_true
 EXT(ARB_texture_env_combine                 , ARB_texture_env_combine                , GLL,  x ,  x ,  x , 2001)
 EXT(ARB_texture_env_crossbar                , ARB_texture_env_crossbar               , GLL,  x ,  x ,  x , 2001)
 EXT(ARB_texture_env_dot3                    , ARB_texture_env_dot3                   , GLL,  x ,  x ,  x , 2001)
 EXT(ARB_texture_env_combine                 , ARB_texture_env_combine                , GLL,  x ,  x ,  x , 2001)
 EXT(ARB_texture_env_crossbar                , ARB_texture_env_crossbar               , GLL,  x ,  x ,  x , 2001)
 EXT(ARB_texture_env_dot3                    , ARB_texture_env_dot3                   , GLL,  x ,  x ,  x , 2001)
+EXT(ARB_texture_filter_anisotropic          , ARB_texture_filter_anisotropic         , GLL, GLC,  x ,  x , 2017)
 EXT(ARB_texture_float                       , ARB_texture_float                      , GLL, GLC,  x ,  x , 2004)
 EXT(ARB_texture_gather                      , ARB_texture_gather                     , GLL, GLC,  x ,  x , 2009)
 EXT(ARB_texture_mirror_clamp_to_edge        , ARB_texture_mirror_clamp_to_edge       , GLL, GLC,  x ,  x , 2013)
 EXT(ARB_texture_float                       , ARB_texture_float                      , GLL, GLC,  x ,  x , 2004)
 EXT(ARB_texture_gather                      , ARB_texture_gather                     , GLL, GLC,  x ,  x , 2009)
 EXT(ARB_texture_mirror_clamp_to_edge        , ARB_texture_mirror_clamp_to_edge       , GLL, GLC,  x ,  x , 2013)
index 592cb48ca3c075a1690a1ac640f422b37083063c..99b6dfa611302bd8fc96af96813944f84cd880c4 100644 (file)
@@ -4093,6 +4093,7 @@ struct gl_extensions
    GLboolean ARB_texture_env_combine;
    GLboolean ARB_texture_env_crossbar;
    GLboolean ARB_texture_env_dot3;
    GLboolean ARB_texture_env_combine;
    GLboolean ARB_texture_env_crossbar;
    GLboolean ARB_texture_env_dot3;
+   GLboolean ARB_texture_filter_anisotropic;
    GLboolean ARB_texture_float;
    GLboolean ARB_texture_gather;
    GLboolean ARB_texture_mirror_clamp_to_edge;
    GLboolean ARB_texture_float;
    GLboolean ARB_texture_gather;
    GLboolean ARB_texture_mirror_clamp_to_edge;
index 7cb4ee7f9cd6e8652c543f77b92761f158a09c72..59e7b89ff6ed2257684135a6d3e00c8849ed9a82 100644 (file)
@@ -395,7 +395,7 @@ compute_version(const struct gl_extensions *extensions,
                          extensions->ARB_shader_atomic_counter_ops &&
                          extensions->ARB_shader_draw_parameters &&
                          extensions->ARB_shader_group_vote &&
                          extensions->ARB_shader_atomic_counter_ops &&
                          extensions->ARB_shader_draw_parameters &&
                          extensions->ARB_shader_group_vote &&
-                         /* extensions->ARB_texture_filter_anisotropic */ 0 &&
+                         extensions->ARB_texture_filter_anisotropic &&
                          extensions->ARB_transform_feedback_overflow_query);
 
    if (ver_4_6) {
                          extensions->ARB_transform_feedback_overflow_query);
 
    if (ver_4_6) {
index 904d9cd8340b772101a3abdc04f0f8c79e57fabb..9a22e54675c2d4d31d069839bc54ba12dd676904 100644 (file)
@@ -1251,6 +1251,10 @@ void st_init_extensions(struct pipe_screen *screen,
       }
    }
 
       }
    }
 
+   if (extensions->EXT_texture_filter_anisotropic &&
+       screen->get_paramf(screen, PIPE_CAPF_MAX_TEXTURE_ANISOTROPY) >= 16.0)
+      extensions->ARB_texture_filter_anisotropic = GL_TRUE;
+
    extensions->KHR_robustness = extensions->ARB_robust_buffer_access_behavior;
 
    /* If we support ES 3.1, we support the ES3_1_compatibility ext. However
    extensions->KHR_robustness = extensions->ARB_robust_buffer_access_behavior;
 
    /* If we support ES 3.1, we support the ES3_1_compatibility ext. However