mojoshader_effects.h
author Ethan Lee <flibitijibibo@flibitijibibo.com>
Fri, 24 Apr 2020 09:13:10 -0400
changeset 1245 ad9a16c8b023
parent 1240 ebb2b1e436f2
child 1270 fb28ba997299
permissions -rw-r--r--
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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     1
/**
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     2
 * MojoShader; generate shader programs from bytecode of compiled
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     3
 *  Direct3D shaders.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     4
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     5
 * Please see the file LICENSE.txt in the source's root directory.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     6
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     7
 *  This file written by Ryan C. Gordon.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     8
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
     9
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    10
#ifndef MOJOSHADER_EFFECTS_H
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    11
#define MOJOSHADER_EFFECTS_H
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    12
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    13
#ifdef MOJOSHADER_EFFECT_SUPPORT
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    14
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    15
/* MOJOSHADER_effectState types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    16
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    17
typedef enum MOJOSHADER_renderStateType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    18
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    19
    /* Note that we are NOT using the actual RS values from D3D here.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    20
     * For some reason, in the binary data, it's 0-based.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    21
     * Even worse, it doesn't even seem to be in order.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    22
     * Here is the list of changes compared to the real D3DRS enum:
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    23
     * - All of the RS_WRAP values are in a row, not separate!
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    24
     *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    25
     * -flibit
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    26
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    27
    MOJOSHADER_RS_ZENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    28
    MOJOSHADER_RS_FILLMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    29
    MOJOSHADER_RS_SHADEMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    30
    MOJOSHADER_RS_ZWRITEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    31
    MOJOSHADER_RS_ALPHATESTENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    32
    MOJOSHADER_RS_LASTPIXEL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    33
    MOJOSHADER_RS_SRCBLEND,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    34
    MOJOSHADER_RS_DESTBLEND,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    35
    MOJOSHADER_RS_CULLMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    36
    MOJOSHADER_RS_ZFUNC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    37
    MOJOSHADER_RS_ALPHAREF,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    38
    MOJOSHADER_RS_ALPHAFUNC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    39
    MOJOSHADER_RS_DITHERENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    40
    MOJOSHADER_RS_ALPHABLENDENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    41
    MOJOSHADER_RS_FOGENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    42
    MOJOSHADER_RS_SPECULARENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    43
    MOJOSHADER_RS_FOGCOLOR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    44
    MOJOSHADER_RS_FOGTABLEMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    45
    MOJOSHADER_RS_FOGSTART,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    46
    MOJOSHADER_RS_FOGEND,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    47
    MOJOSHADER_RS_FOGDENSITY,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    48
    MOJOSHADER_RS_RANGEFOGENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    49
    MOJOSHADER_RS_STENCILENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    50
    MOJOSHADER_RS_STENCILFAIL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    51
    MOJOSHADER_RS_STENCILZFAIL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    52
    MOJOSHADER_RS_STENCILPASS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    53
    MOJOSHADER_RS_STENCILFUNC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    54
    MOJOSHADER_RS_STENCILREF,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    55
    MOJOSHADER_RS_STENCILMASK,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    56
    MOJOSHADER_RS_STENCILWRITEMASK,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    57
    MOJOSHADER_RS_TEXTUREFACTOR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    58
    MOJOSHADER_RS_WRAP0,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    59
    MOJOSHADER_RS_WRAP1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    60
    MOJOSHADER_RS_WRAP2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    61
    MOJOSHADER_RS_WRAP3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    62
    MOJOSHADER_RS_WRAP4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    63
    MOJOSHADER_RS_WRAP5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    64
    MOJOSHADER_RS_WRAP6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    65
    MOJOSHADER_RS_WRAP7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    66
    MOJOSHADER_RS_WRAP8,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    67
    MOJOSHADER_RS_WRAP9,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    68
    MOJOSHADER_RS_WRAP10,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    69
    MOJOSHADER_RS_WRAP11,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    70
    MOJOSHADER_RS_WRAP12,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    71
    MOJOSHADER_RS_WRAP13,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    72
    MOJOSHADER_RS_WRAP14,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    73
    MOJOSHADER_RS_WRAP15,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    74
    MOJOSHADER_RS_CLIPPING,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    75
    MOJOSHADER_RS_LIGHTING,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    76
    MOJOSHADER_RS_AMBIENT,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    77
    MOJOSHADER_RS_FOGVERTEXMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    78
    MOJOSHADER_RS_COLORVERTEX,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    79
    MOJOSHADER_RS_LOCALVIEWER,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    80
    MOJOSHADER_RS_NORMALIZENORMALS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    81
    MOJOSHADER_RS_DIFFUSEMATERIALSOURCE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    82
    MOJOSHADER_RS_SPECULARMATERIALSOURCE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    83
    MOJOSHADER_RS_AMBIENTMATERIALSOURCE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    84
    MOJOSHADER_RS_EMISSIVEMATERIALSOURCE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    85
    MOJOSHADER_RS_VERTEXBLEND,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    86
    MOJOSHADER_RS_CLIPPLANEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    87
    MOJOSHADER_RS_POINTSIZE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    88
    MOJOSHADER_RS_POINTSIZE_MIN,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    89
    MOJOSHADER_RS_POINTSPRITEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    90
    MOJOSHADER_RS_POINTSCALEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    91
    MOJOSHADER_RS_POINTSCALE_A,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    92
    MOJOSHADER_RS_POINTSCALE_B,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    93
    MOJOSHADER_RS_POINTSCALE_C,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    94
    MOJOSHADER_RS_MULTISAMPLEANTIALIAS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    95
    MOJOSHADER_RS_MULTISAMPLEMASK,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    96
    MOJOSHADER_RS_PATCHEDGESTYLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    97
    MOJOSHADER_RS_DEBUGMONITORTOKEN,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    98
    MOJOSHADER_RS_POINTSIZE_MAX,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
    99
    MOJOSHADER_RS_INDEXEDVERTEXBLENDENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   100
    MOJOSHADER_RS_COLORWRITEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   101
    MOJOSHADER_RS_TWEENFACTOR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   102
    MOJOSHADER_RS_BLENDOP,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   103
    MOJOSHADER_RS_POSITIONDEGREE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   104
    MOJOSHADER_RS_NORMALDEGREE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   105
    MOJOSHADER_RS_SCISSORTESTENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   106
    MOJOSHADER_RS_SLOPESCALEDEPTHBIAS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   107
    MOJOSHADER_RS_ANTIALIASEDLINEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   108
    MOJOSHADER_RS_MINTESSELLATIONLEVEL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   109
    MOJOSHADER_RS_MAXTESSELLATIONLEVEL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   110
    MOJOSHADER_RS_ADAPTIVETESS_X,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   111
    MOJOSHADER_RS_ADAPTIVETESS_Y,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   112
    MOJOSHADER_RS_ADAPTIVETESS_Z,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   113
    MOJOSHADER_RS_ADAPTIVETESS_W,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   114
    MOJOSHADER_RS_ENABLEADAPTIVETESSELLATION,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   115
    MOJOSHADER_RS_TWOSIDEDSTENCILMODE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   116
    MOJOSHADER_RS_CCW_STENCILFAIL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   117
    MOJOSHADER_RS_CCW_STENCILZFAIL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   118
    MOJOSHADER_RS_CCW_STENCILPASS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   119
    MOJOSHADER_RS_CCW_STENCILFUNC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   120
    MOJOSHADER_RS_COLORWRITEENABLE1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   121
    MOJOSHADER_RS_COLORWRITEENABLE2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   122
    MOJOSHADER_RS_COLORWRITEENABLE3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   123
    MOJOSHADER_RS_BLENDFACTOR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   124
    MOJOSHADER_RS_SRGBWRITEENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   125
    MOJOSHADER_RS_DEPTHBIAS,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   126
    MOJOSHADER_RS_SEPARATEALPHABLENDENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   127
    MOJOSHADER_RS_SRCBLENDALPHA,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   128
    MOJOSHADER_RS_DESTBLENDALPHA,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   129
    MOJOSHADER_RS_BLENDOPALPHA,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   130
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   131
    /* These aren't really "states", but these numbers are
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   132
     * referred to by MOJOSHADER_effectStateType as such.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   133
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   134
    MOJOSHADER_RS_VERTEXSHADER = 146,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   135
    MOJOSHADER_RS_PIXELSHADER = 147
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   136
} MOJOSHADER_renderStateType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   137
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   138
typedef enum MOJOSHADER_zBufferType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   139
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   140
    MOJOSHADER_ZB_FALSE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   141
    MOJOSHADER_ZB_TRUE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   142
    MOJOSHADER_ZB_USEW
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   143
} MOJOSHADER_zBufferType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   144
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   145
typedef enum MOJOSHADER_fillMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   146
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   147
    MOJOSHADER_FILL_POINT     = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   148
    MOJOSHADER_FILL_WIREFRAME = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   149
    MOJOSHADER_FILL_SOLID     = 3
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   150
} MOJOSHADER_fillMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   151
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   152
typedef enum MOJOSHADER_shadeMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   153
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   154
    MOJOSHADER_SHADE_FLAT    = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   155
    MOJOSHADER_SHADE_GOURAUD = 2,
1235
8fd6c5efe453 -Wpedantic fixes
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1229
diff changeset
   156
    MOJOSHADER_SHADE_PHONG   = 3
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   157
} MOJOSHADER_shadeMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   158
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   159
typedef enum MOJOSHADER_blendMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   160
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   161
    MOJOSHADER_BLEND_ZERO            = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   162
    MOJOSHADER_BLEND_ONE             = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   163
    MOJOSHADER_BLEND_SRCCOLOR        = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   164
    MOJOSHADER_BLEND_INVSRCCOLOR     = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   165
    MOJOSHADER_BLEND_SRCALPHA        = 5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   166
    MOJOSHADER_BLEND_INVSRCALPHA     = 6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   167
    MOJOSHADER_BLEND_DESTALPHA       = 7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   168
    MOJOSHADER_BLEND_INVDESTALPHA    = 8,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   169
    MOJOSHADER_BLEND_DESTCOLOR       = 9,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   170
    MOJOSHADER_BLEND_INVDESTCOLOR    = 10,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   171
    MOJOSHADER_BLEND_SRCALPHASAT     = 11,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   172
    MOJOSHADER_BLEND_BOTHSRCALPHA    = 12,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   173
    MOJOSHADER_BLEND_BOTHINVSRCALPHA = 13,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   174
    MOJOSHADER_BLEND_BLENDFACTOR     = 14,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   175
    MOJOSHADER_BLEND_INVBLENDFACTOR  = 15,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   176
    MOJOSHADER_BLEND_SRCCOLOR2       = 16,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   177
    MOJOSHADER_BLEND_INVSRCCOLOR2    = 17
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   178
} MOJOSHADER_blendMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   179
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   180
typedef enum MOJOSHADER_cullMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   181
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   182
    MOJOSHADER_CULL_NONE = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   183
    MOJOSHADER_CULL_CW   = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   184
    MOJOSHADER_CULL_CCW  = 3
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   185
} MOJOSHADER_cullMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   186
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   187
typedef enum MOJOSHADER_compareFunc
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   188
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   189
    MOJOSHADER_CMP_NEVER        = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   190
    MOJOSHADER_CMP_LESS         = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   191
    MOJOSHADER_CMP_EQUAL        = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   192
    MOJOSHADER_CMP_LESSEQUAL    = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   193
    MOJOSHADER_CMP_GREATER      = 5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   194
    MOJOSHADER_CMP_NOTEQUAL     = 6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   195
    MOJOSHADER_CMP_GREATEREQUAL = 7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   196
    MOJOSHADER_CMP_ALWAYS       = 8
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   197
} MOJOSHADER_compareFunc;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   198
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   199
typedef enum MOJOSHADER_fogMode
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   200
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   201
    MOJOSHADER_FOG_NONE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   202
    MOJOSHADER_FOG_EXP,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   203
    MOJOSHADER_FOG_EXP2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   204
    MOJOSHADER_FOG_LINEAR
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   205
} MOJOSHADER_fogMode;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   206
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   207
typedef enum MOJOSHADER_stencilOp
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   208
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   209
    MOJOSHADER_STENCILOP_KEEP    = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   210
    MOJOSHADER_STENCILOP_ZERO    = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   211
    MOJOSHADER_STENCILOP_REPLACE = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   212
    MOJOSHADER_STENCILOP_INCRSAT = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   213
    MOJOSHADER_STENCILOP_DECRSAT = 5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   214
    MOJOSHADER_STENCILOP_INVERT  = 6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   215
    MOJOSHADER_STENCILOP_INCR    = 7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   216
    MOJOSHADER_STENCILOP_DECR    = 8
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   217
} MOJOSHADER_stencilOp;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   218
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   219
typedef enum MOJOSHADER_materialColorSource
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   220
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   221
    MOJOSHADER_MCS_MATERIAL,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   222
    MOJOSHADER_MCS_COLOR1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   223
    MOJOSHADER_MCS_COLOR2
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   224
} MOJOSHADER_materialColorSource;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   225
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   226
typedef enum MOJOSHADER_vertexBlendFlags
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   227
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   228
    MOJOSHADER_VBF_DISABLE  = 0,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   229
    MOJOSHADER_VBF_1WEIGHTS = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   230
    MOJOSHADER_VBF_2WEIGHTS = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   231
    MOJOSHADER_VBF_3WEIGHTS = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   232
    MOJOSHADER_VBF_TWEENING = 255,
1235
8fd6c5efe453 -Wpedantic fixes
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1229
diff changeset
   233
    MOJOSHADER_VBF_0WEIGHTS = 256
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   234
} MOJOSHADER_vertexBlendFlags;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   235
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   236
typedef enum MOJOSHADER_patchedEdgeStyle
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   237
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   238
    MOJOSHADER_PATCHEDGE_DISCRETE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   239
    MOJOSHADER_PATCHEDGE_CONTINUOUS
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   240
} MOJOSHADER_patchedEdgeStyle;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   241
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   242
typedef enum MOJOSHADER_debugMonitorTokens
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   243
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   244
    MOJOSHADER_DMT_ENABLE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   245
    MOJOSHADER_DMT_DISABLE
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   246
} MOJOSHADER_debugMonitorTokens;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   247
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   248
typedef enum MOJOSHADER_blendOp
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   249
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   250
    MOJOSHADER_BLENDOP_ADD         = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   251
    MOJOSHADER_BLENDOP_SUBTRACT    = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   252
    MOJOSHADER_BLENDOP_REVSUBTRACT = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   253
    MOJOSHADER_BLENDOP_MIN         = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   254
    MOJOSHADER_BLENDOP_MAX         = 5
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   255
} MOJOSHADER_blendOp;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   256
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   257
typedef enum MOJOSHADER_degreeType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   258
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   259
    MOJOSHADER_DEGREE_LINEAR    = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   260
    MOJOSHADER_DEGREE_QUADRATIC = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   261
    MOJOSHADER_DEGREE_CUBIC     = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   262
    MOJOSHADER_DEGREE_QUINTIC   = 5
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   263
} MOJOSHADER_degreeType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   264
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   265
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   266
/* MOJOSHADER_effectSamplerState types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   267
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   268
typedef enum MOJOSHADER_samplerStateType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   269
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   270
    MOJOSHADER_SAMP_UNKNOWN0      = 0,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   271
    MOJOSHADER_SAMP_UNKNOWN1      = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   272
    MOJOSHADER_SAMP_UNKNOWN2      = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   273
    MOJOSHADER_SAMP_UNKNOWN3      = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   274
    MOJOSHADER_SAMP_TEXTURE       = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   275
    MOJOSHADER_SAMP_ADDRESSU      = 5,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   276
    MOJOSHADER_SAMP_ADDRESSV      = 6,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   277
    MOJOSHADER_SAMP_ADDRESSW      = 7,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   278
    MOJOSHADER_SAMP_BORDERCOLOR   = 8,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   279
    MOJOSHADER_SAMP_MAGFILTER     = 9,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   280
    MOJOSHADER_SAMP_MINFILTER     = 10,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   281
    MOJOSHADER_SAMP_MIPFILTER     = 11,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   282
    MOJOSHADER_SAMP_MIPMAPLODBIAS = 12,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   283
    MOJOSHADER_SAMP_MAXMIPLEVEL   = 13,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   284
    MOJOSHADER_SAMP_MAXANISOTROPY = 14,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   285
    MOJOSHADER_SAMP_SRGBTEXTURE   = 15,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   286
    MOJOSHADER_SAMP_ELEMENTINDEX  = 16,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   287
    MOJOSHADER_SAMP_DMAPOFFSET    = 17
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   288
} MOJOSHADER_samplerStateType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   289
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   290
typedef enum MOJOSHADER_textureAddress
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   291
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   292
    MOJOSHADER_TADDRESS_WRAP       = 1,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   293
    MOJOSHADER_TADDRESS_MIRROR     = 2,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   294
    MOJOSHADER_TADDRESS_CLAMP      = 3,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   295
    MOJOSHADER_TADDRESS_BORDER     = 4,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   296
    MOJOSHADER_TADDRESS_MIRRORONCE = 5
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   297
} MOJOSHADER_textureAddress;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   298
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   299
typedef enum MOJOSHADER_textureFilterType
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   300
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   301
    MOJOSHADER_TEXTUREFILTER_NONE,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   302
    MOJOSHADER_TEXTUREFILTER_POINT,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   303
    MOJOSHADER_TEXTUREFILTER_LINEAR,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   304
    MOJOSHADER_TEXTUREFILTER_ANISOTROPIC,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   305
    MOJOSHADER_TEXTUREFILTER_PYRAMIDALQUAD,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   306
    MOJOSHADER_TEXTUREFILTER_GAUSSIANQUAD,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   307
    MOJOSHADER_TEXTUREFILTER_CONVOLUTIONMONO
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   308
} MOJOSHADER_textureFilterType;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   309
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   310
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   311
/* Effect value types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   312
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   313
typedef struct MOJOSHADER_effectSamplerState MOJOSHADER_effectSamplerState;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   314
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   315
typedef struct MOJOSHADER_effectValue
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   316
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   317
    const char *name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   318
    const char *semantic;
1152
8f7653f0dc37 Effect struct parameter support
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1150
diff changeset
   319
    MOJOSHADER_symbolTypeInfo type;
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   320
    unsigned int value_count;
1235
8fd6c5efe453 -Wpedantic fixes
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1229
diff changeset
   321
    MOJOSHADERNAMELESS union
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   322
    {
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   323
         /* Raw value types */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   324
        void                           *values;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   325
        int                            *valuesI;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   326
        float                          *valuesF;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   327
        /* As used by MOJOSHADER_effectState */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   328
        MOJOSHADER_zBufferType         *valuesZBT;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   329
        MOJOSHADER_fillMode            *valuesFiM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   330
        MOJOSHADER_shadeMode           *valuesSM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   331
        MOJOSHADER_blendMode           *valuesBM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   332
        MOJOSHADER_cullMode            *valuesCM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   333
        MOJOSHADER_compareFunc         *valuesCF;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   334
        MOJOSHADER_fogMode             *valuesFoM;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   335
        MOJOSHADER_stencilOp           *valuesSO;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   336
        MOJOSHADER_materialColorSource *valuesMCS;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   337
        MOJOSHADER_vertexBlendFlags    *valuesVBF;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   338
        MOJOSHADER_patchedEdgeStyle    *valuesPES;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   339
        MOJOSHADER_debugMonitorTokens  *valuesDMT;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   340
        MOJOSHADER_blendOp             *valuesBO;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   341
        MOJOSHADER_degreeType          *valuesDT;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   342
        /* As used by MOJOSHADER_effectSamplerState */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   343
        MOJOSHADER_textureAddress      *valuesTA;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   344
        MOJOSHADER_textureFilterType   *valuesTFT;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   345
        /* As used by MOJOSHADER_effectParameter */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   346
        MOJOSHADER_effectSamplerState  *valuesSS;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   347
    };
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   348
} MOJOSHADER_effectValue;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   349
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   350
typedef struct MOJOSHADER_effectState
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   351
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   352
    MOJOSHADER_renderStateType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   353
    MOJOSHADER_effectValue value;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   354
} MOJOSHADER_effectState;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   355
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   356
struct MOJOSHADER_effectSamplerState
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   357
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   358
    MOJOSHADER_samplerStateType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   359
    MOJOSHADER_effectValue value;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   360
};
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   361
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   362
typedef MOJOSHADER_effectValue MOJOSHADER_effectAnnotation;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   363
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   364
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   365
/* Effect interface structures... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   366
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   367
typedef struct MOJOSHADER_effectParam
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   368
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   369
    MOJOSHADER_effectValue value;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   370
    unsigned int annotation_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   371
    MOJOSHADER_effectAnnotation *annotations;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   372
} MOJOSHADER_effectParam;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   373
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   374
typedef struct MOJOSHADER_effectPass
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   375
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   376
    const char *name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   377
    unsigned int state_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   378
    MOJOSHADER_effectState *states;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   379
    unsigned int annotation_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   380
    MOJOSHADER_effectAnnotation* annotations;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   381
} MOJOSHADER_effectPass;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   382
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   383
typedef struct MOJOSHADER_effectTechnique
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   384
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   385
    const char *name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   386
    unsigned int pass_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   387
    MOJOSHADER_effectPass *passes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   388
    unsigned int annotation_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   389
    MOJOSHADER_effectAnnotation* annotations;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   390
} MOJOSHADER_effectTechnique;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   391
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   392
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   393
/* Effect "objects"... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   394
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   395
/* Defined later in the state change types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   396
typedef struct MOJOSHADER_samplerStateRegister MOJOSHADER_samplerStateRegister;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   397
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   398
typedef struct MOJOSHADER_effectShader
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   399
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   400
    MOJOSHADER_symbolType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   401
    unsigned int technique;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   402
    unsigned int pass;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   403
    unsigned int is_preshader;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   404
    unsigned int preshader_param_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   405
    unsigned int *preshader_params;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   406
    unsigned int param_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   407
    unsigned int *params;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   408
    unsigned int sampler_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   409
    MOJOSHADER_samplerStateRegister *samplers;
1235
8fd6c5efe453 -Wpedantic fixes
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1229
diff changeset
   410
    MOJOSHADERNAMELESS union
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   411
    {
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   412
        void *shader; /* glShader, mtlShader, etc. */
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   413
        const MOJOSHADER_preshader *preshader;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   414
    };
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   415
} MOJOSHADER_effectShader;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   416
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   417
typedef struct MOJOSHADER_effectSamplerMap
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   418
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   419
    MOJOSHADER_symbolType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   420
    const char *name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   421
} MOJOSHADER_effectSamplerMap;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   422
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   423
typedef struct MOJOSHADER_effectString
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   424
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   425
    MOJOSHADER_symbolType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   426
    const char *string;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   427
} MOJOSHADER_effectString;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   428
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   429
typedef struct MOJOSHADER_effectTexture
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   430
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   431
    MOJOSHADER_symbolType type;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   432
    /* FIXME: Does this even do anything? */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   433
} MOJOSHADER_effectTexture;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   434
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   435
typedef union MOJOSHADER_effectObject
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   436
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   437
    MOJOSHADER_symbolType type;
1235
8fd6c5efe453 -Wpedantic fixes
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1229
diff changeset
   438
    MOJOSHADERNAMELESS union
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   439
    {
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   440
        MOJOSHADER_effectShader shader;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   441
        MOJOSHADER_effectSamplerMap mapping;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   442
        MOJOSHADER_effectString string;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   443
        MOJOSHADER_effectTexture texture;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   444
    };
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   445
} MOJOSHADER_effectObject;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   446
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   447
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   448
/* Effect state change types... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   449
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   450
/* Used to store sampler states with accompanying sampler registers */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   451
struct MOJOSHADER_samplerStateRegister
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   452
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   453
    const char *sampler_name;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   454
    unsigned int sampler_register;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   455
    unsigned int sampler_state_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   456
    const MOJOSHADER_effectSamplerState *sampler_states;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   457
};
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   458
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   459
/*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   460
 * Used to acquire the desired render state by the effect pass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   461
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   462
typedef struct MOJOSHADER_effectStateChanges
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   463
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   464
    /* Render state changes caused by effect technique */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   465
    unsigned int render_state_change_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   466
    const MOJOSHADER_effectState *render_state_changes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   467
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   468
    /* Sampler state changes caused by effect technique */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   469
    unsigned int sampler_state_change_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   470
    const MOJOSHADER_samplerStateRegister *sampler_state_changes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   471
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   472
    /* Vertex sampler state changes caused by effect technique */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   473
    unsigned int vertex_sampler_state_change_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   474
    const MOJOSHADER_samplerStateRegister *vertex_sampler_state_changes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   475
} MOJOSHADER_effectStateChanges;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   476
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   477
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   478
/*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   479
 * VTable system for building/running effect shaders...
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   480
 */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   481
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   482
typedef void* (MOJOSHADERCALL * MOJOSHADER_compileShaderFunc)(
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   483
    const char *mainfn,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   484
    const unsigned char *tokenbuf,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   485
    const unsigned int bufsize,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   486
    const MOJOSHADER_swizzle *swiz,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   487
    const unsigned int swizcount,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   488
    const MOJOSHADER_samplerMap *smap,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   489
    const unsigned int smapcount
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   490
);
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   491
typedef void (MOJOSHADERCALL * MOJOSHADER_shaderAddRefFunc)(void* shader);
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   492
typedef void (MOJOSHADERCALL * MOJOSHADER_deleteShaderFunc)(void* shader);
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   493
typedef MOJOSHADER_parseData* (MOJOSHADERCALL * MOJOSHADER_getParseDataFunc)(
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   494
    void *shader
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   495
);
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   496
typedef void (MOJOSHADERCALL * MOJOSHADER_bindShadersFunc)(
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   497
    void *vshader,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   498
    void *pshader
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   499
);
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   500
typedef void (MOJOSHADERCALL * MOJOSHADER_getBoundShadersFunc)(
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   501
    void **vshader,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   502
    void **pshader
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   503
);
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   504
typedef void (MOJOSHADERCALL * MOJOSHADER_mapUniformBufferMemoryFunc)(
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   505
    float **vsf, int **vsi, unsigned char **vsb,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   506
    float **psf, int **psi, unsigned char **psb
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   507
);
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   508
typedef void (MOJOSHADERCALL * MOJOSHADER_unmapUniformBufferMemoryFunc)();
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   509
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   510
typedef struct MOJOSHADER_effectShaderContext
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   511
{
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   512
    /* Shader Backend */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   513
    MOJOSHADER_compileShaderFunc compileShader;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   514
    MOJOSHADER_shaderAddRefFunc shaderAddRef;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   515
    MOJOSHADER_deleteShaderFunc deleteShader;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   516
    MOJOSHADER_getParseDataFunc getParseData;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   517
    MOJOSHADER_bindShadersFunc bindShaders;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   518
    MOJOSHADER_getBoundShadersFunc getBoundShaders;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   519
    MOJOSHADER_mapUniformBufferMemoryFunc mapUniformBufferMemory;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   520
    MOJOSHADER_unmapUniformBufferMemoryFunc unmapUniformBufferMemory;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   521
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   522
    /* Allocator */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   523
    MOJOSHADER_malloc m;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   524
    MOJOSHADER_free f;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   525
    void *malloc_data;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   526
} MOJOSHADER_effectShaderContext;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   527
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   528
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   529
/*
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   530
 * Structure used to return data from parsing of an effect file...
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   531
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   532
/* !!! FIXME: most of these ints should be unsigned. */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   533
typedef struct MOJOSHADER_effect
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   534
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   535
    /*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   536
     * Public members. These are the fields your application cares about!
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   537
     */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   538
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   539
    /*
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   540
     * The number of elements pointed to by (errors).
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   541
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   542
    int error_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   543
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   544
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   545
     * (error_count) elements of data that specify errors that were generated
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   546
     *  by parsing this shader.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   547
     * This can be NULL if there were no errors or if (error_count) is zero.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   548
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   549
    MOJOSHADER_error *errors;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   550
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   551
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   552
     * The number of params pointed to by (params).
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   553
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   554
    int param_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   555
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   556
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   557
     * (param_count) elements of data that specify parameter bind points for
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   558
     *  this effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   559
     * This can be NULL on error or if (param_count) is zero.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   560
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   561
    MOJOSHADER_effectParam *params;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   562
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   563
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   564
     * The number of elements pointed to by (techniques).
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   565
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   566
    int technique_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   567
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   568
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   569
     * (technique_count) elements of data that specify techniques used in
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   570
     *  this effect. Each technique contains a series of passes, and each pass
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   571
     *  specifies state and shaders that affect rendering.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   572
     * This can be NULL on error or if (technique_count) is zero.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   573
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   574
    MOJOSHADER_effectTechnique *techniques;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   575
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   576
    /*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   577
     * The number of elements pointed to by (objects).
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   578
     */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   579
    int object_count;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   580
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   581
    /*
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   582
     * (object_count) elements of data that specify objects used in
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   583
     *  this effect.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   584
     * This can be NULL on error or if (object_count) is zero.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   585
     */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   586
    MOJOSHADER_effectObject *objects;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   587
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   588
    /*
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   589
     * Semi-public members. These might be useful, but are better to access from
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   590
     * a function, not directly.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   591
     */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   592
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   593
    /*
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   594
     * The technique currently being rendered by this effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   595
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   596
    const MOJOSHADER_effectTechnique *current_technique;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   597
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   598
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   599
     * The index of the current pass being rendered by this effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   600
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   601
    int current_pass;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   602
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   603
    /*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   604
     * Private Members. Do not touch anything below this line!
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   605
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   606
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   607
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   608
     * Value used to determine whether or not to restore the previous shader
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   609
     * state after rendering an effect, as requested by application.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   610
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   611
    int restore_shader_state;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   612
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   613
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   614
     * The structure provided by the appliation to store the state changes.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   615
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   616
    MOJOSHADER_effectStateChanges *state_changes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   617
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   618
    /*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   619
     * Values used to store the current shader state during execution.
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   620
     */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   621
    MOJOSHADER_effectShader *current_vert_raw;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   622
    MOJOSHADER_effectShader *current_pixl_raw;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   623
    void *current_vert;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   624
    void *current_pixl;
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   625
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   626
    /*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   627
     * Values used to restore shader state after the effect has ended.
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   628
     */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   629
    void *prev_vertex_shader;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   630
    void *prev_pixel_shader;
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   631
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   632
    /*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   633
     * This is the shader implementation you passed to MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   634
     */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   635
    MOJOSHADER_effectShaderContext ctx;
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   636
} MOJOSHADER_effect;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   637
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   638
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   639
/* Effect compiling interface... */
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   640
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   641
/* Fully compile/link the shaders found within the effect.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   642
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   643
 *   (tokenbuf) is a buffer of Direct3D shader bytecode.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   644
 *   (bufsize) is the size, in bytes, of the bytecode buffer.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   645
 *   (swiz), (swizcount), (smap), and (smapcount) are passed to
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   646
 *   MOJOSHADER_parse() unmolested.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   647
 *   (ctx) contains all the function pointers needed to create and bind shaders
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   648
 *   for a specific backend (OpenGL, Metal, etc).
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   649
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   650
 * This function returns a MOJOSHADER_effect*, containing effect data which
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   651
 *  includes shaders usable with the provided backend.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   652
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   653
 * This call is only as thread safe as the backend functions!
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   654
 */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   655
DECLSPEC MOJOSHADER_effect *MOJOSHADER_compileEffect(const unsigned char *tokenbuf,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   656
                                                     const unsigned int bufsize,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   657
                                                     const MOJOSHADER_swizzle *swiz,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   658
                                                     const unsigned int swizcount,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   659
                                                     const MOJOSHADER_samplerMap *smap,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   660
                                                     const unsigned int smapcount,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   661
                                                     const MOJOSHADER_effectShaderContext *ctx);
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   662
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   663
/* Delete the shaders that were allocated for an effect.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   664
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   665
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   666
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   667
 * This call is only as thread safe as the backend functions!
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   668
 */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   669
DECLSPEC void MOJOSHADER_deleteEffect(const MOJOSHADER_effect *effect);
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   670
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   671
/* Copies an effect, including current parameter/technique data.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   672
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   673
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   674
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   675
 * This function returns a MOJOSHADER_effect*, containing effect data which
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   676
 *  includes shaders usable with the provided backend.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   677
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   678
 * This call is only as thread safe as the backend functions!
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   679
 */
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   680
DECLSPEC MOJOSHADER_effect *MOJOSHADER_cloneEffect(const MOJOSHADER_effect *effect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   681
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   682
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   683
/* Effect parameter interface... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   684
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   685
/* Set the constant value for the specified effect parameter.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   686
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   687
 * This function maps to ID3DXEffect::SetRawValue.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   688
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   689
 * (parameter) is a parameter obtained from a MOJOSHADER_effect*.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   690
 * (data) is the constant values to be applied to the parameter.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   691
 * (offset) is the offset, in bytes, of the parameter data being modified.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   692
 * (len) is the size, in bytes, of the data buffer being applied.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   693
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   694
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   695
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   696
DECLSPEC void MOJOSHADER_effectSetRawValueHandle(const MOJOSHADER_effectParam *parameter,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   697
                                                 const void *data,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   698
                                                 const unsigned int offset,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   699
                                                 const unsigned int len);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   700
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   701
/* Set the constant value for the effect parameter, specified by name.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   702
 *  Note: this function is slower than MOJOSHADER_effectSetRawValueHandle(),
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   703
 *  but we still provide it to fully map to ID3DXEffect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   704
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   705
 * This function maps to ID3DXEffect::SetRawValue.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   706
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   707
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   708
 * (name) is the human-readable name of the parameter being modified.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   709
 * (data) is the constant values to be applied to the parameter.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   710
 * (offset) is the offset, in bytes, of the parameter data being modified.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   711
 * (len) is the size, in bytes, of the data buffer being applied.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   712
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   713
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   714
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   715
DECLSPEC void MOJOSHADER_effectSetRawValueName(const MOJOSHADER_effect *effect,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   716
                                               const char *name,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   717
                                               const void *data,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   718
                                               const unsigned int offset,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   719
                                               const unsigned int len);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   720
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   721
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   722
/* Effect technique interface... */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   723
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   724
/* Get the current technique in use by an effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   725
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   726
 * This function maps to ID3DXEffect::GetCurrentTechnique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   727
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   728
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   729
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   730
 * This function returns the technique currently used by the given effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   731
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   732
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   733
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   734
DECLSPEC const MOJOSHADER_effectTechnique *MOJOSHADER_effectGetCurrentTechnique(const MOJOSHADER_effect *effect);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   735
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   736
/* Set the current technique to be used an effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   737
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   738
 * This function maps to ID3DXEffect::SetTechnique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   739
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   740
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   741
 * (technique) is the technique to be used by the effect when rendered.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   742
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   743
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   744
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   745
DECLSPEC void MOJOSHADER_effectSetTechnique(MOJOSHADER_effect *effect,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   746
                                            const MOJOSHADER_effectTechnique *technique);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   747
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   748
/* Get the next technique in an effect's list.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   749
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   750
 * This function maps to ID3DXEffect::FindNextValidTechnique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   751
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   752
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   753
 * (technique) can either be a technique found in the given effect, or NULL to
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   754
 *  find the first technique in the given effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   755
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   756
 * This function returns either the next technique after the passed technique,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   757
 *  or the first technique if the passed technique is NULL.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   758
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   759
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   760
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   761
DECLSPEC const MOJOSHADER_effectTechnique *MOJOSHADER_effectFindNextValidTechnique(const MOJOSHADER_effect *effect,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   762
                                                                                   const MOJOSHADER_effectTechnique *technique);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   763
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   764
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   765
/* Effect rendering interface... */
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   766
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   767
/* Prepare the effect for rendering with the currently applied technique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   768
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   769
 * This function maps to ID3DXEffect::Begin.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   770
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   771
 * In addition to the expected Begin parameters, we also include a parameter
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   772
 *  to pass in a MOJOSHADER_effectRenderState. Rather than change the render
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   773
 *  state within MojoShader itself we will simply provide what the effect wants
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   774
 *  and allow you to use this information with your own renderer.
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   775
 *  MOJOSHADER_effectBeginPass will update with the render state desired by
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   776
 *  the current effect pass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   777
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   778
 * Note that we only provide the ability to preserve the shader state, but NOT
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   779
 * the ability to preserve the render/sampler states. You are expected to
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   780
 * track your own GL state and restore these states as needed for your
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   781
 * application.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   782
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   783
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   784
 * (numPasses) will be filled with the number of passes that this technique
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   785
 *  will need to fully render.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   786
 * (saveShaderState) is a boolean value informing the effect whether or not to
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   787
 *  restore the shader bindings after calling MOJOSHADER_effectEnd.
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   788
 * (renderState) will be filled by the effect to inform you of the render state
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   789
 *  changes introduced by the technique and its passes.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   790
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   791
 * This call is only as thread safe as the backend functions!
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   792
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   793
DECLSPEC void MOJOSHADER_effectBegin(MOJOSHADER_effect *effect,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   794
                                     unsigned int *numPasses,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   795
                                     int saveShaderState,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   796
                                     MOJOSHADER_effectStateChanges *stateChanges);
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   797
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   798
/* Begin an effect pass from the currently applied technique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   799
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   800
 * This function maps to ID3DXEffect::BeginPass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   801
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   802
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   803
 * (pass) is the index of the effect pass as found in the current technique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   804
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   805
 * This call is only as thread safe as the backend functions!
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   806
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   807
DECLSPEC void MOJOSHADER_effectBeginPass(MOJOSHADER_effect *effect,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   808
                                         unsigned int pass);
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   809
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   810
/* Push render state changes that occurred within an actively rendering pass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   811
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   812
 * This function maps to ID3DXEffect::CommitChanges.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   813
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   814
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   815
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   816
 * This call is only as thread safe as the backend functions!
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   817
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   818
DECLSPEC void MOJOSHADER_effectCommitChanges(MOJOSHADER_effect *effect);
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   819
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   820
/* End an effect pass from the currently applied technique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   821
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   822
 * This function maps to ID3DXEffect::EndPass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   823
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   824
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   825
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   826
 * This call is only as thread safe as the backend functions!
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   827
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   828
DECLSPEC void MOJOSHADER_effectEndPass(MOJOSHADER_effect *effect);
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   829
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   830
/* Complete rendering the effect technique, and restore the render state.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   831
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   832
 * This function maps to ID3DXEffect::End.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   833
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   834
 * (effect) is a MOJOSHADER_effect* obtained from MOJOSHADER_compileEffect().
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   835
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   836
 * This call is only as thread safe as the backend functions!
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   837
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   838
DECLSPEC void MOJOSHADER_effectEnd(MOJOSHADER_effect *effect);
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   839
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   840
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   841
/* Profile-specific functions... */
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   842
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   843
/*
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   844
 * Compile a MTLLibrary that contains all shaders of the given effect.
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   845
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   846
 * This call requires a valid MOJOSHADER_mtlContext to have been created,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   847
 *  or it will crash your program. See MOJOSHADER_mtlCreateContext().
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   848
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   849
 * Returns NULL on error, the generated MTLLibrary on success.
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   850
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   851
DECLSPEC void *MOJOSHADER_mtlCompileLibrary(MOJOSHADER_effect *effect);
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   852
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   853
/*
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   854
 * Free the MTLLibrary given by (library).
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   855
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   856
DECLSPEC void MOJOSHADER_mtlDeleteLibrary(void *library);
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   857
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   858
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   859
#endif /* MOJOSHADER_EFFECT_SUPPORT */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   860
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   861
#endif /* MOJOSHADER_EFFECTS_H */