<div dir="ltr"><div>The closed driver treats it the same as textureGather.</div><div><br></div><div>Marek<br></div><div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 28, 2018 at 8:58 PM Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Series is<br>
<br>
Reviewed-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>><br>
<br>
Note that AMD_texture_texture4 is only defined for single-component<br>
textures (not even RED allowed due to the age of the ext -- only ALPHA<br>
/ LUMINANCE / DEPTH_COMPONENT / INTENSITY) -- but it doesn't say what<br>
will happen when a "bad" texture is supplied. I guess it's reasonable<br>
to take the ARB_texture_gather interpretation as if the driver<br>
reported MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB == 1, i.e. it's the<br>
user's fault if something doesn't work.<br>
<br>
  -ilia<br>
On Wed, Nov 28, 2018 at 8:22 PM Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
><br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
><br>
> because the closed driver exposes it. Tested by piglit.<br>
> ---<br>
>  docs/relnotes/19.0.0.html                |  1 +<br>
>  src/compiler/glsl/builtin_functions.cpp  | 10 ++++++++++<br>
>  src/compiler/glsl/glsl_parser_extras.cpp |  1 +<br>
>  src/compiler/glsl/glsl_parser_extras.h   |  2 ++<br>
>  src/mesa/main/extensions_table.h         |  1 +<br>
>  5 files changed, 15 insertions(+)<br>
><br>
> diff --git a/docs/relnotes/19.0.0.html b/docs/relnotes/19.0.0.html<br>
> index d10bd2cf720..bc1776e8f4e 100644<br>
> --- a/docs/relnotes/19.0.0.html<br>
> +++ b/docs/relnotes/19.0.0.html<br>
> @@ -32,20 +32,21 @@ Compatibility contexts may report a lower version depending on each driver.<br>
><br>
>  <h2>SHA256 checksums</h2><br>
>  <pre><br>
>  TBD.<br>
>  </pre><br>
><br>
><br>
>  <h2>New features</h2><br>
><br>
>  <ul><br>
> +<li>GL_AMD_texture_texture4 on all GL 4.0 drivers.</li><br>
>  <li>GL_EXT_shader_implicit_conversions on all drivers (ES extension).</li><br>
>  <li>GL_EXT_texture_compression_bptc on all GL 4.0 drivers (ES extension).<li><br>
>  <li>GL_EXT_texture_compression_rgtc on all GL 3.0 drivers (ES extension).<li><br>
>  <li>GL_EXT_texture_view on drivers supporting texture views (ES extension).<li><br>
>  <li>GL_OES_texture_view on drivers supporting texture views (ES extension).</li><br>
>  </ul><br>
><br>
>  <h2>Bug fixes</h2><br>
><br>
>  <ul><br>
> diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp<br>
> index 5650365d1d5..62fbe10c623 100644<br>
> --- a/src/compiler/glsl/builtin_functions.cpp<br>
> +++ b/src/compiler/glsl/builtin_functions.cpp<br>
> @@ -411,20 +411,26 @@ texture_query_lod(const _mesa_glsl_parse_state *state)<br>
>  static bool<br>
>  texture_gather_cube_map_array(const _mesa_glsl_parse_state *state)<br>
>  {<br>
>     return state->is_version(400, 320) ||<br>
>            state->ARB_texture_gather_enable ||<br>
>            state->ARB_gpu_shader5_enable ||<br>
>            state->EXT_texture_cube_map_array_enable ||<br>
>            state->OES_texture_cube_map_array_enable;<br>
>  }<br>
><br>
> +static bool<br>
> +texture_texture4(const _mesa_glsl_parse_state *state)<br>
> +{<br>
> +   return state->AMD_texture_texture4_enable;<br>
> +}<br>
> +<br>
>  static bool<br>
>  texture_gather_or_es31(const _mesa_glsl_parse_state *state)<br>
>  {<br>
>     return state->is_version(400, 310) ||<br>
>            state->ARB_texture_gather_enable ||<br>
>            state->ARB_gpu_shader5_enable;<br>
>  }<br>
><br>
>  /* Only ARB_texture_gather but not GLSL 4.0 or ARB_gpu_shader5.<br>
>   * used for relaxation of const offset requirements.<br>
> @@ -2895,20 +2901,24 @@ builtin_builder::create_builtins()<br>
>                  NULL);<br>
><br>
>     add_function("shadow2DRectGradARB",<br>
>                  _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type,  glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type),<br>
>                  NULL);<br>
><br>
>     add_function("shadow2DRectProjGradARB",<br>
>                  _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type,  glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT),<br>
>                  NULL);<br>
><br>
> +   add_function("texture4",<br>
> +                _texture(ir_tg4, texture_texture4, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type),<br>
> +                NULL);<br>
> +<br>
>     add_function("textureGather",<br>
>                  _texture(ir_tg4, texture_gather_or_es31, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type),<br>
>                  _texture(ir_tg4, texture_gather_or_es31, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type),<br>
>                  _texture(ir_tg4, texture_gather_or_es31, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type),<br>
><br>
>                  _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type),<br>
>                  _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type),<br>
>                  _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type),<br>
><br>
>                  _texture(ir_tg4, texture_gather_or_es31, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type),<br>
> diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp<br>
> index 21ed34d79d0..1def5c7da5c 100644<br>
> --- a/src/compiler/glsl/glsl_parser_extras.cpp<br>
> +++ b/src/compiler/glsl/glsl_parser_extras.cpp<br>
> @@ -699,20 +699,21 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {<br>
>     EXT(OES_texture_cube_map_array),<br>
>     EXT_AEP(OES_texture_storage_multisample_2d_array),<br>
>     EXT(OES_viewport_array),<br>
><br>
>     /* All other extensions go here, sorted alphabetically.<br>
>      */<br>
>     EXT(AMD_conservative_depth),<br>
>     EXT(AMD_gpu_shader_int64),<br>
>     EXT(AMD_shader_stencil_export),<br>
>     EXT(AMD_shader_trinary_minmax),<br>
> +   EXT(AMD_texture_texture4),<br>
>     EXT(AMD_vertex_shader_layer),<br>
>     EXT(AMD_vertex_shader_viewport_index),<br>
>     EXT(ANDROID_extension_pack_es31a),<br>
>     EXT(EXT_blend_func_extended),<br>
>     EXT(EXT_frag_depth),<br>
>     EXT(EXT_draw_buffers),<br>
>     EXT(EXT_clip_cull_distance),<br>
>     EXT(EXT_geometry_point_size),<br>
>     EXT_AEP(EXT_geometry_shader),<br>
>     EXT_AEP(EXT_gpu_shader5),<br>
> diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h<br>
> index da8b2fa3ab5..ce18f3f89cd 100644<br>
> --- a/src/compiler/glsl/glsl_parser_extras.h<br>
> +++ b/src/compiler/glsl/glsl_parser_extras.h<br>
> @@ -779,20 +779,22 @@ struct _mesa_glsl_parse_state {<br>
>     /* All other extensions go here, sorted alphabetically.<br>
>      */<br>
>     bool AMD_conservative_depth_enable;<br>
>     bool AMD_conservative_depth_warn;<br>
>     bool AMD_gpu_shader_int64_enable;<br>
>     bool AMD_gpu_shader_int64_warn;<br>
>     bool AMD_shader_stencil_export_enable;<br>
>     bool AMD_shader_stencil_export_warn;<br>
>     bool AMD_shader_trinary_minmax_enable;<br>
>     bool AMD_shader_trinary_minmax_warn;<br>
> +   bool AMD_texture_texture4_enable;<br>
> +   bool AMD_texture_texture4_warn;<br>
>     bool AMD_vertex_shader_layer_enable;<br>
>     bool AMD_vertex_shader_layer_warn;<br>
>     bool AMD_vertex_shader_viewport_index_enable;<br>
>     bool AMD_vertex_shader_viewport_index_warn;<br>
>     bool ANDROID_extension_pack_es31a_enable;<br>
>     bool ANDROID_extension_pack_es31a_warn;<br>
>     bool EXT_blend_func_extended_enable;<br>
>     bool EXT_blend_func_extended_warn;<br>
>     bool EXT_clip_cull_distance_enable;<br>
>     bool EXT_clip_cull_distance_warn;<br>
> diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h<br>
> index 45ee7675ab2..2a3e1ab32ca 100644<br>
> --- a/src/mesa/main/extensions_table.h<br>
> +++ b/src/mesa/main/extensions_table.h<br>
> @@ -13,20 +13,21 @@ EXT(AMD_depth_clamp_separate                , AMD_depth_clamp_separate<br>
>  EXT(AMD_draw_buffers_blend                  , ARB_draw_buffers_blend                 , GLL, GLC,  x ,  x , 2009)<br>
>  EXT(AMD_framebuffer_multisample_advanced    , AMD_framebuffer_multisample_advanced   , GLL, GLC,  x , ES2, 2018)<br>
>  EXT(AMD_gpu_shader_int64                    , ARB_gpu_shader_int64                   ,  x , GLC,  x ,  x , 2015)<br>
>  EXT(AMD_multi_draw_indirect                 , ARB_draw_indirect                      , GLL, GLC,  x ,  x , 2011)<br>
>  EXT(AMD_performance_monitor                 , AMD_performance_monitor                , GLL, GLC,  x , ES2, 2007)<br>
>  EXT(AMD_pinned_memory                       , AMD_pinned_memory                      , GLL, GLC,  x ,  x , 2013)<br>
>  EXT(AMD_query_buffer_object                 , ARB_query_buffer_object                , GLL, GLC,  x ,  x , 2012)<br>
>  EXT(AMD_seamless_cubemap_per_texture        , AMD_seamless_cubemap_per_texture       , GLL, GLC,  x ,  x , 2009)<br>
>  EXT(AMD_shader_stencil_export               , ARB_shader_stencil_export              , GLL, GLC,  x ,  x , 2009)<br>
>  EXT(AMD_shader_trinary_minmax               , dummy_true                             , GLL, GLC,  x ,  x , 2012)<br>
> +EXT(AMD_texture_texture4                    , ARB_texture_gather                     , GLL, GLC,  x ,  x , 2008)<br>
>  EXT(AMD_vertex_shader_layer                 , AMD_vertex_shader_layer                , GLL, GLC,  x ,  x , 2012)<br>
>  EXT(AMD_vertex_shader_viewport_index        , AMD_vertex_shader_viewport_index       , GLL, GLC,  x ,  x , 2012)<br>
><br>
>  EXT(ANDROID_extension_pack_es31a            , ANDROID_extension_pack_es31a           ,  x ,  x ,  x ,  31, 2014)<br>
><br>
>  EXT(ANGLE_texture_compression_dxt3          , ANGLE_texture_compression_dxt          , GLL, GLC, ES1, ES2, 2011)<br>
>  EXT(ANGLE_texture_compression_dxt5          , ANGLE_texture_compression_dxt          , GLL, GLC, ES1, ES2, 2011)<br>
><br>
>  EXT(APPLE_object_purgeable                  , APPLE_object_purgeable                 , GLL, GLC,  x ,  x , 2006)<br>
>  EXT(APPLE_packed_pixels                     , dummy_true                             , GLL,  x ,  x ,  x , 2002)<br>
> --<br>
> 2.17.1<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div></div>