1
\$\begingroup\$

At first I thought that ComputeBuffer's could only be used in compute shaders and that GraphicsBuffer's could only be used in materials. But Unity provides overloads for setting ComputeBuffer and GraphicsBuffer to both compute shaders and materials. So how do they differ?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

It seems that they differ in the type of data that they can hold. A GraphicsBuffer can be used for vertex and index buffers, while a ComputeBuffer can be used for any arbitrary data, which is mostly needed for compute shaders.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Don't forget to mark this answer as Accepted if it solved your problem. \$\endgroup\$
    – DMGregory
    Commented Mar 10, 2022 at 11:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .