4
$\begingroup$

In GLSL: Common Mistakes it states:

Functions parameters must be declared with the in, out, or inout qualifiers.

but I have never declared function parameters with in, out, or inout qualifiers and I have never run into any problems. Could this be because of my specific graphics card? What are the side effects of not using the in, out, or inout qualifiers?

Info: I am using GLSL 3.3 and I have an Intel graphics card

$\endgroup$
6
$\begingroup$

The GLSL Specification in section 6.1.1 "Function Calling Conventions" states:

  • The keyword in is used as a qualifier to denote a parameter is to be copied in, but not copied out.

  • The keyword out is used as a qualifier to denote a parameter is to be copied out, but not copied in. This should be used whenever possible to avoid unnecessarily copying parameters in.

  • The keyword inout is used as a qualifier to denote the parameter is to be both copied in and copied out. It means the same thing as specifying both in and out.

  • A function parameter declared with no such qualifier means the same thing as specifying in.

$\endgroup$
  • 1
    $\begingroup$ It should be noted that this is true for all versions of GLSL, all the way back to 1.10 and even the ES versions. $\endgroup$ – Nicol Bolas Jun 4 '17 at 23:24

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.