Home | History | Annotate | Download | only in tgsi

Lines Matching refs:ctx

151    struct sanity_check_ctx *ctx,
157 if (!ctx->print)
165 ctx->errors++;
170 struct sanity_check_ctx *ctx,
176 if (!ctx->print)
184 ctx->warnings++;
189 struct sanity_check_ctx *ctx,
193 report_error( ctx, "(%u): Invalid register file name", file );
201 struct sanity_check_ctx *ctx,
205 ctx->regs_decl, scan_register_key(reg),
212 struct sanity_check_ctx *ctx,
216 cso_hash_first_node(ctx->regs_decl);
230 struct sanity_check_ctx *ctx,
234 ctx->regs_used, scan_register_key(reg),
242 struct sanity_check_ctx *ctx,
245 return cso_hash_contains(ctx->regs_ind_used, reg->file);
267 struct sanity_check_ctx *ctx,
272 if (!check_file_name( ctx, reg->file )) {
282 if (!is_any_register_declared( ctx, reg->file ))
283 report_error( ctx, "%s: Undeclared %s register", file_names[reg->file], name );
284 if (!is_ind_register_used(ctx, reg))
285 cso_hash_insert(ctx->regs_ind_used, reg->file, reg);
290 if (!is_register_declared( ctx, reg )) {
292 report_error( ctx, "%s[%d][%d]: Undeclared %s register", file_names[reg->file],
296 report_error( ctx, "%s[%d]: Undeclared %s register", file_names[reg->file],
300 if (!is_register_used( ctx, reg ))
301 cso_hash_insert(ctx->regs_used, scan_register_key(reg), reg);
313 struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;
318 if (ctx->index_of_END != ~0) {
319 report_error( ctx, "Too many END instructions" );
321 ctx->index_of_END = ctx->num_instructions;
326 report_error( ctx, "(%u): Invalid instruction opcode", inst->Instruction.Opcode );
331 report_error( ctx, "%s: Invalid number of destination operands, should be %u", info->mnemonic, info->num_dst );
334 report_error( ctx, "%s: Invalid number of source operands, should be %u", info->mnemonic, info->num_src );
343 ctx,
348 report_error(ctx, "Destination register has empty writemask");
354 ctx,
365 ctx,
372 ctx->num_instructions++;
378 check_and_declare(struct sanity_check_ctx *ctx,
381 if (is_register_declared( ctx, reg))
382 report_error( ctx, "%s[%u]: The same register declared more than once",
384 cso_hash_insert(ctx->regs_decl,
395 struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;
401 if (ctx->num_instructions > 0)
402 report_error( ctx, "Instruction expected but declaration found" );
408 if (!check_file_name( ctx, file ))
414 ctx->iter.processor.Processor == TGSI_PROCESSOR_GEOMETRY) {
416 for (vert = 0; vert < ctx->implied_array_size; ++vert) {
419 check_and_declare(ctx, reg);
428 check_and_declare(ctx, reg);
440 struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;
445 if (ctx->num_instructions > 0)
446 report_error( ctx, "Instruction expected but immediate found" );
451 fill_scan_register1d(reg, TGSI_FILE_IMMEDIATE, ctx->num_imms);
452 cso_hash_insert(ctx->regs_decl, scan_register_key(reg), reg);
453 ctx->num_imms++;
460 report_error( ctx, "(%u): Invalid immediate data type", imm->Immediate.DataType );
473 struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;
477 ctx->implied_array_size = u_vertices_per_prim(prop->u[0].Data);
486 struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;
490 if (ctx->index_of_END == ~0) {
491 report_error( ctx, "Missing END instruction" );
498 cso_hash_first_node(ctx->regs_decl);
502 if (!is_register_used(ctx, reg) && !is_ind_register_used(ctx, reg)) {
503 report_warning( ctx, "%s[%u]: Register never used",
512 if (ctx->errors || ctx->warnings)
513 debug_printf( "%u errors, %u warnings\n", ctx->errors, ctx->warnings );
535 struct sanity_check_ctx ctx;
537 ctx.iter.prolog = NULL;
538 ctx.iter.iterate_instruction = iter_instruction;
539 ctx.iter.iterate_declaration = iter_declaration;
540 ctx.iter.iterate_immediate = iter_immediate;
541 ctx.iter.iterate_property = iter_property;
542 ctx.iter.epilog = epilog;
544 ctx.regs_decl = cso_hash_create();
545 ctx.regs_used = cso_hash_create();
546 ctx.regs_ind_used = cso_hash_create();
548 ctx.num_imms = 0;
549 ctx.num_instructions = 0;
550 ctx.index_of_END = ~0;
552 ctx.errors = 0;
553 ctx.warnings = 0;
554 ctx.implied_array_size = 0;
555 ctx.print = debug_get_option_print_sanity();
557 if (!tgsi_iterate_shader( tokens, &ctx.iter ))
560 regs_hash_destroy(ctx.regs_decl);
561 regs_hash_destroy(ctx.regs_used);
562 regs_hash_destroy(ctx.regs_ind_used);
563 return ctx.errors == 0;