Skip to content
Snippets Groups Projects

vkd3d-shader/tpf: Create a stub STAT section.

Merged Nikolay Sivov requested to merge nsivov/vkd3d:stat into master
3 unresolved threads

What needs to be reviewed here is additional offset field is considered clean enough. Looking through fields we'll need to set, so far I don't immediately see a case where single instruction needs to touch more than one category. Should a need for that emerge, we could have another per-instruction function.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
6149
6150 put_u32(&buffer, stat->instr_count);
6151 put_u32(&buffer, 0); /* Temp count */
6152 put_u32(&buffer, 0); /* Def count */
6153 put_u32(&buffer, 0); /* DCL count */
6154 put_u32(&buffer, 0); /* Float instruction count */
6155 put_u32(&buffer, 0); /* Int instruction count */
6156 put_u32(&buffer, 0); /* Uint instruction count */
6157 put_u32(&buffer, 0); /* Static flow control count */
6158 put_u32(&buffer, 0); /* Dynamic flow control count */
6159 put_u32(&buffer, 0); /* Macro instruction count */
6160 put_u32(&buffer, 0); /* Temp array count */
6161 put_u32(&buffer, 0); /* Array instr count */
6162 put_u32(&buffer, 0); /* Cut instr count */
6163 put_u32(&buffer, 0); /* Emit instr count */
6164 put_u32(&buffer, 0); /* Texture instructions */
  • Elizabeth Figura
  • Elizabeth Figura
    • "emitThenCut" is another instruction that may plausibly be counted in two different fields.

    • Author Developer

      That's a good point. dxc compiler does update both counters, so it makes sense to do the same.

      Because of that updating existing table is unnecessary, I'll add another helper just for counters.

    • To be fair if it's the only such case, and most instructions correspond to a STAT entry otherwise, it may still be reasonable to reuse this table and just special case emitThenCut. I don't know and I'm not having a strong opinion.

    • Author Developer

      Having just a switch is the most flexible, and does not touch too much of existing code. Flow control counters correspond to branching (dynamic counter) and the rest that are "static", I know discard is, and probably continue/break are as well. So this could be counted directly as well, by opening if/loop/...

      @hverbeet @giomasce do you have an opinion on how to structure this? Two choices to far are to add some extra data to opcode table, or a helper to touch counters directly.

    • I don't have a strong opinion either. The current proposal looks fine to me. It's all private stuff anyway, so it's easy to change in the future as needed.

    • Please register or sign in to reply
  • Nikolay Sivov added 1 commit

    added 1 commit

    • 7fd9197d - vkd3d-shader/tpf: Create a stub STAT section.

    Compare with previous version

  • @hverbeet @giomasce do you have an opinion on how to structure this? Two choices to far are to add some extra data to opcode table, or a helper to touch counters directly.

    I think either of those can work. Note that you don't necessarily need to store the information in opcode_table[] either; other options would be to add a separate table to struct vkd3d_sm4_lookup_tables, or to add the field to struct vkd3d_sm4_opcode_info but using a separate table to initialise that field.

  • Nikolay Sivov added 1 commit

    added 1 commit

    • 4efb6395 - vkd3d-shader/tpf: Create a stub STAT section.

    Compare with previous version

  • Author Developer

    Pushed another variant, where offsets are specified separately, so that additional data table could grow independently while we fill in more fields.

  • Elizabeth Figura approved this merge request

    approved this merge request

  • Nikolay Sivov added 44 commits

    added 44 commits

    Compare with previous version

  • Henri Verbeet approved this merge request

    approved this merge request

  • Henri Verbeet added 4 commits

    added 4 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading