GPU shaders are generic computer programs written to be executed on a graphics processing unit (GPU). Shaders were originally programs running on hardware parts of GPUs which were specifically designed to do actual shading in 3D graphics. Modern "shaders" are executed on more general-purpose CUDA cores on Nvidia GPUs and GCN processors on AMD GPUs.
The first GPUs capable of shaders were limtied to pixel shading. Following GPU generations got vertex shaders. The Nvidia GeForce 3 (NV20) from 2001 got programmable pixer shaders. Eventually the graphics card "shader units" turned into more general-purpose compute units.
The AMD documentation for their Vega 7nm GPU products launched in 2019 describe "shaders" as:
"Compute kernels (shaders) are generic programs that can run on the GCN processor, taking data from memory, processing it, and writing results back to memory. Compute kernels are created by a dispatch, which causes the GCN processors to run the kernel over all of the workitems in a 1D, 2D, or 3D grid of data. The GCN processor walks through this grid and generates wavefronts, which then run the compute kernel. Each work-item is initialized with its unique address (index) within the grid. Based on this index, the work-item computes the address of the "Vega" 7nm Instruction Set Architecture data it is required to work on and what to do with the results."
It is of note that AMD refers to "shaders" as "Compute kernels (shaders)".
Programs written to run on a GPU is commonly referred to as shaders even though they in many cases have little or nothing at all to do with pixel shading.
- "Vega" 7nm Instruction Set Architecture Reference Guide published November 26th, 2019