[Mesa-dev] [PATCH 1/3] gallium: add explicit return type to texture opcodes

Brian Paul brianp at vmware.com
Mon Aug 22 17:05:25 UTC 2016


On 08/22/2016 08:38 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> Sampler view declarations have return types, but that doesn't work with
> variable indexing (e.g. SAMP[-1+i]).
>
> Adding the return type to the instruction is simpler.
>
> All sampler view declaration flags might have to be removed since variable
> indexing makes them inaccessible.

Do you want to get rid of sampler view declarations entirely?

There's other places where we build shaders but don't use the ureg code 
(such as tgsi_transform.[ch]) so I imagine that would need to be updated 
too.


> ---
>   src/gallium/auxiliary/tgsi/tgsi_ureg.c            |  7 ++-
>   src/gallium/auxiliary/tgsi/tgsi_ureg.h            | 21 ++++++---
>   src/gallium/auxiliary/util/u_simple_shaders.c     | 32 +++++++-------
>   src/gallium/auxiliary/vl/vl_bicubic_filter.c      |  3 +-
>   src/gallium/auxiliary/vl/vl_compositor.c          | 16 ++++---
>   src/gallium/auxiliary/vl/vl_deint_filter.c        | 39 +++++++++++------
>   src/gallium/auxiliary/vl/vl_idct.c                |  6 ++-
>   src/gallium/auxiliary/vl/vl_matrix_filter.c       |  3 +-
>   src/gallium/auxiliary/vl/vl_mc.c                  |  3 +-
>   src/gallium/auxiliary/vl/vl_median_filter.c       |  3 +-
>   src/gallium/auxiliary/vl/vl_mpeg12_decoder.c      |  3 +-
>   src/gallium/auxiliary/vl/vl_zscan.c               |  9 ++--
>   src/gallium/drivers/freedreno/freedreno_program.c |  4 +-
>   src/gallium/drivers/nouveau/nv50/nv50_surface.c   |  4 +-
>   src/gallium/include/pipe/p_shader_tokens.h        |  3 +-
>   src/gallium/state_trackers/nine/nine_ff.c         |  6 +--
>   src/gallium/state_trackers/nine/nine_shader.c     | 53 +++++++++++++++--------
>   src/gallium/state_trackers/xa/xa_tgsi.c           | 21 +++++----
>   src/mesa/state_tracker/st_atifs_to_tgsi.c         |  1 +
>   src/mesa/state_tracker/st_cb_drawpixels.c         |  6 ++-
>   src/mesa/state_tracker/st_glsl_to_tgsi.cpp        | 35 +++++++++------
>   src/mesa/state_tracker/st_mesa_to_tgsi.c          |  1 +
>   src/mesa/state_tracker/st_pbo.c                   |  8 +++-
>   23 files changed, 180 insertions(+), 107 deletions(-)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
> index b67c383..b82a2ea 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
> @@ -1207,32 +1207,33 @@ ureg_fixup_label(struct ureg_program *ureg,
>   {
>      union tgsi_any_token *out = retrieve_token( ureg, DOMAIN_INSN, label_token );
>
>      out->insn_label.Label = instruction_number;
>   }
>
>
>   void
>   ureg_emit_texture(struct ureg_program *ureg,
>                     unsigned extended_token,
> -                  unsigned target, unsigned num_offsets)
> +                  unsigned target, unsigned num_offsets, unsigned return_type)

Shouldn't we use enum tgsi_return_type instead of unsigned everywhere? 
That's always nice for debugging.

-Brian



More information about the mesa-dev mailing list