<s>
Standard	B-Application
Portable	I-Application
Intermediate	I-Application
Representation	I-Application
(	O
SPIR	O
)	O
is	O
an	O
intermediate	O
language	O
for	O
parallel	B-Architecture
compute	I-Architecture
and	O
graphics	O
by	O
Khronos	B-Library
Group	I-Library
.	O
</s>
<s>
It	O
is	O
used	O
in	O
multiple	O
execution	O
environments	O
,	O
including	O
the	O
Vulkan	B-Application
graphics	I-Application
API	I-Application
and	O
the	O
OpenCL	B-Application
compute	O
API	O
,	O
to	O
represent	O
a	O
shader	O
or	O
kernel	B-Operating_System
.	O
</s>
<s>
SPIR-V	B-Application
was	O
introduced	O
in	O
2015	O
by	O
the	B-Library
Khronos	I-Library
Group	I-Library
,	O
and	O
has	O
since	O
replaced	O
the	O
original	O
SPIR	O
,	O
which	O
was	O
introduced	O
in	O
2012	O
.	O
</s>
<s>
The	O
purposes	O
of	O
SPIR-V	B-Application
are	O
to	O
natively	O
represent	O
the	O
primitives	O
needed	O
by	O
compute	O
and	O
graphics	O
;	O
to	O
separate	O
high-level	O
language	O
from	O
the	O
interface	O
to	O
compute	O
and	O
graphics	O
drivers	O
;	O
to	O
be	O
the	O
distribution	O
form	O
,	O
or	O
distribute	O
fully	O
compiled	O
binaries	O
;	O
to	O
be	O
a	O
fully	O
self-contained	O
specification	O
;	O
and	O
to	O
support	O
multiple	O
APIs	O
.	O
</s>
<s>
For	O
example	O
,	O
SPIR-V	B-Application
allows	O
the	O
Vulkan	B-Application
API	I-Application
to	O
use	O
any	O
shading	B-Language
language	I-Language
,	O
including	O
GLSL	B-Language
and	O
HLSL	B-Language
.	O
</s>
<s>
SPIR-V	B-Application
can	O
be	O
compiled	O
into	O
several	O
shading	B-Language
languages	I-Language
(	O
GLSL	B-Language
,	O
GLSL	B-Language
ES	O
,	O
MSL	O
,	O
HLSL	B-Language
)	O
using	O
SPIRV-Cross	O
,	O
so	O
that	O
these	O
languages	O
can	O
be	O
interconverted	O
.	O
</s>
<s>
It	O
also	O
has	O
paths	O
to	O
and/or	O
from	O
WebGPU	B-Operating_System
,	O
OpenCL	B-Application
,	O
SYCL	B-Language
,	O
C++	B-Language
,	O
and	O
Rust	B-Application
.	O
</s>
<s>
In	O
target	O
platforms	O
,	O
ingesting	O
SPIR-V	B-Application
removes	O
the	O
need	O
to	O
build	O
a	O
high-level	O
language	O
source	O
compiler	O
into	O
device	O
drivers	O
,	O
which	O
reduces	O
driver	O
complexity	O
.	O
</s>
<s>
SPIR	O
was	O
originally	O
introduced	O
in	O
2011	O
and	O
SPIR-V	B-Application
was	O
introduced	O
in	O
2015	O
.	O
</s>
<s>
SPIR	O
prior	O
to	O
the	O
2015	O
SPIR-V	B-Application
release	O
was	O
based	O
on	O
the	O
LLVM	O
Intermediate	O
Representation	O
.	O
</s>
<s>
SPIR-V	B-Application
does	O
not	O
use	O
LLVM	O
.	O
</s>
<s>
SPIR-V	B-Application
1.0	O
is	O
a	O
new	O
version	O
of	O
SPIR	O
announced	O
in	O
March	O
2015	O
,	O
and	O
released	O
on	O
November	O
16	O
,	O
2015	O
.	O
</s>
<s>
The	O
SPIR	O
family	O
now	O
includes	O
a	O
true	O
cross-API	O
standard	O
that	O
is	O
fully	O
defined	O
by	O
Khronos	B-Library
with	O
native	O
support	O
for	O
shader	O
and	O
kernel	B-Operating_System
features	O
.	O
</s>
<s>
A	O
separate	O
program	O
by	O
the	B-Library
Khronos	I-Library
Group	I-Library
allows	O
for	O
interconversion	O
with	O
LLVM	O
IR	O
.	O
</s>
<s>
Support	O
for	O
ingestion	O
of	O
SPIR-V	B-Application
is	O
incorporated	O
in	O
the	O
core	O
specification	O
of	O
OpenCL	B-Application
2.1	O
,	O
the	O
Vulkan	B-Application
API	I-Application
,	O
and	O
OpenGL	B-Application
version	O
4.6	O
.	O
</s>
<s>
+	O
SPIR-V	B-Application
ReleasesDateVersionNotesApril	O
18	O
,	O
20161.1Released	O
at	O
IWOCL	O
2016	O
along	O
with	O
Provisional	O
OpenCL	B-Application
2.2	O
.	O
</s>
<s>
SPIR-V	B-Application
1.1	O
added	O
support	O
for	O
OpenCL	B-Application
C++	B-Language
,	O
initializer/finalizer	O
function	O
execution	O
modes	O
,	O
named	O
barriers	O
,	O
subgroup	O
execution	O
,	O
program	O
scope	O
pipes	O
and	O
pipe	O
storage	O
.	O
</s>
<s>
May	O
16	O
,	O
20171.2Released	O
at	O
IWOCL	O
2017	O
along	O
with	O
OpenCL	B-Application
2.2	O
.	O
</s>
<s>
SPIR-V	B-Application
1.2	O
added	O
support	O
for	O
runtime	O
specialization	O
of	O
key	O
tuning	O
parameters	O
in	O
OpenCL	B-Application
2.2.March	O
7	O
,	O
20181.3Released	O
along	O
with	O
Vulkan	B-Application
1.1	I-Application
.	O
</s>
<s>
SPIR-V	B-Application
is	O
a	O
high-level	O
intermediate	O
language	O
,	O
exchanged	O
in	O
binary	O
form	O
.	O
</s>
<s>
SPIR-V	B-Application
can	O
be	O
extended	O
by	O
writing	O
extensions	O
to	O
add	O
semantics	O
,	O
or	O
reserving	O
ranges	O
of	O
the	O
token	O
values	O
for	O
the	O
party	O
's	O
use	O
.	O
</s>
<s>
Vendors	O
can	O
independently	O
add	O
desired	O
semantics	O
to	O
SPIR-V	B-Application
.	O
Additional	O
sets	O
of	O
extended	O
instruction	O
sets	O
can	O
be	O
provided	O
in	O
separate	O
specifications	O
.	O
</s>
<s>
Debuggers	O
include	O
RenderDoc	B-Application
,	O
SwiftShader	O
,	O
and	O
Amber	O
.	O
</s>
<s>
Graphical	O
shaders	O
use	O
structured	O
control	O
flow	O
in	O
SPIR-V	B-Application
to	O
state	O
how	O
control	O
flow	O
nests	O
.	O
</s>
<s>
The	O
SPIR-V	B-Application
specification	O
states	O
the	O
rules	O
that	O
must	O
be	O
followed	O
to	O
have	O
a	O
valid	O
SPIR-V	B-Application
module	O
.	O
</s>
<s>
Drivers	O
are	O
not	O
obligated	O
to	O
handle	O
invalid	O
SPIR-V	B-Application
modules	O
.	O
</s>
<s>
In	O
testing	O
,	O
conformance	O
testing	O
verifies	O
that	O
drivers	O
behave	O
correctly	O
when	O
consuming	O
valid	O
SPIR-V	B-Application
,	O
while	O
validators	O
verify	O
that	O
front-ends	O
properly	O
generate	O
SPIR-V	B-Application
.	O
</s>
<s>
SPIR-V	B-Application
can	O
express	O
calls	O
to	O
functions	O
in	O
a	O
different	O
compilation	O
unit	O
.	O
</s>
<s>
The	O
standard	O
version	O
of	O
SPIR-V	B-Application
uses	O
this	O
feature	O
for	O
OpenCL	B-Application
compute	B-Operating_System
kernels	I-Operating_System
,	O
but	O
not	O
for	O
shader	O
stages	O
,	O
which	O
the	O
graphical	O
APIs	O
want	O
fully	O
linked	O
into	O
a	O
single	O
SPIR-V	B-Application
module	O
.	O
</s>
<s>
There	O
are	O
extensions	O
available	O
to	O
allow	O
tools	O
to	O
temporarily	O
use	O
partially	O
linked	O
shaders	O
and	O
also	O
kernels	B-Operating_System
.	O
</s>
<s>
A	O
SPIR-V	B-Application
module	O
is	O
used	O
by	O
a	O
client	O
API	O
to	O
support	O
that	O
module	O
's	O
features	O
,	O
which	O
are	O
classified	O
through	O
capabilities	O
,	O
and	O
declared	O
early	O
in	O
the	O
module	O
.	O
</s>
<s>
SPIR-V	B-Application
has	O
been	O
used	O
to	O
help	O
deal	O
with	O
multiple	O
versions	O
of	O
source-level	O
languages	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
multiple	O
versions	O
of	O
OpenGL	B-Language
Shading	I-Language
Language	I-Language
(	O
GLSL	B-Language
)	O
require	O
distribution	O
of	O
multiple	O
versions	O
of	O
shaders	O
,	O
due	O
to	O
implementations	O
that	O
are	O
pegged	O
to	O
a	O
specific	O
older	O
version	O
of	O
GLSL	B-Language
,	O
such	O
as	O
for	O
WebGL	B-Library
1.0	I-Library
and	O
Apple	O
's	O
OpenGL	B-Application
implementation	O
.	O
</s>
<s>
One	O
of	O
the	O
notable	O
use	O
cases	O
of	O
SPIR-V	B-Application
is	O
its	O
ability	O
to	O
be	O
used	O
as	O
an	O
interchange	O
format	O
between	O
GLSL	B-Language
versions	O
,	O
using	O
tools	O
maintained	O
by	O
the	B-Library
Khronos	I-Library
Group	I-Library
for	O
compiling	O
GLSL	B-Language
to	O
SPIR-V	B-Application
glslangValidator	O
,	O
optimizing	O
SPIR-V	B-Application
spirv-opt	O
,	O
and	O
cross-compiling	O
to	O
SPIR-V	B-Application
to	O
different	O
GLSL	B-Language
targets	O
spirv-cross	O
.	O
</s>
<s>
As	O
a	O
format	O
,	O
however	O
,	O
SPIR-V	B-Application
has	O
some	O
limitations	O
for	O
cross-compilation	O
,	O
including	O
the	O
requirement	O
that	O
every	O
SPIR-V	B-Application
module	O
have	O
at	O
least	O
one	O
entry-point	O
symbol	O
.	O
</s>
<s>
This	O
runs	O
counter	O
to	O
the	O
stated	O
goals	O
of	O
some	O
SPIR-V	B-Application
tools	O
such	O
as	O
spirv-link	O
,	O
which	O
aims	O
to	O
provide	O
full	O
linking	O
functionality	O
for	O
SPIR-V	B-Application
binary	O
code	O
.	O
</s>
