Advanced API Performance: Shaders (original) (raw)

A graphic of a computer sending code to multiple stacks.

This post covers best practices when working with shaders on NVIDIA GPUs. To get a high and consistent frame rate in your applications, see all Advanced API Performance tips.

Shaders play a critical role in graphics programming by enabling you to control various aspects of the rendering process. They run on the GPU and are responsible for manipulating vertices, pixels, and other data.

General shaders

These tips apply to all types of shaders.

Compute shaders

Compute shaders are used for general-purpose computations, from data processing and simulations to machine learning.

Pixel shaders

Pixel shaders, also known as fragment shaders, are used to calculate effects on a per-pixel basis.

Vertex shaders

Vertex shaders are used to calculate effects on a per-vertex basis.

Geometry, domain, and hull shaders

Geometry, domain, and hull shaders are used to control, evaluate, and generate geometry, enabling tessellation to create a dynamic generation of surfaces and objects.

Acknowledgments

Thanks to Ryan Prescott, Ana Mihut, Katherine Sun, and Ivan Fedorov.

Tags

About the Authors