Are loops held in series or parallel on gpu?

My question is about the GLSL language. When I run the for loop in the vertex shader, does the loop execute sequentially or in parallel on the GPU?

+4
source share
2 answers

No shader calls are made in parallel. Different calls to the same shader (for example, the same vertex shader, but with two different input values ​​from two different vertices) are executed in parallel, but each shader acts sequentially (or, if it does not, it should behave like this as if he acted sequentially, which is one and the same).

+3
source

It is carried out sequentially. Different instances of the Vertex shader program are executed in parallel among all processed triangles.

+1
source

Source: https://habr.com/ru/post/1444007/


All Articles