Lines Matching refs:state
60 struct state {
83 printf("%08x: ", (uint32_t)((char *)&field - state->buf)); \
90 printf("%s%12s:\t0x%x\n", tab(state->lvl), #field, s->field); \
97 printf("%s%12s:\t%u\n", tab(state->lvl), #field, s->field); \
104 printf("%s%12s:\t%f (0x%0x)\n", tab(state->lvl), #field, uif(s->field), \
112 printf("%s%12s:\t%c%u.%c\n", tab(state->lvl), #field, type, \
120 printf("%s%12s:\t%s\n", tab(state->lvl), #field, s->field); \
128 dump_unknown(state, s->unk_##start##_##end, 0x##start, \
135 assert(s->field < state->sz); \
136 void *_p = &state->buf[s->field]; \
137 state->lvl++; \
138 decode_##type(state, _p); \
139 state->lvl--; \
143 static void decode_shader_info(struct state *state, struct shader_info *info);
146 dump_unknown(struct state *state, void *buf, unsigned start, unsigned n)
155 printf("%08x:", (uint32_t)((char *)&ptr[i] - state->buf));
157 printf("%s %04x:\t%08x", tab(state->lvl), start + i * 4, d);
172 if ((d < state->sz) && isascii(state->buf[d]) &&
173 (strlen(&state->buf[d]) > 2) && isascii(state->buf[d + 1]))
174 printf("\t<== %s", &state->buf[d]);
199 decode_header(struct state *state, struct header *hdr)
208 state->shader_type = "FRAG";
211 state->shader_type = "VERT";
218 state->shader_type = "BVERT";
225 dump_unknown(state, (void *)hdr + sizeof(*hdr), sizeof(*hdr),
235 decode_shader_entry_point(struct state *state, struct shader_entry_point *e)
247 decode_shader_config(struct state *state, struct shader_config *cfg)
253 state->full_regs = cfg->full_regs;
254 state->half_regs = cfg->half_regs;
257 dump_unknown(state, (void *)cfg + sizeof(*cfg), sizeof(*cfg),
258 (state->desc_size - sizeof(*cfg)) / 4);
268 decode_shader_io_block(struct state *state, struct shader_io_block *io)
282 decode_shader_constant_block(struct state *state,
313 decode_shader_descriptor_block(struct state *state,
323 void *ptr = state->shader + blk->offset;
331 state->desc_size = blk->size / blk->count;
332 state->lvl++;
336 printf("%sentry point %u:\n", tab(state->lvl - 1), i);
337 decode_shader_entry_point(state, ptr);
340 printf("%sconfig %u:\n", tab(state->lvl - 1), i);
341 decode_shader_config(state, ptr);
344 printf("%sinput %u:\n", tab(state->lvl - 1), i);
345 decode_shader_io_block(state, ptr);
348 printf("%soutput %u:\n", tab(state->lvl - 1), i);
349 decode_shader_io_block(state, ptr);
352 printf("%sinternal input %u:\n", tab(state->lvl - 1), i);
353 decode_shader_io_block(state, ptr);
356 printf("%sconstant %u:\n", tab(state->lvl - 1), i);
357 decode_shader_constant_block(state, ptr);
361 printf("%sshader %u:\n", tab(state->lvl - 1), i);
362 disasm_a3xx_stat(ptr, blk->size / 4, state->lvl, stdout, gpu_id,
373 unsigned half_regs = state->half_regs;
374 unsigned full_regs = state->full_regs;
392 state->shader_type, stats.instructions, stats.nops,
405 dump_unknown(state, ptr, 0, state->desc_size / 4);
408 ptr += state->desc_size;
410 state->lvl--;
423 decode_shader_info(struct state *state, struct shader_info *info)
431 dump_unknown(state, &info[1], 0, (info->desc_off - sizeof(*info)) / 4);
433 state->shader = info;
437 printf("%sdescriptor %u:\n", tab(state->lvl), i);
438 state->lvl++;
439 decode_shader_descriptor_block(state, &blocks[i]);
440 state->lvl--;
445 dump_program(struct state *state)
447 struct header *hdr = (void *)state->buf;
450 dump_unknown(state, state->buf, 0, state->sz / 4);
452 decode_header(state, hdr);
535 struct state state = {
541 dump_program(&state);
580 struct state state = {
587 dump_program(&state);