Lines Matching refs:fp

39 print_tabs(unsigned num_tabs, FILE *fp)
42 fprintf(fp, "\t");
46 FILE *fp;
67 FILE *fp = state->fp;
79 fprintf(fp, "%s\n\n", note);
85 FILE *fp = state->fp;
86 fprintf(fp, "r%u", reg->index);
97 FILE *fp = state->fp;
98 fprintf(fp, "decl_reg %s %u ", sizes[reg->num_components], reg->bit_size);
101 fprintf(fp, "[%u]", reg->num_array_elems);
102 fprintf(fp, "\n");
108 FILE *fp = state->fp;
114 fprintf(fp, "%s %2u %sssa_%u", sizes[def->num_components], def->bit_size,
121 FILE *fp = state->fp;
129 fprintf(fp, "(");
133 fprintf(fp, ", ");
137 fprintf(fp, "0x%016" PRIx64, instr->value[i].u64);
140 fprintf(fp, "0x%08x", instr->value[i].u32);
143 fprintf(fp, "0x%04x", instr->value[i].u16);
146 fprintf(fp, "0x%02x", instr->value[i].u8);
149 fprintf(fp, "%s", instr->value[i].b ? "true" : "false");
156 fprintf(fp, ") = (");
158 fprintf(fp, " = ");
162 fprintf(fp, ", ");
166 fprintf(fp, "%f", instr->value[i].f64);
169 fprintf(fp, "%f", instr->value[i].f32);
172 fprintf(fp, "%f", _mesa_half_to_float(instr->value[i].u16));
180 fprintf(fp, ")");
186 FILE *fp = state->fp;
190 fprintf(fp, " = load_const ");
198 FILE *fp = state->fp;
199 fprintf(fp, "ssa_%u", def->index);
202 fprintf(fp, " /*");
204 fprintf(fp, "*/");
213 FILE *fp = state->fp;
216 fprintf(fp, "[%u", src->base_offset);
218 fprintf(fp, " + ");
221 fprintf(fp, "]");
228 FILE *fp = state->fp;
231 fprintf(fp, "[%u", dest->base_offset);
233 fprintf(fp, " + ");
236 fprintf(fp, "]");
267 FILE *fp = state->fp;
270 fprintf(fp, "-");
272 fprintf(fp, "abs(");
294 fprintf(fp, ".");
299 fprintf(fp, "%c", comp_mask_string(live_channels)[instr->src[src].swizzle[i]]);
304 fprintf(fp, ")");
310 FILE *fp = state->fp;
318 fprintf(fp, ".");
321 fprintf(fp, "%c", comp_mask_string(live_channels)[i]);
328 FILE *fp = state->fp;
332 fprintf(fp, " = %s", nir_op_infos[instr->op].name);
334 fprintf(fp, "!");
336 fprintf(fp, ".sat");
338 fprintf(fp, ".nsw");
340 fprintf(fp, ".nuw");
341 fprintf(fp, " ");
345 fprintf(fp, ", ");
411 FILE *fp = state->fp;
422 if (i > 0) fprintf(fp, ", ");
423 fprintf(fp, "%s", c->values[i].b ? "true" : "false");
433 if (i > 0) fprintf(fp, ", ");
434 fprintf(fp, "0x%02x", c->values[i].u8);
444 if (i > 0) fprintf(fp, ", ");
445 fprintf(fp, "0x%04x", c->values[i].u16);
455 if (i > 0) fprintf(fp, ", ");
456 fprintf(fp, "0x%08x", c->values[i].u32);
465 if (i > 0) fprintf(fp, ", ");
472 if (i > 0) fprintf(fp, ", ");
473 fprintf(fp, "%f", _mesa_half_to_float(c->values[i].u16));
479 if (i > 0) fprintf(fp, ", ");
480 fprintf(fp, "%f", c->values[i].f32);
486 if (i > 0) fprintf(fp, ", ");
487 fprintf(fp, "%f", c->values[i].f64);
503 if (i > 0) fprintf(fp, ", ");
504 fprintf(fp, "0x%08" PRIx64, c->values[i].u64);
511 if (i > 0) fprintf(fp, ", ");
512 fprintf(fp, "{ ");
514 fprintf(fp, " }");
520 if (i > 0) fprintf(fp, ", ");
521 fprintf(fp, "{ ");
523 fprintf(fp, " }");
578 FILE *fp = state->fp;
580 fprintf(fp, "decl_var ");
590 fprintf(fp, "%s%s%s%s%s%s%s%s%s %s ",
606 fprintf(fp, "%s%s%s%s%s%s%s%s", coher, volat, restr, ronly, wonly, reorder,
610 fprintf(fp, "%s ", util_format_short_name(var->data.image.format));
620 fprintf(fp, "%s ", precisions[var->data.precision]);
623 fprintf(fp, "%s %s", glsl_get_type_name(var->type),
700 fprintf(fp, " (%s%s, %u, %u)%s", loc,
707 fprintf(fp, " = { ");
709 fprintf(fp, " }");
712 fprintf(fp, " = { %s, %s, %s }",
718 fprintf(fp, " = &%s", get_var_name(var->pointer_initializer, state));
720 fprintf(fp, "\n");
727 FILE *fp = state->fp;
730 fprintf(fp, "%s", get_var_name(instr->var, state));
733 fprintf(fp, "(%s *)", glsl_get_type_name(instr->type));
761 fprintf(fp, "(");
764 fprintf(fp, "*");
773 fprintf(fp, ")");
777 fprintf(fp, "%s%s", is_parent_pointer ? "->" : ".",
784 fprintf(fp, "[%"PRId64"]", nir_src_as_int(instr->arr.index));
786 fprintf(fp, "[");
788 fprintf(fp, "]");
794 fprintf(fp, "[*]");
805 FILE *fp = state->fp;
811 fprintf(fp, " = deref_var ");
815 fprintf(fp, " = deref_array ");
818 fprintf(fp, " = deref_struct ");
821 fprintf(fp, " = deref_cast ");
824 fprintf(fp, " = deref_ptr_as_array ");
832 fprintf(fp, "&");
836 fprintf(fp, " (");
840 fprintf(fp, "%s%s", get_variable_mode_str(1 << m, true),
843 fprintf(fp, " %s) ", glsl_get_type_name(instr->type));
848 fprintf(fp, "/* &");
850 fprintf(fp, " */");
854 fprintf(fp, " /* ptr_stride=%u, align_mul=%u, align_offset=%u */",
884 FILE *fp = state->fp;
896 fprintf(fp, "%s%u", name, size);
898 fprintf(fp, "%s", name);
906 FILE *fp = state->fp;
910 fprintf(fp, " = ");
913 fprintf(fp, "intrinsic %s (", info->name);
917 fprintf(fp, ", ");
922 fprintf(fp, ") (");
928 fprintf(fp, ", ");
933 fprintf(fp, "wrmask=");
936 fprintf(fp, "%c", comp_mask_string(instr->num_components)[i]);
942 fprintf(fp, "reduction_op=%s", nir_op_infos[reduction_op].name);
960 fprintf(fp, "image_dim=%s", dim_name[dim]);
966 fprintf(fp, "image_array=%s", array ? "true" : "false");
972 fprintf(fp, "format=%s", util_format_short_name(format));
978 fprintf(fp, "desc_type=%s", vulkan_descriptor_type_name(desc_type));
983 fprintf(fp, "src_type=");
989 fprintf(fp, "dest_type=");
995 fprintf(fp, "swizzle_mask=");
999 fprintf(fp, "%d", (mask >> (i * 2) & 3));
1001 fprintf(fp, "((id & %d) | %d) ^ %d", mask & 0x1F,
1005 fprintf(fp, "%d", mask);
1012 fprintf(fp, "mem_semantics=");
1014 case 0: fprintf(fp, "NONE"); break;
1015 case NIR_MEMORY_ACQUIRE: fprintf(fp, "ACQ"); break;
1016 case NIR_MEMORY_RELEASE: fprintf(fp, "REL"); break;
1017 default: fprintf(fp, "ACQ|REL"); break;
1019 if (semantics & (NIR_MEMORY_MAKE_AVAILABLE)) fprintf(fp, "|AVAILABLE");
1020 if (semantics & (NIR_MEMORY_MAKE_VISIBLE)) fprintf(fp, "|VISIBLE");
1025 fprintf(fp, "mem_modes=");
1029 fprintf(fp, "%s%s", get_variable_mode_str(1 << m, true), modes ? "|" : "");
1036 fprintf(fp, "%s=", nir_intrinsic_index_names[idx]);
1041 case NIR_SCOPE_NONE: fprintf(fp, "NONE"); break;
1042 case NIR_SCOPE_DEVICE: fprintf(fp, "DEVICE"); break;
1043 case NIR_SCOPE_QUEUE_FAMILY: fprintf(fp, "QUEUE_FAMILY"); break;
1044 case NIR_SCOPE_WORKGROUP: fprintf(fp, "WORKGROUP"); break;
1045 case NIR_SCOPE_SHADER_CALL: fprintf(fp, "SHADER_CALL"); break;
1046 case NIR_SCOPE_SUBGROUP: fprintf(fp, "SUBGROUP"); break;
1047 case NIR_SCOPE_INVOCATION: fprintf(fp, "INVOCATION"); break;
1054 fprintf(fp, "io location=%u slots=%u", io.location, io.num_slots);
1057 fprintf(fp, " dualsrc");
1060 fprintf(fp, " fbfetch");
1063 fprintf(fp, " perview");
1066 fprintf(fp, " mediump");
1069 fprintf(fp, " high_16bits");
1072 fprintf(fp, " no_varying");
1075 fprintf(fp, " no_sysval_output");
1083 fprintf(fp, " gs_streams(");
1085 fprintf(fp, "%s%c=%u", i ? " " : "", "xyzw"[i],
1088 fprintf(fp, ")");
1097 fprintf(fp, "xfb%s(", idx == NIR_INTRINSIC_IO_XFB ? "" : "2");
1108 fprintf(fp, ", ");
1112 fprintf(fp, "components=%u..%u",
1115 fprintf(fp, "component=%u", start_comp);
1117 fprintf(fp, " buffer=%u offset=%u",
1120 fprintf(fp, ")");
1125 fprintf(fp, "rounding_mode=");
1127 case nir_rounding_mode_undef: fprintf(fp, "undef"); break;
1128 case nir_rounding_mode_rtne: fprintf(fp, "rtne"); break;
1129 case nir_rounding_mode_ru: fprintf(fp, "ru"); break;
1130 case nir_rounding_mode_rd: fprintf(fp, "rd"); break;
1131 case nir_rounding_mode_rtz: fprintf(fp, "rtz"); break;
1132 default: fprintf(fp, "unkown"); break;
1139 fprintf(fp, "%s=%d", nir_intrinsic_index_names[idx], instr->const_index[off]);
1145 fprintf(fp, " /*%d*/", instr->const_index[i]);
1147 fprintf(fp, ")");
1178 fprintf(fp, "\t/* %s */", var->name);
1187 FILE *fp = state->fp;
1191 fprintf(fp, " = (");
1193 fprintf(fp, ")");
1197 fprintf(fp, "tex ");
1200 fprintf(fp, "txb ");
1203 fprintf(fp, "txl ");
1206 fprintf(fp, "txd ");
1209 fprintf(fp, "txf ");
1212 fprintf(fp, "txf_ms ");
1215 fprintf(fp, "txf_ms_fb ");
1218 fprintf(fp, "txf_ms_mcs_intel ");
1221 fprintf(fp, "txs ");
1224 fprintf(fp, "lod ");
1227 fprintf(fp, "tg4 ");
1230 fprintf(fp, "query_levels ");
1233 fprintf(fp, "texture_samples ");
1236 fprintf(fp, "samples_identical ");
1239 fprintf(fp, "tex (pre-dispatchable) ");
1242 fprintf(fp, "fragment_fetch_amd ");
1245 fprintf(fp, "fragment_mask_fetch_amd ");
1255 fprintf(fp, ", ");
1259 fprintf(fp, " ");
1263 fprintf(fp, "(backend1)");
1266 fprintf(fp, "(backend2)");
1269 fprintf(fp, "(coord)");
1272 fprintf(fp, "(projector)");
1275 fprintf(fp, "(comparator)");
1278 fprintf(fp, "(offset)");
1281 fprintf(fp, "(bias)");
1284 fprintf(fp, "(lod)");
1287 fprintf(fp, "(min_lod)");
1290 fprintf(fp, "(ms_index)");
1293 fprintf(fp, "(ms_mcs_intel)");
1296 fprintf(fp, "(ddx)");
1299 fprintf(fp, "(ddy)");
1303 fprintf(fp, "(texture_deref)");
1307 fprintf(fp, "(sampler_deref)");
1310 fprintf(fp, "(texture_offset)");
1313 fprintf(fp, "(sampler_offset)");
1316 fprintf(fp, "(texture_handle)");
1319 fprintf(fp, "(sampler_handle)");
1322 fprintf(fp, "(plane)");
1332 fprintf(fp, ", %u (gather_component)", instr->component);
1336 fprintf(fp, ", { (%i, %i)", instr->tg4_offsets[0][0], instr->tg4_offsets[0][1]);
1338 fprintf(fp, ", (%i, %i)", instr->tg4_offsets[i][0],
1340 fprintf(fp, " } (offsets)");
1345 fprintf(fp, ", %u (texture)", instr->texture_index);
1349 fprintf(fp, ", %u (sampler)", instr->sampler_index);
1354 fprintf(fp, ", texture non-uniform");
1358 fprintf(fp, ", sampler non-uniform");
1362 fprintf(fp, ", sparse");
1369 FILE *fp = state->fp;
1371 fprintf(fp, "call %s ", instr->callee->name);
1375 fprintf(fp, ", ");
1384 FILE *fp = state->fp;
1388 fprintf(fp, "break");
1392 fprintf(fp, "continue");
1396 fprintf(fp, "return");
1400 fprintf(fp, "halt");
1404 fprintf(fp, "goto block_%u",
1409 fprintf(fp, "goto block_%u if ",
1412 fprintf(fp, " else block_%u",
1421 FILE *fp = state->fp;
1423 fprintf(fp, " = undefined");
1429 FILE *fp = state->fp;
1431 fprintf(fp, " = phi ");
1434 fprintf(fp, ", ");
1436 fprintf(fp, "block_%u: ", src->pred->index);
1444 FILE *fp = state->fp;
1447 fprintf(fp, "; ");
1450 fprintf(fp, " = ");
1458 FILE *fp = state->fp;
1459 print_tabs(tabs, fp);
1514 FILE *fp = state->fp;
1516 print_tabs(tabs, fp);
1517 fprintf(fp, "block block_%u:\n", block->index);
1521 print_tabs(tabs, fp);
1522 fprintf(fp, "/* preds: ");
1524 fprintf(fp, "block_%u ", preds[i]->index);
1526 fprintf(fp, "*/\n");
1532 fprintf(fp, "\n");
1536 print_tabs(tabs, fp);
1537 fprintf(fp, "/* succs: ");
1540 fprintf(fp, "block_%u ", block->successors[i]->index);
1542 fprintf(fp, "*/\n");
1548 FILE *fp = state->fp;
1550 print_tabs(tabs, fp);
1551 fprintf(fp, "if ");
1553 fprintf(fp, " {\n");
1557 print_tabs(tabs, fp);
1558 fprintf(fp, "} else {\n");
1562 print_tabs(tabs, fp);
1563 fprintf(fp, "}\n");
1569 FILE *fp = state->fp;
1571 print_tabs(tabs, fp);
1572 fprintf(fp, "loop {\n");
1576 print_tabs(tabs, fp);
1577 fprintf(fp, "}\n");
1604 FILE *fp = state->fp;
1606 fprintf(fp, "\nimpl %s ", impl->function->name);
1608 fprintf(fp, "{\n");
1611 fprintf(fp, "\tpreamble %s\n", impl->preamble->name);
1615 fprintf(fp, "\t");
1620 fprintf(fp, "\t");
1630 fprintf(fp, "\tblock block_%u:\n}\n\n", impl->end_block->index);
1636 FILE *fp = state->fp;
1638 fprintf(fp, "decl_function %s (%d params)", function->name,
1641 fprintf(fp, "\n");
1650 init_print_state(print_state *state, nir_shader *shader, FILE *fp)
1652 state->fp = fp;
1689 nir_print_shader_annotated(nir_shader *shader, FILE *fp,
1693 init_print_state(&state, shader, fp);
1697 fprintf(fp, "shader: %s\n", gl_shader_stage_name(shader->info.stage));
1699 fprintf(fp, "source_sha1: {");
1700 _mesa_sha1_print(fp, shader->info.source_sha1);
1701 fprintf(fp, "}\n");
1704 fprintf(fp, "name: %s\n", shader->info.name);
1707 fprintf(fp, "label: %s\n", shader->info.label);
1710 fprintf(fp, "workgroup-size: %u, %u, %u%s\n",
1715 fprintf(fp, "shared-size: %u\n", shader->info.shared_size);
1719 fprintf(fp, "task_payload-size: %u\n", shader->info.task_payload_size);
1722 fprintf(fp, "inputs: %u\n", shader->num_inputs);
1723 fprintf(fp, "outputs: %u\n", shader->num_outputs);
1724 fprintf(fp, "uniforms: %u\n", shader->num_uniforms);
1726 fprintf(fp, "ubos: %u\n", shader->info.num_ubos);
1727 fprintf(fp, "shared: %u\n", shader->info.shared_size);
1728 fprintf(fp, "ray queries: %u\n", shader->info.ray_queries);
1730 fprintf(fp, "scratch: %u\n", shader->scratch_size);
1732 fprintf(fp, "constants: %u\n", shader->constant_data_size);
1735 fprintf(fp, "invocations: %u\n", shader->info.gs.invocations);
1736 fprintf(fp, "vertices in: %u\n", shader->info.gs.vertices_in);
1737 fprintf(fp, "vertices out: %u\n", shader->info.gs.vertices_out);
1738 fprintf(fp, "input primitive: %s\n", primitive_name(shader->info.gs.input_primitive));
1739 fprintf(fp, "output primitive: %s\n", primitive_name(shader->info.gs.output_primitive));
1740 fprintf(fp, "active_stream_mask: 0x%x\n", shader->info.gs.active_stream_mask);
1741 fprintf(fp, "uses_end_primitive: %u\n", shader->info.gs.uses_end_primitive);
1743 fprintf(fp, "output primitive: %s\n", primitive_name(shader->info.mesh.primitive_type));
1744 fprintf(fp, "max primitives out: %u\n", shader->info.mesh.max_primitives_out);
1745 fprintf(fp, "max vertices out: %u\n", shader->info.mesh.max_vertices_out);
1759 nir_print_shader(nir_shader *shader, FILE *fp)
1761 nir_print_shader_annotated(shader, fp, NULL);
1762 fflush(fp);
1793 nir_print_instr(const nir_instr *instr, FILE *fp)
1796 .fp = fp,
1808 nir_print_deref(const nir_deref_instr *deref, FILE *fp)
1811 .fp = fp,