static void fixup_header_size(struct ureg_program *ureg) { union tgsi_any_token *out = retrieve_token( ureg, DOMAIN_DECL, 0 ); out->header.BodySize = ureg->domain[DOMAIN_DECL].count - 2; }
void ureg_fixup_insn_size(struct ureg_program *ureg, unsigned insn ) { union tgsi_any_token *out = retrieve_token( ureg, DOMAIN_INSN, insn ); assert(out->insn.Type == TGSI_TOKEN_TYPE_INSTRUCTION); out->insn.NrTokens = ureg->domain[DOMAIN_INSN].count - insn - 1; }
/* Patch a given label (expressed as a token number) to point to a * given instruction (expressed as an instruction number). */ void ureg_fixup_label(struct ureg_program *ureg, unsigned label_token, unsigned instruction_number ) { union tgsi_any_token *out = retrieve_token( ureg, DOMAIN_INSN, label_token ); out->insn_label.Label = instruction_number; }
void ureg_emit_texture(struct ureg_program *ureg, unsigned extended_token, unsigned target ) { union tgsi_any_token *out, *insn; out = get_tokens( ureg, DOMAIN_INSN, 1 ); insn = retrieve_token( ureg, DOMAIN_INSN, extended_token ); insn->insn.Texture = 1; out[0].value = 0; out[0].insn_texture.Texture = target; }
void ureg_emit_label(struct ureg_program *ureg, unsigned extended_token, unsigned *label_token ) { union tgsi_any_token *out, *insn; if(!label_token) return; out = get_tokens( ureg, DOMAIN_INSN, 1 ); out[0].value = 0; insn = retrieve_token( ureg, DOMAIN_INSN, extended_token ); insn->insn.Label = 1; *label_token = ureg->domain[DOMAIN_INSN].count - 1; }