Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Compute Shader Performance Issues

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member Newbie
    Join Date
    Oct 2017

    Compute Shader Performance Issues

    I'm implementing a rigid body physics system with compute shaders. The problem I'm having is any time I use structs for my data I experience drops to under 1fps. For example, I have a radix sort for my broadphase collision, when I just sort vec4s as most compute shader demos do for particles I have no problem sorting 8192 bodies in under a millisecond, but as soon as I want to move the body structs around performance becomes sub-realtime.

    It's possible to sort with incides and a comparison value so the body SSBO only needs putting in order at the end, but things aren't a lot better and there are still physics operations where I can't really do this.

    If I cut the size of the body struct down performance slightly improves, but I don't think I can cut it down any more. In turn, if I make the struct artficially larger performance gets even worse. This makes it feel like a cache issue.

    Here is the struct I am trying to work with.

    Code :
    struct ConvexHull{
      vec3  position;
      uint enabled;
      vec3  half_ex;
      uint hash;
      vec4  verts_0[8];
      vec4  planes_n[6];
      vec4  planes_d[6];

    Has anybody had this problem or have any ideas for dealing with it?
    Last edited by krackaan; 10-25-2017 at 10:58 AM. Reason: Additional information

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts