Пример #1
0
void
tgsi_dump_str(
   const struct tgsi_token *tokens,
   uint flags,
   char *str,
   size_t size)
{
   struct str_dump_ctx ctx;

   ctx.base.iter.prolog = prolog;
   ctx.base.iter.iterate_instruction = iter_instruction;
   ctx.base.iter.iterate_declaration = iter_declaration;
   ctx.base.iter.iterate_immediate = iter_immediate;
   ctx.base.iter.iterate_property = iter_property;
   ctx.base.iter.epilog = NULL;

   ctx.base.instno = 0;
   ctx.base.immno = 0;
   ctx.base.indent = 0;
   ctx.base.dump_printf = &str_dump_ctx_printf;
   ctx.base.indentation = 0;

   ctx.str = str;
   ctx.str[0] = 0;
   ctx.ptr = str;
   ctx.left = (int)size;

   tgsi_iterate_shader( tokens, &ctx.base.iter );
}
Пример #2
0
boolean
tgsi_sanity_check(
   struct tgsi_token *tokens )
{
   struct sanity_check_ctx ctx;

   ctx.iter.prolog = NULL;
   ctx.iter.iterate_instruction = iter_instruction;
   ctx.iter.iterate_declaration = iter_declaration;
   ctx.iter.iterate_immediate = iter_immediate;
   ctx.iter.epilog = epilog;

   memset( ctx.regs_decl, 0, sizeof( ctx.regs_decl ) );
   memset( ctx.regs_used, 0, sizeof( ctx.regs_used ) );
   memset( ctx.regs_ind_used, 0, sizeof( ctx.regs_ind_used ) );
   ctx.num_imms = 0;
   ctx.num_instructions = 0;
   ctx.index_of_END = ~0;

   ctx.errors = 0;
   ctx.warnings = 0;

   if (!tgsi_iterate_shader( tokens, &ctx.iter ))
      return FALSE;

   return ctx.errors == 0;
}
Пример #3
0
boolean
tgsi_sanity_check(
   const struct tgsi_token *tokens )
{
   struct sanity_check_ctx ctx;

   ctx.iter.prolog = prolog;
   ctx.iter.iterate_instruction = iter_instruction;
   ctx.iter.iterate_declaration = iter_declaration;
   ctx.iter.iterate_immediate = iter_immediate;
   ctx.iter.iterate_property = iter_property;
   ctx.iter.epilog = epilog;

   ctx.regs_decl = cso_hash_create();
   ctx.regs_used = cso_hash_create();
   ctx.regs_ind_used = cso_hash_create();

   ctx.num_imms = 0;
   ctx.num_instructions = 0;
   ctx.index_of_END = ~0;

   ctx.errors = 0;
   ctx.warnings = 0;
   ctx.implied_array_size = 0;
   ctx.print = debug_get_option_print_sanity();

   if (!tgsi_iterate_shader( tokens, &ctx.iter ))
      return FALSE;

   regs_hash_destroy(ctx.regs_decl);
   regs_hash_destroy(ctx.regs_used);
   regs_hash_destroy(ctx.regs_ind_used);
   return ctx.errors == 0;
}
Пример #4
0
void
tgsi_dump_to_file(const struct tgsi_token *tokens, uint flags, FILE *file)
{
   struct dump_ctx ctx;

   ctx.iter.prolog = prolog;
   ctx.iter.iterate_instruction = iter_instruction;
   ctx.iter.iterate_declaration = iter_declaration;
   ctx.iter.iterate_immediate = iter_immediate;
   ctx.iter.iterate_property = iter_property;
   ctx.iter.epilog = NULL;

   ctx.instno = 0;
   ctx.immno = 0;
   ctx.indent = 0;
   ctx.dump_printf = dump_ctx_printf;
   ctx.indentation = 0;
   ctx.file = file;

   if (flags & TGSI_DUMP_FLOAT_AS_HEX)
      ctx.dump_float_as_hex = TRUE;
   else
      ctx.dump_float_as_hex = FALSE;

   tgsi_iterate_shader( tokens, &ctx.iter );
}
Пример #5
0
void
tgsi_dump(
   const struct tgsi_token *tokens,
   uint flags )
{
   struct dump_ctx ctx;

   ctx.iter.prolog = prolog;
   ctx.iter.iterate_instruction = iter_instruction;
   ctx.iter.iterate_declaration = iter_declaration;
   ctx.iter.iterate_immediate = iter_immediate;
   ctx.iter.iterate_property = iter_property;
   ctx.iter.epilog = NULL;

   ctx.instno = 0;
   ctx.indent = 0;
   ctx.dump_printf = dump_ctx_printf;
   ctx.indentation = 0;

   tgsi_iterate_shader( tokens, &ctx.iter );
}
Пример #6
0
bool
tgsi_dump_str(
   const struct tgsi_token *tokens,
   uint flags,
   char *str,
   size_t size)
{
   struct str_dump_ctx ctx;

   ctx.base.iter.prolog = prolog;
   ctx.base.iter.iterate_instruction = iter_instruction;
   ctx.base.iter.iterate_declaration = iter_declaration;
   ctx.base.iter.iterate_immediate = iter_immediate;
   ctx.base.iter.iterate_property = iter_property;
   ctx.base.iter.epilog = NULL;

   ctx.base.instno = 0;
   ctx.base.immno = 0;
   ctx.base.indent = 0;
   ctx.base.dump_printf = &str_dump_ctx_printf;
   ctx.base.indentation = 0;
   ctx.base.file = NULL;

   ctx.str = str;
   ctx.str[0] = 0;
   ctx.ptr = str;
   ctx.left = (int)size;
   ctx.nospace = false;

   if (flags & TGSI_DUMP_FLOAT_AS_HEX)
      ctx.base.dump_float_as_hex = TRUE;
   else
      ctx.base.dump_float_as_hex = FALSE;

   tgsi_iterate_shader( tokens, &ctx.base.iter );

   return !ctx.nospace;
}