My question is about GLSL language. When I run a for loop in a vertex shader, is the loop executed sequentially or in parallel on the GPU?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No single invocation of a shader is executed “in parallel”. Different invocations of the same shader (for example, the same vertex shader but given two different input values from two different vertices) are executed in parallel, but every shader acts sequentially (or if it doesn’t, it must behave as if it acts sequentially, which is the same thing).