On Thu, Feb 19, 2015 at 7:54 PM, Dave Airlie <[email protected]> wrote:
> From: Dave Airlie <[email protected]>
>
> This allows drivers to work out if a shader contains any
> double opcodes easily.
>
> Signed-off-by: Dave Airlie <[email protected]>
> ---
> src/gallium/auxiliary/tgsi/tgsi_scan.c | 4 ++++
> src/gallium/auxiliary/tgsi/tgsi_scan.h | 2 +-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c
> b/src/gallium/auxiliary/tgsi/tgsi_scan.c
> index e6011d2..e19b8a1 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
> @@ -97,6 +97,10 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
> assert(fullinst->Instruction.Opcode < TGSI_OPCODE_LAST);
> info->opcode_count[fullinst->Instruction.Opcode]++;
>
> + if (fullinst->Instruction.Opcode >= TGSI_OPCODE_F2D ||
> + fullinst->Instruction.Opcode < TGSI_OPCODE_DRSQ)
I added a few :)
> + info->uses_doubles = true;
> +
> for (i = 0; i < fullinst->Instruction.NumSrcRegs; i++) {
> const struct tgsi_full_src_register *src =
> &fullinst->Src[i];
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h
> b/src/gallium/auxiliary/tgsi/tgsi_scan.h
> index 5dc9267..daa73cc 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
> +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
> @@ -86,7 +86,7 @@ struct tgsi_shader_info
> boolean writes_viewport_index;
> boolean writes_layer;
> boolean is_msaa_sampler[PIPE_MAX_SAMPLERS];
> -
> + boolean uses_doubles; /**< uses any of the double instructions */
> unsigned clipdist_writemask;
> unsigned culldist_writemask;
> unsigned num_written_culldistance;
> --
> 1.9.3
>
> _______________________________________________
> mesa-dev mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev