• Stars
    star
    130
  • Rank 268,565 (Top 6 %)
  • Language
    C
  • License
    zlib License
  • Created almost 2 years ago
  • Updated 8 months ago

Reviews

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

Repository Details

Shader compiler and tools for SDLSL (Simple Directmedia Layer Shader Language)

THIS IS A WORK IN PROGRESS

This is not yet ready for anything, let alone production use.

It's not clear if this will continue to live in a separate project or become part of SDL itself. At the very least, it will definitely move to a different location on GitHub.

This will--eventually, I hope--become tools used to generate shader bytecode for SDL's GPU API.

This is not meant to become a world-class compiler; the primary goals are:

  • Fast and cheap
  • Reasonable to ship at runtime or embed in another project.

Which is to say that a non-goal is:

  • Heavy optimization of shaders at compile time.

There is much work to be done here, and so much to build, so please be patient as things fall into place and decisions are made.

Current status: semantic analysis!

We have a first draft of the syntax we're aiming for, a parser that can handle it, and enough semantic analysis to tell you if the parsed program is legal (modulo some small incomplete pieces at the moment).

Build the project with CMake, and then you should have a program named "sdl-shader-compiler" ...run it like this to see it spit out the Abstract Syntax Tree (AST) of a shader (which at the moment just looks much like the shader itself with mild reformatting, because it will output source code from the AST that it generated)...

./sdl-shader-compiler -T -I some_dir -DSOME_DEFINE=SOME_VALUE some_source.shader

If you want to see it complain about semantic analysis errors (but not generate any binaries yet)...

./sdl-shader-compiler -C -I some_dir -DSOME_DEFINE=SOME_VALUE some_source.shader

If you just want to see it preprocess stuff, like a C preprocessor does:

./sdl-shader-compiler -P -I some_dir -DSOME_DEFINE=SOME_VALUE some_source.shader

More Repositories

1

SDL

Simple Directmedia Layer
C
8,335
star
2

SDL_image

Image decoding for many popular formats for Simple Directmedia Layer.
C
453
star
3

SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.
C
336
star
4

SDL_ttf

Support for TrueType (.ttf) font files with Simple Directmedia Layer.
C
312
star
5

sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
C
184
star
6

SDL_net

A simple, cross-platform wrapper over TCP/IP sockets.
C
163
star
7

SDL-1.2

Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!
C
87
star
8

sdlwiki

This is the raw contents of SDL's wiki. You can edit this through GitHub or at https://wiki.libsdl.org/ now!
63
star
9

sdl2-compat

An SDL2 compatibility layer that uses SDL3 behind the scenes.
C
59
star
10

SDL_rtf

Support for Rich Text Format (.rtf) files with Simple Directmedia Layer.
C
31
star
11

ghwikipp

A slight improvement on GitHub's current wiki support.
PHP
28
star
12

setup-sdl

GitHub action for providing SDL.
JavaScript
17
star
13

SDL_gesture

SDL2's gesture API split out into a single-header library.
C
15
star
14

libtiff

TIFF decoding library from https://gitlab.com/libtiff/libtiff
C
12
star
15

GUIlib

Simple (and unmaintained!) GUI library built on SDL. Not recommended for new code!
Shell
11
star
16

Maelstrom

Maelstrom 3.0
C++
11
star
17

sdlweb

The website for Simple Directmedia Layer.
PHP
11
star
18

SDL-historical-archive

This is a snapshot of SDL's complete Mercurial repository when we migrated to GitHub. This is is just for historical purposes.
C
8
star
19

SDL_helloworld

A Hello World project that uses SDL.
C
7
star
20

jpeg

JPEG decoding library from https://www.ijg.org/
C
6
star
21

mpg123

mpg decoding library from http://mpg123.de/
C
5
star
22

aom

AV1 Codec Library, forked from https://aomedia.googlesource.com/aom/
C
1
star