mojoshader_effects.h
author Ryan C. Gordon <icculus@icculus.org>
Mon, 20 Jul 2020 20:06:34 -0400
changeset 1295 f592791e062e
parent 1270 fb28ba997299
permissions -rw-r--r--
cmake: build the HLSL profile by default.
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)();
1270
fb28ba997299 Add getError to effectShaderContext
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1245
diff changeset
   509
typedef const char* (MOJOSHADERCALL * MOJOSHADER_getErrorFunc)();
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   510
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   511
typedef struct MOJOSHADER_effectShaderContext
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   512
{
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   513
    /* Shader Backend */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   514
    MOJOSHADER_compileShaderFunc compileShader;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   515
    MOJOSHADER_shaderAddRefFunc shaderAddRef;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   516
    MOJOSHADER_deleteShaderFunc deleteShader;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   517
    MOJOSHADER_getParseDataFunc getParseData;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   518
    MOJOSHADER_bindShadersFunc bindShaders;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   519
    MOJOSHADER_getBoundShadersFunc getBoundShaders;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   520
    MOJOSHADER_mapUniformBufferMemoryFunc mapUniformBufferMemory;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   521
    MOJOSHADER_unmapUniformBufferMemoryFunc unmapUniformBufferMemory;
1270
fb28ba997299 Add getError to effectShaderContext
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1245
diff changeset
   522
    MOJOSHADER_getErrorFunc getError;
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   523
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   524
    /* Allocator */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   525
    MOJOSHADER_malloc m;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   526
    MOJOSHADER_free f;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   527
    void *malloc_data;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   528
} MOJOSHADER_effectShaderContext;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   529
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   530
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   531
/*
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   532
 * 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
   533
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   534
/* !!! 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
   535
typedef struct MOJOSHADER_effect
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   536
{
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   537
    /*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   538
     * 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
   539
     */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   540
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   541
    /*
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   542
     * 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
   543
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   544
    int error_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   545
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   546
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   547
     * (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
   548
     *  by parsing this shader.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   549
     * 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
   550
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   551
    MOJOSHADER_error *errors;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   552
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
     * 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
   555
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   556
    int param_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   557
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   558
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   559
     * (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
   560
     *  this effect.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   561
     * 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
   562
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   563
    MOJOSHADER_effectParam *params;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   564
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
     * 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
   567
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   568
    int technique_count;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   569
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   570
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   571
     * (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
   572
     *  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
   573
     *  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
   574
     * 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
   575
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   576
    MOJOSHADER_effectTechnique *techniques;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   577
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   578
    /*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   579
     * The number of elements pointed to by (objects).
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
    int object_count;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   582
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   583
    /*
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   584
     * (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
   585
     *  this effect.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   586
     * 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
   587
     */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   588
    MOJOSHADER_effectObject *objects;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   589
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   590
    /*
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   591
     * 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
   592
     * a function, not directly.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   593
     */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   594
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   595
    /*
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   596
     * 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
   597
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   598
    const MOJOSHADER_effectTechnique *current_technique;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   599
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
     * 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
   602
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   603
    int current_pass;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   604
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   605
    /*
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   606
     * 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
   607
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   608
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   609
    /*
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   610
     * 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
   611
     * 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
   612
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   613
    int restore_shader_state;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   614
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
     * 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
   617
     */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   618
    MOJOSHADER_effectStateChanges *state_changes;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   619
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
     * 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
   622
     */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   623
    MOJOSHADER_effectShader *current_vert_raw;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   624
    MOJOSHADER_effectShader *current_pixl_raw;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   625
    void *current_vert;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   626
    void *current_pixl;
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   627
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
     * 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
   630
     */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   631
    void *prev_vertex_shader;
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   632
    void *prev_pixel_shader;
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   633
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
     * 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
   636
     */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   637
    MOJOSHADER_effectShaderContext ctx;
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   638
} MOJOSHADER_effect;
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   639
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
/* Effect compiling interface... */
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   642
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   643
/* 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
   644
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   645
 *   (tokenbuf) is a buffer of Direct3D shader bytecode.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   646
 *   (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
   647
 *   (swiz), (swizcount), (smap), and (smapcount) are passed to
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   648
 *   MOJOSHADER_parse() unmolested.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   649
 *   (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
   650
 *   for a specific backend (OpenGL, Metal, etc).
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   651
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   652
 * 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
   653
 *  includes shaders usable with the provided backend.
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
 * 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
   656
 */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   657
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
   658
                                                     const unsigned int bufsize,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   659
                                                     const MOJOSHADER_swizzle *swiz,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   660
                                                     const unsigned int swizcount,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   661
                                                     const MOJOSHADER_samplerMap *smap,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   662
                                                     const unsigned int smapcount,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   663
                                                     const MOJOSHADER_effectShaderContext *ctx);
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   664
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   665
/* 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
   666
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   667
 * (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
   668
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   669
 * 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
   670
 */
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   671
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
   672
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   673
/* Copies an effect, including current parameter/technique data.
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
 * (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
   676
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   677
 * 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
   678
 *  includes shaders usable with the provided backend.
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   679
 *
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   680
 * 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
   681
 */
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   682
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
   683
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
/* Effect parameter interface... */
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
/* 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
   688
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   689
 * This function maps to ID3DXEffect::SetRawValue.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   690
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   691
 * (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
   692
 * (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
   693
 * (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
   694
 * (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
   695
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   696
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   697
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   698
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
   699
                                                 const void *data,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   700
                                                 const unsigned int offset,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   701
                                                 const unsigned int len);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   702
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   703
/* 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
   704
 *  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
   705
 *  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
   706
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   707
 * This function maps to ID3DXEffect::SetRawValue.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   708
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   709
 * (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
   710
 * (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
   711
 * (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
   712
 * (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
   713
 * (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
   714
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   715
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   716
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   717
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
   718
                                               const char *name,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   719
                                               const void *data,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   720
                                               const unsigned int offset,
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   721
                                               const unsigned int len);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   722
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
/* Effect technique interface... */
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
/* 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
   727
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   728
 * This function maps to ID3DXEffect::GetCurrentTechnique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   729
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   730
 * (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
   731
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   732
 * 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
   733
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   734
 * This function is thread safe.
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
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
   737
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   738
/* 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
   739
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   740
 * This function maps to ID3DXEffect::SetTechnique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   741
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   742
 * (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
   743
 * (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
   744
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   745
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   746
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   747
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
   748
                                            const MOJOSHADER_effectTechnique *technique);
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
/* 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
   751
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   752
 * This function maps to ID3DXEffect::FindNextValidTechnique.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   753
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   754
 * (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
   755
 * (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
   756
 *  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
   757
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   758
 * 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
   759
 *  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
   760
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   761
 * This function is thread safe.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   762
 */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   763
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
   764
                                                                                   const MOJOSHADER_effectTechnique *technique);
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   765
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   766
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   767
/* Effect rendering interface... */
1150
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
/* 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
   770
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   771
 * This function maps to ID3DXEffect::Begin.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   772
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   773
 * 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
   774
 *  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
   775
 *  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
   776
 *  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
   777
 *  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
   778
 *  the current effect pass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   779
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   780
 * 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
   781
 * 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
   782
 * 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
   783
 * application.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   784
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   785
 * (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
   786
 * (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
   787
 *  will need to fully render.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   788
 * (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
   789
 *  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
   790
 * (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
   791
 *  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
   792
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   793
 * 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
   794
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   795
DECLSPEC void MOJOSHADER_effectBegin(MOJOSHADER_effect *effect,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   796
                                     unsigned int *numPasses,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   797
                                     int saveShaderState,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   798
                                     MOJOSHADER_effectStateChanges *stateChanges);
1150
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
/* 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
   801
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   802
 * This function maps to ID3DXEffect::BeginPass.
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   803
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   804
 * (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
   805
 * (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
   806
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   807
 * 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
   808
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   809
DECLSPEC void MOJOSHADER_effectBeginPass(MOJOSHADER_effect *effect,
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   810
                                         unsigned int pass);
1150
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
/* 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
   813
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   814
 * This function maps to ID3DXEffect::CommitChanges.
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
 * (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
   817
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   818
 * 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
   819
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   820
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
   821
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   822
/* 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
   823
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   824
 * This function maps to ID3DXEffect::EndPass.
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
 * (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
   827
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   828
 * 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
   829
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   830
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
   831
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   832
/* 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
   833
 *
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   834
 * This function maps to ID3DXEffect::End.
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
 * (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
   837
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   838
 * 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
   839
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   840
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
   841
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
/* Profile-specific functions... */
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   844
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   845
/*
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   846
 * 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
   847
 *
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   848
 * 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
   849
 *  or it will crash your program. See MOJOSHADER_mtlCreateContext().
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
 * Returns NULL on error, the generated MTLLibrary on success.
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
DECLSPEC void *MOJOSHADER_mtlCompileLibrary(MOJOSHADER_effect *effect);
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   854
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   855
/*
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   856
 * Free the MTLLibrary given by (library).
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   857
 */
1245
ad9a16c8b023 Major refactor of the Effects API.
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents: 1240
diff changeset
   858
DECLSPEC void MOJOSHADER_mtlDeleteLibrary(void *library);
1229
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   859
3ecd29a50d9d Metal Effect support!
Caleb Cornett <caleb.cornett@outlook.com>
parents: 1152
diff changeset
   860
1150
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   861
#endif /* MOJOSHADER_EFFECT_SUPPORT */
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   862
02c0f0afb39a - Add ability to build MojoShader as a shared library
Ethan Lee <flibitijibibo@flibitijibibo.com>
parents:
diff changeset
   863
#endif /* MOJOSHADER_EFFECTS_H */