Beispiel #1
0
void
util_dump_shader_state(FILE *stream, const struct pipe_shader_state *state)
{
   unsigned i;

   if (!state) {
      util_dump_null(stream);
      return;
   }

   util_dump_struct_begin(stream, "pipe_shader_state");

   if (state->type == PIPE_SHADER_IR_TGSI) {
      util_dump_member_begin(stream, "tokens");
      fprintf(stream, "\"\n");
      tgsi_dump_to_file(state->tokens, 0, stream);
      fprintf(stream, "\"");
      util_dump_member_end(stream);
   }

   if (state->stream_output.num_outputs) {
      util_dump_member_begin(stream, "stream_output");
      util_dump_struct_begin(stream, "pipe_stream_output_info");
      util_dump_member(stream, uint, &state->stream_output, num_outputs);
      util_dump_array(stream, uint, state->stream_output.stride,
                      ARRAY_SIZE(state->stream_output.stride));
      util_dump_array_begin(stream);
      for(i = 0; i < state->stream_output.num_outputs; ++i) {
         util_dump_elem_begin(stream);
         util_dump_struct_begin(stream, ""); /* anonymous */
         util_dump_member(stream, uint, &state->stream_output.output[i], register_index);
         util_dump_member(stream, uint, &state->stream_output.output[i], start_component);
         util_dump_member(stream, uint, &state->stream_output.output[i], num_components);
         util_dump_member(stream, uint, &state->stream_output.output[i], output_buffer);
         util_dump_struct_end(stream);
         util_dump_elem_end(stream);
      }
      util_dump_array_end(stream);
      util_dump_struct_end(stream);
      util_dump_member_end(stream);
   }

   util_dump_struct_end(stream);
}
Beispiel #2
0
void
tgsi_dump(const struct tgsi_token *tokens, uint flags)
{
   tgsi_dump_to_file(tokens, flags, NULL);
}