tgsi: remove unused tgsi_is_passthrough_shader()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 23 May 2017 13:31:35 +0000 (15:31 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 24 May 2017 07:52:17 +0000 (09:52 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h

index d1ef769ec4dac1c7623a40ee6f0a709af386da11..847f4fce28f5ecd94413cb626cf8d3fe6c117e33 100644 (file)
@@ -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;
-}
index 98387c982c61fe6f1ef334b50e9615c09661cf5f..af1651b7e8215f4478b42442303aa7e4fa2ae9b8 100644 (file)
@@ -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