Each pipeline step run's in parallel or each pipeline process?

Started by
3 comments, last by babaliaris 4 years, 11 months ago

Hello!

I'm reading these tutorials and in some point it says:

Quote

The graphics pipeline takes as input a set of 3D coordinates and transforms these to colored 2D pixels on your screen. The graphics pipeline can be divided into several steps where each step requires the output of the previous step as its input. All of these steps are highly specialized (they have one specific function) and can easily be executed in parallel. Because of their parallel nature, graphics cards of today have thousands of small processing cores to quickly process your data within the graphics pipeline by running small programs on the GPU for each step of the pipeline. These small programs are called shaders.

 

I'm confused here. How can each step require the output of the previous step as it's input but they can also run in parallel? I mean, while the vertex shader is running how can the fragment shader for example run at the same time? It must wait until all the previous steps in the pipeline has finished in order to to get the input from the rasterizer and then run.

Does he mean that each pipeline process can run in parallel but each process must finish in a linear way step by step? This is the only that make sense to me.

Until now I was imagining that each draw call is actually instantiating a new pipeline process and each of these processes can run in parallel. Also I was imagining gl draw calls (like glDrawElements() ) like non blocking calls.

So which one is the truth?

Thank you :)


void life()
{
  while (!succeed())
    try_again();

  die_happily();
}

 

Advertisement

Yes, each single pipeline stage can only work on the data of the previous stage, but there are thousands of pipelines running in parallel.

Embarrassing, isn't it ?

?

 

Edit: oh, by the way, those tutorials you linked really helped me a lot.

1 hour ago, babaliaris said:

Does he mean that each pipeline process can run in parallel but each process must finish in a linear way step by step? This is the only that make sense to me.

1

Somehow, but most of the substeps can run in parallel and you can also have multiple pipelines being executed at the same time.

Imagine rendering a triangle. It consists of 3 vertices. Transforming each of them to screen space in a vertex shader can be done in parallel since they don't depend on each other. After they have been placed, the rasterizer figures out, how many pixels on the screen are affected by the new triangle. This can only be done if all vertex shaders have run. For each pixel, a fragment shader is started, also in parallel.

Of course, the fragment shader of the current triangle can only be executed after its vertex shader, but usually, you have more than one triangle to render, so while the fragment shader of your first triangle is executed, there might be some other triangles vertex and fragment shaders, that are also executed at the same time. ;)

 

Quote

Edit: oh, by the way, those tutorials you linked really helped me a lot. 

Yep, they are great. Can't wait until the author finishes ihisVulkan tutorials :)

18 minutes ago, DerTroll said:

Somehow, but most of the substeps can run in parallel and you can also have multiple pipelines being executed at the same time.

Imagine rendering a triangle. It consists of 3 vertices. Transforming each of them to screen space in a vertex shader can be done in parallel since they don't depend on each other. After they have been placed, the rasterizer figures out, how many pixels on the screen are affected by the new triangle. This can only be done if all vertex shaders have run. For each pixel, a fragment shader is started, also in parallel.

Of course, the fragment shader of the current triangle can only be executed after its vertex shader, but usually, you have more than one triangle to render, so while the fragment shader of your first triangle is executed, there might be some other triangles vertex and fragment shaders, that are also executed at the same time. ;)

 

Yep, they are great. Can't wait until the author finishes ihisVulkan tutorials :)

This answer helped me a lot!!! Thanks!


void life()
{
  while (!succeed())
    try_again();

  die_happily();
}

 

This topic is closed to new replies.

Advertisement