Lines Matching refs:ir
62 ir_instruction *ir = (ir_instruction *)iter.get();
63 ir->print();
64 if (ir->ir_type != ir_type_function)
93 void ir_print_visitor::visit(ir_variable *ir)
97 const char *const cent = (ir->centroid) ? "centroid " : "";
98 const char *const inv = (ir->invariant) ? "invariant " : "";
104 cent, inv, mode[ir->mode], interp[ir->interpolation]);
106 print_type(ir->type);
107 printf(" %s@%p)", ir->name, (void *) ir);
111 void ir_print_visitor::visit(ir_function_signature *ir)
116 print_type(ir->return_type);
123 foreach_iter(exec_list_iterator, iter, ir->parameters) {
140 foreach_iter(exec_list_iterator, iter, ir->body) {
154 void ir_print_visitor::visit(ir_function *ir)
156 printf("(function %s\n", ir->name);
158 foreach_iter(exec_list_iterator, iter, *ir) {
170 void ir_print_visitor::visit(ir_expression *ir)
174 print_type(ir->type);
176 printf(" %s ", ir->operator_string());
178 for (unsigned i = 0; i < ir->get_num_operands(); i++) {
179 ir->operands[i]->accept(this);
186 void ir_print_visitor::visit(ir_texture *ir)
188 printf("(%s ", ir->opcode_string());
190 ir->sampler->accept(this);
193 ir->coordinate->accept(this);
195 printf(" (%d %d %d) ", ir->offsets[0], ir->offsets[1], ir->offsets[2]);
197 if (ir->op != ir_txf) {
198 if (ir->projector)
199 ir->projector->accept(this);
203 if (ir->shadow_comparitor) {
205 ir->shadow_comparitor->accept(this);
212 switch (ir->op)
217 ir->lod_info.bias->accept(this);
221 ir->lod_info.lod->accept(this);
225 ir->lod_info.grad.dPdx->accept(this);
227 ir->lod_info.grad.dPdy->accept(this);
235 void ir_print_visitor::visit(ir_swizzle *ir)
238 ir->mask.x,
239 ir->mask.y,
240 ir->mask.z,
241 ir->mask.w,
245 for (unsigned i = 0; i < ir->mask.num_components; i++) {
249 ir->val->accept(this);
254 void ir_print_visitor::visit(ir_dereference_variable *ir)
256 ir_variable *var = ir->variable_referenced();
261 void ir_print_visitor::visit(ir_dereference_array *ir)
264 ir->array->accept(this);
265 ir->array_index->accept(this);
270 void ir_print_visitor::visit(ir_dereference_record *ir)
273 ir->record->accept(this);
274 printf(" %s) ", ir->field);
278 void ir_print_visitor::visit(ir_assignment *ir)
282 if (ir->condition)
283 ir->condition->accept(this);
292 if ((ir->write_mask & (1 << i)) != 0) {
301 ir->lhs->accept(this);
305 ir->rhs->accept(this);
310 void ir_print_visitor::visit(ir_constant *ir)
312 const glsl_type *const base_type = ir->type->get_base_type();
315 print_type(ir->type);
318 if (ir->type->is_array()) {
319 for (unsigned i = 0; i < ir->type->length; i++)
320 ir->get_array_element(i)->accept(this);
321 } else if (ir->type->is_record()) {
322 ir_constant *value = (ir_constant *) ir->components.get_head();
323 for (unsigned i = 0; i < ir->type->length; i++) {
324 printf("(%s ", ir->type->fields.structure->name);
331 for (unsigned i = 0; i < ir->type->components(); i++) {
335 case GLSL_TYPE_UINT: printf("%u", ir->value.u[i]); break;
336 case GLSL_TYPE_INT: printf("%d", ir->value.i[i]); break;
337 case GLSL_TYPE_FLOAT: printf("%f", ir->value.f[i]); break;
338 case GLSL_TYPE_BOOL: printf("%d", ir->value.b[i]); break;
348 ir_print_visitor::visit(ir_call *ir)
350 printf("(call %s (", ir->callee_name());
351 foreach_iter(exec_list_iterator, iter, *ir) {
361 ir_print_visitor::visit(ir_return *ir)
365 ir_rvalue *const value = ir->get_value();
376 ir_print_visitor::visit(ir_discard *ir)
380 if (ir->condition != NULL) {
382 ir->condition->accept(this);
390 ir_print_visitor::visit(ir_if *ir)
393 ir->condition->accept(this);
398 foreach_iter(exec_list_iterator, iter, ir->then_instructions) {
411 if (!ir->else_instructions.is_empty()) {
415 foreach_iter(exec_list_iterator, iter, ir->else_instructions) {
432 ir_print_visitor::visit(ir_loop *ir)
435 if (ir->counter != NULL)
436 ir->counter->accept(this);
438 if (ir->from != NULL)
439 ir->from->accept(this);
441 if (ir->to != NULL)
442 ir->to->accept(this);
444 if (ir->increment != NULL)
445 ir->increment->accept(this);
449 foreach_iter(exec_list_iterator, iter, ir->body_instructions) {
463 ir_print_visitor::visit(ir_loop_jump *ir)
465 printf("%s", ir->is_break() ? "break" : "continue");