[Mesa-dev] [PATCH 3/3] mesa: expose AMD_texture_texture4

Marek Olšák maraeo at gmail.com
Thu Nov 29 02:56:44 UTC 2018


The closed driver treats it the same as textureGather.

Marek

On Wed, Nov 28, 2018 at 8:58 PM Ilia Mirkin <imirkin at alum.mit.edu> wrote:

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


More information about the mesa-dev mailing list