tgsi: remove unused tgsi_is_passthrough_shader()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
This commit is contained in:
parent
338f47b6d8
commit
51dc5e3df3
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue