Featured Article

Vulkan Shaders: Language Explained

Cynthia Jul 13, 2026

When exploring the realm of Vulkan, a modern graphics and computing API developed by the Khronos Group, you might wonder, "What language are Vulkan shaders written in?" The answer lies at the intersection of programming and graphics, with three key language types taking center stage.

the letter t is made up of fire and lava
the letter t is made up of fire and lava

Vulkan shaders, or more specifically, Spir-V (Shading Language Portable Intermediate Representation) shaders, are written in a unique, intermediate, binary representation of a shading language. But before we delve into that, let's consider the three main languages used in Vulkan's ecosystem.

The Study of Vulcans
The Study of Vulcans

GLSL: The Graphics Shader Language

GLSL (OpenGL Shading Language) is a C-like, cross-platform, high-level shading language used in OpenGL and Vulkan. It supports functions, structures, arrays, and other features familiar to C programmers.

an old book with some type of writing on the pages and in different font styles
an old book with some type of writing on the pages and in different font styles

GLSL is where most Vulkan graphics work begins. It's human-readable, making it easier to write, debug, and optimize shaders. However, GLSL code isn't directly executable by the graphics processing unit (GPU).

GLSL to SPIR-V: The Compilation Process

Vulcan Script Font
Vulcan Script Font

Before a GLSL shader can be used in Vulkan, it must be compiled to SPIR-V. This process involves translating the high-level GLSL code into a lower-level, binary representation understood by the GPU.

Compilation can be done using various tools like `glslc` (included with Vulkan SDK) or SPIR-V Assembler (spirv-as), which generates SPIR-V binaries from GLSL or textual SPIR-V source, respectively.

SPIR-V: The Binary Shader Format

an arabic alphabet with all the letters and numbers written in white on a black background
an arabic alphabet with all the letters and numbers written in white on a black background

SPIR-V (Shading Language Portable Intermediate Representation) is a binary, portable, and flexible intermediate representation of a shading language. It's a fundamental part of Vulkan, used to describe graphics and compute shaders.

SPIR-V shaders have a clear structure, starting with a module declaration, followed by the module body containing functions, variables, and other structured data. The binary format allows SPIR-V shaders to be highly optimized, facilitating efficient GPU execution.

HLSL: The Higher-Level Shading Language

an image of a black screen with red writing on it and the words in different languages
an image of a black screen with red writing on it and the words in different languages

HLSL (High-Level Shader Language) is another C-like shading language, primarily used in Direct3D and later in Direct3D 12 and Vulkan. Like GLSL, HLSL supports advanced features and is easy to read and write.

HLSL shaders can also be compiled to SPIR-V, following a similar process to GLSL, using tools like DXC (DirectX Shader Compiler) or online conversion utilities.

the parts of volcano worksheet for kids to learn and practice their language skills
the parts of volcano worksheet for kids to learn and practice their language skills
All About The 4 Types of Volcanoes+ Formation, Eruption, and Facts
All About The 4 Types of Volcanoes+ Formation, Eruption, and Facts
the latin language is used to describe what things are going on in this text box
the latin language is used to describe what things are going on in this text box
Davovocitian Language
Davovocitian Language
the words are in different languages to describe
the words are in different languages to describe
the poster for all glade commands, which includes words and pictures on black background
the poster for all glade commands, which includes words and pictures on black background
Gifvosone Language
Gifvosone Language
the words kadota are lit up in front of a dark background with bare trees
the words kadota are lit up in front of a dark background with bare trees
Dragon Script
Dragon Script

In conclusion, while Vulkan shaders are ultimately written in SPIR-V, the vast majority of developers use higher-level languages like GLSL or HLSL for shader creation. These languages provide a more comfortable development environment, and compiled SPIR-V shaders offer optimal GPU performance. As you delve deeper into Vulkan, mastering these languages will empower you to create sophisticated graphics and compute shaders.