Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Numthreads best practices?

Discussion in 'Shaders' started by Bas-Smit, Aug 6, 2019.

  1. Bas-Smit

    Bas-Smit

    Joined:
    Dec 23, 2012
    Posts:
    274
    Hi, when writing compute shaders are there any best practices to follow when deciding on the values of the numthreads attribute and dispatch call? For one I know that the product of the numthreads values can not exceed 1024, but should I use the largest values possible? Im assuming its sub optimal to use
    [numthreads(1, 1, 1)]
    then dispatch using the problem dimensions?

    Thanks, Bas