3

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

Archmede
  • 481
  • 2
  • 7
  • 21

1 Answers1

5

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.

user1118321
  • 3,401
  • 11
  • 14
  • 1
    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. – Nicol Bolas Jun 04 '17 at 23:24