3
$\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$
0

1 Answer 1

5
$\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
  • 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$ Commented Jun 4, 2017 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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