Jump to content

Compute vs. Fragment shaders


Josh
 Share

Recommended Posts

Using a simple passthough shader that just samples a texture and writes to an output image, here are my results.

Framebuffer size is 1280x720
GPU: GEForce 1660
Optimal compute batchsize: 8x8
Optimal compute number of workers: 14400

 

 

1 pass:

Compute
FPS: 600

Fragment
FPS: 770

 

 

10 passes:

Compute
FPS: 180

Fragment
FPS: 670

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I think your results are correct. The compute shaders are great when you need more complex one time calculations or when you can benefit from cross thread calculations. Eg. Pass the result from one compute batch to another. Also it is very important either fragment or compute to align your memory for your uniforms or buffers in case of vulkan. 
in my experience, while compute shaders can be faster when used for certain scenarios modern fragment features can be better for others. Sometimes it is not only about performance but also about maintability of the code base. And the in my opinion compute shaders are very good, eg terrain editing or particle, agent simulation. 
one should always decide which one fits better to the subject of the shader.
 

  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...