[Mesa-dev] [PATCH] tgsi: remove unused tgsi_is_passthrough_shader()
tournier.elie
tournier.elie at gmail.com
Tue May 23 14:26:46 UTC 2017
On 23 May 2017 at 14:31, Samuel Pitoiset <samuel.pitoiset at gmail.com> wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Elie Tournier <elie.tournier at collabora.com>
> ---
> src/gallium/auxiliary/tgsi/tgsi_scan.c | 76 ----------------------------------
> src/gallium/auxiliary/tgsi/tgsi_scan.h | 3 --
> 2 files changed, 79 deletions(-)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
> index d1ef769ec4d..847f4fce28f 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
> @@ -891,79 +891,3 @@ tgsi_scan_arrays(const struct tgsi_token *tokens,
>
> return;
> }
> -
> -
> -/**
> - * Check if the given shader is a "passthrough" shader consisting of only
> - * MOV instructions of the form: MOV OUT[n], IN[n]
> - *
> - */
> -boolean
> -tgsi_is_passthrough_shader(const struct tgsi_token *tokens)
> -{
> - struct tgsi_parse_context parse;
> -
> - /**
> - ** Setup to begin parsing input shader
> - **/
> - if (tgsi_parse_init(&parse, tokens) != TGSI_PARSE_OK) {
> - debug_printf("tgsi_parse_init() failed in tgsi_is_passthrough_shader()!\n");
> - return FALSE;
> - }
> -
> - /**
> - ** Loop over incoming program tokens/instructions
> - */
> - while (!tgsi_parse_end_of_tokens(&parse)) {
> -
> - tgsi_parse_token(&parse);
> -
> - switch (parse.FullToken.Token.Type) {
> - case TGSI_TOKEN_TYPE_INSTRUCTION:
> - {
> - struct tgsi_full_instruction *fullinst =
> - &parse.FullToken.FullInstruction;
> - const struct tgsi_full_src_register *src =
> - &fullinst->Src[0];
> - const struct tgsi_full_dst_register *dst =
> - &fullinst->Dst[0];
> -
> - /* Do a whole bunch of checks for a simple move */
> - if (fullinst->Instruction.Opcode != TGSI_OPCODE_MOV ||
> - (src->Register.File != TGSI_FILE_INPUT &&
> - src->Register.File != TGSI_FILE_SYSTEM_VALUE) ||
> - dst->Register.File != TGSI_FILE_OUTPUT ||
> - src->Register.Index != dst->Register.Index ||
> -
> - src->Register.Negate ||
> - src->Register.Absolute ||
> -
> - src->Register.SwizzleX != TGSI_SWIZZLE_X ||
> - src->Register.SwizzleY != TGSI_SWIZZLE_Y ||
> - src->Register.SwizzleZ != TGSI_SWIZZLE_Z ||
> - src->Register.SwizzleW != TGSI_SWIZZLE_W ||
> -
> - dst->Register.WriteMask != TGSI_WRITEMASK_XYZW)
> - {
> - tgsi_parse_free(&parse);
> - return FALSE;
> - }
> - }
> - break;
> -
> - case TGSI_TOKEN_TYPE_DECLARATION:
> - /* fall-through */
> - case TGSI_TOKEN_TYPE_IMMEDIATE:
> - /* fall-through */
> - case TGSI_TOKEN_TYPE_PROPERTY:
> - /* fall-through */
> - default:
> - ; /* no-op */
> - }
> - }
> -
> - tgsi_parse_free(&parse);
> -
> - /* if we get here, it's a pass-through shader */
> - return TRUE;
> -}
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
> index 98387c982c6..af1651b7e82 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
> +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
> @@ -196,9 +196,6 @@ tgsi_scan_arrays(const struct tgsi_token *tokens,
> unsigned max_array_id,
> struct tgsi_array_info *arrays);
>
> -extern boolean
> -tgsi_is_passthrough_shader(const struct tgsi_token *tokens);
> -
> #ifdef __cplusplus
> } // extern "C"
> #endif
> --
> 2.13.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list