Skip to content
Snippets Groups Projects

vkd3d: Allocate temporary arrays on the stack in d3d12_command_list_update_push_descriptors().

Merged Giovanni Mascellani requested to merge giomasce/vkd3d:flegrei into master
1 unresolved thread

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
  • Maybe it's already clear, but generally speaking the philosophy here is to avoid using the heap when the stack is good enough. It makes the code shorter, control flow simpler and we avoid potentially taking a global mutex inside the allocator. Also, currently failure is silently ignored, there is not even an error message.

  • Giovanni Mascellani approved this merge request

    approved this merge request

    • Maybe it's already clear, but generally speaking the philosophy here is to avoid using the heap when the stack is good enough.

      Is that primarily a performance consideration? Do you happen to have performance data? Also, if this is performance sensitive, should we be using something like wined3d_bit_scan() to iterate over the dirty mask?

    • Is that primarily a performance consideration? Do you happen to have performance data? Also, if this is performance sensitive, should we be using something like wined3d_bit_scan() to iterate over the dirty mask?

      No, it's not primarily a performance consideration. Well, in general I expect stack allocation and deallocation to be faster than heap allocation and deallocation, but I guess that the conditions under which the different matters in practice are not that common.

      My main motivation for preferring using the stack instead of the heap when possible (i.e., for sufficiently small objects whose lifetime coincides with a stack frame lifetime) is that allocation is assumed to never fail, so you have simpler code and fewer exceptional code paths to maintain (and I argue that we were bitten by this in this specific case). In addition that is likely to give a non-negative, even if often zero, performance gain.

      I haven't done any performance measurement here.

    • Please register or sign in to reply
  • Henri Verbeet approved this merge request

    approved this merge request

  • Henri Verbeet added 9 commits

    added 9 commits

    • b55eb4ae...ae0faf45 - 8 commits from branch wine:master
    • a876e0b1 - vkd3d: Allocate temporary arrays on the stack in d3d12_command_list_update_push_descriptors().

    Compare with previous version

Please register or sign in to reply
Loading