void
v3d_field_iterator_init(struct v3d_field_iterator *iter,
struct v3d_group *group,
- const uint8_t *p,
- bool print_colors)
+ const uint8_t *p)
{
memset(iter, 0, sizeof(*iter));
iter->group = group;
iter->p = p;
- iter->print_colors = print_colors;
}
static const char *
enum_name = v3d_get_enum_name(&iter->field->inline_enum, value);
break;
}
- case V3D_TYPE_BOOL: {
- const char *true_string =
- iter->print_colors ? "\e[0;35mtrue\e[0m" : "true";
+ case V3D_TYPE_BOOL:
snprintf(iter->value, sizeof(iter->value), "%s",
__gen_unpack_uint(iter->p, s, e) ?
- true_string : "false");
+ "1 /* true */" : "0 /* false */");
break;
- }
case V3D_TYPE_FLOAT:
snprintf(iter->value, sizeof(iter->value), "%f",
__gen_unpack_float(iter->p, s, e));
void
v3d_print_group(struct clif_dump *clif, struct v3d_group *group,
- uint64_t offset, const uint8_t *p, bool color)
+ uint64_t offset, const uint8_t *p)
{
struct v3d_field_iterator iter;
- v3d_field_iterator_init(&iter, group, p, color);
+ v3d_field_iterator_init(&iter, group, p);
while (v3d_field_iterator_next(&iter)) {
fprintf(clif->out, " %s: %s\n", iter.name, iter.value);
if (iter.struct_desc) {
uint64_t struct_offset = offset + iter.offset;
v3d_print_group(clif, iter.struct_desc,
struct_offset,
- &p[iter.offset], color);
+ &p[iter.offset]);
}
}
}
int group_iter;
struct v3d_field *field;
- bool print_colors;
};
struct v3d_group {
void v3d_field_iterator_init(struct v3d_field_iterator *iter,
struct v3d_group *group,
- const uint8_t *p,
- bool print_colors);
+ const uint8_t *p);
bool v3d_field_iterator_next(struct v3d_field_iterator *iter);
void v3d_print_group(struct clif_dump *clif,
struct v3d_group *group,
- uint64_t offset, const uint8_t *p,
- bool color);
+ uint64_t offset, const uint8_t *p);
#endif /* V3D_DECODER_H */
assert(attr);
out(clif, "GL Shader State Record at 0x%08x\n", reloc->addr);
- v3d_print_group(clif, state, 0, vaddr, "");
+ v3d_print_group(clif, state, 0, vaddr);
vaddr += v3d_group_get_length(state);
for (int i = 0; i < reloc->shader_state.num_attrs; i++) {
out(clif, " Attribute %d\n", i);
- v3d_print_group(clif, attr, 0, vaddr, "");
+ v3d_print_group(clif, attr, 0, vaddr);
vaddr += v3d_group_get_length(attr);
}
}
*size = v3d_group_get_length(inst);
out(clif, "%s\n", v3d_group_get_name(inst));
- v3d_print_group(clif, inst, 0, cl, "");
+ v3d_print_group(clif, inst, 0, cl);
switch (*cl) {
case V3DX(GL_SHADER_STATE_opcode): {
cl += *size;
for (int i = 0; i < values.number_of_16_bit_output_data_specs_following; i++) {
- v3d_print_group(clif, spec, 0, cl, "");
+ v3d_print_group(clif, spec, 0, cl);
cl += v3d_group_get_length(spec);
*size += v3d_group_get_length(spec);
}
cl += *size;
for (int i = 0; i < values.number_of_16_bit_output_data_specs_following; i++) {
- v3d_print_group(clif, spec, 0, cl, "");
+ v3d_print_group(clif, spec, 0, cl);
cl += v3d_group_get_length(spec);
*size += v3d_group_get_length(spec);
}
for (int i = 0; i < values.number_of_32_bit_output_buffer_address_following; i++) {
- v3d_print_group(clif, addr, 0, cl, "");
+ v3d_print_group(clif, addr, 0, cl);
cl += v3d_group_get_length(addr);
*size += v3d_group_get_length(addr);
}
fprintf(stderr, "0x%08x 0x%08x: 0x%02x %s\n",
offset, hw_offset, header, v3d_group_get_name(inst));
- v3d_print_group(clif, inst, offset, p, "");
+ v3d_print_group(clif, inst, offset, p);
switch (header) {
case VC4_PACKET_HALT: