Quantcast
Channel: Recent Commits to mojoshader:main
Viewing all articles
Browse latest Browse all 350

Major refactor of the Effects API.

$
0
0
changeset ad9a16c8b023
branch
bookmark
tag
user Ethan Lee <flibitijibibo@flibitijibibo.com>
description Major refactor of the Effects API.

The previous API was very GL-specific and had no abstraction at all, meaning
new backends had to copypaste WAY too much code just to get started.
Additionally, parsing/compiled were separate but still very tightly coupled, to
the point where memory leaks in the GL implementation were inevitable. TL;DR: It
was crap and nobody liked working with it.

The new API provides only a compile function, and moves ALL the effect work to
a common implementation. This is done by providing a shader context at compile
time, with functions that map almost directly to the existing MojoShader GL API.

This is MUCH less work to maintain and add to, to the point where you can see
how a parse API is still possible in the updated testparse! It also means new
shader backends no longer need to worry about the effects framework so much.

The Metal work in this patch was done by Caleb Cornett, as always.
files mojoshader.h
mojoshader_effects.c
mojoshader_effects.h
mojoshader_metal.c
mojoshader_opengl.c

Viewing all articles
Browse latest Browse all 350

Trending Articles