Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Vulkan
  3. glslang

glslang

NOASSERTIONC++16.4.0

A reference compiler front end for GLSL and ESSL, partial HLSL support, and a SPIR-V generator.

GitHubGitHub
3.6k stars981 forks0 contributors

What is glslang?

Glslang is the Khronos Group's official reference front-end compiler for GLSL and ESSL shader languages. It validates shader code against the OpenGL and OpenGL ES specifications, translates it into an abstract syntax tree, and can generate SPIR-V bytecode for use with Vulkan and other APIs. It solves the problem of ensuring shader correctness and portability across different graphics platforms.

Target Audience

Graphics and game engine developers working with OpenGL, OpenGL ES, or Vulkan who need to compile, validate, and translate shaders. It is also used by toolchain developers integrating shader compilation into their pipelines.

Value Proposition

Developers choose Glslang because it is the Khronos-sanctioned reference implementation, guaranteeing specification compliance. Its ability to generate SPIR-V from GLSL/ESSL and its partial HLSL support make it a versatile tool for cross-API shader development.

Overview

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.

Use Cases

Best For

  • Validating GLSL/ESSL shaders against the official Khronos specifications
  • Generating SPIR-V code from GLSL for Vulkan pipelines
  • Integrating a reliable shader compiler into custom game engines or tools
  • Translating a subset of HLSL code for use in non-Direct3D environments
  • Extracting reflection data from shader source code for pipeline setup
  • Building web-based shader tools via its Emscripten/WebAssembly build

Not Ideal For

  • Projects requiring full, production-ready HLSL compilation and validation
  • Teams looking for a lightweight, easy-to-integrate shader compiler with minimal dependencies
  • Applications where shader compilation speed is the highest priority
  • Developers working exclusively with DirectX who need definitive HLSL semantics

Pros & Cons

Pros

Official Reference Validation

As the Khronos-sanctioned front-end, glslang provides specification-conformant validation for GLSL and ESSL, with results carrying similar weight as the specifications, ensuring shader correctness.

Robust SPIR-V Generation

It reliably translates GLSL/ESSL to SPIR-V for Vulkan, with virtually complete support for the intermediate language, making it essential for Vulkan pipeline development.

Comprehensive Reflection API

Offers reflection directly from the AST, extracting types and variables for pipeline setup, though it's approximate for SPIR-V output as noted in the README.

Multiple Integration Options

Provides both C++ class-based and C functional APIs, along with a standalone CLI tool, facilitating integration into various projects, as demonstrated in the code examples.

Cons

Incomplete HLSL Support

HLSL front-end is only partially complete with non-reference semantics and no validation, making it unreliable for serious HLSL work, as openly admitted in the README.

Complex Build Process

Requires dependencies like CMake, Python, and bison, and involves multiple steps for setup, which can be cumbersome for quick integration, especially on non-standard platforms.

Reflection Approximations

Reflection data is accurate for the AST but only approximate for emitted SPIR-V, limiting precision in some use cases, as stated in the project status.

Frequently Asked Questions

Quick Stats

Stars3,557
Forks981
Contributors0
Open Issues406
Last commit23 hours ago
CreatedSince 2015

Tags

#vulkan#compiler#graphics#opengl#shader-compiler#shader#validator#khronos#glsl#hlsl#spir-v

Built With

G
GoogleTest
B
Bison
C
CMake
P
Python
C
C++

Included in

Vulkan3.7k
Auto-fetched 15 hours ago

Related Projects

imguiimgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies

Stars74,986
Forks11,931
Last commit1 day ago
ncnnncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform

Stars23,573
Forks4,465
Last commit2 days ago
BgfxBgfx

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

Stars17,307
Forks2,114
Last commit1 day ago
glfwglfw

A multi-platform library for OpenGL, OpenGL ES, Vulkan, window and input

Stars15,213
Forks5,914
Last commit3 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub