How Shaders map to actual GPU hardware

2

In an attempt to better understand GPU's and GPU programming, I would like to get a better mental picture of shaders and how they are implemented on the GPU. Is there a 1 to 1 relationship between a shader program and a GPU core? So does a vertex shader program run on one core while say the fragment shader run on another core? Then is data passed from the vertex shader core to the fragment shader core? Or is each individual core on a GPU responsible for all the shaders and the entire graphics pipeline? Meaning one GPU core contains the vertex shader, tessellation shader, geometry shader, etc. and each core will output a final pixel. Any information to help solidify my mental picture would be useful.

Boagz

Posted 2016-10-19T04:24:22.440

Reputation: 143

Answers

1

The exact relation depends on the card and the driver. Shader programs are converted from generic forms (OpenGL or DirectX, for example) into something that the card can run directly, kind of like just-in-time compilation for languages like Java that use bytecode.

Thus the relationship depends on the nature of the program and the card. The card may need to assign multiple cores if the program is large and complex, but more likely a single core will run many instances of the shader on multiple stream processors.

Modern cards assign work dynamically so there is rarely a 1:1 relationship. Each core has multiple stream processors so can handle multiple shaders simultaneously, if they are not too complex.

user237698

Posted 2016-10-19T04:24:22.440

Reputation: