<s>
OpenGL	B-Language
Shading	I-Language
Language	I-Language
(	O
GLSL	B-Language
)	O
is	O
a	O
high-level	B-Language
shading	I-Language
language	I-Language
with	O
a	O
syntax	O
based	O
on	O
the	O
C	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
It	O
was	O
created	O
by	O
the	O
OpenGL	B-Application
ARB	B-Language
(	O
OpenGL	B-Application
Architecture	O
Review	O
Board	O
)	O
to	O
give	O
developers	O
more	O
direct	O
control	O
of	O
the	O
graphics	B-General_Concept
pipeline	I-General_Concept
without	O
having	O
to	O
use	O
ARB	B-Language
assembly	I-Language
language	I-Language
or	O
hardware-specific	O
languages	O
.	O
</s>
<s>
With	O
advances	O
in	O
graphics	O
cards	O
,	O
new	O
features	O
have	O
been	O
added	O
to	O
allow	O
for	O
increased	O
flexibility	O
in	O
the	O
rendering	B-General_Concept
pipeline	I-General_Concept
at	O
the	O
vertex	O
and	O
fragment	O
level	O
.	O
</s>
<s>
Originally	O
,	O
this	O
functionality	O
was	O
achieved	O
by	O
writing	O
shaders	O
in	O
ARB	B-Language
assembly	I-Language
language	I-Language
–	O
a	O
complex	O
and	O
unintuitive	O
task	O
.	O
</s>
<s>
The	O
OpenGL	B-Application
ARB	B-Language
created	O
the	O
OpenGL	B-Language
Shading	I-Language
Language	I-Language
to	O
provide	O
a	O
more	O
intuitive	O
method	O
for	O
programming	O
the	O
graphics	B-Architecture
processing	I-Architecture
unit	I-Architecture
while	O
maintaining	O
the	O
open	O
standards	O
advantage	O
that	O
has	O
driven	O
OpenGL	B-Application
throughout	O
its	O
history	O
.	O
</s>
<s>
Originally	O
introduced	O
as	O
an	O
extension	O
to	O
OpenGL	B-Application
1.4	O
,	O
GLSL	B-Language
was	O
formally	O
included	O
into	O
the	O
OpenGL	B-Application
2.0	O
core	O
in	O
2004	O
by	O
the	O
OpenGL	B-Application
ARB	B-Language
.	O
</s>
<s>
It	O
was	O
the	O
first	O
major	O
revision	O
to	O
OpenGL	B-Application
since	O
the	O
creation	O
of	O
OpenGL	B-Application
1.0	O
in	O
1992	O
.	O
</s>
<s>
Some	O
benefits	O
of	O
using	O
GLSL	B-Language
are	O
:	O
</s>
<s>
Cross-platform	B-Operating_System
compatibility	O
on	O
multiple	O
operating	O
systems	O
,	O
including	O
Linux	B-Application
,	O
macOS	B-Application
and	O
Windows	B-Application
.	O
</s>
<s>
The	O
ability	O
to	O
write	O
shaders	O
that	O
can	O
be	O
used	O
on	O
any	O
hardware	O
vendor	O
's	O
graphics	O
card	O
that	O
supports	O
the	O
OpenGL	B-Language
Shading	I-Language
Language	I-Language
.	O
</s>
<s>
Each	O
hardware	O
vendor	O
includes	O
the	O
GLSL	B-Language
compiler	O
in	O
their	O
driver	O
,	O
thus	O
allowing	O
each	O
vendor	O
to	O
create	O
code	O
optimized	O
for	O
their	O
particular	O
graphics	O
card	O
’s	O
architecture	O
.	O
</s>
<s>
GLSL	B-Language
versions	O
have	O
evolved	O
alongside	O
specific	O
versions	O
of	O
the	O
OpenGL	B-Application
API	O
.	O
</s>
<s>
It	O
is	O
only	O
with	O
OpenGL	B-Application
versions	O
3.3	O
and	O
above	O
that	O
the	O
GLSL	B-Language
and	O
OpenGL	B-Application
major	O
and	O
minor	O
version	O
numbers	O
match	O
.	O
</s>
<s>
These	O
versions	O
for	O
GLSL	B-Language
and	O
OpenGL	B-Application
are	O
related	O
in	O
the	O
following	O
table	O
:	O
</s>
<s>
OpenGL	B-Application
ES	I-Application
and	O
WebGL	B-Library
use	O
OpenGL	B-Application
ES	I-Application
Shading	B-Language
Language	I-Language
(	O
abbreviated	O
:	O
GLSL	B-Language
ES	O
or	O
ESSL	O
)	O
.	O
</s>
<s>
They	O
can	O
be	O
interconverted	O
through	O
SPIRV-Cross	B-Application
.	O
</s>
<s>
GLSL	B-Language
contains	O
the	O
same	O
operators	O
as	O
the	O
operators	B-Language
in	I-Language
C	I-Language
and	I-Language
C++	I-Language
,	O
with	O
the	O
exception	O
of	O
pointers	O
.	O
</s>
<s>
Similar	O
to	O
the	O
C	B-Language
programming	I-Language
language	I-Language
,	O
GLSL	B-Language
supports	O
loops	O
and	O
branching	O
,	O
for	O
instance	O
:	O
if-else	O
,	O
for	O
,	O
switch	O
,	O
etc	O
.	O
</s>
<s>
Many	O
of	O
these	O
functions	O
are	O
similar	O
to	O
those	O
in	O
the	O
math	O
library	O
of	O
the	O
C	B-Language
programming	I-Language
language	I-Language
while	O
others	O
are	O
specific	O
to	O
graphics	O
programming	O
.	O
</s>
<s>
GLSL	B-Language
supports	O
function	B-Language
overloading	I-Language
(	O
for	O
both	O
built-in	O
functions	O
and	O
operators	O
,	O
and	O
user-defined	O
functions	O
)	O
,	O
so	O
there	O
might	O
be	O
multiple	O
function	O
definitions	O
with	O
the	O
same	O
name	O
,	O
having	O
different	O
number	O
of	O
parameters	O
or	O
parameter	O
types	O
.	O
</s>
<s>
GLSL	B-Language
defines	O
a	O
subset	O
of	O
the	O
C	B-Language
preprocessor	I-Language
(	O
CPP	O
)	O
,	O
combined	O
with	O
its	O
own	O
special	O
directives	O
for	O
specifying	O
versions	O
and	O
OpenGL	B-Application
extensions	O
.	O
</s>
<s>
The	O
extension	O
(	O
implemented	O
for	O
example	O
in	O
Nvidia	O
drivers	O
on	O
Windows	B-Application
and	O
Linux	B-Application
,	O
and	O
all	O
Mesa	O
20.0.0	O
drivers	O
on	O
Linux	B-Application
,	O
FreeBSD	O
and	O
Android	O
)	O
implements	O
ability	O
to	O
use	O
in	O
source	O
code	O
,	O
allowing	O
easier	O
sharing	O
of	O
code	O
and	O
definitions	O
between	O
many	O
shaders	O
without	O
extra	O
manual	O
pre-processing	O
.	O
</s>
<s>
Similar	O
extension	O
and	O
exist	O
for	O
using	O
GLSL	B-Language
with	O
Vulkan	B-Application
,	O
and	O
are	O
supported	O
in	O
reference	O
SPIR-V	B-Application
compiler	O
(	O
aka	O
glslangValidator	O
)	O
.	O
</s>
<s>
GLSL	B-Language
shaders	O
are	O
not	O
stand-alone	O
applications	O
;	O
they	O
require	O
an	O
application	O
that	O
utilizes	O
the	O
OpenGL	B-Application
API	O
,	O
which	O
is	O
available	O
on	O
many	O
different	O
platforms	O
(	O
e.g.	O
,	O
Linux	B-Application
,	O
macOS	B-Application
,	O
Windows	B-Application
)	O
.	O
</s>
<s>
There	O
are	O
language	O
bindings	O
for	O
C	B-Language
,	O
C++	B-Language
,	O
C#	B-Application
,	O
JavaScript	B-Language
,	O
Delphi	B-Language
,	O
Java	B-Language
,	O
and	O
many	O
more	O
.	O
</s>
<s>
GLSL	B-Language
shaders	O
themselves	O
are	O
simply	O
a	O
set	O
of	O
strings	O
that	O
are	O
passed	O
to	O
the	O
hardware	O
vendor	O
's	O
driver	O
for	O
compilation	O
from	O
within	O
an	O
application	O
using	O
the	O
OpenGL	B-Application
API	O
's	O
entry	O
points	O
.	O
</s>
<s>
The	O
set	O
of	O
APIs	O
used	O
to	O
compile	O
,	O
link	O
,	O
and	O
pass	O
parameters	O
to	O
GLSL	B-Language
programs	O
are	O
specified	O
in	O
three	O
OpenGL	B-Application
extensions	O
,	O
and	O
became	O
part	O
of	O
core	O
OpenGL	B-Application
as	O
of	O
OpenGL	B-Application
Version	O
2.0	O
.	O
</s>
<s>
The	O
API	O
was	O
expanded	O
with	O
geometry	O
shaders	O
in	O
OpenGL	B-Application
3.2	O
,	O
tessellation	O
shaders	O
in	O
OpenGL	B-Application
4.0	O
and	O
compute	B-Operating_System
shaders	I-Operating_System
in	O
OpenGL	B-Application
4.3	O
.	O
</s>
<s>
These	O
OpenGL	B-Application
APIs	O
are	O
found	O
in	O
the	O
extensions	O
:	O
</s>
<s>
GLSL	B-Language
shaders	O
can	O
also	O
be	O
used	O
with	O
Vulkan	B-Application
,	O
and	O
are	O
a	O
common	O
way	O
of	O
using	O
shaders	O
in	O
Vulkan	B-Application
.	O
</s>
<s>
GLSL	B-Language
shaders	O
are	O
precompiled	O
before	O
use	O
,	O
or	O
at	O
runtime	O
,	O
into	O
a	O
binary	O
bytecode	O
format	O
called	O
SPIR-V	B-Application
,	O
usually	O
using	O
offline	O
compiler	O
.	O
</s>
