[Mesa-dev] [PATCH 1/3] gallium: add explicit return type to texture opcodes
Marek Olšák
maraeo at gmail.com
Mon Aug 22 20:14:05 UTC 2016
On Mon, Aug 22, 2016 at 7:05 PM, Brian Paul <brianp at vmware.com> wrote:
> 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?
No, they have their place and I think the sampler view declarations
should stay, but the flags that are attached to them are basically
inaccessible with variable indexing. Since I have no reason to add
array support for sampler view declarations (unlike IN,OUT,TEMP, where
we needed array support due to other reasons), I prefer moving the
flags to instructions.
>
> 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.
Yeah, sorry I missed those. I'll update them.
>
>
>
>> ---
>> 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.
Yeah, that's a good idea.
Marke
More information about the mesa-dev
mailing list