• Stars
    star
    251
  • Rank 161,862 (Top 4 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A GLSL parser

glsl-parser

glsl-parser is an offline GLSL parser which can be used to do many things with GLSL source code.

The straight-forward API allows you to parse GLSL into an abstact-syntax-tree in only a couple lines, for example

glsl::parser parse(sourceCode);
glsl::astTU *translationUnit = parse.parse(astTU::kFragment);
if (translationUnit) {
    // Do something with the AST here
} else {
    // A parse error occured
    fprintf(stderr, "%s\n", parse.error());
}

A test-suite and GLSL source-generator is included to get you started.

Check out the superior diagnostics here

Known limitations

  • Does not support preprocessor directives
    • Does support #version and #extension though.
  • Does not handle new-line termination with the backslack character \
  • Not all of GLSL is supported, if you run into a missing feature open an issue.
  • None of the builtin functions or variables are provided, you must provide those yourself.

Possible uses

  • Verify a shader without running it
  • Find hard-to-find syntax or semantic errors with the superior diagnostics
  • Extend GLSL
  • Transcompile GLSL to other languages
  • Quickly check or verify something
  • Optimize shaders
  • Generate introspection information

Portable and embeddable

  • Written in portable C++03.
    • Only uses std::vector from the standard library
  • Exception free
  • Doesn't use virtual functions
  • Small (~90 KB)
  • Permissive (MIT)

More Repositories

1

incbin

Include binary files in C/C++
C
946
star
2

moreram

Get more system memory
C
804
star
3

breaking_the_physical_limits_of_fonts

Breaking the physical limits of fonts
JavaScript
319
star
4

lambdapp

Anonymous functions in C
C
247
star
5

gmqcc

An Improved Quake C Compiler
C++
159
star
6

normals_revisited

revisiting a known normal transformation in computer graphics
149
star
7

codin

Odin to C compiler
C
141
star
8

fpinspect

Inspect floating point computations
C
135
star
9

cvec

No bullshit vector library for C
C
78
star
10

neothyne

Engine and game
C++
77
star
11

libintrusive

Intrusive data structures for C
C
55
star
12

NVFC

OpenSource tool for monitoring, configuring and overclocking NVIDIA GPUs
C
44
star
13

scope_stack_alloc

A scoped stack allocator
C++
36
star
14

deshade

dump and replace shaders of any OpenGL or Vulkan application
C++
29
star
15

gml

Dynamically typed, higher-order, semi-functional, interpreted and embeddable programming language
C
28
star
16

0xABAD1DEA

Static global objects with constructors and destructors made useful in C++
C++
27
star
17

fibers

The fiber sourcebook
HTML
21
star
18

smbf

Static model binary format
C++
19
star
19

gmrtdxt

Realtime DXT compressor and optimizer
C++
19
star
20

fpot

Fast Point Overlap Test
C
17
star
21

dep_sort

Generic topological sorting for sorting a list of dependencies in C++17
C++
13
star
22

wfstd

Standard library I developed while working for Wayforward
C
11
star
23

vector_benchmark

Benchmarking a trivial replacement for std::vector
C++
11
star
24

alice

A barebones kernel for i386
C
10
star
25

bbgl

OpenGL Rendering as a seperate process (Black Box)
C
10
star
26

redroid

The ultimate IRC bot
C
9
star
27

lua-vec

highly efficent, caching, copy-on-write lua vector math library
Lua
7
star
28

printer-display

Use your printer as a display
C
7
star
29

odin_review

A review of the Odin programming language
HTML
6
star
30

pastes

Just a place where I store my pastes
C
6
star
31

discord-rogue

A tiny rogue like for Discord on nodejs
JavaScript
6
star
32

pds2tc

Public domain S2TC implementation
C
5
star
33

aau

Almost Always Unsigned
HTML
5
star
34

Kaizen

a small, embeddable continous integration framework for small projects
C
4
star
35

libpartial

Partially applied functions for C
C
4
star
36

xcpumemperf

Benchmark to determine cross CPU memory performance for UNIX/POSIX systems
C
3
star
37

zbar-lite

Stripped down light weight version of the zbar library
C
3
star
38

aoc

advent of code 2018 solutions https://adventofcode.com/
C++
3
star
39

glsl-compiler

GLSL compiler targeting a simple SSA IR
3
star
40

smm_video_scraper

Scrape level codes from SMM videos
Python
3
star
41

nra

patch games for nes mini and snes mini to use retroarch cores automatically
C
2
star
42

windows_explicide_runtime_imports

Explicit runtime imports for Windows
C
1
star
43

CV

CV, resume of @graphitemaster
1
star