| 1 | /** |
| 2 | * MojoShader; generate shader programs from bytecode of compiled |
| 3 | * Direct3D shaders. |
| 4 | * |
| 5 | * Please see the file LICENSE.txt in the source's root directory. |
| 6 | * |
| 7 | * This file written by Ryan C. Gordon. |
| 8 | */ |
| 9 | |
| 10 | #ifndef _INCL_MOJOSHADER_H_ |
| 11 | #define _INCL_MOJOSHADER_H_cxx . . $ `mojoshader.h:11:9`! |
| 12 | |
| 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | |
| 17 | /* You can define this if you aren't generating mojoshader_version.h */ |
| 18 | #ifndef MOJOSHADER_NO_VERSION_INCLUDE |
| 19 | #include "mojoshader_version.h"cxx . . $ `<file>/mojoshader_version.h`/ |
| 20 | #endif |
| 21 | |
| 22 | #ifndef MOJOSHADER_VERSIONcxx . . $ `mojoshader_version.h:4:9`! |
| 23 | #define MOJOSHADER_VERSION -1 |
| 24 | #endif |
| 25 | |
| 26 | #ifndef MOJOSHADER_CHANGESETcxx . . $ `mojoshader_version.h:5:9`! |
| 27 | #define MOJOSHADER_CHANGESET "???" |
| 28 | #endif |
| 29 | |
| 30 | #ifndef DECLSPECcxx . . $ `<built-in>:410:9`! |
| 31 | #ifdef _WIN32 |
| 32 | #define DECLSPEC __declspec(dllexport) |
| 33 | #else |
| 34 | #define DECLSPEC |
| 35 | #endif |
| 36 | #endif |
| 37 | |
| 38 | #ifndef MOJOSHADERCALL |
| 39 | #ifdef _WIN32 |
| 40 | #define MOJOSHADERCALL __cdecl |
| 41 | #else |
| 42 | #define MOJOSHADERCALLcxx . . $ `mojoshader.h:42:9`! |
| 43 | #endif |
| 44 | #endif |
| 45 | |
| 46 | /* -Wpedantic nameless union/struct silencing */ |
| 47 | #ifndef MOJOSHADERNAMELESS |
| 48 | #ifdef __GNUC__cxx . . $ `<built-in>:8:9`! |
| 49 | #define MOJOSHADERNAMELESScxx . . $ `mojoshader.h:49:9`! __extension__ |
| 50 | #else |
| 51 | #define MOJOSHADERNAMELESS |
| 52 | #endif /* __GNUC__ */ |
| 53 | #endif /* MOJOSHADERNAMELESS */ |
| 54 | |
| 55 | /* |
| 56 | * For determining the version of MojoShader you are using: |
| 57 | * const int compiled_against = MOJOSHADER_VERSION; |
| 58 | * const int linked_against = MOJOSHADER_version(); |
| 59 | * |
| 60 | * The version is a single integer that increments, not a major/minor value. |
| 61 | * |
| 62 | * Please note that since moving to git, this function always returns -1; |
| 63 | * when hosted in Mercurial, this number meant something, but even |
| 64 | * there it wasn't reliable. With git, this number no longer exists at all. |
| 65 | */ |
| 66 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_versioncxx . . $ MOJOSHADER_version(b126dc7c1de90089).(void); |
| 67 | |
| 68 | /* |
| 69 | * For determining the revision control changeset of MojoShader you are using: |
| 70 | * const char *compiled_against = MOJOSHADER_CHANGESET; |
| 71 | * const char *linked_against = MOJOSHADER_changeset(); |
| 72 | * |
| 73 | * The version is an arbitrary, null-terminated ASCII string. It is probably |
| 74 | * a hash that represents a revision control changeset, and can't be |
| 75 | * compared to any other string to determine chronology. |
| 76 | * |
| 77 | * Do not attempt to free this string; it's statically allocated. |
| 78 | */ |
| 79 | DECLSPECcxx . . $ `<built-in>:410:9`! const char *MOJOSHADER_changesetcxx . . $ MOJOSHADER_changeset(33a1f659e94feb42).(void); |
| 80 | |
| 81 | /* |
| 82 | * These allocators work just like the C runtime's malloc() and free() |
| 83 | * (in fact, they probably use malloc() and free() internally if you don't |
| 84 | * specify your own allocator, but don't rely on that behaviour). |
| 85 | * (data) is the pointer you supplied when specifying these allocator |
| 86 | * callbacks, in case you need instance-specific data...it is passed through |
| 87 | * to your allocator unmolested, and can be NULL if you like. |
| 88 | */ |
| 89 | typedef void *(MOJOSHADERCALLcxx . . $ `mojoshader.h:42:9`! *MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc#)(int bytes, void *data); |
| 90 | typedef void (MOJOSHADERCALLcxx . . $ `mojoshader.h:42:9`! *MOJOSHADER_freecxx . . $ MOJOSHADER_free#)(void *ptr, void *data); |
| 91 | |
| 92 | |
| 93 | /* |
| 94 | * These are enum values, but they also can be used in bitmasks, so we can |
| 95 | * test if an opcode is acceptable: if (op->shader_types & ourtype) {} ... |
| 96 | */ |
| 97 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_0# |
| 98 | { |
| 99 | MOJOSHADER_TYPE_UNKNOWNcxx . . $ MOJOSHADER_TYPE_UNKNOWN. = 0, |
| 100 | MOJOSHADER_TYPE_PIXELcxx . . $ MOJOSHADER_TYPE_PIXEL. = (1 << 0), |
| 101 | MOJOSHADER_TYPE_VERTEXcxx . . $ MOJOSHADER_TYPE_VERTEX. = (1 << 1), |
| 102 | MOJOSHADER_TYPE_GEOMETRYcxx . . $ MOJOSHADER_TYPE_GEOMETRY. = (1 << 2), /* (not supported yet.) */ |
| 103 | MOJOSHADER_TYPE_ANYcxx . . $ MOJOSHADER_TYPE_ANY. = 0x7FFFFFFF /* used for bitmasks */ |
| 104 | } MOJOSHADER_shaderTypecxx . . $ MOJOSHADER_shaderType#; |
| 105 | |
| 106 | /* |
| 107 | * Data types for vertex attribute streams. |
| 108 | */ |
| 109 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_1# |
| 110 | { |
| 111 | MOJOSHADER_ATTRIBUTE_UNKNOWNcxx . . $ MOJOSHADER_ATTRIBUTE_UNKNOWN. = -1, /* housekeeping; not returned. */ |
| 112 | MOJOSHADER_ATTRIBUTE_BYTEcxx . . $ MOJOSHADER_ATTRIBUTE_BYTE., |
| 113 | MOJOSHADER_ATTRIBUTE_UBYTEcxx . . $ MOJOSHADER_ATTRIBUTE_UBYTE., |
| 114 | MOJOSHADER_ATTRIBUTE_SHORTcxx . . $ MOJOSHADER_ATTRIBUTE_SHORT., |
| 115 | MOJOSHADER_ATTRIBUTE_USHORTcxx . . $ MOJOSHADER_ATTRIBUTE_USHORT., |
| 116 | MOJOSHADER_ATTRIBUTE_INTcxx . . $ MOJOSHADER_ATTRIBUTE_INT., |
| 117 | MOJOSHADER_ATTRIBUTE_UINTcxx . . $ MOJOSHADER_ATTRIBUTE_UINT., |
| 118 | MOJOSHADER_ATTRIBUTE_FLOATcxx . . $ MOJOSHADER_ATTRIBUTE_FLOAT., |
| 119 | MOJOSHADER_ATTRIBUTE_DOUBLEcxx . . $ MOJOSHADER_ATTRIBUTE_DOUBLE., |
| 120 | MOJOSHADER_ATTRIBUTE_HALF_FLOATcxx . . $ MOJOSHADER_ATTRIBUTE_HALF_FLOAT. /* MAYBE available in your OpenGL! */ |
| 121 | } MOJOSHADER_attributeTypecxx . . $ MOJOSHADER_attributeType#; |
| 122 | |
| 123 | /* |
| 124 | * Data types for uniforms. See MOJOSHADER_uniform for more information. |
| 125 | */ |
| 126 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_2# |
| 127 | { |
| 128 | MOJOSHADER_UNIFORM_UNKNOWNcxx . . $ MOJOSHADER_UNIFORM_UNKNOWN. = -1, /* housekeeping value; never returned. */ |
| 129 | MOJOSHADER_UNIFORM_FLOATcxx . . $ MOJOSHADER_UNIFORM_FLOAT., |
| 130 | MOJOSHADER_UNIFORM_INTcxx . . $ MOJOSHADER_UNIFORM_INT., |
| 131 | MOJOSHADER_UNIFORM_BOOLcxx . . $ MOJOSHADER_UNIFORM_BOOL. |
| 132 | } MOJOSHADER_uniformTypecxx . . $ MOJOSHADER_uniformType#; |
| 133 | |
| 134 | /* |
| 135 | * These are the uniforms to be set for a shader. "Uniforms" are what Direct3D |
| 136 | * calls "Constants" ... IDirect3DDevice::SetVertexShaderConstantF() would |
| 137 | * need this data, for example. These integers are register indexes. So if |
| 138 | * index==6 and type==MOJOSHADER_UNIFORM_FLOAT, that means we'd expect a |
| 139 | * 4-float vector to be specified for what would be register "c6" in D3D |
| 140 | * assembly language, before drawing with the shader. |
| 141 | * (array_count) means this is an array of uniforms...this happens in some |
| 142 | * profiles when we see a relative address ("c0[a0.x]", not the usual "c0"). |
| 143 | * In those cases, the shader was built to set some range of constant |
| 144 | * registers as an array. You should set this array with (array_count) |
| 145 | * elements from the constant register file, starting at (index) instead of |
| 146 | * just a single uniform. To be extra difficult, you'll need to fill in the |
| 147 | * correct values from the MOJOSHADER_constant data into the appropriate |
| 148 | * parts of the array, overriding the constant register file. Fun! |
| 149 | * (constant) says whether this is a constant array; these need to be loaded |
| 150 | * once at creation time, from the constant list and not ever updated from |
| 151 | * the constant register file. This is a workaround for limitations in some |
| 152 | * profiles. |
| 153 | * (name) is a profile-specific variable name; it may be NULL if it isn't |
| 154 | * applicable to the requested profile. |
| 155 | */ |
| 156 | typedef struct MOJOSHADER_uniformcxx . . $ MOJOSHADER_uniform# |
| 157 | { |
| 158 | MOJOSHADER_uniformTypecxx . . $ MOJOSHADER_uniformType# typecxx . . $ MOJOSHADER_uniform#type.; |
| 159 | int indexcxx . . $ MOJOSHADER_uniform#index.; |
| 160 | int array_countcxx . . $ MOJOSHADER_uniform#array_count.; |
| 161 | int constantcxx . . $ MOJOSHADER_uniform#constant.; |
| 162 | const char *namecxx . . $ MOJOSHADER_uniform#name.; |
| 163 | } MOJOSHADER_uniformcxx . . $ MOJOSHADER_uniform#; |
| 164 | |
| 165 | /* |
| 166 | * These are the constants defined in a shader. These are data values |
| 167 | * hardcoded in a shader (with the DEF, DEFI, DEFB instructions), which |
| 168 | * override your Uniforms. This data is largely for informational purposes, |
| 169 | * since they are compiled in and can't be changed, like Uniforms can be. |
| 170 | * These integers are register indexes. So if index==6 and |
| 171 | * type==MOJOSHADER_UNIFORM_FLOAT, that means we'd expect a 4-float vector |
| 172 | * to be specified for what would be register "c6" in D3D assembly language, |
| 173 | * before drawing with the shader. |
| 174 | * (value) is the value of the constant, unioned by type. |
| 175 | */ |
| 176 | typedef struct MOJOSHADER_constantcxx . . $ MOJOSHADER_constant# |
| 177 | { |
| 178 | MOJOSHADER_uniformTypecxx . . $ MOJOSHADER_uniformType# typecxx . . $ MOJOSHADER_constant#type.; |
| 179 | int indexcxx . . $ MOJOSHADER_constant#index.; |
| 180 | unioncxx . . $ MOJOSHADER_constant#$anonymous_type_3# |
| 181 | { |
| 182 | float fcxx . . $ MOJOSHADER_constant#$anonymous_type_3#f.[4]; /* if type==MOJOSHADER_UNIFORM_FLOAT */ |
| 183 | int icxx . . $ MOJOSHADER_constant#$anonymous_type_3#i.[4]; /* if type==MOJOSHADER_UNIFORM_INT */ |
| 184 | int bcxx . . $ MOJOSHADER_constant#$anonymous_type_3#b.; /* if type==MOJOSHADER_UNIFORM_BOOL */ |
| 185 | } valuecxx . . $ MOJOSHADER_constant#value.; |
| 186 | } MOJOSHADER_constantcxx . . $ MOJOSHADER_constant#; |
| 187 | |
| 188 | /* |
| 189 | * Data types for samplers. See MOJOSHADER_sampler for more information. |
| 190 | */ |
| 191 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_4# |
| 192 | { |
| 193 | MOJOSHADER_SAMPLER_UNKNOWNcxx . . $ MOJOSHADER_SAMPLER_UNKNOWN. = -1, /* housekeeping value; never returned. */ |
| 194 | MOJOSHADER_SAMPLER_2Dcxx . . $ MOJOSHADER_SAMPLER_2D., |
| 195 | MOJOSHADER_SAMPLER_CUBEcxx . . $ MOJOSHADER_SAMPLER_CUBE., |
| 196 | MOJOSHADER_SAMPLER_VOLUMEcxx . . $ MOJOSHADER_SAMPLER_VOLUME. |
| 197 | } MOJOSHADER_samplerTypecxx . . $ MOJOSHADER_samplerType#; |
| 198 | |
| 199 | /* |
| 200 | * These are the samplers to be set for a shader. ... |
| 201 | * IDirect3DDevice::SetTexture() would need this data, for example. |
| 202 | * These integers are the sampler "stage". So if index==6 and |
| 203 | * type==MOJOSHADER_SAMPLER_2D, that means we'd expect a regular 2D texture |
| 204 | * to be specified for what would be register "s6" in D3D assembly language, |
| 205 | * before drawing with the shader. |
| 206 | * (name) is a profile-specific variable name; it may be NULL if it isn't |
| 207 | * applicable to the requested profile. |
| 208 | * (texbem) will be non-zero if a TEXBEM opcode references this sampler. This |
| 209 | * is only used in legacy shaders (ps_1_1 through ps_1_3), but it needs some |
| 210 | * special support to work, as we have to load a magic uniform behind the |
| 211 | * scenes to support it. Most code can ignore this field in general, and no |
| 212 | * one has to touch it unless they really know what they're doing. |
| 213 | */ |
| 214 | typedef struct MOJOSHADER_samplercxx . . $ MOJOSHADER_sampler# |
| 215 | { |
| 216 | MOJOSHADER_samplerTypecxx . . $ MOJOSHADER_samplerType# typecxx . . $ MOJOSHADER_sampler#type.; |
| 217 | int indexcxx . . $ MOJOSHADER_sampler#index.; |
| 218 | const char *namecxx . . $ MOJOSHADER_sampler#name.; |
| 219 | int texbemcxx . . $ MOJOSHADER_sampler#texbem.; |
| 220 | } MOJOSHADER_samplercxx . . $ MOJOSHADER_sampler#; |
| 221 | |
| 222 | |
| 223 | /* |
| 224 | * This struct is used if you have to force a sampler to a specific type. |
| 225 | * Generally, you can ignore this, but if you have, say, a ps_1_1 |
| 226 | * shader, you might need to specify what the samplers are meant to be |
| 227 | * to get correct results, as Shader Model 1 samples textures according |
| 228 | * to what is bound to a sampler at the moment instead of what the shader |
| 229 | * is hardcoded to expect. |
| 230 | */ |
| 231 | typedef struct MOJOSHADER_samplerMapcxx . . $ MOJOSHADER_samplerMap# |
| 232 | { |
| 233 | int indexcxx . . $ MOJOSHADER_samplerMap#index.; |
| 234 | MOJOSHADER_samplerTypecxx . . $ MOJOSHADER_samplerType# typecxx . . $ MOJOSHADER_samplerMap#type.; |
| 235 | } MOJOSHADER_samplerMapcxx . . $ MOJOSHADER_samplerMap#; |
| 236 | |
| 237 | /* |
| 238 | * Data types for attributes. See MOJOSHADER_attribute for more information. |
| 239 | */ |
| 240 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_5# |
| 241 | { |
| 242 | MOJOSHADER_USAGE_UNKNOWNcxx . . $ MOJOSHADER_USAGE_UNKNOWN. = -1, /* housekeeping value; never returned. */ |
| 243 | MOJOSHADER_USAGE_POSITIONcxx . . $ MOJOSHADER_USAGE_POSITION., /* 0-15 for Vertex, 1-15 for Pixel */ |
| 244 | MOJOSHADER_USAGE_BLENDWEIGHTcxx . . $ MOJOSHADER_USAGE_BLENDWEIGHT., /* 0-15 */ |
| 245 | MOJOSHADER_USAGE_BLENDINDICEScxx . . $ MOJOSHADER_USAGE_BLENDINDICES., /* 0-15 */ |
| 246 | MOJOSHADER_USAGE_NORMALcxx . . $ MOJOSHADER_USAGE_NORMAL., /* 0-15 */ |
| 247 | MOJOSHADER_USAGE_POINTSIZEcxx . . $ MOJOSHADER_USAGE_POINTSIZE., /* 0-15 */ |
| 248 | MOJOSHADER_USAGE_TEXCOORDcxx . . $ MOJOSHADER_USAGE_TEXCOORD., /* 0-15 */ |
| 249 | MOJOSHADER_USAGE_TANGENTcxx . . $ MOJOSHADER_USAGE_TANGENT., /* 0-15 */ |
| 250 | MOJOSHADER_USAGE_BINORMALcxx . . $ MOJOSHADER_USAGE_BINORMAL., /* 0-15 */ |
| 251 | MOJOSHADER_USAGE_TESSFACTORcxx . . $ MOJOSHADER_USAGE_TESSFACTOR., /* 0 only */ |
| 252 | MOJOSHADER_USAGE_POSITIONTcxx . . $ MOJOSHADER_USAGE_POSITIONT., /* 0-15 for Vertex, 1-15 for Pixel */ |
| 253 | MOJOSHADER_USAGE_COLORcxx . . $ MOJOSHADER_USAGE_COLOR., /* 0-15 but depends on MRT support */ |
| 254 | MOJOSHADER_USAGE_FOGcxx . . $ MOJOSHADER_USAGE_FOG., /* 0-15 */ |
| 255 | MOJOSHADER_USAGE_DEPTHcxx . . $ MOJOSHADER_USAGE_DEPTH., /* 0-15 */ |
| 256 | MOJOSHADER_USAGE_SAMPLEcxx . . $ MOJOSHADER_USAGE_SAMPLE., |
| 257 | MOJOSHADER_USAGE_TOTALcxx . . $ MOJOSHADER_USAGE_TOTAL. /* housekeeping value; never returned. */ |
| 258 | } MOJOSHADER_usagecxx . . $ MOJOSHADER_usage#; |
| 259 | |
| 260 | /* |
| 261 | * These are the attributes to be set for a shader. "Attributes" are what |
| 262 | * Direct3D calls "Vertex Declarations Usages" ... |
| 263 | * IDirect3DDevice::CreateVertexDeclaration() would need this data, for |
| 264 | * example. Each attribute is associated with an array of data that uses one |
| 265 | * element per-vertex. So if usage==MOJOSHADER_USAGE_COLOR and index==1, that |
| 266 | * means we'd expect a secondary color array to be bound to this shader |
| 267 | * before drawing. |
| 268 | * (name) is a profile-specific variable name; it may be NULL if it isn't |
| 269 | * applicable to the requested profile. |
| 270 | */ |
| 271 | typedef struct MOJOSHADER_attributecxx . . $ MOJOSHADER_attribute# |
| 272 | { |
| 273 | MOJOSHADER_usagecxx . . $ MOJOSHADER_usage# usagecxx . . $ MOJOSHADER_attribute#usage.; |
| 274 | int indexcxx . . $ MOJOSHADER_attribute#index.; |
| 275 | const char *namecxx . . $ MOJOSHADER_attribute#name.; |
| 276 | } MOJOSHADER_attributecxx . . $ MOJOSHADER_attribute#; |
| 277 | |
| 278 | /* |
| 279 | * Use this if you want to specify newly-parsed code to swizzle incoming |
| 280 | * data. This can be useful if you know, at parse time, that a shader |
| 281 | * will be processing data on COLOR0 that should be RGBA, but you'll |
| 282 | * be passing it a vertex array full of ARGB instead. |
| 283 | */ |
| 284 | typedef struct MOJOSHADER_swizzlecxx . . $ MOJOSHADER_swizzle# |
| 285 | { |
| 286 | MOJOSHADER_usagecxx . . $ MOJOSHADER_usage# usagecxx . . $ MOJOSHADER_swizzle#usage.; |
| 287 | unsigned int indexcxx . . $ MOJOSHADER_swizzle#index.; |
| 288 | unsigned char swizzlescxx . . $ MOJOSHADER_swizzle#swizzles.[4]; /* {0,1,2,3} == .xyzw, {2,2,2,2} == .zzzz */ |
| 289 | } MOJOSHADER_swizzlecxx . . $ MOJOSHADER_swizzle#; |
| 290 | |
| 291 | |
| 292 | /* |
| 293 | * MOJOSHADER_symbol data. |
| 294 | * |
| 295 | * These are used to expose high-level information in shader bytecode. |
| 296 | * They associate HLSL variables with registers. This data is used for both |
| 297 | * debugging and optimization. |
| 298 | */ |
| 299 | |
| 300 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_6# |
| 301 | { |
| 302 | MOJOSHADER_SYMREGSET_BOOLcxx . . $ MOJOSHADER_SYMREGSET_BOOL.=0, |
| 303 | MOJOSHADER_SYMREGSET_INT4cxx . . $ MOJOSHADER_SYMREGSET_INT4., |
| 304 | MOJOSHADER_SYMREGSET_FLOAT4cxx . . $ MOJOSHADER_SYMREGSET_FLOAT4., |
| 305 | MOJOSHADER_SYMREGSET_SAMPLERcxx . . $ MOJOSHADER_SYMREGSET_SAMPLER., |
| 306 | MOJOSHADER_SYMREGSET_TOTALcxx . . $ MOJOSHADER_SYMREGSET_TOTAL. /* housekeeping value; never returned. */ |
| 307 | } MOJOSHADER_symbolRegisterSetcxx . . $ MOJOSHADER_symbolRegisterSet#; |
| 308 | |
| 309 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_7# |
| 310 | { |
| 311 | MOJOSHADER_SYMCLASS_SCALARcxx . . $ MOJOSHADER_SYMCLASS_SCALAR.=0, |
| 312 | MOJOSHADER_SYMCLASS_VECTORcxx . . $ MOJOSHADER_SYMCLASS_VECTOR., |
| 313 | MOJOSHADER_SYMCLASS_MATRIX_ROWScxx . . $ MOJOSHADER_SYMCLASS_MATRIX_ROWS., |
| 314 | MOJOSHADER_SYMCLASS_MATRIX_COLUMNScxx . . $ MOJOSHADER_SYMCLASS_MATRIX_COLUMNS., |
| 315 | MOJOSHADER_SYMCLASS_OBJECTcxx . . $ MOJOSHADER_SYMCLASS_OBJECT., |
| 316 | MOJOSHADER_SYMCLASS_STRUCTcxx . . $ MOJOSHADER_SYMCLASS_STRUCT., |
| 317 | MOJOSHADER_SYMCLASS_TOTALcxx . . $ MOJOSHADER_SYMCLASS_TOTAL. /* housekeeping value; never returned. */ |
| 318 | } MOJOSHADER_symbolClasscxx . . $ MOJOSHADER_symbolClass#; |
| 319 | |
| 320 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_8# |
| 321 | { |
| 322 | MOJOSHADER_SYMTYPE_VOIDcxx . . $ MOJOSHADER_SYMTYPE_VOID.=0, |
| 323 | MOJOSHADER_SYMTYPE_BOOLcxx . . $ MOJOSHADER_SYMTYPE_BOOL., |
| 324 | MOJOSHADER_SYMTYPE_INTcxx . . $ MOJOSHADER_SYMTYPE_INT., |
| 325 | MOJOSHADER_SYMTYPE_FLOATcxx . . $ MOJOSHADER_SYMTYPE_FLOAT., |
| 326 | MOJOSHADER_SYMTYPE_STRINGcxx . . $ MOJOSHADER_SYMTYPE_STRING., |
| 327 | MOJOSHADER_SYMTYPE_TEXTUREcxx . . $ MOJOSHADER_SYMTYPE_TEXTURE., |
| 328 | MOJOSHADER_SYMTYPE_TEXTURE1Dcxx . . $ MOJOSHADER_SYMTYPE_TEXTURE1D., |
| 329 | MOJOSHADER_SYMTYPE_TEXTURE2Dcxx . . $ MOJOSHADER_SYMTYPE_TEXTURE2D., |
| 330 | MOJOSHADER_SYMTYPE_TEXTURE3Dcxx . . $ MOJOSHADER_SYMTYPE_TEXTURE3D., |
| 331 | MOJOSHADER_SYMTYPE_TEXTURECUBEcxx . . $ MOJOSHADER_SYMTYPE_TEXTURECUBE., |
| 332 | MOJOSHADER_SYMTYPE_SAMPLERcxx . . $ MOJOSHADER_SYMTYPE_SAMPLER., |
| 333 | MOJOSHADER_SYMTYPE_SAMPLER1Dcxx . . $ MOJOSHADER_SYMTYPE_SAMPLER1D., |
| 334 | MOJOSHADER_SYMTYPE_SAMPLER2Dcxx . . $ MOJOSHADER_SYMTYPE_SAMPLER2D., |
| 335 | MOJOSHADER_SYMTYPE_SAMPLER3Dcxx . . $ MOJOSHADER_SYMTYPE_SAMPLER3D., |
| 336 | MOJOSHADER_SYMTYPE_SAMPLERCUBEcxx . . $ MOJOSHADER_SYMTYPE_SAMPLERCUBE., |
| 337 | MOJOSHADER_SYMTYPE_PIXELSHADERcxx . . $ MOJOSHADER_SYMTYPE_PIXELSHADER., |
| 338 | MOJOSHADER_SYMTYPE_VERTEXSHADERcxx . . $ MOJOSHADER_SYMTYPE_VERTEXSHADER., |
| 339 | MOJOSHADER_SYMTYPE_PIXELFRAGMENTcxx . . $ MOJOSHADER_SYMTYPE_PIXELFRAGMENT., |
| 340 | MOJOSHADER_SYMTYPE_VERTEXFRAGMENTcxx . . $ MOJOSHADER_SYMTYPE_VERTEXFRAGMENT., |
| 341 | MOJOSHADER_SYMTYPE_UNSUPPORTEDcxx . . $ MOJOSHADER_SYMTYPE_UNSUPPORTED., |
| 342 | MOJOSHADER_SYMTYPE_TOTALcxx . . $ MOJOSHADER_SYMTYPE_TOTAL. /* housekeeping value; never returned. */ |
| 343 | } MOJOSHADER_symbolTypecxx . . $ MOJOSHADER_symbolType#; |
| 344 | |
| 345 | typedef struct MOJOSHADER_symbolStructMembercxx . . $ MOJOSHADER_symbolStructMember# MOJOSHADER_symbolStructMembercxx . . $ MOJOSHADER_symbolStructMember#; |
| 346 | |
| 347 | typedef struct MOJOSHADER_symbolTypeInfocxx . . $ MOJOSHADER_symbolTypeInfo# |
| 348 | { |
| 349 | MOJOSHADER_symbolClasscxx . . $ MOJOSHADER_symbolClass# parameter_classcxx . . $ MOJOSHADER_symbolTypeInfo#parameter_class.; |
| 350 | MOJOSHADER_symbolTypecxx . . $ MOJOSHADER_symbolType# parameter_typecxx . . $ MOJOSHADER_symbolTypeInfo#parameter_type.; |
| 351 | unsigned int rowscxx . . $ MOJOSHADER_symbolTypeInfo#rows.; |
| 352 | unsigned int columnscxx . . $ MOJOSHADER_symbolTypeInfo#columns.; |
| 353 | unsigned int elementscxx . . $ MOJOSHADER_symbolTypeInfo#elements.; |
| 354 | unsigned int member_countcxx . . $ MOJOSHADER_symbolTypeInfo#member_count.; |
| 355 | MOJOSHADER_symbolStructMembercxx . . $ MOJOSHADER_symbolStructMember# *memberscxx . . $ MOJOSHADER_symbolTypeInfo#members.; |
| 356 | } MOJOSHADER_symbolTypeInfocxx . . $ MOJOSHADER_symbolTypeInfo#; |
| 357 | |
| 358 | struct MOJOSHADER_symbolStructMembercxx . . $ MOJOSHADER_symbolStructMember# |
| 359 | { |
| 360 | const char *namecxx . . $ MOJOSHADER_symbolStructMember#name.; |
| 361 | MOJOSHADER_symbolTypeInfocxx . . $ MOJOSHADER_symbolTypeInfo# infocxx . . $ MOJOSHADER_symbolStructMember#info.; |
| 362 | }; |
| 363 | |
| 364 | typedef struct MOJOSHADER_symbolcxx . . $ MOJOSHADER_symbol# |
| 365 | { |
| 366 | const char *namecxx . . $ MOJOSHADER_symbol#name.; |
| 367 | MOJOSHADER_symbolRegisterSetcxx . . $ MOJOSHADER_symbolRegisterSet# register_setcxx . . $ MOJOSHADER_symbol#register_set.; |
| 368 | unsigned int register_indexcxx . . $ MOJOSHADER_symbol#register_index.; |
| 369 | unsigned int register_countcxx . . $ MOJOSHADER_symbol#register_count.; |
| 370 | MOJOSHADER_symbolTypeInfocxx . . $ MOJOSHADER_symbolTypeInfo# infocxx . . $ MOJOSHADER_symbol#info.; |
| 371 | } MOJOSHADER_symbolcxx . . $ MOJOSHADER_symbol#; |
| 372 | |
| 373 | |
| 374 | /* |
| 375 | * These are used with MOJOSHADER_error as special case positions. |
| 376 | */ |
| 377 | #define MOJOSHADER_POSITION_NONEcxx . . $ `mojoshader.h:377:9`! (-3) |
| 378 | #define MOJOSHADER_POSITION_BEFOREcxx . . $ `mojoshader.h:378:9`! (-2) |
| 379 | #define MOJOSHADER_POSITION_AFTERcxx . . $ `mojoshader.h:379:9`! (-1) |
| 380 | |
| 381 | typedef struct MOJOSHADER_errorcxx . . $ MOJOSHADER_error# |
| 382 | { |
| 383 | /* |
| 384 | * Human-readable error, if there is one. Will be NULL if there was no |
| 385 | * error. The string will be UTF-8 encoded, and English only. Most of |
| 386 | * these shouldn't be shown to the end-user anyhow. |
| 387 | */ |
| 388 | const char *errorcxx . . $ MOJOSHADER_error#error.; |
| 389 | |
| 390 | /* |
| 391 | * Filename where error happened. This can be NULL if the information |
| 392 | * isn't available. |
| 393 | */ |
| 394 | const char *filenamecxx . . $ MOJOSHADER_error#filename.; |
| 395 | |
| 396 | /* |
| 397 | * Position of error, if there is one. Will be MOJOSHADER_POSITION_NONE if |
| 398 | * there was no error, MOJOSHADER_POSITION_BEFORE if there was an error |
| 399 | * before processing started, and MOJOSHADER_POSITION_AFTER if there was |
| 400 | * an error during final processing. If >= 0, MOJOSHADER_parse() sets |
| 401 | * this to the byte offset (starting at zero) into the bytecode you |
| 402 | * supplied, and MOJOSHADER_assemble(), MOJOSHADER_parseAst(), and |
| 403 | * MOJOSHADER_compile() sets this to a a line number in the source code |
| 404 | * you supplied (starting at one). |
| 405 | */ |
| 406 | int error_positioncxx . . $ MOJOSHADER_error#error_position.; |
| 407 | } MOJOSHADER_errorcxx . . $ MOJOSHADER_error#; |
| 408 | |
| 409 | |
| 410 | /* !!! FIXME: document me. */ |
| 411 | typedef enum MOJOSHADER_preshaderOpcodecxx . . $ MOJOSHADER_preshaderOpcode# |
| 412 | { |
| 413 | MOJOSHADER_PRESHADEROP_NOPcxx . . $ MOJOSHADER_PRESHADEROP_NOP., |
| 414 | MOJOSHADER_PRESHADEROP_MOVcxx . . $ MOJOSHADER_PRESHADEROP_MOV., |
| 415 | MOJOSHADER_PRESHADEROP_NEGcxx . . $ MOJOSHADER_PRESHADEROP_NEG., |
| 416 | MOJOSHADER_PRESHADEROP_RCPcxx . . $ MOJOSHADER_PRESHADEROP_RCP., |
| 417 | MOJOSHADER_PRESHADEROP_FRCcxx . . $ MOJOSHADER_PRESHADEROP_FRC., |
| 418 | MOJOSHADER_PRESHADEROP_EXPcxx . . $ MOJOSHADER_PRESHADEROP_EXP., |
| 419 | MOJOSHADER_PRESHADEROP_LOGcxx . . $ MOJOSHADER_PRESHADEROP_LOG., |
| 420 | MOJOSHADER_PRESHADEROP_RSQcxx . . $ MOJOSHADER_PRESHADEROP_RSQ., |
| 421 | MOJOSHADER_PRESHADEROP_SINcxx . . $ MOJOSHADER_PRESHADEROP_SIN., |
| 422 | MOJOSHADER_PRESHADEROP_COScxx . . $ MOJOSHADER_PRESHADEROP_COS., |
| 423 | MOJOSHADER_PRESHADEROP_ASINcxx . . $ MOJOSHADER_PRESHADEROP_ASIN., |
| 424 | MOJOSHADER_PRESHADEROP_ACOScxx . . $ MOJOSHADER_PRESHADEROP_ACOS., |
| 425 | MOJOSHADER_PRESHADEROP_ATANcxx . . $ MOJOSHADER_PRESHADEROP_ATAN., |
| 426 | MOJOSHADER_PRESHADEROP_MINcxx . . $ MOJOSHADER_PRESHADEROP_MIN., |
| 427 | MOJOSHADER_PRESHADEROP_MAXcxx . . $ MOJOSHADER_PRESHADEROP_MAX., |
| 428 | MOJOSHADER_PRESHADEROP_LTcxx . . $ MOJOSHADER_PRESHADEROP_LT., |
| 429 | MOJOSHADER_PRESHADEROP_GEcxx . . $ MOJOSHADER_PRESHADEROP_GE., |
| 430 | MOJOSHADER_PRESHADEROP_ADDcxx . . $ MOJOSHADER_PRESHADEROP_ADD., |
| 431 | MOJOSHADER_PRESHADEROP_MULcxx . . $ MOJOSHADER_PRESHADEROP_MUL., |
| 432 | MOJOSHADER_PRESHADEROP_ATAN2cxx . . $ MOJOSHADER_PRESHADEROP_ATAN2., |
| 433 | MOJOSHADER_PRESHADEROP_DIVcxx . . $ MOJOSHADER_PRESHADEROP_DIV., |
| 434 | MOJOSHADER_PRESHADEROP_CMPcxx . . $ MOJOSHADER_PRESHADEROP_CMP., |
| 435 | MOJOSHADER_PRESHADEROP_MOVCcxx . . $ MOJOSHADER_PRESHADEROP_MOVC., |
| 436 | MOJOSHADER_PRESHADEROP_DOTcxx . . $ MOJOSHADER_PRESHADEROP_DOT., |
| 437 | MOJOSHADER_PRESHADEROP_NOISEcxx . . $ MOJOSHADER_PRESHADEROP_NOISE., |
| 438 | MOJOSHADER_PRESHADEROP_SCALAR_OPScxx . . $ MOJOSHADER_PRESHADEROP_SCALAR_OPS., |
| 439 | MOJOSHADER_PRESHADEROP_MIN_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_MIN_SCALAR. = MOJOSHADER_PRESHADEROP_SCALAR_OPScxx . . $ MOJOSHADER_PRESHADEROP_SCALAR_OPS., |
| 440 | MOJOSHADER_PRESHADEROP_MAX_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_MAX_SCALAR., |
| 441 | MOJOSHADER_PRESHADEROP_LT_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_LT_SCALAR., |
| 442 | MOJOSHADER_PRESHADEROP_GE_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_GE_SCALAR., |
| 443 | MOJOSHADER_PRESHADEROP_ADD_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_ADD_SCALAR., |
| 444 | MOJOSHADER_PRESHADEROP_MUL_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_MUL_SCALAR., |
| 445 | MOJOSHADER_PRESHADEROP_ATAN2_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_ATAN2_SCALAR., |
| 446 | MOJOSHADER_PRESHADEROP_DIV_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_DIV_SCALAR., |
| 447 | MOJOSHADER_PRESHADEROP_DOT_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_DOT_SCALAR., |
| 448 | MOJOSHADER_PRESHADEROP_NOISE_SCALARcxx . . $ MOJOSHADER_PRESHADEROP_NOISE_SCALAR. |
| 449 | } MOJOSHADER_preshaderOpcodecxx . . $ MOJOSHADER_preshaderOpcode#; |
| 450 | |
| 451 | typedef enum MOJOSHADER_preshaderOperandTypecxx . . $ MOJOSHADER_preshaderOperandType# |
| 452 | { |
| 453 | MOJOSHADER_PRESHADEROPERAND_INPUTcxx . . $ MOJOSHADER_PRESHADEROPERAND_INPUT., |
| 454 | MOJOSHADER_PRESHADEROPERAND_OUTPUTcxx . . $ MOJOSHADER_PRESHADEROPERAND_OUTPUT., |
| 455 | MOJOSHADER_PRESHADEROPERAND_LITERALcxx . . $ MOJOSHADER_PRESHADEROPERAND_LITERAL., |
| 456 | MOJOSHADER_PRESHADEROPERAND_TEMPcxx . . $ MOJOSHADER_PRESHADEROPERAND_TEMP. |
| 457 | } MOJOSHADER_preshaderOperandTypecxx . . $ MOJOSHADER_preshaderOperandType#; |
| 458 | |
| 459 | typedef struct MOJOSHADER_preshaderOperandcxx . . $ MOJOSHADER_preshaderOperand# |
| 460 | { |
| 461 | MOJOSHADER_preshaderOperandTypecxx . . $ MOJOSHADER_preshaderOperandType# typecxx . . $ MOJOSHADER_preshaderOperand#type.; |
| 462 | unsigned int indexcxx . . $ MOJOSHADER_preshaderOperand#index.; |
| 463 | unsigned int array_register_countcxx . . $ MOJOSHADER_preshaderOperand#array_register_count.; |
| 464 | unsigned int *array_registerscxx . . $ MOJOSHADER_preshaderOperand#array_registers.; |
| 465 | } MOJOSHADER_preshaderOperandcxx . . $ MOJOSHADER_preshaderOperand#; |
| 466 | |
| 467 | typedef struct MOJOSHADER_preshaderInstructioncxx . . $ MOJOSHADER_preshaderInstruction# |
| 468 | { |
| 469 | MOJOSHADER_preshaderOpcodecxx . . $ MOJOSHADER_preshaderOpcode# opcodecxx . . $ MOJOSHADER_preshaderInstruction#opcode.; |
| 470 | unsigned int element_countcxx . . $ MOJOSHADER_preshaderInstruction#element_count.; |
| 471 | unsigned int operand_countcxx . . $ MOJOSHADER_preshaderInstruction#operand_count.; |
| 472 | MOJOSHADER_preshaderOperandcxx . . $ MOJOSHADER_preshaderOperand# operandscxx . . $ MOJOSHADER_preshaderInstruction#operands.[4]; |
| 473 | } MOJOSHADER_preshaderInstructioncxx . . $ MOJOSHADER_preshaderInstruction#; |
| 474 | |
| 475 | typedef struct MOJOSHADER_preshadercxx . . $ MOJOSHADER_preshader# |
| 476 | { |
| 477 | unsigned int literal_countcxx . . $ MOJOSHADER_preshader#literal_count.; |
| 478 | double *literalscxx . . $ MOJOSHADER_preshader#literals.; |
| 479 | unsigned int temp_countcxx . . $ MOJOSHADER_preshader#temp_count.; /* scalar, not vector! */ |
| 480 | unsigned int symbol_countcxx . . $ MOJOSHADER_preshader#symbol_count.; |
| 481 | MOJOSHADER_symbolcxx . . $ MOJOSHADER_symbol# *symbolscxx . . $ MOJOSHADER_preshader#symbols.; |
| 482 | unsigned int instruction_countcxx . . $ MOJOSHADER_preshader#instruction_count.; |
| 483 | MOJOSHADER_preshaderInstructioncxx . . $ MOJOSHADER_preshaderInstruction# *instructionscxx . . $ MOJOSHADER_preshader#instructions.; |
| 484 | unsigned int register_countcxx . . $ MOJOSHADER_preshader#register_count.; |
| 485 | float *registerscxx . . $ MOJOSHADER_preshader#registers.; |
| 486 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# malloccxx . . $ MOJOSHADER_preshader#malloc.; |
| 487 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# freecxx . . $ MOJOSHADER_preshader#free.; |
| 488 | void *malloc_datacxx . . $ MOJOSHADER_preshader#malloc_data.; |
| 489 | } MOJOSHADER_preshadercxx . . $ MOJOSHADER_preshader#; |
| 490 | |
| 491 | /* |
| 492 | * Structure used to return data from parsing of a shader... |
| 493 | */ |
| 494 | /* !!! FIXME: most of these ints should be unsigned. */ |
| 495 | typedef struct MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# |
| 496 | { |
| 497 | /* |
| 498 | * The number of elements pointed to by (errors). |
| 499 | */ |
| 500 | int error_countcxx . . $ MOJOSHADER_parseData#error_count.; |
| 501 | |
| 502 | /* |
| 503 | * (error_count) elements of data that specify errors that were generated |
| 504 | * by parsing this shader. |
| 505 | * This can be NULL if there were no errors or if (error_count) is zero. |
| 506 | */ |
| 507 | MOJOSHADER_errorcxx . . $ MOJOSHADER_error# *errorscxx . . $ MOJOSHADER_parseData#errors.; |
| 508 | |
| 509 | /* |
| 510 | * The name of the profile used to parse the shader. Will be NULL on error. |
| 511 | */ |
| 512 | const char *profilecxx . . $ MOJOSHADER_parseData#profile.; |
| 513 | |
| 514 | /* |
| 515 | * Bytes of output from parsing. Most profiles produce a string of source |
| 516 | * code, but profiles that do binary output may not be text at all. |
| 517 | * Will be NULL on error. |
| 518 | */ |
| 519 | const char *outputcxx . . $ MOJOSHADER_parseData#output.; |
| 520 | |
| 521 | /* |
| 522 | * Byte count for output, not counting any null terminator. Most profiles |
| 523 | * produce an ASCII string of source code (which will be null-terminated |
| 524 | * even though that null char isn't included in output_len), but profiles |
| 525 | * that do binary output may not be text at all. Will be 0 on error. |
| 526 | */ |
| 527 | int output_lencxx . . $ MOJOSHADER_parseData#output_len.; |
| 528 | |
| 529 | /* |
| 530 | * Count of Direct3D instruction slots used. This is meaningless in terms |
| 531 | * of the actual output, as the profile will probably grow or reduce |
| 532 | * the count (or for high-level languages, not have that information at |
| 533 | * all). Also, as with Microsoft's own assembler, this value is just a |
| 534 | * rough estimate, as unpredicable real-world factors make the actual |
| 535 | * value vary at least a little from this count. Still, it can give you |
| 536 | * a rough idea of the size of your shader. Will be zero on error. |
| 537 | */ |
| 538 | int instruction_countcxx . . $ MOJOSHADER_parseData#instruction_count.; |
| 539 | |
| 540 | /* |
| 541 | * The type of shader we parsed. Will be MOJOSHADER_TYPE_UNKNOWN on error. |
| 542 | */ |
| 543 | MOJOSHADER_shaderTypecxx . . $ MOJOSHADER_shaderType# shader_typecxx . . $ MOJOSHADER_parseData#shader_type.; |
| 544 | |
| 545 | /* |
| 546 | * The shader's major version. If this was a "vs_3_0", this would be 3. |
| 547 | */ |
| 548 | int major_vercxx . . $ MOJOSHADER_parseData#major_ver.; |
| 549 | |
| 550 | /* |
| 551 | * The shader's minor version. If this was a "ps_1_4", this would be 4. |
| 552 | * Two notes: for "vs_2_x", this is 1, and for "vs_3_sw", this is 255. |
| 553 | */ |
| 554 | int minor_vercxx . . $ MOJOSHADER_parseData#minor_ver.; |
| 555 | |
| 556 | /* |
| 557 | * This is the main function name of the shader. This will be the |
| 558 | * caller-supplied string even if a given profile ignores it (GLSL, |
| 559 | * for example, always uses "main" in the shader output out of necessity, |
| 560 | * and Direct3D assembly has no concept of a "main function", etc). |
| 561 | * Otherwise, it'll be a default name chosen by the profile ("main") or |
| 562 | * whatnot. |
| 563 | */ |
| 564 | const char *mainfncxx . . $ MOJOSHADER_parseData#mainfn.; |
| 565 | |
| 566 | /* |
| 567 | * The number of elements pointed to by (uniforms). |
| 568 | */ |
| 569 | int uniform_countcxx . . $ MOJOSHADER_parseData#uniform_count.; |
| 570 | |
| 571 | /* |
| 572 | * (uniform_count) elements of data that specify Uniforms to be set for |
| 573 | * this shader. See discussion on MOJOSHADER_uniform for details. |
| 574 | * This can be NULL on error or if (uniform_count) is zero. |
| 575 | */ |
| 576 | MOJOSHADER_uniformcxx . . $ MOJOSHADER_uniform# *uniformscxx . . $ MOJOSHADER_parseData#uniforms.; |
| 577 | |
| 578 | /* |
| 579 | * The number of elements pointed to by (constants). |
| 580 | */ |
| 581 | int constant_countcxx . . $ MOJOSHADER_parseData#constant_count.; |
| 582 | |
| 583 | /* |
| 584 | * (constant_count) elements of data that specify constants used in |
| 585 | * this shader. See discussion on MOJOSHADER_constant for details. |
| 586 | * This can be NULL on error or if (constant_count) is zero. |
| 587 | * This is largely informational: constants are hardcoded into a shader. |
| 588 | * The constants that you can set like parameters are in the "uniforms" |
| 589 | * list. |
| 590 | */ |
| 591 | MOJOSHADER_constantcxx . . $ MOJOSHADER_constant# *constantscxx . . $ MOJOSHADER_parseData#constants.; |
| 592 | |
| 593 | /* |
| 594 | * The number of elements pointed to by (samplers). |
| 595 | */ |
| 596 | int sampler_countcxx . . $ MOJOSHADER_parseData#sampler_count.; |
| 597 | |
| 598 | /* |
| 599 | * (sampler_count) elements of data that specify Samplers to be set for |
| 600 | * this shader. See discussion on MOJOSHADER_sampler for details. |
| 601 | * This can be NULL on error or if (sampler_count) is zero. |
| 602 | */ |
| 603 | MOJOSHADER_samplercxx . . $ MOJOSHADER_sampler# *samplerscxx . . $ MOJOSHADER_parseData#samplers.; |
| 604 | |
| 605 | /* !!! FIXME: this should probably be "input" and not "attribute" */ |
| 606 | /* |
| 607 | * The number of elements pointed to by (attributes). |
| 608 | */ |
| 609 | int attribute_countcxx . . $ MOJOSHADER_parseData#attribute_count.; |
| 610 | |
| 611 | /* !!! FIXME: this should probably be "input" and not "attribute" */ |
| 612 | /* |
| 613 | * (attribute_count) elements of data that specify Attributes to be set |
| 614 | * for this shader. See discussion on MOJOSHADER_attribute for details. |
| 615 | * This can be NULL on error or if (attribute_count) is zero. |
| 616 | */ |
| 617 | MOJOSHADER_attributecxx . . $ MOJOSHADER_attribute# *attributescxx . . $ MOJOSHADER_parseData#attributes.; |
| 618 | |
| 619 | /* |
| 620 | * The number of elements pointed to by (outputs). |
| 621 | */ |
| 622 | int output_countcxx . . $ MOJOSHADER_parseData#output_count.; |
| 623 | |
| 624 | /* |
| 625 | * (output_count) elements of data that specify outputs this shader |
| 626 | * writes to. See discussion on MOJOSHADER_attribute for details. |
| 627 | * This can be NULL on error or if (output_count) is zero. |
| 628 | */ |
| 629 | MOJOSHADER_attributecxx . . $ MOJOSHADER_attribute# *outputscxx . . $ MOJOSHADER_parseData#outputs.; |
| 630 | |
| 631 | /* |
| 632 | * The number of elements pointed to by (swizzles). |
| 633 | */ |
| 634 | int swizzle_countcxx . . $ MOJOSHADER_parseData#swizzle_count.; |
| 635 | |
| 636 | /* !!! FIXME: this should probably be "input" and not "attribute" */ |
| 637 | /* |
| 638 | * (swizzle_count) elements of data that specify swizzles the shader will |
| 639 | * apply to incoming attributes. This is a copy of what was passed to |
| 640 | * MOJOSHADER_parseData(). |
| 641 | * This can be NULL on error or if (swizzle_count) is zero. |
| 642 | */ |
| 643 | MOJOSHADER_swizzlecxx . . $ MOJOSHADER_swizzle# *swizzlescxx . . $ MOJOSHADER_parseData#swizzles.; |
| 644 | |
| 645 | /* |
| 646 | * The number of elements pointed to by (symbols). |
| 647 | */ |
| 648 | int symbol_countcxx . . $ MOJOSHADER_parseData#symbol_count.; |
| 649 | |
| 650 | /* |
| 651 | * (symbol_count) elements of data that specify high-level symbol data |
| 652 | * for the shader. This will be parsed from the CTAB section |
| 653 | * in bytecode, and will be a copy of what you provide to |
| 654 | * MOJOSHADER_assemble(). This data is optional. |
| 655 | * This can be NULL on error or if (symbol_count) is zero. |
| 656 | */ |
| 657 | MOJOSHADER_symbolcxx . . $ MOJOSHADER_symbol# *symbolscxx . . $ MOJOSHADER_parseData#symbols.; |
| 658 | |
| 659 | /* |
| 660 | * !!! FIXME: document me. |
| 661 | * This can be NULL on error or if no preshader was available. |
| 662 | */ |
| 663 | MOJOSHADER_preshadercxx . . $ MOJOSHADER_preshader# *preshadercxx . . $ MOJOSHADER_parseData#preshader.; |
| 664 | |
| 665 | /* |
| 666 | * This is the malloc implementation you passed to MOJOSHADER_parse(). |
| 667 | */ |
| 668 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# malloccxx . . $ MOJOSHADER_parseData#malloc.; |
| 669 | |
| 670 | /* |
| 671 | * This is the free implementation you passed to MOJOSHADER_parse(). |
| 672 | */ |
| 673 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# freecxx . . $ MOJOSHADER_parseData#free.; |
| 674 | |
| 675 | /* |
| 676 | * This is the pointer you passed as opaque data for your allocator. |
| 677 | */ |
| 678 | void *malloc_datacxx . . $ MOJOSHADER_parseData#malloc_data.; |
| 679 | } MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData#; |
| 680 | |
| 681 | |
| 682 | /* |
| 683 | * Profile string for Direct3D assembly language output. |
| 684 | */ |
| 685 | #define MOJOSHADER_PROFILE_D3Dcxx . . $ `mojoshader.h:685:9`! "d3d" |
| 686 | |
| 687 | /* |
| 688 | * Profile string for passthrough of the original bytecode, unchanged. |
| 689 | */ |
| 690 | #define MOJOSHADER_PROFILE_BYTECODEcxx . . $ `mojoshader.h:690:9`! "bytecode" |
| 691 | |
| 692 | /* |
| 693 | * Profile string for HLSL Shader Model 4 output. |
| 694 | */ |
| 695 | #define MOJOSHADER_PROFILE_HLSLcxx . . $ `mojoshader.h:695:9`! "hlsl" |
| 696 | |
| 697 | /* |
| 698 | * Profile string for GLSL: OpenGL high-level shader language output. |
| 699 | */ |
| 700 | #define MOJOSHADER_PROFILE_GLSLcxx . . $ `mojoshader.h:700:9`! "glsl" |
| 701 | |
| 702 | /* |
| 703 | * Profile string for GLSL 1.20: minor improvements to base GLSL spec. |
| 704 | */ |
| 705 | #define MOJOSHADER_PROFILE_GLSL120cxx . . $ `mojoshader.h:705:9`! "glsl120" |
| 706 | |
| 707 | /* |
| 708 | * Profile string for GLSL ES: minor changes to GLSL output for ES compliance. |
| 709 | */ |
| 710 | #define MOJOSHADER_PROFILE_GLSLEScxx . . $ `mojoshader.h:710:9`! "glsles" |
| 711 | |
| 712 | /* |
| 713 | * Profile string for GLSL ES: changes to GLSL output for ES 3.x compliance. |
| 714 | */ |
| 715 | #define MOJOSHADER_PROFILE_GLSLES3cxx . . $ `mojoshader.h:715:9`! "glsles3" |
| 716 | |
| 717 | /* |
| 718 | * Profile string for OpenGL ARB 1.0 shaders: GL_ARB_(vertex|fragment)_program. |
| 719 | */ |
| 720 | #define MOJOSHADER_PROFILE_ARB1cxx . . $ `mojoshader.h:720:9`! "arb1" |
| 721 | |
| 722 | /* |
| 723 | * Profile string for OpenGL ARB 1.0 shaders with Nvidia 2.0 extensions: |
| 724 | * GL_NV_vertex_program2_option and GL_NV_fragment_program2 |
| 725 | */ |
| 726 | #define MOJOSHADER_PROFILE_NV2cxx . . $ `mojoshader.h:726:9`! "nv2" |
| 727 | |
| 728 | /* |
| 729 | * Profile string for OpenGL ARB 1.0 shaders with Nvidia 3.0 extensions: |
| 730 | * GL_NV_vertex_program3 and GL_NV_fragment_program2 |
| 731 | */ |
| 732 | #define MOJOSHADER_PROFILE_NV3cxx . . $ `mojoshader.h:732:9`! "nv3" |
| 733 | |
| 734 | /* |
| 735 | * Profile string for OpenGL ARB 1.0 shaders with Nvidia 4.0 extensions: |
| 736 | * GL_NV_gpu_program4 |
| 737 | */ |
| 738 | #define MOJOSHADER_PROFILE_NV4cxx . . $ `mojoshader.h:738:9`! "nv4" |
| 739 | |
| 740 | /* |
| 741 | * Profile string for Metal: Apple's lowlevel API's high-level shader language. |
| 742 | */ |
| 743 | #define MOJOSHADER_PROFILE_METALcxx . . $ `mojoshader.h:743:9`! "metal" |
| 744 | |
| 745 | /* |
| 746 | * Profile string for SPIR-V binary output |
| 747 | */ |
| 748 | #define MOJOSHADER_PROFILE_SPIRVcxx . . $ `mojoshader.h:748:9`! "spirv" |
| 749 | |
| 750 | /* |
| 751 | * Profile string for ARB_gl_spirv-friendly SPIR-V binary output |
| 752 | */ |
| 753 | #define MOJOSHADER_PROFILE_GLSPIRVcxx . . $ `mojoshader.h:753:9`! "glspirv" |
| 754 | |
| 755 | /* |
| 756 | * Determine the highest supported Shader Model for a profile. |
| 757 | */ |
| 758 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_maxShaderModelcxx . . $ MOJOSHADER_maxShaderModel(5c4306d8553b3696).(const char *profile); |
| 759 | |
| 760 | |
| 761 | /* |
| 762 | * Parse a compiled Direct3D shader's bytecode. |
| 763 | * |
| 764 | * This is your primary entry point into MojoShader. You need to pass it |
| 765 | * a compiled D3D shader and tell it which "profile" you want to use to |
| 766 | * convert it into useful data. |
| 767 | * |
| 768 | * The available profiles are the set of MOJOSHADER_PROFILE_* defines. |
| 769 | * Note that MojoShader may be built without support for all listed |
| 770 | * profiles (in which case using one here will return with an error). |
| 771 | * |
| 772 | * As parsing requires some memory to be allocated, you may provide a custom |
| 773 | * allocator to this function, which will be used to allocate/free memory. |
| 774 | * They function just like malloc() and free(). We do not use realloc(). |
| 775 | * If you don't care, pass NULL in for the allocator functions. If your |
| 776 | * allocator needs instance-specific data, you may supply it with the |
| 777 | * (d) parameter. This pointer is passed as-is to your (m) and (f) functions. |
| 778 | * |
| 779 | * This function returns a MOJOSHADER_parseData. |
| 780 | * |
| 781 | * This function will never return NULL, even if the system is completely |
| 782 | * out of memory upon entry (in which case, this function returns a static |
| 783 | * MOJOSHADER_parseData object, which is still safe to pass to |
| 784 | * MOJOSHADER_freeParseData()). |
| 785 | * |
| 786 | * You can tell the generated program to swizzle certain inputs. If you know |
| 787 | * that COLOR0 should be RGBA but you're passing in ARGB, you can specify |
| 788 | * a swizzle of { MOJOSHADER_USAGE_COLOR, 0, {1,2,3,0} } to (swiz). If the |
| 789 | * input register in the code would produce reg.ywzx, that swizzle would |
| 790 | * change it to reg.wzxy ... (swiz) can be NULL. |
| 791 | * |
| 792 | * You can force the shader to expect samplers of certain types. Generally |
| 793 | * you don't need this, as Shader Model 2 and later always specify what they |
| 794 | * expect samplers to be (2D, cubemap, etc). Shader Model 1, however, just |
| 795 | * uses whatever is bound to a given sampler at draw time, but this doesn't |
| 796 | * work in OpenGL, etc. In these cases, MojoShader will default to |
| 797 | * 2D texture sampling (or cubemap sampling, in cases where it makes sense, |
| 798 | * like the TEXM3X3TEX opcode), which works 75% of the time, but if you |
| 799 | * really needed something else, you'll need to specify it here. This can |
| 800 | * also be used, at your own risk, to override DCL opcodes in shaders: if |
| 801 | * the shader explicit says 2D, but you want Cubemap, for example, you can |
| 802 | * use this to override. If you aren't sure about any of this stuff, you can |
| 803 | * (and should) almost certainly ignore it: (smap) can be NULL. |
| 804 | * |
| 805 | * (bufsize) is the size in bytes of (tokenbuf). If (bufsize) is zero, |
| 806 | * MojoShader will attempt to figure out the size of the buffer, but you |
| 807 | * risk a buffer overflow if you have corrupt data, etc. Supply the value |
| 808 | * if you can. |
| 809 | * |
| 810 | * You should pass a name for your shader's main function in here, via the |
| 811 | * (mainfn) param. Some profiles need this name to be unique. Passing a NULL |
| 812 | * here will pick a reasonable default, and most profiles will ignore it |
| 813 | * anyhow. As the name of the shader's main function, etc, so make it a |
| 814 | * simple name that would match C's identifier rules. Keep it simple! |
| 815 | * |
| 816 | * This function is thread safe, so long as (m) and (f) are too, and that |
| 817 | * (tokenbuf) remains intact for the duration of the call. This allows you |
| 818 | * to parse several shaders on separate CPU cores at the same time. |
| 819 | */ |
| 820 | DECLSPECcxx . . $ `<built-in>:410:9`! const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *MOJOSHADER_parsecxx . . $ MOJOSHADER_parse(ff0909865cf9979a).(const char *profile, |
| 821 | const char *mainfn, |
| 822 | const unsigned char *tokenbuf, |
| 823 | const unsigned int bufsize, |
| 824 | const MOJOSHADER_swizzlecxx . . $ MOJOSHADER_swizzle# *swiz, |
| 825 | const unsigned int swizcount, |
| 826 | const MOJOSHADER_samplerMapcxx . . $ MOJOSHADER_samplerMap# *smap, |
| 827 | const unsigned int smapcount, |
| 828 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, |
| 829 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 830 | void *d); |
| 831 | |
| 832 | |
| 833 | /* |
| 834 | * Call this to dispose of parsing results when you are done with them. |
| 835 | * This will call the MOJOSHADER_free function you provided to |
| 836 | * MOJOSHADER_parse multiple times, if you provided one. |
| 837 | * Passing a NULL here is a safe no-op. |
| 838 | * |
| 839 | * This function is thread safe, so long as any allocator you passed into |
| 840 | * MOJOSHADER_parse() is, too. |
| 841 | */ |
| 842 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_freeParseDatacxx . . $ MOJOSHADER_freeParseData(c292f651a0772a1d).(const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *data); |
| 843 | |
| 844 | |
| 845 | /* |
| 846 | * You almost certainly don't need this function, unless you absolutely know |
| 847 | * why you need it without hesitation. This is useful if you're doing |
| 848 | * extremely low-level shader work or building specialized tools. |
| 849 | * |
| 850 | * Parse a preshader structure. This expects a buffer of bytes that represents |
| 851 | * the preshader data starting with its magic number token and ending at |
| 852 | * the end of the comment tokens that contain this preshader. Note that it |
| 853 | * does _not_ start at the beginning of the comment tokens. |
| 854 | * |
| 855 | * On success, this will return a MOJOSHADER_preshader. This can be |
| 856 | * deallocated later by calling MOJOSHADER_freePreshader(). On failure, |
| 857 | * this will return NULL. Unlike other MojoShader APIs, this assumes you |
| 858 | * either have a complete and valid buffer of preshader tokens or you have |
| 859 | * incomplete/corrupted data, so there is no explicit error reporting. Please |
| 860 | * note that if the system runs out of memory, this function will also return |
| 861 | * NULL without distinction. |
| 862 | * |
| 863 | * This function is thread safe, so long as any allocator you passed into |
| 864 | * MOJOSHADER_parsePreshader() is, too. |
| 865 | */ |
| 866 | DECLSPECcxx . . $ `<built-in>:410:9`! const MOJOSHADER_preshadercxx . . $ MOJOSHADER_preshader# *MOJOSHADER_parsePreshadercxx . . $ MOJOSHADER_parsePreshader(e43202ce76f10a1b).(const unsigned char *buf, |
| 867 | const unsigned int len, |
| 868 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, |
| 869 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 870 | void *d); |
| 871 | |
| 872 | |
| 873 | /* |
| 874 | * You almost certainly don't need this function, unless you absolutely know |
| 875 | * why you need it without hesitation. This is useful if you're doing |
| 876 | * extremely low-level shader work or building specialized tools. |
| 877 | * |
| 878 | * Call this to dispose of preshader parsing results when you are done with |
| 879 | * them. This will call the MOJOSHADER_free function you provided to |
| 880 | * MOJOSHADER_parsePreshader() multiple times, if you provided one. |
| 881 | * Passing a NULL here is a safe no-op. |
| 882 | * |
| 883 | * You only need to call this function for results from a call to |
| 884 | * MOJOSHADER_parsePreshader(). Other MojoShader structures with a preshader |
| 885 | * field, such as MOJOSHADER_parseData(), should not use this function, as |
| 886 | * the preshader will be deallocated with everything else in |
| 887 | * MOJOSHADER_freeParseData(), etc. |
| 888 | * |
| 889 | * This function is thread safe, so long as any allocator you passed into |
| 890 | * MOJOSHADER_parsePreshader() is, too. |
| 891 | */ |
| 892 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_freePreshadercxx . . $ MOJOSHADER_freePreshader(7b3a2df688ff99e3).(const MOJOSHADER_preshadercxx . . $ MOJOSHADER_preshader# *preshader); |
| 893 | |
| 894 | |
| 895 | /* SPIR-V interface... */ |
| 896 | |
| 897 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_9# |
| 898 | { |
| 899 | MOJOSHADER_VERTEXELEMENTFORMAT_SINGLEcxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_SINGLE., |
| 900 | MOJOSHADER_VERTEXELEMENTFORMAT_VECTOR2cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_VECTOR2., |
| 901 | MOJOSHADER_VERTEXELEMENTFORMAT_VECTOR3cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_VECTOR3., |
| 902 | MOJOSHADER_VERTEXELEMENTFORMAT_VECTOR4cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_VECTOR4., |
| 903 | MOJOSHADER_VERTEXELEMENTFORMAT_COLORcxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_COLOR., |
| 904 | MOJOSHADER_VERTEXELEMENTFORMAT_BYTE4cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_BYTE4., |
| 905 | MOJOSHADER_VERTEXELEMENTFORMAT_SHORT2cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_SHORT2., |
| 906 | MOJOSHADER_VERTEXELEMENTFORMAT_SHORT4cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_SHORT4., |
| 907 | MOJOSHADER_VERTEXELEMENTFORMAT_NORMALIZEDSHORT2cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_NORMALIZEDSHORT2., |
| 908 | MOJOSHADER_VERTEXELEMENTFORMAT_NORMALIZEDSHORT4cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_NORMALIZEDSHORT4., |
| 909 | MOJOSHADER_VERTEXELEMENTFORMAT_HALFVECTOR2cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_HALFVECTOR2., |
| 910 | MOJOSHADER_VERTEXELEMENTFORMAT_HALFVECTOR4cxx . . $ MOJOSHADER_VERTEXELEMENTFORMAT_HALFVECTOR4. |
| 911 | } MOJOSHADER_vertexElementFormatcxx . . $ MOJOSHADER_vertexElementFormat#; |
| 912 | |
| 913 | typedef struct MOJOSHADER_vertexAttributecxx . . $ MOJOSHADER_vertexAttribute# |
| 914 | { |
| 915 | MOJOSHADER_usagecxx . . $ MOJOSHADER_usage# usagecxx . . $ MOJOSHADER_vertexAttribute#usage.; |
| 916 | MOJOSHADER_vertexElementFormatcxx . . $ MOJOSHADER_vertexElementFormat# vertexElementFormatcxx . . $ MOJOSHADER_vertexAttribute#vertexElementFormat.; |
| 917 | int usageIndexcxx . . $ MOJOSHADER_vertexAttribute#usageIndex.; |
| 918 | } MOJOSHADER_vertexAttributecxx . . $ MOJOSHADER_vertexAttribute#; |
| 919 | |
| 920 | /* |
| 921 | * You almost certainly don't need this function, unless you absolutely know |
| 922 | * why you need it without hesitation. This is useful if you're doing |
| 923 | * extremely low-level shader work or building specialized tools. |
| 924 | * |
| 925 | * Call this to patch SPIR-V output returned from MOJOSHADER_parse to correctly |
| 926 | * interpret vertex input and link vertex shader output to pixel shader input. |
| 927 | * |
| 928 | * On success, this returns the size of the shaders' internal "patch table", |
| 929 | * which should be subtracted from the parseData's output_len when passing the |
| 930 | * final SPIR-V to your shader compiler. |
| 931 | */ |
| 932 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_linkSPIRVShaderscxx . . $ MOJOSHADER_linkSPIRVShaders(45dfc763bb1862e7).(const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *vertex_spirv, |
| 933 | const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *pixel_spirv, |
| 934 | const MOJOSHADER_vertexAttributecxx . . $ MOJOSHADER_vertexAttribute# *vertexAttributes, |
| 935 | const int vertexAttributeCount); |
| 936 | |
| 937 | /* Preprocessor interface... */ |
| 938 | |
| 939 | /* |
| 940 | * Structure used to pass predefined macros. Maps to D3DXMACRO. |
| 941 | * You can have macro arguments: set identifier to "a(b, c)" or whatever. |
| 942 | */ |
| 943 | typedef struct MOJOSHADER_preprocessorDefinecxx . . $ MOJOSHADER_preprocessorDefine# |
| 944 | { |
| 945 | const char *identifiercxx . . $ MOJOSHADER_preprocessorDefine#identifier.; |
| 946 | const char *definitioncxx . . $ MOJOSHADER_preprocessorDefine#definition.; |
| 947 | } MOJOSHADER_preprocessorDefinecxx . . $ MOJOSHADER_preprocessorDefine#; |
| 948 | |
| 949 | /* |
| 950 | * Used with the MOJOSHADER_includeOpen callback. Maps to D3DXINCLUDE_TYPE. |
| 951 | */ |
| 952 | typedef enumcxx . . $ $anonymous_type_f73a62e8b01a54ac_10# |
| 953 | { |
| 954 | MOJOSHADER_INCLUDETYPE_LOCALcxx . . $ MOJOSHADER_INCLUDETYPE_LOCAL., /* local header: #include "blah.h" */ |
| 955 | MOJOSHADER_INCLUDETYPE_SYSTEMcxx . . $ MOJOSHADER_INCLUDETYPE_SYSTEM. /* system header: #include <blah.h> */ |
| 956 | } MOJOSHADER_includeTypecxx . . $ MOJOSHADER_includeType#; |
| 957 | |
| 958 | |
| 959 | /* |
| 960 | * Structure used to return data from preprocessing of a shader... |
| 961 | */ |
| 962 | /* !!! FIXME: most of these ints should be unsigned. */ |
| 963 | typedef struct MOJOSHADER_preprocessDatacxx . . $ MOJOSHADER_preprocessData# |
| 964 | { |
| 965 | /* |
| 966 | * The number of elements pointed to by (errors). |
| 967 | */ |
| 968 | int error_countcxx . . $ MOJOSHADER_preprocessData#error_count.; |
| 969 | |
| 970 | /* |
| 971 | * (error_count) elements of data that specify errors that were generated |
| 972 | * by parsing this shader. |
| 973 | * This can be NULL if there were no errors or if (error_count) is zero. |
| 974 | */ |
| 975 | MOJOSHADER_errorcxx . . $ MOJOSHADER_error# *errorscxx . . $ MOJOSHADER_preprocessData#errors.; |
| 976 | |
| 977 | /* |
| 978 | * Bytes of output from preprocessing. This is a UTF-8 string. We |
| 979 | * guarantee it to be NULL-terminated. Will be NULL on error. |
| 980 | */ |
| 981 | const char *outputcxx . . $ MOJOSHADER_preprocessData#output.; |
| 982 | |
| 983 | /* |
| 984 | * Byte count for output, not counting any null terminator. |
| 985 | * Will be 0 on error. |
| 986 | */ |
| 987 | int output_lencxx . . $ MOJOSHADER_preprocessData#output_len.; |
| 988 | |
| 989 | /* |
| 990 | * This is the malloc implementation you passed to MOJOSHADER_parse(). |
| 991 | */ |
| 992 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# malloccxx . . $ MOJOSHADER_preprocessData#malloc.; |
| 993 | |
| 994 | /* |
| 995 | * This is the free implementation you passed to MOJOSHADER_parse(). |
| 996 | */ |
| 997 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# freecxx . . $ MOJOSHADER_preprocessData#free.; |
| 998 | |
| 999 | /* |
| 1000 | * This is the pointer you passed as opaque data for your allocator. |
| 1001 | */ |
| 1002 | void *malloc_datacxx . . $ MOJOSHADER_preprocessData#malloc_data.; |
| 1003 | } MOJOSHADER_preprocessDatacxx . . $ MOJOSHADER_preprocessData#; |
| 1004 | |
| 1005 | |
| 1006 | /* |
| 1007 | * This callback allows an app to handle #include statements for the |
| 1008 | * preprocessor. When the preprocessor sees an #include, it will call this |
| 1009 | * function to obtain the contents of the requested file. This is optional; |
| 1010 | * the preprocessor will open files directly if no callback is supplied, but |
| 1011 | * this allows an app to retrieve data from something other than the |
| 1012 | * traditional filesystem (for example, headers packed in a .zip file or |
| 1013 | * headers generated on-the-fly). |
| 1014 | * |
| 1015 | * This function maps to ID3DXInclude::Open() |
| 1016 | * |
| 1017 | * (inctype) specifies the type of header we wish to include. |
| 1018 | * (fname) specifies the name of the file specified on the #include line. |
| 1019 | * (parent) is a string of the entire source file containing the include, in |
| 1020 | * its original, not-yet-preprocessed state. Note that this is just the |
| 1021 | * contents of the specific file, not all source code that the preprocessor |
| 1022 | * has seen through other includes, etc. |
| 1023 | * (outdata) will be set by the callback to a pointer to the included file's |
| 1024 | * contents. The callback is responsible for allocating this however they |
| 1025 | * see fit (we provide allocator functions, but you may ignore them). This |
| 1026 | * pointer must remain valid until the includeClose callback runs. This |
| 1027 | * string does not need to be NULL-terminated. |
| 1028 | * (outbytes) will be set by the callback to the number of bytes pointed to |
| 1029 | * by (outdata). |
| 1030 | * (m),(f), and (d) are the allocator details that the application passed to |
| 1031 | * MojoShader. If these were NULL, MojoShader may have replaced them with its |
| 1032 | * own internal allocators. |
| 1033 | * |
| 1034 | * The callback returns zero on error, non-zero on success. |
| 1035 | * |
| 1036 | * If you supply an includeOpen callback, you must supply includeClose, too. |
| 1037 | */ |
| 1038 | typedef int (MOJOSHADERCALLcxx . . $ `mojoshader.h:42:9`! *MOJOSHADER_includeOpencxx . . $ MOJOSHADER_includeOpen#)(MOJOSHADER_includeTypecxx . . $ MOJOSHADER_includeType# inctype, |
| 1039 | const char *fname, const char *parent, |
| 1040 | const char **outdata, unsigned int *outbytes, |
| 1041 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, void *d); |
| 1042 | |
| 1043 | /* |
| 1044 | * This callback allows an app to clean up the results of a previous |
| 1045 | * includeOpen callback. |
| 1046 | * |
| 1047 | * This function maps to ID3DXInclude::Close() |
| 1048 | * |
| 1049 | * (data) is the data that was returned from a previous call to includeOpen. |
| 1050 | * It is now safe to deallocate this data. |
| 1051 | * (m),(f), and (d) are the same allocator details that were passed to your |
| 1052 | * includeOpen callback. |
| 1053 | * |
| 1054 | * If you supply an includeClose callback, you must supply includeOpen, too. |
| 1055 | */ |
| 1056 | typedef void (MOJOSHADERCALLcxx . . $ `mojoshader.h:42:9`! *MOJOSHADER_includeClosecxx . . $ MOJOSHADER_includeClose#)(const char *data, |
| 1057 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, void *d); |
| 1058 | |
| 1059 | |
| 1060 | /* |
| 1061 | * This function is optional. Even if you are dealing with shader source |
| 1062 | * code, you don't need to explicitly use the preprocessor, as the compiler |
| 1063 | * and assembler will use it behind the scenes. In fact, you probably never |
| 1064 | * need this function unless you are debugging a custom tool (or debugging |
| 1065 | * MojoShader itself). |
| 1066 | * |
| 1067 | * Preprocessing roughly follows the syntax of an ANSI C preprocessor, as |
| 1068 | * Microsoft's Direct3D assembler and HLSL compiler use this syntax. Please |
| 1069 | * note that we try to match the output you'd get from Direct3D's |
| 1070 | * preprocessor, which has some quirks if you're expecting output that matches |
| 1071 | * a generic C preprocessor. |
| 1072 | * |
| 1073 | * This function maps to D3DXPreprocessShader(). |
| 1074 | * |
| 1075 | * (filename) is a NULL-terminated UTF-8 filename. It can be NULL. We do not |
| 1076 | * actually access this file, as we obtain our data from (source). This |
| 1077 | * string is copied when we need to report errors while processing (source), |
| 1078 | * as opposed to errors in a file referenced via the #include directive in |
| 1079 | * (source). If this is NULL, then errors will report the filename as NULL, |
| 1080 | * too. |
| 1081 | * |
| 1082 | * (source) is an string of UTF-8 text to preprocess. It does not need to be |
| 1083 | * NULL-terminated. |
| 1084 | * |
| 1085 | * (sourcelen) is the length of the string pointed to by (source), in bytes. |
| 1086 | * |
| 1087 | * (defines) points to (define_count) preprocessor definitions, and can be |
| 1088 | * NULL. These are treated by the preprocessor as if the source code started |
| 1089 | * with one #define for each entry you pass in here. |
| 1090 | * |
| 1091 | * (include_open) and (include_close) let the app control the preprocessor's |
| 1092 | * behaviour for #include statements. Both are optional and can be NULL, but |
| 1093 | * both must be specified if either is specified. |
| 1094 | * |
| 1095 | * This will return a MOJOSHADER_preprocessorData. You should pass this |
| 1096 | * return value to MOJOSHADER_freePreprocessData() when you are done with |
| 1097 | * it. |
| 1098 | * |
| 1099 | * This function will never return NULL, even if the system is completely |
| 1100 | * out of memory upon entry (in which case, this function returns a static |
| 1101 | * MOJOSHADER_preprocessData object, which is still safe to pass to |
| 1102 | * MOJOSHADER_freePreprocessData()). |
| 1103 | * |
| 1104 | * As preprocessing requires some memory to be allocated, you may provide a |
| 1105 | * custom allocator to this function, which will be used to allocate/free |
| 1106 | * memory. They function just like malloc() and free(). We do not use |
| 1107 | * realloc(). If you don't care, pass NULL in for the allocator functions. |
| 1108 | * If your allocator needs instance-specific data, you may supply it with the |
| 1109 | * (d) parameter. This pointer is passed as-is to your (m) and (f) functions. |
| 1110 | * |
| 1111 | * This function is thread safe, so long as the various callback functions |
| 1112 | * are, too, and that the parameters remains intact for the duration of the |
| 1113 | * call. This allows you to preprocess several shaders on separate CPU cores |
| 1114 | * at the same time. |
| 1115 | */ |
| 1116 | DECLSPECcxx . . $ `<built-in>:410:9`! const MOJOSHADER_preprocessDatacxx . . $ MOJOSHADER_preprocessData# *MOJOSHADER_preprocesscxx . . $ MOJOSHADER_preprocess(f484d502d17e39bb).(const char *filename, |
| 1117 | const char *source, unsigned int sourcelen, |
| 1118 | const MOJOSHADER_preprocessorDefinecxx . . $ MOJOSHADER_preprocessorDefine# *defines, |
| 1119 | unsigned int define_count, |
| 1120 | MOJOSHADER_includeOpencxx . . $ MOJOSHADER_includeOpen# include_open, |
| 1121 | MOJOSHADER_includeClosecxx . . $ MOJOSHADER_includeClose# include_close, |
| 1122 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, void *d); |
| 1123 | |
| 1124 | |
| 1125 | /* |
| 1126 | * Call this to dispose of preprocessing results when you are done with them. |
| 1127 | * This will call the MOJOSHADER_free function you provided to |
| 1128 | * MOJOSHADER_preprocess() multiple times, if you provided one. |
| 1129 | * Passing a NULL here is a safe no-op. |
| 1130 | * |
| 1131 | * This function is thread safe, so long as any allocator you passed into |
| 1132 | * MOJOSHADER_preprocess() is, too. |
| 1133 | */ |
| 1134 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_freePreprocessDatacxx . . $ MOJOSHADER_freePreprocessData(8cb50e4bf58354e4).(const MOJOSHADER_preprocessDatacxx . . $ MOJOSHADER_preprocessData# *data); |
| 1135 | |
| 1136 | |
| 1137 | /* Assembler interface... */ |
| 1138 | |
| 1139 | /* |
| 1140 | * This function is optional. Use this to convert Direct3D shader assembly |
| 1141 | * language into bytecode, which can be handled by MOJOSHADER_parse(). |
| 1142 | * |
| 1143 | * (filename) is a NULL-terminated UTF-8 filename. It can be NULL. We do not |
| 1144 | * actually access this file, as we obtain our data from (source). This |
| 1145 | * string is copied when we need to report errors while processing (source), |
| 1146 | * as opposed to errors in a file referenced via the #include directive in |
| 1147 | * (source). If this is NULL, then errors will report the filename as NULL, |
| 1148 | * too. |
| 1149 | * |
| 1150 | * (source) is an UTF-8 string of valid Direct3D shader assembly source code. |
| 1151 | * It does not need to be NULL-terminated. |
| 1152 | * |
| 1153 | * (sourcelen) is the length of the string pointed to by (source), in bytes. |
| 1154 | * |
| 1155 | * (comments) points to (comment_count) NULL-terminated UTF-8 strings, and |
| 1156 | * can be NULL. These strings are inserted as comments in the bytecode. |
| 1157 | * |
| 1158 | * (symbols) points to (symbol_count) symbol structs, and can be NULL. These |
| 1159 | * become a CTAB field in the bytecode. This is optional, but |
| 1160 | * MOJOSHADER_parse() needs CTAB data for all arrays used in a program, or |
| 1161 | * relative addressing will not be permitted, so you'll want to at least |
| 1162 | * provide symbol information for those. The symbol data is 100% trusted |
| 1163 | * at this time; it will not be checked to see if it matches what was |
| 1164 | * assembled in any way whatsoever. |
| 1165 | * |
| 1166 | * (defines) points to (define_count) preprocessor definitions, and can be |
| 1167 | * NULL. These are treated by the preprocessor as if the source code started |
| 1168 | * with one #define for each entry you pass in here. |
| 1169 | * |
| 1170 | * (include_open) and (include_close) let the app control the preprocessor's |
| 1171 | * behaviour for #include statements. Both are optional and can be NULL, but |
| 1172 | * both must be specified if either is specified. |
| 1173 | * |
| 1174 | * This will return a MOJOSHADER_parseData, like MOJOSHADER_parse() would, |
| 1175 | * except the profile will be MOJOSHADER_PROFILE_BYTECODE and the output |
| 1176 | * will be the assembled bytecode instead of some other language. This output |
| 1177 | * can be pushed back through MOJOSHADER_parseData() with a different profile. |
| 1178 | * |
| 1179 | * This function will never return NULL, even if the system is completely |
| 1180 | * out of memory upon entry (in which case, this function returns a static |
| 1181 | * MOJOSHADER_parseData object, which is still safe to pass to |
| 1182 | * MOJOSHADER_freeParseData()). |
| 1183 | * |
| 1184 | * As assembling requires some memory to be allocated, you may provide a |
| 1185 | * custom allocator to this function, which will be used to allocate/free |
| 1186 | * memory. They function just like malloc() and free(). We do not use |
| 1187 | * realloc(). If you don't care, pass NULL in for the allocator functions. |
| 1188 | * If your allocator needs instance-specific data, you may supply it with the |
| 1189 | * (d) parameter. This pointer is passed as-is to your (m) and (f) functions. |
| 1190 | * |
| 1191 | * This function is thread safe, so long as the various callback functions |
| 1192 | * are, too, and that the parameters remains intact for the duration of the |
| 1193 | * call. This allows you to assemble several shaders on separate CPU cores |
| 1194 | * at the same time. |
| 1195 | */ |
| 1196 | DECLSPECcxx . . $ `<built-in>:410:9`! const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *MOJOSHADER_assemblecxx . . $ MOJOSHADER_assemble(7e5b741c6450972).(const char *filename, |
| 1197 | const char *source, unsigned int sourcelen, |
| 1198 | const char **comments, unsigned int comment_count, |
| 1199 | const MOJOSHADER_symbolcxx . . $ MOJOSHADER_symbol# *symbols, |
| 1200 | unsigned int symbol_count, |
| 1201 | const MOJOSHADER_preprocessorDefinecxx . . $ MOJOSHADER_preprocessorDefine# *defines, |
| 1202 | unsigned int define_count, |
| 1203 | MOJOSHADER_includeOpencxx . . $ MOJOSHADER_includeOpen# include_open, |
| 1204 | MOJOSHADER_includeClosecxx . . $ MOJOSHADER_includeClose# include_close, |
| 1205 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, void *d); |
| 1206 | |
| 1207 | |
| 1208 | /* High level shading language support... */ |
| 1209 | |
| 1210 | /* |
| 1211 | * Source profile strings for HLSL: Direct3D High Level Shading Language. |
| 1212 | */ |
| 1213 | #define MOJOSHADER_SRC_PROFILE_HLSL_VS_1_1cxx . . $ `mojoshader.h:1213:9`! "hlsl_vs_1_1" |
| 1214 | #define MOJOSHADER_SRC_PROFILE_HLSL_VS_2_0cxx . . $ `mojoshader.h:1214:9`! "hlsl_vs_2_0" |
| 1215 | #define MOJOSHADER_SRC_PROFILE_HLSL_VS_3_0cxx . . $ `mojoshader.h:1215:9`! "hlsl_vs_3_0" |
| 1216 | #define MOJOSHADER_SRC_PROFILE_HLSL_PS_1_1cxx . . $ `mojoshader.h:1216:9`! "hlsl_ps_1_1" |
| 1217 | #define MOJOSHADER_SRC_PROFILE_HLSL_PS_1_2cxx . . $ `mojoshader.h:1217:9`! "hlsl_ps_1_2" |
| 1218 | #define MOJOSHADER_SRC_PROFILE_HLSL_PS_1_3cxx . . $ `mojoshader.h:1218:9`! "hlsl_ps_1_3" |
| 1219 | #define MOJOSHADER_SRC_PROFILE_HLSL_PS_1_4cxx . . $ `mojoshader.h:1219:9`! "hlsl_ps_1_4" |
| 1220 | #define MOJOSHADER_SRC_PROFILE_HLSL_PS_2_0cxx . . $ `mojoshader.h:1220:9`! "hlsl_ps_2_0" |
| 1221 | #define MOJOSHADER_SRC_PROFILE_HLSL_PS_3_0cxx . . $ `mojoshader.h:1221:9`! "hlsl_ps_3_0" |
| 1222 | |
| 1223 | |
| 1224 | /* Abstract Syntax Tree interface... */ |
| 1225 | |
| 1226 | /* |
| 1227 | * ATTENTION: This adds a lot of stuff to the API, but almost everyone can |
| 1228 | * ignore this section. Seriously, go ahead and skip over anything that has |
| 1229 | * "AST" in it, unless you know why you'd want to use it. |
| 1230 | * |
| 1231 | * ALSO: This API is still evolving! We make no promises at this time to keep |
| 1232 | * source or binary compatibility for the AST pieces. |
| 1233 | * |
| 1234 | * Important notes: |
| 1235 | * - ASTs are the result of parsing the source code: a program that fails to |
| 1236 | * compile will often parse successfully. Undeclared variables, |
| 1237 | * type incompatibilities, etc, aren't detected at this point. |
| 1238 | * - Vector swizzles (the ".xyzw" part of "MyVec4.xyzw") will look like |
| 1239 | * structure dereferences. We don't realize these are actually swizzles |
| 1240 | * until semantic analysis. |
| 1241 | * - MOJOSHADER_astDataType info is not reliable when returned from |
| 1242 | * MOJOSHADER_parseAst()! Most of the datatype info will be missing or have |
| 1243 | * inaccurate data types. We sort these out during semantic analysis, which |
| 1244 | * happens after the AST parsing is complete. A few are filled in, or can |
| 1245 | * be deduced fairly trivially by processing several pieces into one. |
| 1246 | * It's enough that you can reproduce the original source code, more or |
| 1247 | * less, from the AST. |
| 1248 | */ |
| 1249 | |
| 1250 | /* High-level datatypes for AST nodes. */ |
| 1251 | typedef enum MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType# |
| 1252 | { |
| 1253 | MOJOSHADER_AST_DATATYPE_NONEcxx . . $ MOJOSHADER_AST_DATATYPE_NONE., |
| 1254 | MOJOSHADER_AST_DATATYPE_BOOLcxx . . $ MOJOSHADER_AST_DATATYPE_BOOL., |
| 1255 | MOJOSHADER_AST_DATATYPE_INTcxx . . $ MOJOSHADER_AST_DATATYPE_INT., |
| 1256 | MOJOSHADER_AST_DATATYPE_UINTcxx . . $ MOJOSHADER_AST_DATATYPE_UINT., |
| 1257 | MOJOSHADER_AST_DATATYPE_FLOATcxx . . $ MOJOSHADER_AST_DATATYPE_FLOAT., |
| 1258 | MOJOSHADER_AST_DATATYPE_FLOAT_SNORMcxx . . $ MOJOSHADER_AST_DATATYPE_FLOAT_SNORM., |
| 1259 | MOJOSHADER_AST_DATATYPE_FLOAT_UNORMcxx . . $ MOJOSHADER_AST_DATATYPE_FLOAT_UNORM., |
| 1260 | MOJOSHADER_AST_DATATYPE_HALFcxx . . $ MOJOSHADER_AST_DATATYPE_HALF., |
| 1261 | MOJOSHADER_AST_DATATYPE_DOUBLEcxx . . $ MOJOSHADER_AST_DATATYPE_DOUBLE., |
| 1262 | MOJOSHADER_AST_DATATYPE_STRINGcxx . . $ MOJOSHADER_AST_DATATYPE_STRING., |
| 1263 | MOJOSHADER_AST_DATATYPE_SAMPLER_1Dcxx . . $ MOJOSHADER_AST_DATATYPE_SAMPLER_1D., |
| 1264 | MOJOSHADER_AST_DATATYPE_SAMPLER_2Dcxx . . $ MOJOSHADER_AST_DATATYPE_SAMPLER_2D., |
| 1265 | MOJOSHADER_AST_DATATYPE_SAMPLER_3Dcxx . . $ MOJOSHADER_AST_DATATYPE_SAMPLER_3D., |
| 1266 | MOJOSHADER_AST_DATATYPE_SAMPLER_CUBEcxx . . $ MOJOSHADER_AST_DATATYPE_SAMPLER_CUBE., |
| 1267 | MOJOSHADER_AST_DATATYPE_SAMPLER_STATEcxx . . $ MOJOSHADER_AST_DATATYPE_SAMPLER_STATE., |
| 1268 | MOJOSHADER_AST_DATATYPE_SAMPLER_COMPARISON_STATEcxx . . $ MOJOSHADER_AST_DATATYPE_SAMPLER_COMPARISON_STATE., |
| 1269 | MOJOSHADER_AST_DATATYPE_STRUCTcxx . . $ MOJOSHADER_AST_DATATYPE_STRUCT., |
| 1270 | MOJOSHADER_AST_DATATYPE_ARRAYcxx . . $ MOJOSHADER_AST_DATATYPE_ARRAY., |
| 1271 | MOJOSHADER_AST_DATATYPE_VECTORcxx . . $ MOJOSHADER_AST_DATATYPE_VECTOR., |
| 1272 | MOJOSHADER_AST_DATATYPE_MATRIXcxx . . $ MOJOSHADER_AST_DATATYPE_MATRIX., |
| 1273 | MOJOSHADER_AST_DATATYPE_BUFFERcxx . . $ MOJOSHADER_AST_DATATYPE_BUFFER., |
| 1274 | MOJOSHADER_AST_DATATYPE_FUNCTIONcxx . . $ MOJOSHADER_AST_DATATYPE_FUNCTION., |
| 1275 | MOJOSHADER_AST_DATATYPE_USERcxx . . $ MOJOSHADER_AST_DATATYPE_USER. |
| 1276 | } MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType#; |
| 1277 | #define MOJOSHADER_AST_DATATYPE_CONSTcxx . . $ `mojoshader.h:1277:9`! (1 << 31) |
| 1278 | |
| 1279 | typedef union MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType#; |
| 1280 | |
| 1281 | /* This is just part of DataTypeStruct, never appears outside of it. */ |
| 1282 | typedef struct MOJOSHADER_astDataTypeStructMembercxx . . $ MOJOSHADER_astDataTypeStructMember# |
| 1283 | { |
| 1284 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astDataTypeStructMember#datatype.; |
| 1285 | const char *identifiercxx . . $ MOJOSHADER_astDataTypeStructMember#identifier.; |
| 1286 | } MOJOSHADER_astDataTypeStructMembercxx . . $ MOJOSHADER_astDataTypeStructMember#; |
| 1287 | |
| 1288 | typedef struct MOJOSHADER_astDataTypeStructcxx . . $ MOJOSHADER_astDataTypeStruct# |
| 1289 | { |
| 1290 | MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType# typecxx . . $ MOJOSHADER_astDataTypeStruct#type.; |
| 1291 | const MOJOSHADER_astDataTypeStructMembercxx . . $ MOJOSHADER_astDataTypeStructMember# *memberscxx . . $ MOJOSHADER_astDataTypeStruct#members.; |
| 1292 | int member_countcxx . . $ MOJOSHADER_astDataTypeStruct#member_count.; |
| 1293 | } MOJOSHADER_astDataTypeStructcxx . . $ MOJOSHADER_astDataTypeStruct#; |
| 1294 | |
| 1295 | typedef struct MOJOSHADER_astDataTypeArraycxx . . $ MOJOSHADER_astDataTypeArray# |
| 1296 | { |
| 1297 | MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType# typecxx . . $ MOJOSHADER_astDataTypeArray#type.; |
| 1298 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *basecxx . . $ MOJOSHADER_astDataTypeArray#base.; |
| 1299 | int elementscxx . . $ MOJOSHADER_astDataTypeArray#elements.; |
| 1300 | } MOJOSHADER_astDataTypeArraycxx . . $ MOJOSHADER_astDataTypeArray#; |
| 1301 | |
| 1302 | typedef MOJOSHADER_astDataTypeArraycxx . . $ MOJOSHADER_astDataTypeArray# MOJOSHADER_astDataTypeVectorcxx . . $ MOJOSHADER_astDataTypeVector#; |
| 1303 | |
| 1304 | typedef struct MOJOSHADER_astDataTypeMatrixcxx . . $ MOJOSHADER_astDataTypeMatrix# |
| 1305 | { |
| 1306 | MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType# typecxx . . $ MOJOSHADER_astDataTypeMatrix#type.; |
| 1307 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *basecxx . . $ MOJOSHADER_astDataTypeMatrix#base.; |
| 1308 | int rowscxx . . $ MOJOSHADER_astDataTypeMatrix#rows.; |
| 1309 | int columnscxx . . $ MOJOSHADER_astDataTypeMatrix#columns.; |
| 1310 | } MOJOSHADER_astDataTypeMatrixcxx . . $ MOJOSHADER_astDataTypeMatrix#; |
| 1311 | |
| 1312 | typedef struct MOJOSHADER_astDataTypeBuffercxx . . $ MOJOSHADER_astDataTypeBuffer# |
| 1313 | { |
| 1314 | MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType# typecxx . . $ MOJOSHADER_astDataTypeBuffer#type.; |
| 1315 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *basecxx . . $ MOJOSHADER_astDataTypeBuffer#base.; |
| 1316 | } MOJOSHADER_astDataTypeBuffercxx . . $ MOJOSHADER_astDataTypeBuffer#; |
| 1317 | |
| 1318 | typedef struct MOJOSHADER_astDataTypeFunctioncxx . . $ MOJOSHADER_astDataTypeFunction# |
| 1319 | { |
| 1320 | MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType# typecxx . . $ MOJOSHADER_astDataTypeFunction#type.; |
| 1321 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *retvalcxx . . $ MOJOSHADER_astDataTypeFunction#retval.; |
| 1322 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# **paramscxx . . $ MOJOSHADER_astDataTypeFunction#params.; |
| 1323 | int num_paramscxx . . $ MOJOSHADER_astDataTypeFunction#num_params.; |
| 1324 | int intrinsiccxx . . $ MOJOSHADER_astDataTypeFunction#intrinsic.; /* non-zero for built-in functions */ |
| 1325 | } MOJOSHADER_astDataTypeFunctioncxx . . $ MOJOSHADER_astDataTypeFunction#; |
| 1326 | |
| 1327 | typedef struct MOJOSHADER_astDataTypeUsercxx . . $ MOJOSHADER_astDataTypeUser# |
| 1328 | { |
| 1329 | MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType# typecxx . . $ MOJOSHADER_astDataTypeUser#type.; |
| 1330 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *detailscxx . . $ MOJOSHADER_astDataTypeUser#details.; |
| 1331 | const char *namecxx . . $ MOJOSHADER_astDataTypeUser#name.; |
| 1332 | } MOJOSHADER_astDataTypeUsercxx . . $ MOJOSHADER_astDataTypeUser#; |
| 1333 | |
| 1334 | union MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# |
| 1335 | { |
| 1336 | MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType# typecxx . . $ MOJOSHADER_astDataType#type.; |
| 1337 | MOJOSHADER_astDataTypeArraycxx . . $ MOJOSHADER_astDataTypeArray# arraycxx . . $ MOJOSHADER_astDataType#array.; |
| 1338 | MOJOSHADER_astDataTypeStructcxx . . $ MOJOSHADER_astDataTypeStruct# structurecxx . . $ MOJOSHADER_astDataType#structure.; |
| 1339 | MOJOSHADER_astDataTypeVectorcxx . . $ MOJOSHADER_astDataTypeVector# vectorcxx . . $ MOJOSHADER_astDataType#vector.; |
| 1340 | MOJOSHADER_astDataTypeMatrixcxx . . $ MOJOSHADER_astDataTypeMatrix# matrixcxx . . $ MOJOSHADER_astDataType#matrix.; |
| 1341 | MOJOSHADER_astDataTypeBuffercxx . . $ MOJOSHADER_astDataTypeBuffer# buffercxx . . $ MOJOSHADER_astDataType#buffer.; |
| 1342 | MOJOSHADER_astDataTypeUsercxx . . $ MOJOSHADER_astDataTypeUser# usercxx . . $ MOJOSHADER_astDataType#user.; |
| 1343 | MOJOSHADER_astDataTypeFunctioncxx . . $ MOJOSHADER_astDataTypeFunction# functioncxx . . $ MOJOSHADER_astDataType#function.; |
| 1344 | }; |
| 1345 | |
| 1346 | /* Structures that make up the parse tree... */ |
| 1347 | |
| 1348 | typedef enum MOJOSHADER_astNodeTypecxx . . $ MOJOSHADER_astNodeType# |
| 1349 | { |
| 1350 | MOJOSHADER_AST_OP_START_RANGEcxx . . $ MOJOSHADER_AST_OP_START_RANGE., /* expression operators. */ |
| 1351 | |
| 1352 | MOJOSHADER_AST_OP_START_RANGE_UNARYcxx . . $ MOJOSHADER_AST_OP_START_RANGE_UNARY., /* unary operators. */ |
| 1353 | MOJOSHADER_AST_OP_PREINCREMENTcxx . . $ MOJOSHADER_AST_OP_PREINCREMENT., |
| 1354 | MOJOSHADER_AST_OP_PREDECREMENTcxx . . $ MOJOSHADER_AST_OP_PREDECREMENT., |
| 1355 | MOJOSHADER_AST_OP_NEGATEcxx . . $ MOJOSHADER_AST_OP_NEGATE., |
| 1356 | MOJOSHADER_AST_OP_COMPLEMENTcxx . . $ MOJOSHADER_AST_OP_COMPLEMENT., |
| 1357 | MOJOSHADER_AST_OP_NOTcxx . . $ MOJOSHADER_AST_OP_NOT., |
| 1358 | MOJOSHADER_AST_OP_POSTINCREMENTcxx . . $ MOJOSHADER_AST_OP_POSTINCREMENT., |
| 1359 | MOJOSHADER_AST_OP_POSTDECREMENTcxx . . $ MOJOSHADER_AST_OP_POSTDECREMENT., |
| 1360 | MOJOSHADER_AST_OP_CASTcxx . . $ MOJOSHADER_AST_OP_CAST., |
| 1361 | MOJOSHADER_AST_OP_END_RANGE_UNARYcxx . . $ MOJOSHADER_AST_OP_END_RANGE_UNARY., |
| 1362 | |
| 1363 | MOJOSHADER_AST_OP_START_RANGE_BINARYcxx . . $ MOJOSHADER_AST_OP_START_RANGE_BINARY., /* binary operators. */ |
| 1364 | MOJOSHADER_AST_OP_COMMAcxx . . $ MOJOSHADER_AST_OP_COMMA., |
| 1365 | MOJOSHADER_AST_OP_MULTIPLYcxx . . $ MOJOSHADER_AST_OP_MULTIPLY., |
| 1366 | MOJOSHADER_AST_OP_DIVIDEcxx . . $ MOJOSHADER_AST_OP_DIVIDE., |
| 1367 | MOJOSHADER_AST_OP_MODULOcxx . . $ MOJOSHADER_AST_OP_MODULO., |
| 1368 | MOJOSHADER_AST_OP_ADDcxx . . $ MOJOSHADER_AST_OP_ADD., |
| 1369 | MOJOSHADER_AST_OP_SUBTRACTcxx . . $ MOJOSHADER_AST_OP_SUBTRACT., |
| 1370 | MOJOSHADER_AST_OP_LSHIFTcxx . . $ MOJOSHADER_AST_OP_LSHIFT., |
| 1371 | MOJOSHADER_AST_OP_RSHIFTcxx . . $ MOJOSHADER_AST_OP_RSHIFT., |
| 1372 | MOJOSHADER_AST_OP_LESSTHANcxx . . $ MOJOSHADER_AST_OP_LESSTHAN., |
| 1373 | MOJOSHADER_AST_OP_GREATERTHANcxx . . $ MOJOSHADER_AST_OP_GREATERTHAN., |
| 1374 | MOJOSHADER_AST_OP_LESSTHANOREQUALcxx . . $ MOJOSHADER_AST_OP_LESSTHANOREQUAL., |
| 1375 | MOJOSHADER_AST_OP_GREATERTHANOREQUALcxx . . $ MOJOSHADER_AST_OP_GREATERTHANOREQUAL., |
| 1376 | MOJOSHADER_AST_OP_EQUALcxx . . $ MOJOSHADER_AST_OP_EQUAL., |
| 1377 | MOJOSHADER_AST_OP_NOTEQUALcxx . . $ MOJOSHADER_AST_OP_NOTEQUAL., |
| 1378 | MOJOSHADER_AST_OP_BINARYANDcxx . . $ MOJOSHADER_AST_OP_BINARYAND., |
| 1379 | MOJOSHADER_AST_OP_BINARYXORcxx . . $ MOJOSHADER_AST_OP_BINARYXOR., |
| 1380 | MOJOSHADER_AST_OP_BINARYORcxx . . $ MOJOSHADER_AST_OP_BINARYOR., |
| 1381 | MOJOSHADER_AST_OP_LOGICALANDcxx . . $ MOJOSHADER_AST_OP_LOGICALAND., |
| 1382 | MOJOSHADER_AST_OP_LOGICALORcxx . . $ MOJOSHADER_AST_OP_LOGICALOR., |
| 1383 | MOJOSHADER_AST_OP_ASSIGNcxx . . $ MOJOSHADER_AST_OP_ASSIGN., |
| 1384 | MOJOSHADER_AST_OP_MULASSIGNcxx . . $ MOJOSHADER_AST_OP_MULASSIGN., |
| 1385 | MOJOSHADER_AST_OP_DIVASSIGNcxx . . $ MOJOSHADER_AST_OP_DIVASSIGN., |
| 1386 | MOJOSHADER_AST_OP_MODASSIGNcxx . . $ MOJOSHADER_AST_OP_MODASSIGN., |
| 1387 | MOJOSHADER_AST_OP_ADDASSIGNcxx . . $ MOJOSHADER_AST_OP_ADDASSIGN., |
| 1388 | MOJOSHADER_AST_OP_SUBASSIGNcxx . . $ MOJOSHADER_AST_OP_SUBASSIGN., |
| 1389 | MOJOSHADER_AST_OP_LSHIFTASSIGNcxx . . $ MOJOSHADER_AST_OP_LSHIFTASSIGN., |
| 1390 | MOJOSHADER_AST_OP_RSHIFTASSIGNcxx . . $ MOJOSHADER_AST_OP_RSHIFTASSIGN., |
| 1391 | MOJOSHADER_AST_OP_ANDASSIGNcxx . . $ MOJOSHADER_AST_OP_ANDASSIGN., |
| 1392 | MOJOSHADER_AST_OP_XORASSIGNcxx . . $ MOJOSHADER_AST_OP_XORASSIGN., |
| 1393 | MOJOSHADER_AST_OP_ORASSIGNcxx . . $ MOJOSHADER_AST_OP_ORASSIGN., |
| 1394 | MOJOSHADER_AST_OP_DEREF_ARRAYcxx . . $ MOJOSHADER_AST_OP_DEREF_ARRAY., |
| 1395 | MOJOSHADER_AST_OP_END_RANGE_BINARYcxx . . $ MOJOSHADER_AST_OP_END_RANGE_BINARY., |
| 1396 | |
| 1397 | MOJOSHADER_AST_OP_START_RANGE_TERNARYcxx . . $ MOJOSHADER_AST_OP_START_RANGE_TERNARY., /* ternary operators. */ |
| 1398 | MOJOSHADER_AST_OP_CONDITIONALcxx . . $ MOJOSHADER_AST_OP_CONDITIONAL., |
| 1399 | MOJOSHADER_AST_OP_END_RANGE_TERNARYcxx . . $ MOJOSHADER_AST_OP_END_RANGE_TERNARY., |
| 1400 | |
| 1401 | MOJOSHADER_AST_OP_START_RANGE_DATAcxx . . $ MOJOSHADER_AST_OP_START_RANGE_DATA., /* expression operands. */ |
| 1402 | MOJOSHADER_AST_OP_IDENTIFIERcxx . . $ MOJOSHADER_AST_OP_IDENTIFIER., |
| 1403 | MOJOSHADER_AST_OP_INT_LITERALcxx . . $ MOJOSHADER_AST_OP_INT_LITERAL., |
| 1404 | MOJOSHADER_AST_OP_FLOAT_LITERALcxx . . $ MOJOSHADER_AST_OP_FLOAT_LITERAL., |
| 1405 | MOJOSHADER_AST_OP_STRING_LITERALcxx . . $ MOJOSHADER_AST_OP_STRING_LITERAL., |
| 1406 | MOJOSHADER_AST_OP_BOOLEAN_LITERALcxx . . $ MOJOSHADER_AST_OP_BOOLEAN_LITERAL., |
| 1407 | MOJOSHADER_AST_OP_END_RANGE_DATAcxx . . $ MOJOSHADER_AST_OP_END_RANGE_DATA., |
| 1408 | |
| 1409 | MOJOSHADER_AST_OP_START_RANGE_MISCcxx . . $ MOJOSHADER_AST_OP_START_RANGE_MISC., /* other expression things. */ |
| 1410 | MOJOSHADER_AST_OP_DEREF_STRUCTcxx . . $ MOJOSHADER_AST_OP_DEREF_STRUCT., |
| 1411 | MOJOSHADER_AST_OP_CALLFUNCcxx . . $ MOJOSHADER_AST_OP_CALLFUNC., |
| 1412 | MOJOSHADER_AST_OP_CONSTRUCTORcxx . . $ MOJOSHADER_AST_OP_CONSTRUCTOR., |
| 1413 | MOJOSHADER_AST_OP_END_RANGE_MISCcxx . . $ MOJOSHADER_AST_OP_END_RANGE_MISC., |
| 1414 | MOJOSHADER_AST_OP_END_RANGEcxx . . $ MOJOSHADER_AST_OP_END_RANGE., |
| 1415 | |
| 1416 | MOJOSHADER_AST_COMPUNIT_START_RANGEcxx . . $ MOJOSHADER_AST_COMPUNIT_START_RANGE., /* things in global scope. */ |
| 1417 | MOJOSHADER_AST_COMPUNIT_FUNCTIONcxx . . $ MOJOSHADER_AST_COMPUNIT_FUNCTION., |
| 1418 | MOJOSHADER_AST_COMPUNIT_TYPEDEFcxx . . $ MOJOSHADER_AST_COMPUNIT_TYPEDEF., |
| 1419 | MOJOSHADER_AST_COMPUNIT_STRUCTcxx . . $ MOJOSHADER_AST_COMPUNIT_STRUCT., |
| 1420 | MOJOSHADER_AST_COMPUNIT_VARIABLEcxx . . $ MOJOSHADER_AST_COMPUNIT_VARIABLE., |
| 1421 | MOJOSHADER_AST_COMPUNIT_END_RANGEcxx . . $ MOJOSHADER_AST_COMPUNIT_END_RANGE., |
| 1422 | |
| 1423 | MOJOSHADER_AST_STATEMENT_START_RANGEcxx . . $ MOJOSHADER_AST_STATEMENT_START_RANGE., /* statements in function scope. */ |
| 1424 | MOJOSHADER_AST_STATEMENT_EMPTYcxx . . $ MOJOSHADER_AST_STATEMENT_EMPTY., |
| 1425 | MOJOSHADER_AST_STATEMENT_BREAKcxx . . $ MOJOSHADER_AST_STATEMENT_BREAK., |
| 1426 | MOJOSHADER_AST_STATEMENT_CONTINUEcxx . . $ MOJOSHADER_AST_STATEMENT_CONTINUE., |
| 1427 | MOJOSHADER_AST_STATEMENT_DISCARDcxx . . $ MOJOSHADER_AST_STATEMENT_DISCARD., |
| 1428 | MOJOSHADER_AST_STATEMENT_BLOCKcxx . . $ MOJOSHADER_AST_STATEMENT_BLOCK., |
| 1429 | MOJOSHADER_AST_STATEMENT_EXPRESSIONcxx . . $ MOJOSHADER_AST_STATEMENT_EXPRESSION., |
| 1430 | MOJOSHADER_AST_STATEMENT_IFcxx . . $ MOJOSHADER_AST_STATEMENT_IF., |
| 1431 | MOJOSHADER_AST_STATEMENT_SWITCHcxx . . $ MOJOSHADER_AST_STATEMENT_SWITCH., |
| 1432 | MOJOSHADER_AST_STATEMENT_FORcxx . . $ MOJOSHADER_AST_STATEMENT_FOR., |
| 1433 | MOJOSHADER_AST_STATEMENT_DOcxx . . $ MOJOSHADER_AST_STATEMENT_DO., |
| 1434 | MOJOSHADER_AST_STATEMENT_WHILEcxx . . $ MOJOSHADER_AST_STATEMENT_WHILE., |
| 1435 | MOJOSHADER_AST_STATEMENT_RETURNcxx . . $ MOJOSHADER_AST_STATEMENT_RETURN., |
| 1436 | MOJOSHADER_AST_STATEMENT_TYPEDEFcxx . . $ MOJOSHADER_AST_STATEMENT_TYPEDEF., |
| 1437 | MOJOSHADER_AST_STATEMENT_STRUCTcxx . . $ MOJOSHADER_AST_STATEMENT_STRUCT., |
| 1438 | MOJOSHADER_AST_STATEMENT_VARDECLcxx . . $ MOJOSHADER_AST_STATEMENT_VARDECL., |
| 1439 | MOJOSHADER_AST_STATEMENT_END_RANGEcxx . . $ MOJOSHADER_AST_STATEMENT_END_RANGE., |
| 1440 | |
| 1441 | MOJOSHADER_AST_MISC_START_RANGEcxx . . $ MOJOSHADER_AST_MISC_START_RANGE., /* misc. syntactic glue. */ |
| 1442 | MOJOSHADER_AST_FUNCTION_PARAMScxx . . $ MOJOSHADER_AST_FUNCTION_PARAMS., |
| 1443 | MOJOSHADER_AST_FUNCTION_SIGNATUREcxx . . $ MOJOSHADER_AST_FUNCTION_SIGNATURE., |
| 1444 | MOJOSHADER_AST_SCALAR_OR_ARRAYcxx . . $ MOJOSHADER_AST_SCALAR_OR_ARRAY., |
| 1445 | MOJOSHADER_AST_TYPEDEFcxx . . $ MOJOSHADER_AST_TYPEDEF., |
| 1446 | MOJOSHADER_AST_PACK_OFFSETcxx . . $ MOJOSHADER_AST_PACK_OFFSET., |
| 1447 | MOJOSHADER_AST_VARIABLE_LOWLEVELcxx . . $ MOJOSHADER_AST_VARIABLE_LOWLEVEL., |
| 1448 | MOJOSHADER_AST_ANNOTATIONcxx . . $ MOJOSHADER_AST_ANNOTATION., |
| 1449 | MOJOSHADER_AST_VARIABLE_DECLARATIONcxx . . $ MOJOSHADER_AST_VARIABLE_DECLARATION., |
| 1450 | MOJOSHADER_AST_STRUCT_DECLARATIONcxx . . $ MOJOSHADER_AST_STRUCT_DECLARATION., |
| 1451 | MOJOSHADER_AST_STRUCT_MEMBERcxx . . $ MOJOSHADER_AST_STRUCT_MEMBER., |
| 1452 | MOJOSHADER_AST_SWITCH_CASEcxx . . $ MOJOSHADER_AST_SWITCH_CASE., |
| 1453 | MOJOSHADER_AST_ARGUMENTScxx . . $ MOJOSHADER_AST_ARGUMENTS., |
| 1454 | MOJOSHADER_AST_MISC_END_RANGEcxx . . $ MOJOSHADER_AST_MISC_END_RANGE., |
| 1455 | |
| 1456 | MOJOSHADER_AST_END_RANGEcxx . . $ MOJOSHADER_AST_END_RANGE. |
| 1457 | } MOJOSHADER_astNodeTypecxx . . $ MOJOSHADER_astNodeType#; |
| 1458 | |
| 1459 | typedef struct MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# |
| 1460 | { |
| 1461 | MOJOSHADER_astNodeTypecxx . . $ MOJOSHADER_astNodeType# typecxx . . $ MOJOSHADER_astNodeInfo#type.; |
| 1462 | const char *filenamecxx . . $ MOJOSHADER_astNodeInfo#filename.; |
| 1463 | unsigned int linecxx . . $ MOJOSHADER_astNodeInfo#line.; |
| 1464 | } MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo#; |
| 1465 | |
| 1466 | typedef enum MOJOSHADER_astVariableAttributescxx . . $ MOJOSHADER_astVariableAttributes# |
| 1467 | { |
| 1468 | MOJOSHADER_AST_VARATTR_EXTERNcxx . . $ MOJOSHADER_AST_VARATTR_EXTERN. = (1 << 0), |
| 1469 | MOJOSHADER_AST_VARATTR_NOINTERPOLATIONcxx . . $ MOJOSHADER_AST_VARATTR_NOINTERPOLATION. = (1 << 1), |
| 1470 | MOJOSHADER_AST_VARATTR_SHAREDcxx . . $ MOJOSHADER_AST_VARATTR_SHARED. = (1 << 2), |
| 1471 | MOJOSHADER_AST_VARATTR_STATICcxx . . $ MOJOSHADER_AST_VARATTR_STATIC. = (1 << 3), |
| 1472 | MOJOSHADER_AST_VARATTR_UNIFORMcxx . . $ MOJOSHADER_AST_VARATTR_UNIFORM. = (1 << 4), |
| 1473 | MOJOSHADER_AST_VARATTR_VOLATILEcxx . . $ MOJOSHADER_AST_VARATTR_VOLATILE. = (1 << 5), |
| 1474 | MOJOSHADER_AST_VARATTR_CONSTcxx . . $ MOJOSHADER_AST_VARATTR_CONST. = (1 << 6), |
| 1475 | MOJOSHADER_AST_VARATTR_ROWMAJORcxx . . $ MOJOSHADER_AST_VARATTR_ROWMAJOR. = (1 << 7), |
| 1476 | MOJOSHADER_AST_VARATTR_COLUMNMAJORcxx . . $ MOJOSHADER_AST_VARATTR_COLUMNMAJOR. = (1 << 8) |
| 1477 | } MOJOSHADER_astVariableAttributescxx . . $ MOJOSHADER_astVariableAttributes#; |
| 1478 | |
| 1479 | typedef enum MOJOSHADER_astIfAttributescxx . . $ MOJOSHADER_astIfAttributes# |
| 1480 | { |
| 1481 | MOJOSHADER_AST_IFATTR_NONEcxx . . $ MOJOSHADER_AST_IFATTR_NONE., |
| 1482 | MOJOSHADER_AST_IFATTR_BRANCHcxx . . $ MOJOSHADER_AST_IFATTR_BRANCH., |
| 1483 | MOJOSHADER_AST_IFATTR_FLATTENcxx . . $ MOJOSHADER_AST_IFATTR_FLATTEN., |
| 1484 | MOJOSHADER_AST_IFATTR_IFALLcxx . . $ MOJOSHADER_AST_IFATTR_IFALL., |
| 1485 | MOJOSHADER_AST_IFATTR_IFANYcxx . . $ MOJOSHADER_AST_IFATTR_IFANY., |
| 1486 | MOJOSHADER_AST_IFATTR_PREDICATEcxx . . $ MOJOSHADER_AST_IFATTR_PREDICATE., |
| 1487 | MOJOSHADER_AST_IFATTR_PREDICATEBLOCKcxx . . $ MOJOSHADER_AST_IFATTR_PREDICATEBLOCK. |
| 1488 | } MOJOSHADER_astIfAttributescxx . . $ MOJOSHADER_astIfAttributes#; |
| 1489 | |
| 1490 | typedef enum MOJOSHADER_astSwitchAttributescxx . . $ MOJOSHADER_astSwitchAttributes# |
| 1491 | { |
| 1492 | MOJOSHADER_AST_SWITCHATTR_NONEcxx . . $ MOJOSHADER_AST_SWITCHATTR_NONE., |
| 1493 | MOJOSHADER_AST_SWITCHATTR_FLATTENcxx . . $ MOJOSHADER_AST_SWITCHATTR_FLATTEN., |
| 1494 | MOJOSHADER_AST_SWITCHATTR_BRANCHcxx . . $ MOJOSHADER_AST_SWITCHATTR_BRANCH., |
| 1495 | MOJOSHADER_AST_SWITCHATTR_FORCECASEcxx . . $ MOJOSHADER_AST_SWITCHATTR_FORCECASE., |
| 1496 | MOJOSHADER_AST_SWITCHATTR_CALLcxx . . $ MOJOSHADER_AST_SWITCHATTR_CALL. |
| 1497 | } MOJOSHADER_astSwitchAttributescxx . . $ MOJOSHADER_astSwitchAttributes#; |
| 1498 | |
| 1499 | /* You can cast any AST node pointer to this. */ |
| 1500 | typedef struct MOJOSHADER_astGenericcxx . . $ MOJOSHADER_astGeneric# |
| 1501 | { |
| 1502 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astGeneric#ast.; |
| 1503 | } MOJOSHADER_astGenericcxx . . $ MOJOSHADER_astGeneric#; |
| 1504 | |
| 1505 | typedef struct MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# |
| 1506 | { |
| 1507 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpression#ast.; |
| 1508 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpression#datatype.; |
| 1509 | } MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression#; |
| 1510 | |
| 1511 | typedef struct MOJOSHADER_astArgumentscxx . . $ MOJOSHADER_astArguments# |
| 1512 | { |
| 1513 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astArguments#ast.; /* Always MOJOSHADER_AST_ARGUMENTS */ |
| 1514 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *argumentcxx . . $ MOJOSHADER_astArguments#argument.; |
| 1515 | struct MOJOSHADER_astArgumentscxx . . $ MOJOSHADER_astArguments# *nextcxx . . $ MOJOSHADER_astArguments#next.; |
| 1516 | } MOJOSHADER_astArgumentscxx . . $ MOJOSHADER_astArguments#; |
| 1517 | |
| 1518 | typedef struct MOJOSHADER_astExpressionUnarycxx . . $ MOJOSHADER_astExpressionUnary# |
| 1519 | { |
| 1520 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionUnary#ast.; |
| 1521 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionUnary#datatype.; |
| 1522 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *operandcxx . . $ MOJOSHADER_astExpressionUnary#operand.; |
| 1523 | } MOJOSHADER_astExpressionUnarycxx . . $ MOJOSHADER_astExpressionUnary#; |
| 1524 | |
| 1525 | typedef struct MOJOSHADER_astExpressionBinarycxx . . $ MOJOSHADER_astExpressionBinary# |
| 1526 | { |
| 1527 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionBinary#ast.; |
| 1528 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionBinary#datatype.; |
| 1529 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *leftcxx . . $ MOJOSHADER_astExpressionBinary#left.; |
| 1530 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *rightcxx . . $ MOJOSHADER_astExpressionBinary#right.; |
| 1531 | } MOJOSHADER_astExpressionBinarycxx . . $ MOJOSHADER_astExpressionBinary#; |
| 1532 | |
| 1533 | typedef struct MOJOSHADER_astExpressionTernarycxx . . $ MOJOSHADER_astExpressionTernary# |
| 1534 | { |
| 1535 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionTernary#ast.; |
| 1536 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionTernary#datatype.; |
| 1537 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *leftcxx . . $ MOJOSHADER_astExpressionTernary#left.; |
| 1538 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *centercxx . . $ MOJOSHADER_astExpressionTernary#center.; |
| 1539 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *rightcxx . . $ MOJOSHADER_astExpressionTernary#right.; |
| 1540 | } MOJOSHADER_astExpressionTernarycxx . . $ MOJOSHADER_astExpressionTernary#; |
| 1541 | |
| 1542 | /* Identifier indexes aren't available until semantic analysis phase completes. |
| 1543 | * It provides a unique id for this identifier's variable. |
| 1544 | * It will be negative for global scope, positive for function scope |
| 1545 | * (global values are globally unique, function values are only |
| 1546 | * unique within the scope of the given function). There's a different |
| 1547 | * set of indices if this identifier is a function (positive for |
| 1548 | * user-defined functions, negative for intrinsics). |
| 1549 | * May be zero for various reasons (unknown identifier, etc). |
| 1550 | */ |
| 1551 | typedef struct MOJOSHADER_astExpressionIdentifiercxx . . $ MOJOSHADER_astExpressionIdentifier# |
| 1552 | { |
| 1553 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionIdentifier#ast.; /* Always MOJOSHADER_AST_OP_IDENTIFIER */ |
| 1554 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionIdentifier#datatype.; |
| 1555 | const char *identifiercxx . . $ MOJOSHADER_astExpressionIdentifier#identifier.; |
| 1556 | int indexcxx . . $ MOJOSHADER_astExpressionIdentifier#index.; |
| 1557 | } MOJOSHADER_astExpressionIdentifiercxx . . $ MOJOSHADER_astExpressionIdentifier#; |
| 1558 | |
| 1559 | typedef struct MOJOSHADER_astExpressionIntLiteralcxx . . $ MOJOSHADER_astExpressionIntLiteral# |
| 1560 | { |
| 1561 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionIntLiteral#ast.; /* Always MOJOSHADER_AST_OP_INT_LITERAL */ |
| 1562 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionIntLiteral#datatype.; /* always AST_DATATYPE_INT */ |
| 1563 | int valuecxx . . $ MOJOSHADER_astExpressionIntLiteral#value.; |
| 1564 | } MOJOSHADER_astExpressionIntLiteralcxx . . $ MOJOSHADER_astExpressionIntLiteral#; |
| 1565 | |
| 1566 | typedef struct MOJOSHADER_astExpressionFloatLiteralcxx . . $ MOJOSHADER_astExpressionFloatLiteral# |
| 1567 | { |
| 1568 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionFloatLiteral#ast.; /* Always MOJOSHADER_AST_OP_FLOAT_LITERAL */ |
| 1569 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionFloatLiteral#datatype.; /* always AST_DATATYPE_FLOAT */ |
| 1570 | double valuecxx . . $ MOJOSHADER_astExpressionFloatLiteral#value.; |
| 1571 | } MOJOSHADER_astExpressionFloatLiteralcxx . . $ MOJOSHADER_astExpressionFloatLiteral#; |
| 1572 | |
| 1573 | typedef struct MOJOSHADER_astExpressionStringLiteralcxx . . $ MOJOSHADER_astExpressionStringLiteral# |
| 1574 | { |
| 1575 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionStringLiteral#ast.; /* Always MOJOSHADER_AST_OP_STRING_LITERAL */ |
| 1576 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionStringLiteral#datatype.; /* always AST_DATATYPE_STRING */ |
| 1577 | const char *stringcxx . . $ MOJOSHADER_astExpressionStringLiteral#string.; |
| 1578 | } MOJOSHADER_astExpressionStringLiteralcxx . . $ MOJOSHADER_astExpressionStringLiteral#; |
| 1579 | |
| 1580 | typedef struct MOJOSHADER_astExpressionBooleanLiteralcxx . . $ MOJOSHADER_astExpressionBooleanLiteral# |
| 1581 | { |
| 1582 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionBooleanLiteral#ast.; /* Always MOJOSHADER_AST_OP_BOOLEAN_LITERAL */ |
| 1583 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionBooleanLiteral#datatype.; /* always AST_DATATYPE_BOOL */ |
| 1584 | int valuecxx . . $ MOJOSHADER_astExpressionBooleanLiteral#value.; /* Always 1 or 0. */ |
| 1585 | } MOJOSHADER_astExpressionBooleanLiteralcxx . . $ MOJOSHADER_astExpressionBooleanLiteral#; |
| 1586 | |
| 1587 | typedef struct MOJOSHADER_astExpressionConstructorcxx . . $ MOJOSHADER_astExpressionConstructor# |
| 1588 | { |
| 1589 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionConstructor#ast.; /* Always MOJOSHADER_AST_OP_CONSTRUCTOR */ |
| 1590 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionConstructor#datatype.; |
| 1591 | MOJOSHADER_astArgumentscxx . . $ MOJOSHADER_astArguments# *argscxx . . $ MOJOSHADER_astExpressionConstructor#args.; |
| 1592 | } MOJOSHADER_astExpressionConstructorcxx . . $ MOJOSHADER_astExpressionConstructor#; |
| 1593 | |
| 1594 | typedef struct MOJOSHADER_astExpressionDerefStructcxx . . $ MOJOSHADER_astExpressionDerefStruct# |
| 1595 | { |
| 1596 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionDerefStruct#ast.; /* Always MOJOSHADER_AST_OP_DEREF_STRUCT */ |
| 1597 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionDerefStruct#datatype.; |
| 1598 | /* !!! FIXME: |
| 1599 | * "identifier" is misnamed; this might not be an identifier at all: |
| 1600 | * x = FunctionThatReturnsAStruct().SomeMember; |
| 1601 | */ |
| 1602 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *identifiercxx . . $ MOJOSHADER_astExpressionDerefStruct#identifier.; |
| 1603 | const char *membercxx . . $ MOJOSHADER_astExpressionDerefStruct#member.; |
| 1604 | int isswizzlecxx . . $ MOJOSHADER_astExpressionDerefStruct#isswizzle.; /* Always 1 or 0. Never set by parseAst()! */ |
| 1605 | int member_indexcxx . . $ MOJOSHADER_astExpressionDerefStruct#member_index.; /* Never set by parseAst()! */ |
| 1606 | } MOJOSHADER_astExpressionDerefStructcxx . . $ MOJOSHADER_astExpressionDerefStruct#; |
| 1607 | |
| 1608 | typedef struct MOJOSHADER_astExpressionCallFunctioncxx . . $ MOJOSHADER_astExpressionCallFunction# |
| 1609 | { |
| 1610 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionCallFunction#ast.; /* Always MOJOSHADER_AST_OP_CALLFUNC */ |
| 1611 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionCallFunction#datatype.; |
| 1612 | MOJOSHADER_astExpressionIdentifiercxx . . $ MOJOSHADER_astExpressionIdentifier# *identifiercxx . . $ MOJOSHADER_astExpressionCallFunction#identifier.; |
| 1613 | MOJOSHADER_astArgumentscxx . . $ MOJOSHADER_astArguments# *argscxx . . $ MOJOSHADER_astExpressionCallFunction#args.; |
| 1614 | } MOJOSHADER_astExpressionCallFunctioncxx . . $ MOJOSHADER_astExpressionCallFunction#; |
| 1615 | |
| 1616 | typedef struct MOJOSHADER_astExpressionCastcxx . . $ MOJOSHADER_astExpressionCast# |
| 1617 | { |
| 1618 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionCast#ast.; /* Always MOJOSHADER_AST_OP_CAST */ |
| 1619 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astExpressionCast#datatype.; |
| 1620 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *operandcxx . . $ MOJOSHADER_astExpressionCast#operand.; |
| 1621 | } MOJOSHADER_astExpressionCastcxx . . $ MOJOSHADER_astExpressionCast#; |
| 1622 | |
| 1623 | typedef struct MOJOSHADER_astCompilationUnitcxx . . $ MOJOSHADER_astCompilationUnit# |
| 1624 | { |
| 1625 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astCompilationUnit#ast.; |
| 1626 | struct MOJOSHADER_astCompilationUnitcxx . . $ MOJOSHADER_astCompilationUnit# *nextcxx . . $ MOJOSHADER_astCompilationUnit#next.; |
| 1627 | } MOJOSHADER_astCompilationUnitcxx . . $ MOJOSHADER_astCompilationUnit#; |
| 1628 | |
| 1629 | typedef enum MOJOSHADER_astFunctionStorageClasscxx . . $ MOJOSHADER_astFunctionStorageClass# |
| 1630 | { |
| 1631 | MOJOSHADER_AST_FNSTORECLS_NONEcxx . . $ MOJOSHADER_AST_FNSTORECLS_NONE., |
| 1632 | MOJOSHADER_AST_FNSTORECLS_INLINEcxx . . $ MOJOSHADER_AST_FNSTORECLS_INLINE. |
| 1633 | } MOJOSHADER_astFunctionStorageClasscxx . . $ MOJOSHADER_astFunctionStorageClass#; |
| 1634 | |
| 1635 | typedef enum MOJOSHADER_astInputModifiercxx . . $ MOJOSHADER_astInputModifier# |
| 1636 | { |
| 1637 | MOJOSHADER_AST_INPUTMOD_NONEcxx . . $ MOJOSHADER_AST_INPUTMOD_NONE., |
| 1638 | MOJOSHADER_AST_INPUTMOD_INcxx . . $ MOJOSHADER_AST_INPUTMOD_IN., |
| 1639 | MOJOSHADER_AST_INPUTMOD_OUTcxx . . $ MOJOSHADER_AST_INPUTMOD_OUT., |
| 1640 | MOJOSHADER_AST_INPUTMOD_INOUTcxx . . $ MOJOSHADER_AST_INPUTMOD_INOUT., |
| 1641 | MOJOSHADER_AST_INPUTMOD_UNIFORMcxx . . $ MOJOSHADER_AST_INPUTMOD_UNIFORM. |
| 1642 | } MOJOSHADER_astInputModifiercxx . . $ MOJOSHADER_astInputModifier#; |
| 1643 | |
| 1644 | typedef enum MOJOSHADER_astInterpolationModifiercxx . . $ MOJOSHADER_astInterpolationModifier# |
| 1645 | { |
| 1646 | MOJOSHADER_AST_INTERPMOD_NONEcxx . . $ MOJOSHADER_AST_INTERPMOD_NONE., |
| 1647 | MOJOSHADER_AST_INTERPMOD_LINEARcxx . . $ MOJOSHADER_AST_INTERPMOD_LINEAR., |
| 1648 | MOJOSHADER_AST_INTERPMOD_CENTROIDcxx . . $ MOJOSHADER_AST_INTERPMOD_CENTROID., |
| 1649 | MOJOSHADER_AST_INTERPMOD_NOINTERPOLATIONcxx . . $ MOJOSHADER_AST_INTERPMOD_NOINTERPOLATION., |
| 1650 | MOJOSHADER_AST_INTERPMOD_NOPERSPECTIVEcxx . . $ MOJOSHADER_AST_INTERPMOD_NOPERSPECTIVE., |
| 1651 | MOJOSHADER_AST_INTERPMOD_SAMPLEcxx . . $ MOJOSHADER_AST_INTERPMOD_SAMPLE. |
| 1652 | } MOJOSHADER_astInterpolationModifiercxx . . $ MOJOSHADER_astInterpolationModifier#; |
| 1653 | |
| 1654 | typedef struct MOJOSHADER_astFunctionParameterscxx . . $ MOJOSHADER_astFunctionParameters# |
| 1655 | { |
| 1656 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astFunctionParameters#ast.; |
| 1657 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astFunctionParameters#datatype.; |
| 1658 | MOJOSHADER_astInputModifiercxx . . $ MOJOSHADER_astInputModifier# input_modifiercxx . . $ MOJOSHADER_astFunctionParameters#input_modifier.; |
| 1659 | const char *identifiercxx . . $ MOJOSHADER_astFunctionParameters#identifier.; |
| 1660 | const char *semanticcxx . . $ MOJOSHADER_astFunctionParameters#semantic.; |
| 1661 | MOJOSHADER_astInterpolationModifiercxx . . $ MOJOSHADER_astInterpolationModifier# interpolation_modifiercxx . . $ MOJOSHADER_astFunctionParameters#interpolation_modifier.; |
| 1662 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *initializercxx . . $ MOJOSHADER_astFunctionParameters#initializer.; |
| 1663 | struct MOJOSHADER_astFunctionParameterscxx . . $ MOJOSHADER_astFunctionParameters# *nextcxx . . $ MOJOSHADER_astFunctionParameters#next.; |
| 1664 | } MOJOSHADER_astFunctionParameterscxx . . $ MOJOSHADER_astFunctionParameters#; |
| 1665 | |
| 1666 | typedef struct MOJOSHADER_astFunctionSignaturecxx . . $ MOJOSHADER_astFunctionSignature# |
| 1667 | { |
| 1668 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astFunctionSignature#ast.; |
| 1669 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astFunctionSignature#datatype.; |
| 1670 | const char *identifiercxx . . $ MOJOSHADER_astFunctionSignature#identifier.; |
| 1671 | MOJOSHADER_astFunctionParameterscxx . . $ MOJOSHADER_astFunctionParameters# *paramscxx . . $ MOJOSHADER_astFunctionSignature#params.; |
| 1672 | MOJOSHADER_astFunctionStorageClasscxx . . $ MOJOSHADER_astFunctionStorageClass# storage_classcxx . . $ MOJOSHADER_astFunctionSignature#storage_class.; |
| 1673 | const char *semanticcxx . . $ MOJOSHADER_astFunctionSignature#semantic.; |
| 1674 | } MOJOSHADER_astFunctionSignaturecxx . . $ MOJOSHADER_astFunctionSignature#; |
| 1675 | |
| 1676 | typedef struct MOJOSHADER_astScalarOrArraycxx . . $ MOJOSHADER_astScalarOrArray# |
| 1677 | { |
| 1678 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astScalarOrArray#ast.; |
| 1679 | const char *identifiercxx . . $ MOJOSHADER_astScalarOrArray#identifier.; |
| 1680 | int isarraycxx . . $ MOJOSHADER_astScalarOrArray#isarray.; /* boolean: 1 or 0 */ |
| 1681 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *dimensioncxx . . $ MOJOSHADER_astScalarOrArray#dimension.; |
| 1682 | } MOJOSHADER_astScalarOrArraycxx . . $ MOJOSHADER_astScalarOrArray#; |
| 1683 | |
| 1684 | typedef struct MOJOSHADER_astAnnotationscxx . . $ MOJOSHADER_astAnnotations# |
| 1685 | { |
| 1686 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astAnnotations#ast.; |
| 1687 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astAnnotations#datatype.; |
| 1688 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *initializercxx . . $ MOJOSHADER_astAnnotations#initializer.; |
| 1689 | struct MOJOSHADER_astAnnotationscxx . . $ MOJOSHADER_astAnnotations# *nextcxx . . $ MOJOSHADER_astAnnotations#next.; |
| 1690 | } MOJOSHADER_astAnnotationscxx . . $ MOJOSHADER_astAnnotations#; |
| 1691 | |
| 1692 | typedef struct MOJOSHADER_astPackOffsetcxx . . $ MOJOSHADER_astPackOffset# |
| 1693 | { |
| 1694 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astPackOffset#ast.; |
| 1695 | const char *ident1cxx . . $ MOJOSHADER_astPackOffset#ident1.; /* !!! FIXME: rename this. */ |
| 1696 | const char *ident2cxx . . $ MOJOSHADER_astPackOffset#ident2.; |
| 1697 | } MOJOSHADER_astPackOffsetcxx . . $ MOJOSHADER_astPackOffset#; |
| 1698 | |
| 1699 | typedef struct MOJOSHADER_astVariableLowLevelcxx . . $ MOJOSHADER_astVariableLowLevel# |
| 1700 | { |
| 1701 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astVariableLowLevel#ast.; |
| 1702 | MOJOSHADER_astPackOffsetcxx . . $ MOJOSHADER_astPackOffset# *packoffsetcxx . . $ MOJOSHADER_astVariableLowLevel#packoffset.; |
| 1703 | const char *register_namecxx . . $ MOJOSHADER_astVariableLowLevel#register_name.; |
| 1704 | } MOJOSHADER_astVariableLowLevelcxx . . $ MOJOSHADER_astVariableLowLevel#; |
| 1705 | |
| 1706 | typedef struct MOJOSHADER_astStructMemberscxx . . $ MOJOSHADER_astStructMembers# |
| 1707 | { |
| 1708 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astStructMembers#ast.; |
| 1709 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astStructMembers#datatype.; |
| 1710 | const char *semanticcxx . . $ MOJOSHADER_astStructMembers#semantic.; |
| 1711 | MOJOSHADER_astScalarOrArraycxx . . $ MOJOSHADER_astScalarOrArray# *detailscxx . . $ MOJOSHADER_astStructMembers#details.; |
| 1712 | MOJOSHADER_astInterpolationModifiercxx . . $ MOJOSHADER_astInterpolationModifier# interpolation_modcxx . . $ MOJOSHADER_astStructMembers#interpolation_mod.; |
| 1713 | struct MOJOSHADER_astStructMemberscxx . . $ MOJOSHADER_astStructMembers# *nextcxx . . $ MOJOSHADER_astStructMembers#next.; |
| 1714 | } MOJOSHADER_astStructMemberscxx . . $ MOJOSHADER_astStructMembers#; |
| 1715 | |
| 1716 | typedef struct MOJOSHADER_astStructDeclarationcxx . . $ MOJOSHADER_astStructDeclaration# |
| 1717 | { |
| 1718 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astStructDeclaration#ast.; |
| 1719 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astStructDeclaration#datatype.; |
| 1720 | const char *namecxx . . $ MOJOSHADER_astStructDeclaration#name.; |
| 1721 | MOJOSHADER_astStructMemberscxx . . $ MOJOSHADER_astStructMembers# *memberscxx . . $ MOJOSHADER_astStructDeclaration#members.; |
| 1722 | } MOJOSHADER_astStructDeclarationcxx . . $ MOJOSHADER_astStructDeclaration#; |
| 1723 | |
| 1724 | typedef struct MOJOSHADER_astVariableDeclarationcxx . . $ MOJOSHADER_astVariableDeclaration# |
| 1725 | { |
| 1726 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astVariableDeclaration#ast.; |
| 1727 | int attributescxx . . $ MOJOSHADER_astVariableDeclaration#attributes.; |
| 1728 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astVariableDeclaration#datatype.; |
| 1729 | MOJOSHADER_astStructDeclarationcxx . . $ MOJOSHADER_astStructDeclaration# *anonymous_datatypecxx . . $ MOJOSHADER_astVariableDeclaration#anonymous_datatype.; |
| 1730 | MOJOSHADER_astScalarOrArraycxx . . $ MOJOSHADER_astScalarOrArray# *detailscxx . . $ MOJOSHADER_astVariableDeclaration#details.; |
| 1731 | const char *semanticcxx . . $ MOJOSHADER_astVariableDeclaration#semantic.; |
| 1732 | MOJOSHADER_astAnnotationscxx . . $ MOJOSHADER_astAnnotations# *annotationscxx . . $ MOJOSHADER_astVariableDeclaration#annotations.; |
| 1733 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *initializercxx . . $ MOJOSHADER_astVariableDeclaration#initializer.; |
| 1734 | MOJOSHADER_astVariableLowLevelcxx . . $ MOJOSHADER_astVariableLowLevel# *lowlevelcxx . . $ MOJOSHADER_astVariableDeclaration#lowlevel.; |
| 1735 | struct MOJOSHADER_astVariableDeclarationcxx . . $ MOJOSHADER_astVariableDeclaration# *nextcxx . . $ MOJOSHADER_astVariableDeclaration#next.; |
| 1736 | } MOJOSHADER_astVariableDeclarationcxx . . $ MOJOSHADER_astVariableDeclaration#; |
| 1737 | |
| 1738 | typedef struct MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# |
| 1739 | { |
| 1740 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astStatement#ast.; |
| 1741 | struct MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astStatement#next.; |
| 1742 | } MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement#; |
| 1743 | |
| 1744 | typedef MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# MOJOSHADER_astEmptyStatementcxx . . $ MOJOSHADER_astEmptyStatement#; |
| 1745 | typedef MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# MOJOSHADER_astBreakStatementcxx . . $ MOJOSHADER_astBreakStatement#; |
| 1746 | typedef MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# MOJOSHADER_astContinueStatementcxx . . $ MOJOSHADER_astContinueStatement#; |
| 1747 | typedef MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# MOJOSHADER_astDiscardStatementcxx . . $ MOJOSHADER_astDiscardStatement#; |
| 1748 | |
| 1749 | /* something enclosed in "{}" braces. */ |
| 1750 | typedef struct MOJOSHADER_astBlockStatementcxx . . $ MOJOSHADER_astBlockStatement# |
| 1751 | { |
| 1752 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astBlockStatement#ast.; |
| 1753 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astBlockStatement#next.; |
| 1754 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *statementscxx . . $ MOJOSHADER_astBlockStatement#statements.; /* list of child statements. */ |
| 1755 | } MOJOSHADER_astBlockStatementcxx . . $ MOJOSHADER_astBlockStatement#; |
| 1756 | |
| 1757 | typedef struct MOJOSHADER_astReturnStatementcxx . . $ MOJOSHADER_astReturnStatement# |
| 1758 | { |
| 1759 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astReturnStatement#ast.; |
| 1760 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astReturnStatement#next.; |
| 1761 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *exprcxx . . $ MOJOSHADER_astReturnStatement#expr.; |
| 1762 | } MOJOSHADER_astReturnStatementcxx . . $ MOJOSHADER_astReturnStatement#; |
| 1763 | |
| 1764 | typedef struct MOJOSHADER_astExpressionStatementcxx . . $ MOJOSHADER_astExpressionStatement# |
| 1765 | { |
| 1766 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astExpressionStatement#ast.; |
| 1767 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astExpressionStatement#next.; |
| 1768 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *exprcxx . . $ MOJOSHADER_astExpressionStatement#expr.; |
| 1769 | } MOJOSHADER_astExpressionStatementcxx . . $ MOJOSHADER_astExpressionStatement#; |
| 1770 | |
| 1771 | typedef struct MOJOSHADER_astIfStatementcxx . . $ MOJOSHADER_astIfStatement# |
| 1772 | { |
| 1773 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astIfStatement#ast.; |
| 1774 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astIfStatement#next.; |
| 1775 | int attributescxx . . $ MOJOSHADER_astIfStatement#attributes.; |
| 1776 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *exprcxx . . $ MOJOSHADER_astIfStatement#expr.; |
| 1777 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *statementcxx . . $ MOJOSHADER_astIfStatement#statement.; |
| 1778 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *else_statementcxx . . $ MOJOSHADER_astIfStatement#else_statement.; |
| 1779 | } MOJOSHADER_astIfStatementcxx . . $ MOJOSHADER_astIfStatement#; |
| 1780 | |
| 1781 | typedef struct MOJOSHADER_astSwitchCasescxx . . $ MOJOSHADER_astSwitchCases# |
| 1782 | { |
| 1783 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astSwitchCases#ast.; |
| 1784 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *exprcxx . . $ MOJOSHADER_astSwitchCases#expr.; |
| 1785 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *statementcxx . . $ MOJOSHADER_astSwitchCases#statement.; |
| 1786 | struct MOJOSHADER_astSwitchCasescxx . . $ MOJOSHADER_astSwitchCases# *nextcxx . . $ MOJOSHADER_astSwitchCases#next.; |
| 1787 | } MOJOSHADER_astSwitchCasescxx . . $ MOJOSHADER_astSwitchCases#; |
| 1788 | |
| 1789 | typedef struct MOJOSHADER_astSwitchStatementcxx . . $ MOJOSHADER_astSwitchStatement# |
| 1790 | { |
| 1791 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astSwitchStatement#ast.; |
| 1792 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astSwitchStatement#next.; |
| 1793 | int attributescxx . . $ MOJOSHADER_astSwitchStatement#attributes.; |
| 1794 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *exprcxx . . $ MOJOSHADER_astSwitchStatement#expr.; |
| 1795 | MOJOSHADER_astSwitchCasescxx . . $ MOJOSHADER_astSwitchCases# *casescxx . . $ MOJOSHADER_astSwitchStatement#cases.; |
| 1796 | } MOJOSHADER_astSwitchStatementcxx . . $ MOJOSHADER_astSwitchStatement#; |
| 1797 | |
| 1798 | typedef struct MOJOSHADER_astWhileStatementcxx . . $ MOJOSHADER_astWhileStatement# |
| 1799 | { |
| 1800 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astWhileStatement#ast.; |
| 1801 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astWhileStatement#next.; |
| 1802 | int unrollcxx . . $ MOJOSHADER_astWhileStatement#unroll.; /* # times to unroll, 0 to loop, < 0 == compiler's choice. */ |
| 1803 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *exprcxx . . $ MOJOSHADER_astWhileStatement#expr.; |
| 1804 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *statementcxx . . $ MOJOSHADER_astWhileStatement#statement.; |
| 1805 | } MOJOSHADER_astWhileStatementcxx . . $ MOJOSHADER_astWhileStatement#; |
| 1806 | |
| 1807 | typedef MOJOSHADER_astWhileStatementcxx . . $ MOJOSHADER_astWhileStatement# MOJOSHADER_astDoStatementcxx . . $ MOJOSHADER_astDoStatement#; |
| 1808 | |
| 1809 | typedef struct MOJOSHADER_astForStatementcxx . . $ MOJOSHADER_astForStatement# |
| 1810 | { |
| 1811 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astForStatement#ast.; |
| 1812 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astForStatement#next.; |
| 1813 | int unrollcxx . . $ MOJOSHADER_astForStatement#unroll.; /* # times to unroll, 0 to loop, < 0 == compiler's choice. */ |
| 1814 | MOJOSHADER_astVariableDeclarationcxx . . $ MOJOSHADER_astVariableDeclaration# *var_declcxx . . $ MOJOSHADER_astForStatement#var_decl.; /* either this ... */ |
| 1815 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *initializercxx . . $ MOJOSHADER_astForStatement#initializer.; /* ... or this will used. */ |
| 1816 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *looptestcxx . . $ MOJOSHADER_astForStatement#looptest.; |
| 1817 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# *countercxx . . $ MOJOSHADER_astForStatement#counter.; |
| 1818 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *statementcxx . . $ MOJOSHADER_astForStatement#statement.; |
| 1819 | } MOJOSHADER_astForStatementcxx . . $ MOJOSHADER_astForStatement#; |
| 1820 | |
| 1821 | typedef struct MOJOSHADER_astTypedefcxx . . $ MOJOSHADER_astTypedef# |
| 1822 | { |
| 1823 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astTypedef#ast.; |
| 1824 | const MOJOSHADER_astDataTypecxx . . $ MOJOSHADER_astDataType# *datatypecxx . . $ MOJOSHADER_astTypedef#datatype.; |
| 1825 | int isconstcxx . . $ MOJOSHADER_astTypedef#isconst.; /* boolean: 1 or 0 */ |
| 1826 | MOJOSHADER_astScalarOrArraycxx . . $ MOJOSHADER_astScalarOrArray# *detailscxx . . $ MOJOSHADER_astTypedef#details.; |
| 1827 | } MOJOSHADER_astTypedefcxx . . $ MOJOSHADER_astTypedef#; |
| 1828 | |
| 1829 | typedef struct MOJOSHADER_astTypedefStatementcxx . . $ MOJOSHADER_astTypedefStatement# |
| 1830 | { |
| 1831 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astTypedefStatement#ast.; |
| 1832 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astTypedefStatement#next.; |
| 1833 | MOJOSHADER_astTypedefcxx . . $ MOJOSHADER_astTypedef# *type_infocxx . . $ MOJOSHADER_astTypedefStatement#type_info.; |
| 1834 | } MOJOSHADER_astTypedefStatementcxx . . $ MOJOSHADER_astTypedefStatement#; |
| 1835 | |
| 1836 | typedef struct MOJOSHADER_astVarDeclStatementcxx . . $ MOJOSHADER_astVarDeclStatement# |
| 1837 | { |
| 1838 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astVarDeclStatement#ast.; |
| 1839 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astVarDeclStatement#next.; |
| 1840 | MOJOSHADER_astVariableDeclarationcxx . . $ MOJOSHADER_astVariableDeclaration# *declarationcxx . . $ MOJOSHADER_astVarDeclStatement#declaration.; |
| 1841 | } MOJOSHADER_astVarDeclStatementcxx . . $ MOJOSHADER_astVarDeclStatement#; |
| 1842 | |
| 1843 | typedef struct MOJOSHADER_astStructStatementcxx . . $ MOJOSHADER_astStructStatement# |
| 1844 | { |
| 1845 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astStructStatement#ast.; |
| 1846 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *nextcxx . . $ MOJOSHADER_astStructStatement#next.; |
| 1847 | MOJOSHADER_astStructDeclarationcxx . . $ MOJOSHADER_astStructDeclaration# *struct_infocxx . . $ MOJOSHADER_astStructStatement#struct_info.; |
| 1848 | } MOJOSHADER_astStructStatementcxx . . $ MOJOSHADER_astStructStatement#; |
| 1849 | |
| 1850 | typedef struct MOJOSHADER_astCompilationUnitFunctioncxx . . $ MOJOSHADER_astCompilationUnitFunction# |
| 1851 | { |
| 1852 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astCompilationUnitFunction#ast.; |
| 1853 | MOJOSHADER_astCompilationUnitcxx . . $ MOJOSHADER_astCompilationUnit# *nextcxx . . $ MOJOSHADER_astCompilationUnitFunction#next.; |
| 1854 | MOJOSHADER_astFunctionSignaturecxx . . $ MOJOSHADER_astFunctionSignature# *declarationcxx . . $ MOJOSHADER_astCompilationUnitFunction#declaration.; |
| 1855 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# *definitioncxx . . $ MOJOSHADER_astCompilationUnitFunction#definition.; |
| 1856 | int indexcxx . . $ MOJOSHADER_astCompilationUnitFunction#index.; /* unique id. Will be 0 until semantic analysis runs. */ |
| 1857 | } MOJOSHADER_astCompilationUnitFunctioncxx . . $ MOJOSHADER_astCompilationUnitFunction#; |
| 1858 | |
| 1859 | typedef struct MOJOSHADER_astCompilationUnitTypedefcxx . . $ MOJOSHADER_astCompilationUnitTypedef# |
| 1860 | { |
| 1861 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astCompilationUnitTypedef#ast.; |
| 1862 | MOJOSHADER_astCompilationUnitcxx . . $ MOJOSHADER_astCompilationUnit# *nextcxx . . $ MOJOSHADER_astCompilationUnitTypedef#next.; |
| 1863 | MOJOSHADER_astTypedefcxx . . $ MOJOSHADER_astTypedef# *type_infocxx . . $ MOJOSHADER_astCompilationUnitTypedef#type_info.; |
| 1864 | } MOJOSHADER_astCompilationUnitTypedefcxx . . $ MOJOSHADER_astCompilationUnitTypedef#; |
| 1865 | |
| 1866 | typedef struct MOJOSHADER_astCompilationUnitStructcxx . . $ MOJOSHADER_astCompilationUnitStruct# |
| 1867 | { |
| 1868 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astCompilationUnitStruct#ast.; |
| 1869 | MOJOSHADER_astCompilationUnitcxx . . $ MOJOSHADER_astCompilationUnit# *nextcxx . . $ MOJOSHADER_astCompilationUnitStruct#next.; |
| 1870 | MOJOSHADER_astStructDeclarationcxx . . $ MOJOSHADER_astStructDeclaration# *struct_infocxx . . $ MOJOSHADER_astCompilationUnitStruct#struct_info.; |
| 1871 | } MOJOSHADER_astCompilationUnitStructcxx . . $ MOJOSHADER_astCompilationUnitStruct#; |
| 1872 | |
| 1873 | typedef struct MOJOSHADER_astCompilationUnitVariablecxx . . $ MOJOSHADER_astCompilationUnitVariable# |
| 1874 | { |
| 1875 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astCompilationUnitVariable#ast.; |
| 1876 | MOJOSHADER_astCompilationUnitcxx . . $ MOJOSHADER_astCompilationUnit# *nextcxx . . $ MOJOSHADER_astCompilationUnitVariable#next.; |
| 1877 | MOJOSHADER_astVariableDeclarationcxx . . $ MOJOSHADER_astVariableDeclaration# *declarationcxx . . $ MOJOSHADER_astCompilationUnitVariable#declaration.; |
| 1878 | } MOJOSHADER_astCompilationUnitVariablecxx . . $ MOJOSHADER_astCompilationUnitVariable#; |
| 1879 | |
| 1880 | |
| 1881 | /* this is way cleaner than all the nasty typecasting. */ |
| 1882 | typedef union MOJOSHADER_astNodecxx . . $ MOJOSHADER_astNode# |
| 1883 | { |
| 1884 | MOJOSHADER_astNodeInfocxx . . $ MOJOSHADER_astNodeInfo# astcxx . . $ MOJOSHADER_astNode#ast.; |
| 1885 | MOJOSHADER_astGenericcxx . . $ MOJOSHADER_astGeneric# genericcxx . . $ MOJOSHADER_astNode#generic.; |
| 1886 | MOJOSHADER_astExpressioncxx . . $ MOJOSHADER_astExpression# expressioncxx . . $ MOJOSHADER_astNode#expression.; |
| 1887 | MOJOSHADER_astArgumentscxx . . $ MOJOSHADER_astArguments# argumentscxx . . $ MOJOSHADER_astNode#arguments.; |
| 1888 | MOJOSHADER_astExpressionUnarycxx . . $ MOJOSHADER_astExpressionUnary# unarycxx . . $ MOJOSHADER_astNode#unary.; |
| 1889 | MOJOSHADER_astExpressionBinarycxx . . $ MOJOSHADER_astExpressionBinary# binarycxx . . $ MOJOSHADER_astNode#binary.; |
| 1890 | MOJOSHADER_astExpressionTernarycxx . . $ MOJOSHADER_astExpressionTernary# ternarycxx . . $ MOJOSHADER_astNode#ternary.; |
| 1891 | MOJOSHADER_astExpressionIdentifiercxx . . $ MOJOSHADER_astExpressionIdentifier# identifiercxx . . $ MOJOSHADER_astNode#identifier.; |
| 1892 | MOJOSHADER_astExpressionIntLiteralcxx . . $ MOJOSHADER_astExpressionIntLiteral# intliteralcxx . . $ MOJOSHADER_astNode#intliteral.; |
| 1893 | MOJOSHADER_astExpressionFloatLiteralcxx . . $ MOJOSHADER_astExpressionFloatLiteral# floatliteralcxx . . $ MOJOSHADER_astNode#floatliteral.; |
| 1894 | MOJOSHADER_astExpressionStringLiteralcxx . . $ MOJOSHADER_astExpressionStringLiteral# stringliteralcxx . . $ MOJOSHADER_astNode#stringliteral.; |
| 1895 | MOJOSHADER_astExpressionBooleanLiteralcxx . . $ MOJOSHADER_astExpressionBooleanLiteral# boolliteralcxx . . $ MOJOSHADER_astNode#boolliteral.; |
| 1896 | MOJOSHADER_astExpressionConstructorcxx . . $ MOJOSHADER_astExpressionConstructor# constructorcxx . . $ MOJOSHADER_astNode#constructor.; |
| 1897 | MOJOSHADER_astExpressionDerefStructcxx . . $ MOJOSHADER_astExpressionDerefStruct# derefstructcxx . . $ MOJOSHADER_astNode#derefstruct.; |
| 1898 | MOJOSHADER_astExpressionCallFunctioncxx . . $ MOJOSHADER_astExpressionCallFunction# callfunccxx . . $ MOJOSHADER_astNode#callfunc.; |
| 1899 | MOJOSHADER_astExpressionCastcxx . . $ MOJOSHADER_astExpressionCast# castcxx . . $ MOJOSHADER_astNode#cast.; |
| 1900 | MOJOSHADER_astCompilationUnitcxx . . $ MOJOSHADER_astCompilationUnit# compunitcxx . . $ MOJOSHADER_astNode#compunit.; |
| 1901 | MOJOSHADER_astFunctionParameterscxx . . $ MOJOSHADER_astFunctionParameters# paramscxx . . $ MOJOSHADER_astNode#params.; |
| 1902 | MOJOSHADER_astFunctionSignaturecxx . . $ MOJOSHADER_astFunctionSignature# funcsigcxx . . $ MOJOSHADER_astNode#funcsig.; |
| 1903 | MOJOSHADER_astScalarOrArraycxx . . $ MOJOSHADER_astScalarOrArray# soacxx . . $ MOJOSHADER_astNode#soa.; |
| 1904 | MOJOSHADER_astAnnotationscxx . . $ MOJOSHADER_astAnnotations# annotationscxx . . $ MOJOSHADER_astNode#annotations.; |
| 1905 | MOJOSHADER_astPackOffsetcxx . . $ MOJOSHADER_astPackOffset# packoffsetcxx . . $ MOJOSHADER_astNode#packoffset.; |
| 1906 | MOJOSHADER_astVariableLowLevelcxx . . $ MOJOSHADER_astVariableLowLevel# varlowlevelcxx . . $ MOJOSHADER_astNode#varlowlevel.; |
| 1907 | MOJOSHADER_astStructMemberscxx . . $ MOJOSHADER_astStructMembers# structmemberscxx . . $ MOJOSHADER_astNode#structmembers.; |
| 1908 | MOJOSHADER_astStructDeclarationcxx . . $ MOJOSHADER_astStructDeclaration# structdeclcxx . . $ MOJOSHADER_astNode#structdecl.; |
| 1909 | MOJOSHADER_astVariableDeclarationcxx . . $ MOJOSHADER_astVariableDeclaration# vardeclcxx . . $ MOJOSHADER_astNode#vardecl.; |
| 1910 | MOJOSHADER_astStatementcxx . . $ MOJOSHADER_astStatement# stmtcxx . . $ MOJOSHADER_astNode#stmt.; |
| 1911 | MOJOSHADER_astEmptyStatementcxx . . $ MOJOSHADER_astEmptyStatement# emptystmtcxx . . $ MOJOSHADER_astNode#emptystmt.; |
| 1912 | MOJOSHADER_astBreakStatementcxx . . $ MOJOSHADER_astBreakStatement# breakstmtcxx . . $ MOJOSHADER_astNode#breakstmt.; |
| 1913 | MOJOSHADER_astContinueStatementcxx . . $ MOJOSHADER_astContinueStatement# contstmtcxx . . $ MOJOSHADER_astNode#contstmt.; |
| 1914 | MOJOSHADER_astDiscardStatementcxx . . $ MOJOSHADER_astDiscardStatement# discardstmtcxx . . $ MOJOSHADER_astNode#discardstmt.; |
| 1915 | MOJOSHADER_astBlockStatementcxx . . $ MOJOSHADER_astBlockStatement# blockstmtcxx . . $ MOJOSHADER_astNode#blockstmt.; |
| 1916 | MOJOSHADER_astReturnStatementcxx . . $ MOJOSHADER_astReturnStatement# returnstmtcxx . . $ MOJOSHADER_astNode#returnstmt.; |
| 1917 | MOJOSHADER_astExpressionStatementcxx . . $ MOJOSHADER_astExpressionStatement# exprstmtcxx . . $ MOJOSHADER_astNode#exprstmt.; |
| 1918 | MOJOSHADER_astIfStatementcxx . . $ MOJOSHADER_astIfStatement# ifstmtcxx . . $ MOJOSHADER_astNode#ifstmt.; |
| 1919 | MOJOSHADER_astSwitchCasescxx . . $ MOJOSHADER_astSwitchCases# casescxx . . $ MOJOSHADER_astNode#cases.; |
| 1920 | MOJOSHADER_astSwitchStatementcxx . . $ MOJOSHADER_astSwitchStatement# switchstmtcxx . . $ MOJOSHADER_astNode#switchstmt.; |
| 1921 | MOJOSHADER_astWhileStatementcxx . . $ MOJOSHADER_astWhileStatement# whilestmtcxx . . $ MOJOSHADER_astNode#whilestmt.; |
| 1922 | MOJOSHADER_astDoStatementcxx . . $ MOJOSHADER_astDoStatement# dostmtcxx . . $ MOJOSHADER_astNode#dostmt.; |
| 1923 | MOJOSHADER_astForStatementcxx . . $ MOJOSHADER_astForStatement# forstmtcxx . . $ MOJOSHADER_astNode#forstmt.; |
| 1924 | MOJOSHADER_astTypedefcxx . . $ MOJOSHADER_astTypedef# typdefcxx . . $ MOJOSHADER_astNode#typdef.; |
| 1925 | MOJOSHADER_astTypedefStatementcxx . . $ MOJOSHADER_astTypedefStatement# typedefstmtcxx . . $ MOJOSHADER_astNode#typedefstmt.; |
| 1926 | MOJOSHADER_astVarDeclStatementcxx . . $ MOJOSHADER_astVarDeclStatement# vardeclstmtcxx . . $ MOJOSHADER_astNode#vardeclstmt.; |
| 1927 | MOJOSHADER_astStructStatementcxx . . $ MOJOSHADER_astStructStatement# structstmtcxx . . $ MOJOSHADER_astNode#structstmt.; |
| 1928 | MOJOSHADER_astCompilationUnitFunctioncxx . . $ MOJOSHADER_astCompilationUnitFunction# funcunitcxx . . $ MOJOSHADER_astNode#funcunit.; |
| 1929 | MOJOSHADER_astCompilationUnitTypedefcxx . . $ MOJOSHADER_astCompilationUnitTypedef# typedefunitcxx . . $ MOJOSHADER_astNode#typedefunit.; |
| 1930 | MOJOSHADER_astCompilationUnitStructcxx . . $ MOJOSHADER_astCompilationUnitStruct# structunitcxx . . $ MOJOSHADER_astNode#structunit.; |
| 1931 | MOJOSHADER_astCompilationUnitVariablecxx . . $ MOJOSHADER_astCompilationUnitVariable# varunitcxx . . $ MOJOSHADER_astNode#varunit.; |
| 1932 | } MOJOSHADER_astNodecxx . . $ MOJOSHADER_astNode#; |
| 1933 | |
| 1934 | |
| 1935 | /* |
| 1936 | * Structure used to return data from parsing of a shader into an AST... |
| 1937 | */ |
| 1938 | /* !!! FIXME: most of these ints should be unsigned. */ |
| 1939 | typedef struct MOJOSHADER_astDatacxx . . $ MOJOSHADER_astData# |
| 1940 | { |
| 1941 | /* |
| 1942 | * The number of elements pointed to by (errors). |
| 1943 | */ |
| 1944 | int error_countcxx . . $ MOJOSHADER_astData#error_count.; |
| 1945 | |
| 1946 | /* |
| 1947 | * (error_count) elements of data that specify errors that were generated |
| 1948 | * by parsing this shader. |
| 1949 | * This can be NULL if there were no errors or if (error_count) is zero. |
| 1950 | * Note that this will only produce errors for syntax problems. Most of |
| 1951 | * the things we expect a compiler to produce errors for--incompatible |
| 1952 | * types, unknown identifiers, etc--are not checked at all during |
| 1953 | * initial generation of the syntax tree...bogus programs that would |
| 1954 | * fail to compile will pass here without error, if they are syntactically |
| 1955 | * correct! |
| 1956 | */ |
| 1957 | MOJOSHADER_errorcxx . . $ MOJOSHADER_error# *errorscxx . . $ MOJOSHADER_astData#errors.; |
| 1958 | |
| 1959 | /* |
| 1960 | * The name of the source profile used to parse the shader. Will be NULL |
| 1961 | * on error. |
| 1962 | */ |
| 1963 | const char *source_profilecxx . . $ MOJOSHADER_astData#source_profile.; |
| 1964 | |
| 1965 | /* |
| 1966 | * The actual syntax tree. You are responsible for walking it yourself. |
| 1967 | * CompilationUnits are always the top of the tree (functions, typedefs, |
| 1968 | * global variables, etc). Will be NULL on error. |
| 1969 | */ |
| 1970 | const MOJOSHADER_astNodecxx . . $ MOJOSHADER_astNode# *astcxx . . $ MOJOSHADER_astData#ast.; |
| 1971 | |
| 1972 | /* |
| 1973 | * This is the malloc implementation you passed to MOJOSHADER_parse(). |
| 1974 | */ |
| 1975 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# malloccxx . . $ MOJOSHADER_astData#malloc.; |
| 1976 | |
| 1977 | /* |
| 1978 | * This is the free implementation you passed to MOJOSHADER_parse(). |
| 1979 | */ |
| 1980 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# freecxx . . $ MOJOSHADER_astData#free.; |
| 1981 | |
| 1982 | /* |
| 1983 | * This is the pointer you passed as opaque data for your allocator. |
| 1984 | */ |
| 1985 | void *malloc_datacxx . . $ MOJOSHADER_astData#malloc_data.; |
| 1986 | |
| 1987 | /* |
| 1988 | * This is internal data, and not for the application to touch. |
| 1989 | */ |
| 1990 | void *opaquecxx . . $ MOJOSHADER_astData#opaque.; |
| 1991 | } MOJOSHADER_astDatacxx . . $ MOJOSHADER_astData#; |
| 1992 | |
| 1993 | |
| 1994 | /* |
| 1995 | * You almost certainly don't need this function, unless you absolutely know |
| 1996 | * why you need it without hesitation. This is almost certainly only good for |
| 1997 | * building code analysis tools on top of. |
| 1998 | * |
| 1999 | * This is intended to parse HLSL source code, turning it into an abstract |
| 2000 | * syntax tree. |
| 2001 | * |
| 2002 | * (srcprofile) specifies the source language of the shader. You can specify |
| 2003 | * a shader model with this, too. See MOJOSHADER_SRC_PROFILE_* constants. |
| 2004 | * |
| 2005 | * (filename) is a NULL-terminated UTF-8 filename. It can be NULL. We do not |
| 2006 | * actually access this file, as we obtain our data from (source). This |
| 2007 | * string is copied when we need to report errors while processing (source), |
| 2008 | * as opposed to errors in a file referenced via the #include directive in |
| 2009 | * (source). If this is NULL, then errors will report the filename as NULL, |
| 2010 | * too. |
| 2011 | * |
| 2012 | * (source) is an UTF-8 string of valid high-level shader source code. |
| 2013 | * It does not need to be NULL-terminated. |
| 2014 | * |
| 2015 | * (sourcelen) is the length of the string pointed to by (source), in bytes. |
| 2016 | * |
| 2017 | * (defines) points to (define_count) preprocessor definitions, and can be |
| 2018 | * NULL. These are treated by the preprocessor as if the source code started |
| 2019 | * with one #define for each entry you pass in here. |
| 2020 | * |
| 2021 | * (include_open) and (include_close) let the app control the preprocessor's |
| 2022 | * behaviour for #include statements. Both are optional and can be NULL, but |
| 2023 | * both must be specified if either is specified. |
| 2024 | * |
| 2025 | * This will return a MOJOSHADER_astData. The data supplied here gives the |
| 2026 | * application a tree-like structure they can walk to see the layout of |
| 2027 | * a given program. When you are done with this data, pass it to |
| 2028 | * MOJOSHADER_freeCompileData() to deallocate resources. |
| 2029 | * |
| 2030 | * This function will never return NULL, even if the system is completely |
| 2031 | * out of memory upon entry (in which case, this function returns a static |
| 2032 | * MOJOSHADER_astData object, which is still safe to pass to |
| 2033 | * MOJOSHADER_freeAstData()). |
| 2034 | * |
| 2035 | * As parsing requires some memory to be allocated, you may provide a |
| 2036 | * custom allocator to this function, which will be used to allocate/free |
| 2037 | * memory. They function just like malloc() and free(). We do not use |
| 2038 | * realloc(). If you don't care, pass NULL in for the allocator functions. |
| 2039 | * If your allocator needs instance-specific data, you may supply it with the |
| 2040 | * (d) parameter. This pointer is passed as-is to your (m) and (f) functions. |
| 2041 | * |
| 2042 | * This function is thread safe, so long as the various callback functions |
| 2043 | * are, too, and that the parameters remains intact for the duration of the |
| 2044 | * call. This allows you to parse several shaders on separate CPU cores |
| 2045 | * at the same time. |
| 2046 | */ |
| 2047 | DECLSPECcxx . . $ `<built-in>:410:9`! const MOJOSHADER_astDatacxx . . $ MOJOSHADER_astData# *MOJOSHADER_parseAstcxx . . $ MOJOSHADER_parseAst(35daf8507993f555).(const char *srcprofile, |
| 2048 | const char *filename, const char *source, |
| 2049 | unsigned int sourcelen, |
| 2050 | const MOJOSHADER_preprocessorDefinecxx . . $ MOJOSHADER_preprocessorDefine# *defs, |
| 2051 | unsigned int define_count, |
| 2052 | MOJOSHADER_includeOpencxx . . $ MOJOSHADER_includeOpen# include_open, |
| 2053 | MOJOSHADER_includeClosecxx . . $ MOJOSHADER_includeClose# include_close, |
| 2054 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 2055 | void *d); |
| 2056 | |
| 2057 | |
| 2058 | /* !!! FIXME: expose semantic analysis to the public API? */ |
| 2059 | |
| 2060 | |
| 2061 | /* |
| 2062 | * Call this to dispose of AST parsing results when you are done with them. |
| 2063 | * This will call the MOJOSHADER_free function you provided to |
| 2064 | * MOJOSHADER_parseAst() multiple times, if you provided one. |
| 2065 | * Passing a NULL here is a safe no-op. |
| 2066 | * |
| 2067 | * This function is thread safe, so long as any allocator you passed into |
| 2068 | * MOJOSHADER_parseAst() is, too. |
| 2069 | */ |
| 2070 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_freeAstDatacxx . . $ MOJOSHADER_freeAstData(657721de2ec29daa).(const MOJOSHADER_astDatacxx . . $ MOJOSHADER_astData# *data); |
| 2071 | |
| 2072 | |
| 2073 | /* Intermediate Representation interface... */ |
| 2074 | /* !!! FIXME: there is currently no way to access the IR via the public API. */ |
| 2075 | typedef enum MOJOSHADER_irNodeTypecxx . . $ MOJOSHADER_irNodeType# |
| 2076 | { |
| 2077 | MOJOSHADER_IR_START_RANGE_EXPRcxx . . $ MOJOSHADER_IR_START_RANGE_EXPR., |
| 2078 | MOJOSHADER_IR_CONSTANTcxx . . $ MOJOSHADER_IR_CONSTANT., |
| 2079 | MOJOSHADER_IR_TEMPcxx . . $ MOJOSHADER_IR_TEMP., |
| 2080 | MOJOSHADER_IR_BINOPcxx . . $ MOJOSHADER_IR_BINOP., |
| 2081 | MOJOSHADER_IR_MEMORYcxx . . $ MOJOSHADER_IR_MEMORY., |
| 2082 | MOJOSHADER_IR_CALLcxx . . $ MOJOSHADER_IR_CALL., |
| 2083 | MOJOSHADER_IR_ESEQcxx . . $ MOJOSHADER_IR_ESEQ., |
| 2084 | MOJOSHADER_IR_ARRAYcxx . . $ MOJOSHADER_IR_ARRAY., |
| 2085 | MOJOSHADER_IR_CONVERTcxx . . $ MOJOSHADER_IR_CONVERT., |
| 2086 | MOJOSHADER_IR_SWIZZLEcxx . . $ MOJOSHADER_IR_SWIZZLE., |
| 2087 | MOJOSHADER_IR_CONSTRUCTcxx . . $ MOJOSHADER_IR_CONSTRUCT., |
| 2088 | MOJOSHADER_IR_END_RANGE_EXPRcxx . . $ MOJOSHADER_IR_END_RANGE_EXPR., |
| 2089 | |
| 2090 | MOJOSHADER_IR_START_RANGE_STMTcxx . . $ MOJOSHADER_IR_START_RANGE_STMT., |
| 2091 | MOJOSHADER_IR_MOVEcxx . . $ MOJOSHADER_IR_MOVE., |
| 2092 | MOJOSHADER_IR_EXPR_STMTcxx . . $ MOJOSHADER_IR_EXPR_STMT., |
| 2093 | MOJOSHADER_IR_JUMPcxx . . $ MOJOSHADER_IR_JUMP., |
| 2094 | MOJOSHADER_IR_CJUMPcxx . . $ MOJOSHADER_IR_CJUMP., |
| 2095 | MOJOSHADER_IR_SEQcxx . . $ MOJOSHADER_IR_SEQ., |
| 2096 | MOJOSHADER_IR_LABELcxx . . $ MOJOSHADER_IR_LABEL., |
| 2097 | MOJOSHADER_IR_DISCARDcxx . . $ MOJOSHADER_IR_DISCARD., |
| 2098 | MOJOSHADER_IR_END_RANGE_STMTcxx . . $ MOJOSHADER_IR_END_RANGE_STMT., |
| 2099 | |
| 2100 | MOJOSHADER_IR_START_RANGE_MISCcxx . . $ MOJOSHADER_IR_START_RANGE_MISC., |
| 2101 | MOJOSHADER_IR_EXPRLISTcxx . . $ MOJOSHADER_IR_EXPRLIST., |
| 2102 | MOJOSHADER_IR_END_RANGE_MISCcxx . . $ MOJOSHADER_IR_END_RANGE_MISC., |
| 2103 | |
| 2104 | MOJOSHADER_IR_END_RANGEcxx . . $ MOJOSHADER_IR_END_RANGE. |
| 2105 | } MOJOSHADER_irNodeTypecxx . . $ MOJOSHADER_irNodeType#; |
| 2106 | |
| 2107 | typedef struct MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# |
| 2108 | { |
| 2109 | MOJOSHADER_irNodeTypecxx . . $ MOJOSHADER_irNodeType# typecxx . . $ MOJOSHADER_irNodeInfo#type.; |
| 2110 | const char *filenamecxx . . $ MOJOSHADER_irNodeInfo#filename.; |
| 2111 | unsigned int linecxx . . $ MOJOSHADER_irNodeInfo#line.; |
| 2112 | } MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo#; |
| 2113 | |
| 2114 | typedef struct MOJOSHADER_irExprListcxx . . $ MOJOSHADER_irExprList# MOJOSHADER_irExprListcxx . . $ MOJOSHADER_irExprList#; |
| 2115 | |
| 2116 | /* |
| 2117 | * IR nodes are categorized into Expressions, Statements, and Everything Else. |
| 2118 | * You can cast any of them to MOJOSHADER_irGeneric, but this split is |
| 2119 | * useful for slightly better type-checking (you can't cleanly assign |
| 2120 | * something that doesn't return a value to something that wants one, etc). |
| 2121 | * These broader categories are just unions of the simpler types, so the |
| 2122 | * real definitions are below all the things they contain (but these |
| 2123 | * predeclarations are because the simpler types refer to the broader |
| 2124 | * categories). |
| 2125 | */ |
| 2126 | typedef union MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression#; /* returns a value. */ |
| 2127 | typedef union MOJOSHADER_irStatementcxx . . $ MOJOSHADER_irStatement# MOJOSHADER_irStatementcxx . . $ MOJOSHADER_irStatement#; /* no returned value. */ |
| 2128 | typedef union MOJOSHADER_irMisccxx . . $ MOJOSHADER_irMisc# MOJOSHADER_irMisccxx . . $ MOJOSHADER_irMisc#; /* Everything Else. */ |
| 2129 | typedef union MOJOSHADER_irNodecxx . . $ MOJOSHADER_irNode# MOJOSHADER_irNodecxx . . $ MOJOSHADER_irNode#; /* Generic uber-wrapper. */ |
| 2130 | |
| 2131 | /* You can cast any IR node pointer to this. */ |
| 2132 | typedef struct MOJOSHADER_irGenericcxx . . $ MOJOSHADER_irGeneric# |
| 2133 | { |
| 2134 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irGeneric#ir.; |
| 2135 | } MOJOSHADER_irGenericcxx . . $ MOJOSHADER_irGeneric#; |
| 2136 | |
| 2137 | |
| 2138 | /* These are used for MOJOSHADER_irBinOp */ |
| 2139 | typedef enum MOJOSHADER_irBinOpTypecxx . . $ MOJOSHADER_irBinOpType# |
| 2140 | { |
| 2141 | MOJOSHADER_IR_BINOP_ADDcxx . . $ MOJOSHADER_IR_BINOP_ADD., |
| 2142 | MOJOSHADER_IR_BINOP_SUBTRACTcxx . . $ MOJOSHADER_IR_BINOP_SUBTRACT., |
| 2143 | MOJOSHADER_IR_BINOP_MULTIPLYcxx . . $ MOJOSHADER_IR_BINOP_MULTIPLY., |
| 2144 | MOJOSHADER_IR_BINOP_DIVIDEcxx . . $ MOJOSHADER_IR_BINOP_DIVIDE., |
| 2145 | MOJOSHADER_IR_BINOP_MODULOcxx . . $ MOJOSHADER_IR_BINOP_MODULO., |
| 2146 | MOJOSHADER_IR_BINOP_ANDcxx . . $ MOJOSHADER_IR_BINOP_AND., |
| 2147 | MOJOSHADER_IR_BINOP_ORcxx . . $ MOJOSHADER_IR_BINOP_OR., |
| 2148 | MOJOSHADER_IR_BINOP_XORcxx . . $ MOJOSHADER_IR_BINOP_XOR., |
| 2149 | MOJOSHADER_IR_BINOP_LSHIFTcxx . . $ MOJOSHADER_IR_BINOP_LSHIFT., |
| 2150 | MOJOSHADER_IR_BINOP_RSHIFTcxx . . $ MOJOSHADER_IR_BINOP_RSHIFT., |
| 2151 | MOJOSHADER_IR_BINOP_UNKNOWNcxx . . $ MOJOSHADER_IR_BINOP_UNKNOWN. |
| 2152 | } MOJOSHADER_irBinOpTypecxx . . $ MOJOSHADER_irBinOpType#; |
| 2153 | |
| 2154 | typedef enum MOJOSHADER_irConditionTypecxx . . $ MOJOSHADER_irConditionType# |
| 2155 | { |
| 2156 | MOJOSHADER_IR_COND_EQLcxx . . $ MOJOSHADER_IR_COND_EQL., |
| 2157 | MOJOSHADER_IR_COND_NEQcxx . . $ MOJOSHADER_IR_COND_NEQ., |
| 2158 | MOJOSHADER_IR_COND_LTcxx . . $ MOJOSHADER_IR_COND_LT., |
| 2159 | MOJOSHADER_IR_COND_GTcxx . . $ MOJOSHADER_IR_COND_GT., |
| 2160 | MOJOSHADER_IR_COND_LEQcxx . . $ MOJOSHADER_IR_COND_LEQ., |
| 2161 | MOJOSHADER_IR_COND_GEQcxx . . $ MOJOSHADER_IR_COND_GEQ., |
| 2162 | MOJOSHADER_IR_COND_UNKNOWNcxx . . $ MOJOSHADER_IR_COND_UNKNOWN. |
| 2163 | } MOJOSHADER_irConditionTypecxx . . $ MOJOSHADER_irConditionType#; |
| 2164 | |
| 2165 | |
| 2166 | /* MOJOSHADER_irExpression types... */ |
| 2167 | |
| 2168 | typedef struct MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# |
| 2169 | { |
| 2170 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irExprInfo#ir.; |
| 2171 | MOJOSHADER_astDataTypeTypecxx . . $ MOJOSHADER_astDataTypeType# typecxx . . $ MOJOSHADER_irExprInfo#type.; |
| 2172 | int elementscxx . . $ MOJOSHADER_irExprInfo#elements.; |
| 2173 | } MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo#; |
| 2174 | |
| 2175 | typedef struct MOJOSHADER_irConstantcxx . . $ MOJOSHADER_irConstant# /* Constant value */ |
| 2176 | { |
| 2177 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irConstant#info.; /* Always MOJOSHADER_IR_CONSTANT */ |
| 2178 | unioncxx . . $ MOJOSHADER_irConstant#$anonymous_type_11# |
| 2179 | { |
| 2180 | int ivalcxx . . $ MOJOSHADER_irConstant#$anonymous_type_11#ival.[16]; |
| 2181 | float fvalcxx . . $ MOJOSHADER_irConstant#$anonymous_type_11#fval.[16]; |
| 2182 | } valuecxx . . $ MOJOSHADER_irConstant#value.; |
| 2183 | } MOJOSHADER_irConstantcxx . . $ MOJOSHADER_irConstant#; |
| 2184 | |
| 2185 | typedef struct MOJOSHADER_irTempcxx . . $ MOJOSHADER_irTemp# /* temp value (not necessarily a register). */ |
| 2186 | { |
| 2187 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irTemp#info.; /* Always MOJOSHADER_IR_TEMP */ |
| 2188 | int indexcxx . . $ MOJOSHADER_irTemp#index.; |
| 2189 | } MOJOSHADER_irTempcxx . . $ MOJOSHADER_irTemp#; |
| 2190 | |
| 2191 | typedef struct MOJOSHADER_irBinOpcxx . . $ MOJOSHADER_irBinOp# /* binary operator (+, -, etc) */ |
| 2192 | { |
| 2193 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irBinOp#info.; /* Always MOJOSHADER_IR_BINOP */ |
| 2194 | MOJOSHADER_irBinOpTypecxx . . $ MOJOSHADER_irBinOpType# opcxx . . $ MOJOSHADER_irBinOp#op.; |
| 2195 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *leftcxx . . $ MOJOSHADER_irBinOp#left.; |
| 2196 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *rightcxx . . $ MOJOSHADER_irBinOp#right.; |
| 2197 | } MOJOSHADER_irBinOpcxx . . $ MOJOSHADER_irBinOp#; |
| 2198 | |
| 2199 | typedef struct MOJOSHADER_irMemorycxx . . $ MOJOSHADER_irMemory# |
| 2200 | { |
| 2201 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irMemory#info.; /* Always MOJOSHADER_IR_MEMORY */ |
| 2202 | int indexcxx . . $ MOJOSHADER_irMemory#index.; /* not final addresses, just a unique identifier. */ |
| 2203 | } MOJOSHADER_irMemorycxx . . $ MOJOSHADER_irMemory#; |
| 2204 | |
| 2205 | typedef struct MOJOSHADER_irCallcxx . . $ MOJOSHADER_irCall# |
| 2206 | { |
| 2207 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irCall#info.; /* Always MOJOSHADER_IR_CALL */ |
| 2208 | int indexcxx . . $ MOJOSHADER_irCall#index.; |
| 2209 | MOJOSHADER_irExprListcxx . . $ MOJOSHADER_irExprList# *argscxx . . $ MOJOSHADER_irCall#args.; |
| 2210 | } MOJOSHADER_irCallcxx . . $ MOJOSHADER_irCall#; |
| 2211 | |
| 2212 | typedef struct MOJOSHADER_irESeqcxx . . $ MOJOSHADER_irESeq# /* statement with result */ |
| 2213 | { |
| 2214 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irESeq#info.; /* Always MOJOSHADER_IR_ESEQ */ |
| 2215 | MOJOSHADER_irStatementcxx . . $ MOJOSHADER_irStatement# *stmtcxx . . $ MOJOSHADER_irESeq#stmt.; /* execute this for side-effects, then... */ |
| 2216 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *exprcxx . . $ MOJOSHADER_irESeq#expr.; /* ...use this for the result. */ |
| 2217 | } MOJOSHADER_irESeqcxx . . $ MOJOSHADER_irESeq#; |
| 2218 | |
| 2219 | typedef struct MOJOSHADER_irArraycxx . . $ MOJOSHADER_irArray# /* Array dereference. */ |
| 2220 | { |
| 2221 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irArray#info.; /* Always MOJOSHADER_IR_ARRAY */ |
| 2222 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *arraycxx . . $ MOJOSHADER_irArray#array.; |
| 2223 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *elementcxx . . $ MOJOSHADER_irArray#element.; |
| 2224 | } MOJOSHADER_irArraycxx . . $ MOJOSHADER_irArray#; |
| 2225 | |
| 2226 | typedef struct MOJOSHADER_irConvertcxx . . $ MOJOSHADER_irConvert# /* casting between datatypes */ |
| 2227 | { |
| 2228 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irConvert#info.; /* Always MOJOSHADER_IR_CONVERT */ |
| 2229 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *exprcxx . . $ MOJOSHADER_irConvert#expr.; |
| 2230 | } MOJOSHADER_irConvertcxx . . $ MOJOSHADER_irConvert#; |
| 2231 | |
| 2232 | typedef struct MOJOSHADER_irSwizzlecxx . . $ MOJOSHADER_irSwizzle# /* vector swizzle */ |
| 2233 | { |
| 2234 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irSwizzle#info.; /* Always MOJOSHADER_IR_SWIZZLE */ |
| 2235 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *exprcxx . . $ MOJOSHADER_irSwizzle#expr.; |
| 2236 | char channelscxx . . $ MOJOSHADER_irSwizzle#channels.[4]; |
| 2237 | } MOJOSHADER_irSwizzlecxx . . $ MOJOSHADER_irSwizzle#; |
| 2238 | |
| 2239 | typedef struct MOJOSHADER_irConstructcxx . . $ MOJOSHADER_irConstruct# /* vector construct from discrete items */ |
| 2240 | { |
| 2241 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irConstruct#info.; /* Always MOJOSHADER_IR_CONTSTRUCT */ |
| 2242 | MOJOSHADER_irExprListcxx . . $ MOJOSHADER_irExprList# *argscxx . . $ MOJOSHADER_irConstruct#args.; |
| 2243 | } MOJOSHADER_irConstructcxx . . $ MOJOSHADER_irConstruct#; |
| 2244 | |
| 2245 | /* Wrap the whole category in a union for type "safety." */ |
| 2246 | union MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# |
| 2247 | { |
| 2248 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irExpression#ir.; |
| 2249 | MOJOSHADER_irExprInfocxx . . $ MOJOSHADER_irExprInfo# infocxx . . $ MOJOSHADER_irExpression#info.; |
| 2250 | MOJOSHADER_irConstantcxx . . $ MOJOSHADER_irConstant# constantcxx . . $ MOJOSHADER_irExpression#constant.; |
| 2251 | MOJOSHADER_irTempcxx . . $ MOJOSHADER_irTemp# tempcxx . . $ MOJOSHADER_irExpression#temp.; |
| 2252 | MOJOSHADER_irBinOpcxx . . $ MOJOSHADER_irBinOp# binopcxx . . $ MOJOSHADER_irExpression#binop.; |
| 2253 | MOJOSHADER_irMemorycxx . . $ MOJOSHADER_irMemory# memorycxx . . $ MOJOSHADER_irExpression#memory.; |
| 2254 | MOJOSHADER_irCallcxx . . $ MOJOSHADER_irCall# callcxx . . $ MOJOSHADER_irExpression#call.; |
| 2255 | MOJOSHADER_irESeqcxx . . $ MOJOSHADER_irESeq# eseqcxx . . $ MOJOSHADER_irExpression#eseq.; |
| 2256 | MOJOSHADER_irArraycxx . . $ MOJOSHADER_irArray# arraycxx . . $ MOJOSHADER_irExpression#array.; |
| 2257 | MOJOSHADER_irConvertcxx . . $ MOJOSHADER_irConvert# convertcxx . . $ MOJOSHADER_irExpression#convert.; |
| 2258 | MOJOSHADER_irSwizzlecxx . . $ MOJOSHADER_irSwizzle# swizzlecxx . . $ MOJOSHADER_irExpression#swizzle.; |
| 2259 | MOJOSHADER_irConstructcxx . . $ MOJOSHADER_irConstruct# constructcxx . . $ MOJOSHADER_irExpression#construct.; |
| 2260 | }; |
| 2261 | |
| 2262 | /* MOJOSHADER_irStatement types. */ |
| 2263 | |
| 2264 | typedef struct MOJOSHADER_irMovecxx . . $ MOJOSHADER_irMove# /* load/store. */ |
| 2265 | { |
| 2266 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irMove#ir.; /* Always MOJOSHADER_IR_MOVE */ |
| 2267 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *dstcxx . . $ MOJOSHADER_irMove#dst.; /* must result in a temp or mem! */ |
| 2268 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *srccxx . . $ MOJOSHADER_irMove#src.; |
| 2269 | int writemaskcxx . . $ MOJOSHADER_irMove#writemask.; /* for write-masking vector channels. */ |
| 2270 | } MOJOSHADER_irMovecxx . . $ MOJOSHADER_irMove#; |
| 2271 | |
| 2272 | typedef struct MOJOSHADER_irExprStmtcxx . . $ MOJOSHADER_irExprStmt# /* evaluate expression, throw it away. */ |
| 2273 | { |
| 2274 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irExprStmt#ir.; /* Always MOJOSHADER_IR_EXPR_STMT */ |
| 2275 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *exprcxx . . $ MOJOSHADER_irExprStmt#expr.; |
| 2276 | } MOJOSHADER_irExprStmtcxx . . $ MOJOSHADER_irExprStmt#; |
| 2277 | |
| 2278 | typedef struct MOJOSHADER_irJumpcxx . . $ MOJOSHADER_irJump# /* unconditional jump */ |
| 2279 | { |
| 2280 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irJump#ir.; /* Always MOJOSHADER_IR_JUMP */ |
| 2281 | int labelcxx . . $ MOJOSHADER_irJump#label.; |
| 2282 | /* !!! FIXME: possible label list, for further optimization passes. */ |
| 2283 | } MOJOSHADER_irJumpcxx . . $ MOJOSHADER_irJump#; |
| 2284 | |
| 2285 | typedef struct MOJOSHADER_irCJumpcxx . . $ MOJOSHADER_irCJump# /* conditional jump */ |
| 2286 | { |
| 2287 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irCJump#ir.; /* Always MOJOSHADER_IR_CJUMP */ |
| 2288 | MOJOSHADER_irConditionTypecxx . . $ MOJOSHADER_irConditionType# condcxx . . $ MOJOSHADER_irCJump#cond.; |
| 2289 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *leftcxx . . $ MOJOSHADER_irCJump#left.; /* if (left cond right) */ |
| 2290 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *rightcxx . . $ MOJOSHADER_irCJump#right.; |
| 2291 | int iftruecxx . . $ MOJOSHADER_irCJump#iftrue.; /* label id for true case. */ |
| 2292 | int iffalsecxx . . $ MOJOSHADER_irCJump#iffalse.; /* label id for false case. */ |
| 2293 | } MOJOSHADER_irCJumpcxx . . $ MOJOSHADER_irCJump#; |
| 2294 | |
| 2295 | typedef struct MOJOSHADER_irSeqcxx . . $ MOJOSHADER_irSeq# /* statement without side effects */ |
| 2296 | { |
| 2297 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irSeq#ir.; /* Always MOJOSHADER_IR_SEQ */ |
| 2298 | MOJOSHADER_irStatementcxx . . $ MOJOSHADER_irStatement# *firstcxx . . $ MOJOSHADER_irSeq#first.; |
| 2299 | MOJOSHADER_irStatementcxx . . $ MOJOSHADER_irStatement# *nextcxx . . $ MOJOSHADER_irSeq#next.; |
| 2300 | } MOJOSHADER_irSeqcxx . . $ MOJOSHADER_irSeq#; |
| 2301 | |
| 2302 | typedef struct MOJOSHADER_irLabelcxx . . $ MOJOSHADER_irLabel# /* like a label in assembly language. */ |
| 2303 | { |
| 2304 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irLabel#ir.; /* Always MOJOSHADER_IR_LABEL */ |
| 2305 | int indexcxx . . $ MOJOSHADER_irLabel#index.; |
| 2306 | } MOJOSHADER_irLabelcxx . . $ MOJOSHADER_irLabel#; |
| 2307 | |
| 2308 | typedef MOJOSHADER_irGenericcxx . . $ MOJOSHADER_irGeneric# MOJOSHADER_irDiscardcxx . . $ MOJOSHADER_irDiscard#; /* discard statement. */ |
| 2309 | |
| 2310 | |
| 2311 | /* Wrap the whole category in a union for type "safety." */ |
| 2312 | union MOJOSHADER_irStatementcxx . . $ MOJOSHADER_irStatement# |
| 2313 | { |
| 2314 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irStatement#ir.; |
| 2315 | MOJOSHADER_irGenericcxx . . $ MOJOSHADER_irGeneric# genericcxx . . $ MOJOSHADER_irStatement#generic.; |
| 2316 | MOJOSHADER_irMovecxx . . $ MOJOSHADER_irMove# movecxx . . $ MOJOSHADER_irStatement#move.; |
| 2317 | MOJOSHADER_irExprStmtcxx . . $ MOJOSHADER_irExprStmt# exprcxx . . $ MOJOSHADER_irStatement#expr.; |
| 2318 | MOJOSHADER_irJumpcxx . . $ MOJOSHADER_irJump# jumpcxx . . $ MOJOSHADER_irStatement#jump.; |
| 2319 | MOJOSHADER_irCJumpcxx . . $ MOJOSHADER_irCJump# cjumpcxx . . $ MOJOSHADER_irStatement#cjump.; |
| 2320 | MOJOSHADER_irSeqcxx . . $ MOJOSHADER_irSeq# seqcxx . . $ MOJOSHADER_irStatement#seq.; |
| 2321 | MOJOSHADER_irLabelcxx . . $ MOJOSHADER_irLabel# labelcxx . . $ MOJOSHADER_irStatement#label.; |
| 2322 | MOJOSHADER_irDiscardcxx . . $ MOJOSHADER_irDiscard# discardcxx . . $ MOJOSHADER_irStatement#discard.; |
| 2323 | }; |
| 2324 | |
| 2325 | /* MOJOSHADER_irMisc types. */ |
| 2326 | |
| 2327 | struct MOJOSHADER_irExprListcxx . . $ MOJOSHADER_irExprList# |
| 2328 | { |
| 2329 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irExprList#ir.; /* Always MOJOSHADER_IR_EXPRLIST */ |
| 2330 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# *exprcxx . . $ MOJOSHADER_irExprList#expr.; |
| 2331 | MOJOSHADER_irExprListcxx . . $ MOJOSHADER_irExprList# *nextcxx . . $ MOJOSHADER_irExprList#next.; |
| 2332 | }; |
| 2333 | |
| 2334 | /* Wrap the whole category in a union for type "safety." */ |
| 2335 | union MOJOSHADER_irMisccxx . . $ MOJOSHADER_irMisc# |
| 2336 | { |
| 2337 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irMisc#ir.; |
| 2338 | MOJOSHADER_irGenericcxx . . $ MOJOSHADER_irGeneric# genericcxx . . $ MOJOSHADER_irMisc#generic.; |
| 2339 | MOJOSHADER_irExprListcxx . . $ MOJOSHADER_irExprList# exprlistcxx . . $ MOJOSHADER_irMisc#exprlist.; |
| 2340 | }; |
| 2341 | |
| 2342 | /* This is a catchall for all your needs. :) */ |
| 2343 | union MOJOSHADER_irNodecxx . . $ MOJOSHADER_irNode# |
| 2344 | { |
| 2345 | MOJOSHADER_irNodeInfocxx . . $ MOJOSHADER_irNodeInfo# ircxx . . $ MOJOSHADER_irNode#ir.; |
| 2346 | MOJOSHADER_irGenericcxx . . $ MOJOSHADER_irGeneric# genericcxx . . $ MOJOSHADER_irNode#generic.; |
| 2347 | MOJOSHADER_irExpressioncxx . . $ MOJOSHADER_irExpression# exprcxx . . $ MOJOSHADER_irNode#expr.; |
| 2348 | MOJOSHADER_irStatementcxx . . $ MOJOSHADER_irStatement# stmtcxx . . $ MOJOSHADER_irNode#stmt.; |
| 2349 | MOJOSHADER_irMisccxx . . $ MOJOSHADER_irMisc# misccxx . . $ MOJOSHADER_irNode#misc.; |
| 2350 | }; |
| 2351 | |
| 2352 | |
| 2353 | /* Compiler interface... */ |
| 2354 | |
| 2355 | /* |
| 2356 | * Structure used to return data from parsing of a shader... |
| 2357 | */ |
| 2358 | /* !!! FIXME: most of these ints should be unsigned. */ |
| 2359 | typedef struct MOJOSHADER_compileDatacxx . . $ MOJOSHADER_compileData# |
| 2360 | { |
| 2361 | /* |
| 2362 | * The number of elements pointed to by (errors). |
| 2363 | */ |
| 2364 | int error_countcxx . . $ MOJOSHADER_compileData#error_count.; |
| 2365 | |
| 2366 | /* |
| 2367 | * (error_count) elements of data that specify errors that were generated |
| 2368 | * by compiling this shader. |
| 2369 | * This can be NULL if there were no errors or if (error_count) is zero. |
| 2370 | */ |
| 2371 | MOJOSHADER_errorcxx . . $ MOJOSHADER_error# *errorscxx . . $ MOJOSHADER_compileData#errors.; |
| 2372 | |
| 2373 | /* |
| 2374 | * The number of elements pointed to by (warnings). |
| 2375 | */ |
| 2376 | int warning_countcxx . . $ MOJOSHADER_compileData#warning_count.; |
| 2377 | |
| 2378 | /* |
| 2379 | * (warning_count) elements of data that specify errors that were |
| 2380 | * generated by compiling this shader. |
| 2381 | * This can be NULL if there were no errors or if (warning_count) is zero. |
| 2382 | */ |
| 2383 | MOJOSHADER_errorcxx . . $ MOJOSHADER_error# *warningscxx . . $ MOJOSHADER_compileData#warnings.; |
| 2384 | |
| 2385 | /* |
| 2386 | * The name of the source profile used to compile the shader. Will be NULL |
| 2387 | * on error. |
| 2388 | */ |
| 2389 | const char *source_profilecxx . . $ MOJOSHADER_compileData#source_profile.; |
| 2390 | |
| 2391 | /* |
| 2392 | * Bytes of output from compiling. This will be a null-terminated ASCII |
| 2393 | * string of D3D assembly source code. |
| 2394 | */ |
| 2395 | const char *outputcxx . . $ MOJOSHADER_compileData#output.; |
| 2396 | |
| 2397 | /* |
| 2398 | * Byte count for output, not counting any null terminator. |
| 2399 | * Will be 0 on error. |
| 2400 | */ |
| 2401 | int output_lencxx . . $ MOJOSHADER_compileData#output_len.; |
| 2402 | |
| 2403 | /* |
| 2404 | * The number of elements pointed to by (symbols). |
| 2405 | */ |
| 2406 | int symbol_countcxx . . $ MOJOSHADER_compileData#symbol_count.; |
| 2407 | |
| 2408 | /* |
| 2409 | * (symbol_count) elements of data that specify high-level symbol data |
| 2410 | * for the shader. This can be used by MOJOSHADER_assemble() to |
| 2411 | * generate a CTAB section in bytecode, which is needed by |
| 2412 | * MOJOSHADER_parseData() to handle some shaders. This can be NULL on |
| 2413 | * error or if (symbol_count) is zero. |
| 2414 | */ |
| 2415 | MOJOSHADER_symbolcxx . . $ MOJOSHADER_symbol# *symbolscxx . . $ MOJOSHADER_compileData#symbols.; |
| 2416 | |
| 2417 | /* |
| 2418 | * This is the malloc implementation you passed to MOJOSHADER_parse(). |
| 2419 | */ |
| 2420 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# malloccxx . . $ MOJOSHADER_compileData#malloc.; |
| 2421 | |
| 2422 | /* |
| 2423 | * This is the free implementation you passed to MOJOSHADER_parse(). |
| 2424 | */ |
| 2425 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# freecxx . . $ MOJOSHADER_compileData#free.; |
| 2426 | |
| 2427 | /* |
| 2428 | * This is the pointer you passed as opaque data for your allocator. |
| 2429 | */ |
| 2430 | void *malloc_datacxx . . $ MOJOSHADER_compileData#malloc_data.; |
| 2431 | } MOJOSHADER_compileDatacxx . . $ MOJOSHADER_compileData#; |
| 2432 | |
| 2433 | |
| 2434 | /* |
| 2435 | * This function is optional. Use this to compile high-level shader programs. |
| 2436 | * |
| 2437 | * This is intended to turn HLSL source code into D3D assembly code, which |
| 2438 | * can then be passed to MOJOSHADER_assemble() to convert it to D3D bytecode |
| 2439 | * (which can then be used with MOJOSHADER_parseData() to support other |
| 2440 | * shading targets). |
| 2441 | * |
| 2442 | * (srcprofile) specifies the source language of the shader. You can specify |
| 2443 | * a shader model with this, too. See MOJOSHADER_SRC_PROFILE_* constants. |
| 2444 | * |
| 2445 | * (filename) is a NULL-terminated UTF-8 filename. It can be NULL. We do not |
| 2446 | * actually access this file, as we obtain our data from (source). This |
| 2447 | * string is copied when we need to report errors while processing (source), |
| 2448 | * as opposed to errors in a file referenced via the #include directive in |
| 2449 | * (source). If this is NULL, then errors will report the filename as NULL, |
| 2450 | * too. |
| 2451 | * |
| 2452 | * (source) is an UTF-8 string of valid high-level shader source code. |
| 2453 | * It does not need to be NULL-terminated. |
| 2454 | * |
| 2455 | * (sourcelen) is the length of the string pointed to by (source), in bytes. |
| 2456 | * |
| 2457 | * (defines) points to (define_count) preprocessor definitions, and can be |
| 2458 | * NULL. These are treated by the preprocessor as if the source code started |
| 2459 | * with one #define for each entry you pass in here. |
| 2460 | * |
| 2461 | * (include_open) and (include_close) let the app control the preprocessor's |
| 2462 | * behaviour for #include statements. Both are optional and can be NULL, but |
| 2463 | * both must be specified if either is specified. |
| 2464 | * |
| 2465 | * This will return a MOJOSHADER_compileData. The data supplied here is |
| 2466 | * sufficient to supply to MOJOSHADER_assemble() for further processing. |
| 2467 | * When you are done with this data, pass it to MOJOSHADER_freeCompileData() |
| 2468 | * to deallocate resources. |
| 2469 | * |
| 2470 | * This function will never return NULL, even if the system is completely |
| 2471 | * out of memory upon entry (in which case, this function returns a static |
| 2472 | * MOJOSHADER_compileData object, which is still safe to pass to |
| 2473 | * MOJOSHADER_freeCompileData()). |
| 2474 | * |
| 2475 | * As compiling requires some memory to be allocated, you may provide a |
| 2476 | * custom allocator to this function, which will be used to allocate/free |
| 2477 | * memory. They function just like malloc() and free(). We do not use |
| 2478 | * realloc(). If you don't care, pass NULL in for the allocator functions. |
| 2479 | * If your allocator needs instance-specific data, you may supply it with the |
| 2480 | * (d) parameter. This pointer is passed as-is to your (m) and (f) functions. |
| 2481 | * |
| 2482 | * This function is thread safe, so long as the various callback functions |
| 2483 | * are, too, and that the parameters remains intact for the duration of the |
| 2484 | * call. This allows you to compile several shaders on separate CPU cores |
| 2485 | * at the same time. |
| 2486 | */ |
| 2487 | DECLSPECcxx . . $ `<built-in>:410:9`! const MOJOSHADER_compileDatacxx . . $ MOJOSHADER_compileData# *MOJOSHADER_compilecxx . . $ MOJOSHADER_compile(8d00c3aaaec8e0af).(const char *srcprofile, |
| 2488 | const char *filename, const char *source, |
| 2489 | unsigned int sourcelen, |
| 2490 | const MOJOSHADER_preprocessorDefinecxx . . $ MOJOSHADER_preprocessorDefine# *defs, |
| 2491 | unsigned int define_count, |
| 2492 | MOJOSHADER_includeOpencxx . . $ MOJOSHADER_includeOpen# include_open, |
| 2493 | MOJOSHADER_includeClosecxx . . $ MOJOSHADER_includeClose# include_close, |
| 2494 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 2495 | void *d); |
| 2496 | |
| 2497 | |
| 2498 | /* |
| 2499 | * Call this to dispose of compile results when you are done with them. |
| 2500 | * This will call the MOJOSHADER_free function you provided to |
| 2501 | * MOJOSHADER_compile() multiple times, if you provided one. |
| 2502 | * Passing a NULL here is a safe no-op. |
| 2503 | * |
| 2504 | * This function is thread safe, so long as any allocator you passed into |
| 2505 | * MOJOSHADER_compile() is, too. |
| 2506 | */ |
| 2507 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_freeCompileDatacxx . . $ MOJOSHADER_freeCompileData(ef027feabce6ae2b).(const MOJOSHADER_compileDatacxx . . $ MOJOSHADER_compileData# *data); |
| 2508 | |
| 2509 | |
| 2510 | /* OpenGL interface... */ |
| 2511 | |
| 2512 | /* |
| 2513 | * Signature for function lookup callbacks. MojoShader will call a function |
| 2514 | * you provide to get OpenGL entry points (both standard functions and |
| 2515 | * extensions). Through this, MojoShader never links directly to OpenGL, |
| 2516 | * but relies on you to provide the implementation. This means you can |
| 2517 | * swap in different drivers, or hook functions (log every GL call MojoShader |
| 2518 | * makes, etc). |
| 2519 | * |
| 2520 | * (fnname) is the function name we want the address for ("glBegin" or |
| 2521 | * whatever. (data) is a void pointer you provide, if this callback needs |
| 2522 | * extra information. If you don't need it, you may specify NULL. |
| 2523 | * |
| 2524 | * Return the entry point on success, NULL if it couldn't be found. |
| 2525 | * Note that this could ask for standard entry points like glEnable(), or |
| 2526 | * extensions like glProgramLocalParameterI4ivNV(), so you might need |
| 2527 | * to check two places to find the desired entry point, depending on your |
| 2528 | * platform (Windows might need to look in OpenGL32.dll and use WGL, etc). |
| 2529 | */ |
| 2530 | typedef void *(MOJOSHADERCALLcxx . . $ `mojoshader.h:42:9`! *MOJOSHADER_glGetProcAddresscxx . . $ MOJOSHADER_glGetProcAddress#)(const char *fnname, void *data); |
| 2531 | |
| 2532 | |
| 2533 | /* |
| 2534 | * "Contexts" map to OpenGL contexts...you need one per window, or whatever, |
| 2535 | * and need to inform MojoShader when you make a new one current. |
| 2536 | * |
| 2537 | * "Shaders" refer to individual vertex or pixel programs, and are created |
| 2538 | * by "compiling" Direct3D shader bytecode. A vertex and pixel shader are |
| 2539 | * "linked" into a "Program" before you can use them to render. |
| 2540 | * |
| 2541 | * To the calling application, these are all opaque handles. |
| 2542 | */ |
| 2543 | typedef struct MOJOSHADER_glContextcxx . . $ MOJOSHADER_glContext# MOJOSHADER_glContextcxx . . $ MOJOSHADER_glContext#; |
| 2544 | typedef struct MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader#; |
| 2545 | typedef struct MOJOSHADER_glProgramcxx . . $ MOJOSHADER_glProgram# MOJOSHADER_glProgramcxx . . $ MOJOSHADER_glProgram#; |
| 2546 | |
| 2547 | |
| 2548 | /* |
| 2549 | * Get a list of available profiles. This will fill in the array (profs) |
| 2550 | * with up to (size) pointers of profiles that the current system can handle; |
| 2551 | * that is, the profiles are built into MojoShader and the OpenGL extensions |
| 2552 | * required for them exist at runtime. This function returns the number of |
| 2553 | * available profiles, which may be more, less, or equal to (size). |
| 2554 | * |
| 2555 | * If there are more than (size) profiles, the (profs) buffer will not |
| 2556 | * overflow. You can check the return value for the total number of |
| 2557 | * available profiles, allocate more space, and try again if necessary. |
| 2558 | * Calling this function with (size) == 0 is legal. |
| 2559 | * |
| 2560 | * You can only call this AFTER you have successfully built your GL context |
| 2561 | * and made it current. This function will lookup the GL functions it needs |
| 2562 | * through the callback you supply, via (lookup) and (lookup_d). The lookup |
| 2563 | * function is neither stored nor used by MojoShader after this function |
| 2564 | * returns, nor are the functions it might look up. |
| 2565 | * |
| 2566 | * As MojoShader requires some memory to be allocated, you may provide a |
| 2567 | * custom allocator to this function, which will be used to allocate/free |
| 2568 | * memory. They function just like malloc() and free(). We do not use |
| 2569 | * realloc(). If you don't care, pass NULL in for the allocator functions. |
| 2570 | * If your allocator needs instance-specific data, you may supply it with the |
| 2571 | * (malloc_d) parameter. This pointer is passed as-is to your (m) and (f) |
| 2572 | * functions. |
| 2573 | * |
| 2574 | * You should not free any strings returned from this function; they are |
| 2575 | * pointers to internal, probably static, memory. |
| 2576 | * |
| 2577 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2578 | * safe, you should probably only call this from the same thread that created |
| 2579 | * the GL context. |
| 2580 | */ |
| 2581 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_glAvailableProfilescxx . . $ MOJOSHADER_glAvailableProfiles(3b3a24d9228d4570).(MOJOSHADER_glGetProcAddresscxx . . $ MOJOSHADER_glGetProcAddress# lookup, |
| 2582 | void *lookup_d, |
| 2583 | const char **profs, const int size, |
| 2584 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 2585 | void *malloc_d); |
| 2586 | |
| 2587 | |
| 2588 | /* |
| 2589 | * Determine the best profile to use for the current system. |
| 2590 | * |
| 2591 | * You can only call this AFTER you have successfully built your GL context |
| 2592 | * and made it current. This function will lookup the GL functions it needs |
| 2593 | * through the callback you supply via (lookup) and (lookup_d). The lookup |
| 2594 | * function is neither stored nor used by MojoShader after this function |
| 2595 | * returns, nor are the functions it might look up. |
| 2596 | * |
| 2597 | * Returns the name of the "best" profile on success, NULL if none of the |
| 2598 | * available profiles will work on this system. "Best" is a relative term, |
| 2599 | * but it generally means the best trade off between feature set and |
| 2600 | * performance. The selection algorithm may be arbitrary and complex. |
| 2601 | * |
| 2602 | * As MojoShader requires some memory to be allocated, you may provide a |
| 2603 | * custom allocator to this function, which will be used to allocate/free |
| 2604 | * memory. They function just like malloc() and free(). We do not use |
| 2605 | * realloc(). If you don't care, pass NULL in for the allocator functions. |
| 2606 | * If your allocator needs instance-specific data, you may supply it with the |
| 2607 | * (malloc_d) parameter. This pointer is passed as-is to your (m) and (f) |
| 2608 | * functions. |
| 2609 | * |
| 2610 | * The returned value is an internal static string, and should not be free()'d |
| 2611 | * by the caller. If you get a NULL, calling MOJOSHADER_glGetError() might |
| 2612 | * shed some light on why. |
| 2613 | * |
| 2614 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2615 | * safe, you should probably only call this from the same thread that created |
| 2616 | * the GL context. |
| 2617 | */ |
| 2618 | DECLSPECcxx . . $ `<built-in>:410:9`! const char *MOJOSHADER_glBestProfilecxx . . $ MOJOSHADER_glBestProfile(9e574eee0221474a).(MOJOSHADER_glGetProcAddresscxx . . $ MOJOSHADER_glGetProcAddress# lookup, |
| 2619 | void *lookup_d, |
| 2620 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 2621 | void *malloc_d); |
| 2622 | |
| 2623 | /* |
| 2624 | * Prepare MojoShader to manage OpenGL shaders. |
| 2625 | * |
| 2626 | * You do not need to call this if all you want is MOJOSHADER_parse(). |
| 2627 | * |
| 2628 | * You must call this once AFTER you have successfully built your GL context |
| 2629 | * and made it current. This function will lookup the GL functions it needs |
| 2630 | * through the callback you supply via (lookup) and (lookup_d), after which |
| 2631 | * it may call them at any time up until you call |
| 2632 | * MOJOSHADER_glDestroyContext(). The lookup function is neither stored nor |
| 2633 | * used by MojoShader after this function returns. |
| 2634 | * |
| 2635 | * (profile) is an OpenGL-specific MojoShader profile, which decides how |
| 2636 | * Direct3D bytecode shaders get turned into OpenGL programs, and how they |
| 2637 | * are fed to the GL. |
| 2638 | * |
| 2639 | * (lookup) is a callback that is used to load GL entry points. This callback |
| 2640 | * has to look up base GL functions and extension entry points. The pointer |
| 2641 | * you supply in (lookup_d) is passed as-is to the callback. |
| 2642 | * |
| 2643 | * As MojoShader requires some memory to be allocated, you may provide a |
| 2644 | * custom allocator to this function, which will be used to allocate/free |
| 2645 | * memory. They function just like malloc() and free(). We do not use |
| 2646 | * realloc(). If you don't care, pass NULL in for the allocator functions. |
| 2647 | * If your allocator needs instance-specific data, you may supply it with the |
| 2648 | * (malloc_d) parameter. This pointer is passed as-is to your (m) and (f) |
| 2649 | * functions. |
| 2650 | * |
| 2651 | * Returns a new context on success, NULL on error. If you get a new context, |
| 2652 | * you need to make it current before using it with |
| 2653 | * MOJOSHADER_glMakeContextCurrent(). |
| 2654 | * |
| 2655 | * This call is NOT thread safe! It must return success before you may call |
| 2656 | * any other MOJOSHADER_gl* function. Also, as most OpenGL implementations |
| 2657 | * are not thread safe, you should probably only call this from the same |
| 2658 | * thread that created the GL context. |
| 2659 | */ |
| 2660 | DECLSPECcxx . . $ `<built-in>:410:9`! MOJOSHADER_glContextcxx . . $ MOJOSHADER_glContext# *MOJOSHADER_glCreateContextcxx . . $ MOJOSHADER_glCreateContext(9bd61f5b213a9467).(const char *profile, |
| 2661 | MOJOSHADER_glGetProcAddresscxx . . $ MOJOSHADER_glGetProcAddress# lookup, |
| 2662 | void *lookup_d, |
| 2663 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 2664 | void *malloc_d); |
| 2665 | |
| 2666 | /* |
| 2667 | * You must call this before using the context that you got from |
| 2668 | * MOJOSHADER_glCreateContext(), and must use it when you switch to a new GL |
| 2669 | * context. |
| 2670 | * |
| 2671 | * You can only have one MOJOSHADER_glContext per actual GL context, or |
| 2672 | * undefined behaviour will result. |
| 2673 | * |
| 2674 | * It is legal to call this with a NULL pointer to make no context current, |
| 2675 | * but you need a valid context to be current to use most of MojoShader. |
| 2676 | * |
| 2677 | * In current times, this allows one context to be current _per thread_, |
| 2678 | * as the internal state inside MojoShader is marked thread local. Each |
| 2679 | * new thread should call this function before using the context, even if |
| 2680 | * other threads have previously set it current. You _also_ have to set |
| 2681 | * the OpenGL context itself current for each thread (and have an OpenGL |
| 2682 | * implementation that allows that in the first place). |
| 2683 | */ |
| 2684 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glMakeContextCurrentcxx . . $ MOJOSHADER_glMakeContextCurrent(512d40087428bebb).(MOJOSHADER_glContextcxx . . $ MOJOSHADER_glContext# *ctx); |
| 2685 | |
| 2686 | /* |
| 2687 | * Get any error state we might have picked up. MojoShader will NOT call |
| 2688 | * glGetError() internally, but there are other errors we can pick up, |
| 2689 | * such as failed shader compilation, etc. |
| 2690 | * |
| 2691 | * Returns a human-readable string. This string is for debugging purposes, and |
| 2692 | * not guaranteed to be localized, coherent, or user-friendly in any way. |
| 2693 | * It's for programmers! |
| 2694 | * |
| 2695 | * The latest error may remain between calls. New errors replace any existing |
| 2696 | * error. Don't check this string for a sign that an error happened, check |
| 2697 | * return codes instead and use this for explanation when debugging. |
| 2698 | * |
| 2699 | * Do not free the returned string: it's a pointer to a static internal |
| 2700 | * buffer. Do not keep the pointer around, either, as it's likely to become |
| 2701 | * invalid as soon as you call into MojoShader again. |
| 2702 | * |
| 2703 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2704 | * safe, you should probably only call this from the same thread that created |
| 2705 | * the GL context. |
| 2706 | * |
| 2707 | * This call does NOT require a valid MOJOSHADER_glContext to have been made |
| 2708 | * current. The error buffer is shared between contexts, so you can get |
| 2709 | * error results from a failed MOJOSHADER_glCreateContext(). |
| 2710 | */ |
| 2711 | DECLSPECcxx . . $ `<built-in>:410:9`! const char *MOJOSHADER_glGetErrorcxx . . $ MOJOSHADER_glGetError(33a1f659e94feb42).(void); |
| 2712 | |
| 2713 | /* |
| 2714 | * Get the maximum uniforms a shader can support for the current GL context, |
| 2715 | * MojoShader profile, and shader type. You can use this to make decisions |
| 2716 | * about what shaders you want to use (for example, a less complicated |
| 2717 | * shader may be swapped in for lower-end systems). |
| 2718 | * |
| 2719 | * Returns the number, or -1 on error. |
| 2720 | * |
| 2721 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2722 | * safe, you should probably only call this from the same thread that created |
| 2723 | * the GL context. |
| 2724 | * |
| 2725 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2726 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2727 | */ |
| 2728 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_glMaxUniformscxx . . $ MOJOSHADER_glMaxUniforms(31af91354e387fe).(MOJOSHADER_shaderTypecxx . . $ MOJOSHADER_shaderType# shader_type); |
| 2729 | |
| 2730 | /* |
| 2731 | * Compile a buffer of Direct3D shader bytecode into an OpenGL shader. |
| 2732 | * You still need to link the shader before you may render with it. |
| 2733 | * |
| 2734 | * (tokenbuf) is a buffer of Direct3D shader bytecode. |
| 2735 | * (bufsize) is the size, in bytes, of the bytecode buffer. |
| 2736 | * (swiz), (swizcount), (smap), and (smapcount) are passed to |
| 2737 | * MOJOSHADER_parse() unmolested. |
| 2738 | * |
| 2739 | * Returns NULL on error, or a shader handle on success. |
| 2740 | * |
| 2741 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2742 | * safe, you should probably only call this from the same thread that created |
| 2743 | * the GL context. |
| 2744 | * |
| 2745 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2746 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2747 | * |
| 2748 | * Compiled shaders from this function may not be shared between contexts. |
| 2749 | */ |
| 2750 | DECLSPECcxx . . $ `<built-in>:410:9`! MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# *MOJOSHADER_glCompileShadercxx . . $ MOJOSHADER_glCompileShader(d9f5a783dddaff9b).(const unsigned char *tokenbuf, |
| 2751 | const unsigned int bufsize, |
| 2752 | const MOJOSHADER_swizzlecxx . . $ MOJOSHADER_swizzle# *swiz, |
| 2753 | const unsigned int swizcount, |
| 2754 | const MOJOSHADER_samplerMapcxx . . $ MOJOSHADER_samplerMap# *smap, |
| 2755 | const unsigned int smapcount); |
| 2756 | |
| 2757 | /* |
| 2758 | * Increments a shader's internal refcount. To decrement the refcount, call |
| 2759 | * MOJOSHADER_glDeleteShader(). |
| 2760 | * |
| 2761 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2762 | * safe, you should probably only call this from the same thread that created |
| 2763 | * the GL context. |
| 2764 | * |
| 2765 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2766 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2767 | */ |
| 2768 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glShaderAddRefcxx . . $ MOJOSHADER_glShaderAddRef(faf9002d9d72f6c2).(MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# *shader); |
| 2769 | |
| 2770 | /* |
| 2771 | * Get the MOJOSHADER_parseData structure that was produced from the |
| 2772 | * call to MOJOSHADER_glCompileShader(). |
| 2773 | * |
| 2774 | * This data is read-only, and you should NOT attempt to free it. This |
| 2775 | * pointer remains valid until the shader is deleted. |
| 2776 | */ |
| 2777 | DECLSPECcxx . . $ `<built-in>:410:9`! const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *MOJOSHADER_glGetShaderParseDatacxx . . $ MOJOSHADER_glGetShaderParseData(6c5741abd4b24cbc).( |
| 2778 | MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# *shader); |
| 2779 | /* |
| 2780 | * Link a vertex and pixel shader into an OpenGL program. |
| 2781 | * (vshader) or (pshader) can be NULL, to specify that the GL should use the |
| 2782 | * fixed-function pipeline instead of the programmable pipeline for that |
| 2783 | * portion of the work. You can reuse shaders in various combinations across |
| 2784 | * multiple programs, by relinking different pairs. |
| 2785 | * |
| 2786 | * It is illegal to give a vertex shader for (pshader) or a pixel shader |
| 2787 | * for (vshader). |
| 2788 | * |
| 2789 | * Once you have successfully linked a program, you may render with it. |
| 2790 | * |
| 2791 | * Returns NULL on error, or a program handle on success. |
| 2792 | * |
| 2793 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2794 | * safe, you should probably only call this from the same thread that created |
| 2795 | * the GL context. |
| 2796 | * |
| 2797 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2798 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2799 | * |
| 2800 | * Linked programs from this function may not be shared between contexts. |
| 2801 | */ |
| 2802 | DECLSPECcxx . . $ `<built-in>:410:9`! MOJOSHADER_glProgramcxx . . $ MOJOSHADER_glProgram# *MOJOSHADER_glLinkProgramcxx . . $ MOJOSHADER_glLinkProgram(cadeb3b15fc44e60).(MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# *vshader, |
| 2803 | MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# *pshader); |
| 2804 | |
| 2805 | /* |
| 2806 | * This binds the program (using, for example, glUseProgramObjectARB()), and |
| 2807 | * disables all the client-side arrays so we can reset them with new values |
| 2808 | * if appropriate. |
| 2809 | * |
| 2810 | * Call with NULL to disable the programmable pipeline and all enabled |
| 2811 | * client-side arrays. |
| 2812 | * |
| 2813 | * After binding a program, you should update any uniforms you care about |
| 2814 | * with MOJOSHADER_glSetVertexShaderUniformF() (etc), set any vertex arrays |
| 2815 | * you want to use with MOJOSHADER_glSetVertexAttribute(), and finally call |
| 2816 | * MOJOSHADER_glProgramReady() to commit everything to the GL. Then you may |
| 2817 | * begin drawing through standard GL entry points. |
| 2818 | * |
| 2819 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2820 | * safe, you should probably only call this from the same thread that created |
| 2821 | * the GL context. |
| 2822 | * |
| 2823 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2824 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2825 | */ |
| 2826 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glBindProgramcxx . . $ MOJOSHADER_glBindProgram(b6cc5ff6e33eca9d).(MOJOSHADER_glProgramcxx . . $ MOJOSHADER_glProgram# *program); |
| 2827 | |
| 2828 | /* |
| 2829 | * This binds individual shaders as if you had linked them with |
| 2830 | * MOJOSHADER_glLinkProgram(), and used MOJOSHADER_glBindProgram() on the |
| 2831 | * linked result. |
| 2832 | * |
| 2833 | * MojoShader will handle linking behind the scenes, and keep a cache of |
| 2834 | * programs linked here. Programs are removed from this cache when one of the |
| 2835 | * invidual shaders in it is deleted, otherwise they remain cached so future |
| 2836 | * calls to this function don't need to relink a previously-used shader |
| 2837 | * grouping. |
| 2838 | * |
| 2839 | * This function is for convenience, as the API is closer to how Direct3D |
| 2840 | * works, and retrofitting linking into your app can be difficult; |
| 2841 | * frequently, you just end up building your own cache, anyhow. |
| 2842 | * |
| 2843 | * Calling with all shaders set to NULL is equivalent to calling |
| 2844 | * MOJOSHADER_glBindProgram(NULL). |
| 2845 | * |
| 2846 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2847 | * safe, you should probably only call this from the same thread that created |
| 2848 | * the GL context. |
| 2849 | * |
| 2850 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2851 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2852 | */ |
| 2853 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glBindShaderscxx . . $ MOJOSHADER_glBindShaders(63618d261cfc072a).(MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# *vshader, |
| 2854 | MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# *pshader); |
| 2855 | |
| 2856 | /* |
| 2857 | * This queries for the shaders currently bound to the active context. |
| 2858 | * |
| 2859 | * This function is only for convenience, specifically for compatibility with |
| 2860 | * the effects API. |
| 2861 | * |
| 2862 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2863 | * safe, you should probably only call this from the same thread that created |
| 2864 | * the GL context. |
| 2865 | * |
| 2866 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2867 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2868 | */ |
| 2869 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glGetBoundShaderscxx . . $ MOJOSHADER_glGetBoundShaders(b68bb660a2720edd).(MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# **vshader, |
| 2870 | MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# **pshader); |
| 2871 | |
| 2872 | /* |
| 2873 | * Set a floating-point uniform value (what Direct3D calls a "constant"). |
| 2874 | * |
| 2875 | * There is a single array of 4-float "registers" shared by all vertex shaders. |
| 2876 | * This is the "c" register file in Direct3D (c0, c1, c2, etc...) |
| 2877 | * MojoShader will take care of synchronizing this internal array with the |
| 2878 | * appropriate variables in the GL shaders. |
| 2879 | * |
| 2880 | * (idx) is the index into the internal array: 0 is the first four floats, |
| 2881 | * 1 is the next four, etc. |
| 2882 | * (data) is a pointer to (vec4count*4) floats. |
| 2883 | * |
| 2884 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2885 | * safe, you should probably only call this from the same thread that created |
| 2886 | * the GL context. |
| 2887 | * |
| 2888 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2889 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2890 | * |
| 2891 | * Uniforms are not shared between contexts. |
| 2892 | */ |
| 2893 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glSetVertexShaderUniformFcxx . . $ MOJOSHADER_glSetVertexShaderUniformF(ab18346244e02b37).(unsigned int idx, const float *data, |
| 2894 | unsigned int vec4count); |
| 2895 | |
| 2896 | /* |
| 2897 | * Retrieve a floating-point uniform value (what Direct3D calls a "constant"). |
| 2898 | * |
| 2899 | * There is a single array of 4-float "registers" shared by all vertex shaders. |
| 2900 | * This is the "c" register file in Direct3D (c0, c1, c2, etc...) |
| 2901 | * MojoShader will take care of synchronizing this internal array with the |
| 2902 | * appropriate variables in the GL shaders. |
| 2903 | * |
| 2904 | * (idx) is the index into the internal array: 0 is the first four floats, |
| 2905 | * 1 is the next four, etc. |
| 2906 | * (data) is a pointer to space for (vec4count*4) floats. |
| 2907 | * (data) will be filled will current values in the register file. Results |
| 2908 | * are undefined if you request data past the end of the register file or |
| 2909 | * previously uninitialized registers. |
| 2910 | * |
| 2911 | * This is a "fast" call; we're just reading from internal memory. We do not |
| 2912 | * query the GPU or the GL for this information. |
| 2913 | * |
| 2914 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2915 | * safe, you should probably only call this from the same thread that created |
| 2916 | * the GL context. |
| 2917 | * |
| 2918 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2919 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2920 | * |
| 2921 | * Uniforms are not shared between contexts. |
| 2922 | */ |
| 2923 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glGetVertexShaderUniformFcxx . . $ MOJOSHADER_glGetVertexShaderUniformF(2a42829f5589e07f).(unsigned int idx, float *data, |
| 2924 | unsigned int vec4count); |
| 2925 | |
| 2926 | |
| 2927 | /* |
| 2928 | * Set an integer uniform value (what Direct3D calls a "constant"). |
| 2929 | * |
| 2930 | * There is a single array of 4-int "registers" shared by all vertex shaders. |
| 2931 | * This is the "i" register file in Direct3D (i0, i1, i2, etc...) |
| 2932 | * MojoShader will take care of synchronizing this internal array with the |
| 2933 | * appropriate variables in the GL shaders. |
| 2934 | * |
| 2935 | * (idx) is the index into the internal array: 0 is the first four ints, |
| 2936 | * 1 is the next four, etc. |
| 2937 | * (data) is a pointer to (ivec4count*4) ints. |
| 2938 | * |
| 2939 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2940 | * safe, you should probably only call this from the same thread that created |
| 2941 | * the GL context. |
| 2942 | * |
| 2943 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2944 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2945 | * |
| 2946 | * Uniforms are not shared between contexts. |
| 2947 | */ |
| 2948 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glSetVertexShaderUniformIcxx . . $ MOJOSHADER_glSetVertexShaderUniformI(888c01118f5b337b).(unsigned int idx, const int *data, |
| 2949 | unsigned int ivec4count); |
| 2950 | |
| 2951 | /* |
| 2952 | * Retrieve an integer uniform value (what Direct3D calls a "constant"). |
| 2953 | * |
| 2954 | * There is a single array of 4-int "registers" shared by all vertex shaders. |
| 2955 | * This is the "i" register file in Direct3D (i0, i1, i2, etc...) |
| 2956 | * MojoShader will take care of synchronizing this internal array with the |
| 2957 | * appropriate variables in the GL shaders. |
| 2958 | * |
| 2959 | * (idx) is the index into the internal array: 0 is the first four ints, |
| 2960 | * 1 is the next four, etc. |
| 2961 | * (data) is a pointer to space for (ivec4count*4) ints. |
| 2962 | * (data) will be filled will current values in the register file. Results |
| 2963 | * are undefined if you request data past the end of the register file or |
| 2964 | * previously uninitialized registers. |
| 2965 | * |
| 2966 | * This is a "fast" call; we're just reading from internal memory. We do not |
| 2967 | * query the GPU or the GL for this information. |
| 2968 | * |
| 2969 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2970 | * safe, you should probably only call this from the same thread that created |
| 2971 | * the GL context. |
| 2972 | * |
| 2973 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 2974 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 2975 | * |
| 2976 | * Uniforms are not shared between contexts. |
| 2977 | */ |
| 2978 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glGetVertexShaderUniformIcxx . . $ MOJOSHADER_glGetVertexShaderUniformI(cc39dc86876ea3dd).(unsigned int idx, int *data, |
| 2979 | unsigned int ivec4count); |
| 2980 | |
| 2981 | /* |
| 2982 | * Set a boolean uniform value (what Direct3D calls a "constant"). |
| 2983 | * |
| 2984 | * There is a single array of "registers" shared by all vertex shaders. |
| 2985 | * This is the "b" register file in Direct3D (b0, b1, b2, etc...) |
| 2986 | * MojoShader will take care of synchronizing this internal array with the |
| 2987 | * appropriate variables in the GL shaders. |
| 2988 | * |
| 2989 | * Unlike the float and int counterparts, booleans are single values, not |
| 2990 | * four-element vectors...so idx==1 is the second boolean in the internal |
| 2991 | * array, not the fifth. |
| 2992 | * |
| 2993 | * Non-zero values are considered "true" and zero is considered "false". |
| 2994 | * |
| 2995 | * (idx) is the index into the internal array. |
| 2996 | * (data) is a pointer to (bcount) ints. |
| 2997 | * |
| 2998 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 2999 | * safe, you should probably only call this from the same thread that created |
| 3000 | * the GL context. |
| 3001 | * |
| 3002 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3003 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3004 | * |
| 3005 | * Uniforms are not shared between contexts. |
| 3006 | */ |
| 3007 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glSetVertexShaderUniformBcxx . . $ MOJOSHADER_glSetVertexShaderUniformB(888c01118f5b337b).(unsigned int idx, const int *data, |
| 3008 | unsigned int bcount); |
| 3009 | |
| 3010 | /* |
| 3011 | * Retrieve a boolean uniform value (what Direct3D calls a "constant"). |
| 3012 | * |
| 3013 | * There is a single array of "registers" shared by all vertex shaders. |
| 3014 | * This is the "b" register file in Direct3D (b0, b1, b2, etc...) |
| 3015 | * MojoShader will take care of synchronizing this internal array with the |
| 3016 | * appropriate variables in the GL shaders. |
| 3017 | * |
| 3018 | * Unlike the float and int counterparts, booleans are single values, not |
| 3019 | * four-element vectors...so idx==1 is the second boolean in the internal |
| 3020 | * array, not the fifth. |
| 3021 | * |
| 3022 | * Non-zero values are considered "true" and zero is considered "false". |
| 3023 | * This function will always return true values as 1, regardless of what |
| 3024 | * non-zero integer you originally used to set the registers. |
| 3025 | * |
| 3026 | * (idx) is the index into the internal array. |
| 3027 | * (data) is a pointer to space for (bcount) ints. |
| 3028 | * (data) will be filled will current values in the register file. Results |
| 3029 | * are undefined if you request data past the end of the register file or |
| 3030 | * previously uninitialized registers. |
| 3031 | * |
| 3032 | * This is a "fast" call; we're just reading from internal memory. We do not |
| 3033 | * query the GPU or the GL for this information. |
| 3034 | * |
| 3035 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3036 | * safe, you should probably only call this from the same thread that created |
| 3037 | * the GL context. |
| 3038 | * |
| 3039 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3040 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3041 | * |
| 3042 | * Uniforms are not shared between contexts. |
| 3043 | */ |
| 3044 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glGetVertexShaderUniformBcxx . . $ MOJOSHADER_glGetVertexShaderUniformB(cc39dc86876ea3dd).(unsigned int idx, int *data, |
| 3045 | unsigned int bcount); |
| 3046 | |
| 3047 | /* |
| 3048 | * The equivalent of MOJOSHADER_glSetVertexShaderUniformF() for pixel |
| 3049 | * shaders. Other than using a different internal array that is specific |
| 3050 | * to pixel shaders, this functions just like its vertex array equivalent. |
| 3051 | * |
| 3052 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3053 | * safe, you should probably only call this from the same thread that created |
| 3054 | * the GL context. |
| 3055 | * |
| 3056 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3057 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3058 | * |
| 3059 | * Uniforms are not shared between contexts. |
| 3060 | */ |
| 3061 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glSetPixelShaderUniformFcxx . . $ MOJOSHADER_glSetPixelShaderUniformF(ab18346244e02b37).(unsigned int idx, const float *data, |
| 3062 | unsigned int vec4count); |
| 3063 | |
| 3064 | |
| 3065 | /* |
| 3066 | * The equivalent of MOJOSHADER_glGetVertexShaderUniformF() for pixel |
| 3067 | * shaders. Other than using a different internal array that is specific |
| 3068 | * to pixel shaders, this functions just like its vertex array equivalent. |
| 3069 | * |
| 3070 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3071 | * safe, you should probably only call this from the same thread that created |
| 3072 | * the GL context. |
| 3073 | * |
| 3074 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3075 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3076 | * |
| 3077 | * Uniforms are not shared between contexts. |
| 3078 | */ |
| 3079 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glGetPixelShaderUniformFcxx . . $ MOJOSHADER_glGetPixelShaderUniformF(2a42829f5589e07f).(unsigned int idx, float *data, |
| 3080 | unsigned int vec4count); |
| 3081 | |
| 3082 | |
| 3083 | /* |
| 3084 | * The equivalent of MOJOSHADER_glSetVertexShaderUniformI() for pixel |
| 3085 | * shaders. Other than using a different internal array that is specific |
| 3086 | * to pixel shaders, this functions just like its vertex array equivalent. |
| 3087 | * |
| 3088 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3089 | * safe, you should probably only call this from the same thread that created |
| 3090 | * the GL context. |
| 3091 | * |
| 3092 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3093 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3094 | * |
| 3095 | * Uniforms are not shared between contexts. |
| 3096 | */ |
| 3097 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glSetPixelShaderUniformIcxx . . $ MOJOSHADER_glSetPixelShaderUniformI(888c01118f5b337b).(unsigned int idx, const int *data, |
| 3098 | unsigned int ivec4count); |
| 3099 | |
| 3100 | |
| 3101 | /* |
| 3102 | * The equivalent of MOJOSHADER_glGetVertexShaderUniformI() for pixel |
| 3103 | * shaders. Other than using a different internal array that is specific |
| 3104 | * to pixel shaders, this functions just like its vertex array equivalent. |
| 3105 | * |
| 3106 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3107 | * safe, you should probably only call this from the same thread that created |
| 3108 | * the GL context. |
| 3109 | * |
| 3110 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3111 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3112 | * |
| 3113 | * Uniforms are not shared between contexts. |
| 3114 | */ |
| 3115 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glGetPixelShaderUniformIcxx . . $ MOJOSHADER_glGetPixelShaderUniformI(cc39dc86876ea3dd).(unsigned int idx, int *data, |
| 3116 | unsigned int ivec4count); |
| 3117 | |
| 3118 | /* |
| 3119 | * The equivalent of MOJOSHADER_glSetVertexShaderUniformB() for pixel |
| 3120 | * shaders. Other than using a different internal array that is specific |
| 3121 | * to pixel shaders, this functions just like its vertex array equivalent. |
| 3122 | * |
| 3123 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3124 | * safe, you should probably only call this from the same thread that created |
| 3125 | * the GL context. |
| 3126 | * |
| 3127 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3128 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3129 | * |
| 3130 | * Uniforms are not shared between contexts. |
| 3131 | */ |
| 3132 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glSetPixelShaderUniformBcxx . . $ MOJOSHADER_glSetPixelShaderUniformB(888c01118f5b337b).(unsigned int idx, const int *data, |
| 3133 | unsigned int bcount); |
| 3134 | |
| 3135 | /* |
| 3136 | * The equivalent of MOJOSHADER_glGetVertexShaderUniformB() for pixel |
| 3137 | * shaders. Other than using a different internal array that is specific |
| 3138 | * to pixel shaders, this functions just like its vertex array equivalent. |
| 3139 | * |
| 3140 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3141 | * safe, you should probably only call this from the same thread that created |
| 3142 | * the GL context. |
| 3143 | * |
| 3144 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3145 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3146 | * |
| 3147 | * Uniforms are not shared between contexts. |
| 3148 | */ |
| 3149 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glGetPixelShaderUniformBcxx . . $ MOJOSHADER_glGetPixelShaderUniformB(cc39dc86876ea3dd).(unsigned int idx, int *data, |
| 3150 | unsigned int bcount); |
| 3151 | |
| 3152 | /* |
| 3153 | * Fills register pointers with pointers that are directly used to push uniform |
| 3154 | * data to the GL shader context. |
| 3155 | * |
| 3156 | * This function is really just for the effects API, you should NOT be using |
| 3157 | * this unless you know every single line of MojoShader from memory. |
| 3158 | * |
| 3159 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3160 | * safe, you should probably only call this from the same thread that created |
| 3161 | * the GL context. |
| 3162 | * |
| 3163 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3164 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3165 | */ |
| 3166 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glMapUniformBufferMemorycxx . . $ MOJOSHADER_glMapUniformBufferMemory(6e9d59e50a3cee90).(float **vsf, int **vsi, unsigned char **vsb, |
| 3167 | float **psf, int **psi, unsigned char **psb); |
| 3168 | |
| 3169 | /* |
| 3170 | * Tells the context that you are done with the memory mapped by |
| 3171 | * MOJOSHADER_glMapUniformBufferMemory(). |
| 3172 | * |
| 3173 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3174 | * safe, you should probably only call this from the same thread that created |
| 3175 | * the GL context. |
| 3176 | * |
| 3177 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3178 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3179 | */ |
| 3180 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glUnmapUniformBufferMemorycxx . . $ MOJOSHADER_glUnmapUniformBufferMemory(d878ad36e69247c7).(); |
| 3181 | |
| 3182 | /* |
| 3183 | * Set up the vector for the TEXBEM opcode. Most apps can ignore this API. |
| 3184 | * |
| 3185 | * Shader Model 1.1 through 1.3 had an instruction for "fake bump mapping" |
| 3186 | * called TEXBEM. To use it, you had to set some sampler states, |
| 3187 | * D3DTSS_BUMPENVMATxx, which would be referenced by the opcode. |
| 3188 | * |
| 3189 | * This functionality was removed from Shader Model 1.4 and later, because |
| 3190 | * it was special-purpose and limited. The functionality could be built on |
| 3191 | * more general opcodes, and the sampler state could be supplied in a more |
| 3192 | * general uniform. |
| 3193 | * |
| 3194 | * However, to support this opcode, we supply a way to specify that sampler |
| 3195 | * state, and the OpenGL glue code does the right thing to pass that |
| 3196 | * information to the shader. |
| 3197 | * |
| 3198 | * This call maps to IDirect3DDevice::SetTextureStageState() with the |
| 3199 | * D3DTSS_BUMPENVMAT00, D3DTSS_BUMPENVMAT01, D3DTSS_BUMPENVMAT10, |
| 3200 | * D3DTSS_BUMPENVMAT11, D3DTSS_BUMPENVLSCALE, and D3DTSS_BUMPENVLOFFSET |
| 3201 | * targets. This is only useful for Shader Model < 1.4 pixel shaders, if |
| 3202 | * they use the TEXBEM or TEXBEML opcode. If you aren't sure, you don't need |
| 3203 | * this function. |
| 3204 | * |
| 3205 | * Like the rest of your uniforms, you must call MOJOSHADER_glProgramReady() |
| 3206 | * between setting new values and drawing with them. |
| 3207 | * |
| 3208 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3209 | * safe, you should probably only call this from the same thread that created |
| 3210 | * the GL context. |
| 3211 | * |
| 3212 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3213 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3214 | * |
| 3215 | * These values are not shared between contexts. |
| 3216 | */ |
| 3217 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glSetLegacyBumpMapEnvcxx . . $ MOJOSHADER_glSetLegacyBumpMapEnv(c7dc24266a8c329b).(unsigned int sampler, float mat00, |
| 3218 | float mat01, float mat10, float mat11, |
| 3219 | float lscale, float loffset); |
| 3220 | |
| 3221 | /* |
| 3222 | * Return the location of a vertex attribute for the currently-bound program. |
| 3223 | * |
| 3224 | * (usage) and (index) map to Direct3D vertex declaration values: COLOR1 would |
| 3225 | * be MOJOSHADER_USAGE_COLOR and 1. |
| 3226 | * |
| 3227 | * The return value is the index of the attribute to be sent to |
| 3228 | * glVertexAttribPointer, or -1 if the stream is not used. |
| 3229 | * |
| 3230 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3231 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3232 | */ |
| 3233 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_glGetVertexAttribLocationcxx . . $ MOJOSHADER_glGetVertexAttribLocation(42d8cb8c798fe890).(MOJOSHADER_usagecxx . . $ MOJOSHADER_usage# usage, int index); |
| 3234 | |
| 3235 | /* |
| 3236 | * Connect a client-side array to the currently-bound program. |
| 3237 | * |
| 3238 | * (usage) and (index) map to Direct3D vertex declaration values: COLOR1 would |
| 3239 | * be MOJOSHADER_USAGE_COLOR and 1. |
| 3240 | * |
| 3241 | * The caller should bind VBOs before this call and treat (ptr) as an offset, |
| 3242 | * if appropriate. |
| 3243 | * |
| 3244 | * MojoShader will figure out where to plug this stream into the |
| 3245 | * currently-bound program, and enable the appropriate client-side array. |
| 3246 | * |
| 3247 | * (size), (type), (normalized), (stride), and (ptr) correspond to |
| 3248 | * glVertexAttribPointer()'s parameters (in most cases, these get passed |
| 3249 | * unmolested to that very entry point during this function). |
| 3250 | * |
| 3251 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3252 | * safe, you should probably only call this from the same thread that created |
| 3253 | * the GL context. |
| 3254 | * |
| 3255 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3256 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3257 | * |
| 3258 | * Vertex attributes are not shared between contexts. |
| 3259 | */ |
| 3260 | /* !!! FIXME: this should probably be "input" and not "attribute" */ |
| 3261 | /* !!! FIXME: or maybe "vertex array" or something. */ |
| 3262 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glSetVertexAttributecxx . . $ MOJOSHADER_glSetVertexAttribute(6df45b7f96483cdb).(MOJOSHADER_usagecxx . . $ MOJOSHADER_usage# usage, |
| 3263 | int index, unsigned int size, |
| 3264 | MOJOSHADER_attributeTypecxx . . $ MOJOSHADER_attributeType# type, |
| 3265 | int normalized, unsigned int stride, |
| 3266 | const void *ptr); |
| 3267 | |
| 3268 | /* |
| 3269 | * Modify the rate at which this vertex attribute advances during instanced |
| 3270 | * rendering. |
| 3271 | * |
| 3272 | * This should be called alongside glSetVertexAttribute, as this does not flag |
| 3273 | * the vertex array as being in use. This just calls glVertexAttribDivisorARB. |
| 3274 | * |
| 3275 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3276 | * safe, you should probably only call this from the same thread that created |
| 3277 | * the GL context. |
| 3278 | * |
| 3279 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3280 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3281 | * |
| 3282 | * Vertex attributes are not shared between contexts. |
| 3283 | */ |
| 3284 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glSetVertexAttribDivisorcxx . . $ MOJOSHADER_glSetVertexAttribDivisor(16e0bb98d649a25d).(MOJOSHADER_usagecxx . . $ MOJOSHADER_usage# usage, |
| 3285 | int index, unsigned int divisor); |
| 3286 | |
| 3287 | /* |
| 3288 | * Inform MojoShader that it should commit any pending state to the GL. This |
| 3289 | * must be called after you bind a program and update any inputs, right |
| 3290 | * before you start drawing, so any outstanding changes made to the shared |
| 3291 | * constants array (etc) can propagate to the shader during this call. |
| 3292 | * |
| 3293 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3294 | * safe, you should probably only call this from the same thread that created |
| 3295 | * the GL context. |
| 3296 | * |
| 3297 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3298 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3299 | */ |
| 3300 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glProgramReadycxx . . $ MOJOSHADER_glProgramReady(49f6e7a06ebc5aa8).(void); |
| 3301 | |
| 3302 | /* |
| 3303 | * Provide information about the current viewport to the prepared shader |
| 3304 | * program. |
| 3305 | * |
| 3306 | * There are numerous components of OpenGL and Direct3D where the coordinate |
| 3307 | * systems do not match, and so the vertex/pixel shaders have to be modified to |
| 3308 | * compensate for these mismatches (for example, gl_FragCoord requires some |
| 3309 | * additional math on the Y coordinate to match vPos when rendering to the |
| 3310 | * backbuffer). Call this after MOJOSHADER_glProgramReady to apply all of the |
| 3311 | * relevant coordinate fixups at once. |
| 3312 | * |
| 3313 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3314 | * safe, you should probably only call this from the same thread that created |
| 3315 | * the GL context. |
| 3316 | * |
| 3317 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3318 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3319 | */ |
| 3320 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glProgramViewportInfocxx . . $ MOJOSHADER_glProgramViewportInfo(1559a299834bcdd5).(int viewportW, int viewportH, |
| 3321 | int backbufferW, int backbufferH, |
| 3322 | int renderTargetBound); |
| 3323 | |
| 3324 | /* |
| 3325 | * Free the resources of a linked program. This will delete the GL object |
| 3326 | * and free memory. |
| 3327 | * |
| 3328 | * If the program is currently bound by MOJOSHADER_glBindProgram(), it will |
| 3329 | * be deleted as soon as it becomes unbound. |
| 3330 | * |
| 3331 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3332 | * safe, you should probably only call this from the same thread that created |
| 3333 | * the GL context. |
| 3334 | * |
| 3335 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3336 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3337 | */ |
| 3338 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glDeleteProgramcxx . . $ MOJOSHADER_glDeleteProgram(b6cc5ff6e33eca9d).(MOJOSHADER_glProgramcxx . . $ MOJOSHADER_glProgram# *program); |
| 3339 | |
| 3340 | /* |
| 3341 | * Free the resources of a compiled shader. This will delete the GL object |
| 3342 | * and free memory. |
| 3343 | * |
| 3344 | * If the shader is currently referenced by a linked program (or is currently |
| 3345 | * bound with MOJOSHADER_glBindShaders()), it will be deleted as soon as all |
| 3346 | * referencing programs are deleted and it is no longer bound, too. |
| 3347 | * |
| 3348 | * This call is NOT thread safe! As most OpenGL implementations are not thread |
| 3349 | * safe, you should probably only call this from the same thread that created |
| 3350 | * the GL context. |
| 3351 | * |
| 3352 | * This call requires a valid MOJOSHADER_glContext to have been made current, |
| 3353 | * or it will crash your program. See MOJOSHADER_glMakeContextCurrent(). |
| 3354 | */ |
| 3355 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glDeleteShadercxx . . $ MOJOSHADER_glDeleteShader(faf9002d9d72f6c2).(MOJOSHADER_glShadercxx . . $ MOJOSHADER_glShader# *shader); |
| 3356 | |
| 3357 | /* |
| 3358 | * Deinitialize MojoShader's OpenGL shader management. |
| 3359 | * |
| 3360 | * You must call this once, while your GL context (not MojoShader context) is |
| 3361 | * still current, if you previously had a successful call to |
| 3362 | * MOJOSHADER_glCreateContext(). This should be the last MOJOSHADER_gl* |
| 3363 | * function you call until you've prepared a context again. |
| 3364 | * |
| 3365 | * This will clean up resources previously allocated, and may call into the GL. |
| 3366 | * |
| 3367 | * This will not clean up shaders and programs you created! Please call |
| 3368 | * MOJOSHADER_glDeleteShader() and MOJOSHADER_glDeleteProgram() to clean |
| 3369 | * those up before calling this function! |
| 3370 | * |
| 3371 | * This function destroys the MOJOSHADER_glContext you pass it. If it's the |
| 3372 | * current context, then no context will be current upon return. |
| 3373 | * |
| 3374 | * This call is NOT thread safe! There must not be any other MOJOSHADER_gl* |
| 3375 | * functions running when this is called. Also, as most OpenGL implementations |
| 3376 | * are not thread safe, you should probably only call this from the same |
| 3377 | * thread that created the GL context. |
| 3378 | */ |
| 3379 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_glDestroyContextcxx . . $ MOJOSHADER_glDestroyContext(512d40087428bebb).(MOJOSHADER_glContextcxx . . $ MOJOSHADER_glContext# *ctx); |
| 3380 | |
| 3381 | |
| 3382 | /* D3D11 interface... */ |
| 3383 | |
| 3384 | typedef struct MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context#; |
| 3385 | typedef struct MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader#; |
| 3386 | |
| 3387 | /* |
| 3388 | * Prepare MojoShader to manage Direct3D 11 shaders. |
| 3389 | * |
| 3390 | * You do not need to call this if all you want is MOJOSHADER_parse(). |
| 3391 | * |
| 3392 | * You must call this once AFTER you have successfully built your D3D11 context. |
| 3393 | * |
| 3394 | * As MojoShader requires some memory to be allocated, you may provide a |
| 3395 | * custom allocator to this function, which will be used to allocate/free |
| 3396 | * memory. They function just like malloc() and free(). We do not use |
| 3397 | * realloc(). If you don't care, pass NULL in for the allocator functions. |
| 3398 | * If your allocator needs instance-specific data, you may supply it with the |
| 3399 | * (malloc_d) parameter. This pointer is passed as-is to your (m) and (f) |
| 3400 | * functions. |
| 3401 | * |
| 3402 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3403 | * context from multiple threads, you must protect this call with whatever |
| 3404 | * thread synchronization technique you have for your other D3D calls. |
| 3405 | */ |
| 3406 | DECLSPECcxx . . $ `<built-in>:410:9`! MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *MOJOSHADER_d3d11CreateContextcxx . . $ MOJOSHADER_d3d11CreateContext(e7f39130b051cd99).(void *device, |
| 3407 | void *deviceContext, |
| 3408 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, |
| 3409 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 3410 | void *malloc_d); |
| 3411 | |
| 3412 | /* |
| 3413 | * Get any error state we might have picked up, such as failed shader |
| 3414 | * compilation. |
| 3415 | * |
| 3416 | * Returns a human-readable string. This string is for debugging purposes, and |
| 3417 | * not guaranteed to be localized, coherent, or user-friendly in any way. |
| 3418 | * It's for programmers! |
| 3419 | * |
| 3420 | * The latest error may remain between calls. New errors replace any existing |
| 3421 | * error. Don't check this string for a sign that an error happened, check |
| 3422 | * return codes instead and use this for explanation when debugging. |
| 3423 | * |
| 3424 | * Do not free the returned string: it's a pointer to a static internal |
| 3425 | * buffer. Do not keep the pointer around, either, as it's likely to become |
| 3426 | * invalid as soon as you call into MojoShader again. |
| 3427 | */ |
| 3428 | DECLSPECcxx . . $ `<built-in>:410:9`! const char *MOJOSHADER_d3d11GetErrorcxx . . $ MOJOSHADER_d3d11GetError(26e24448d35d806c).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *context); |
| 3429 | |
| 3430 | /* |
| 3431 | * Compile a buffer of Direct3D 9 shader bytecode into a Direct3D 11 shader. |
| 3432 | * You still need to link the shader before you may render with it. |
| 3433 | * |
| 3434 | * (mainfn) is the name of the shader's main function. |
| 3435 | * (tokenbuf) is a buffer of Direct3D shader bytecode. |
| 3436 | * (bufsize) is the size, in bytes, of the bytecode buffer. |
| 3437 | * (swiz), (swizcount), (smap), and (smapcount) are passed to |
| 3438 | * MOJOSHADER_parse() unmolested. |
| 3439 | * |
| 3440 | * Returns NULL on error, or a shader handle on success. |
| 3441 | * |
| 3442 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3443 | * context from multiple threads, you must protect this call with whatever |
| 3444 | * thread synchronization technique you have for your other D3D calls. |
| 3445 | */ |
| 3446 | DECLSPECcxx . . $ `<built-in>:410:9`! MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# *MOJOSHADER_d3d11CompileShadercxx . . $ MOJOSHADER_d3d11CompileShader(df1d0ef9e56235b5).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *context, |
| 3447 | const char *mainfn, |
| 3448 | const unsigned char *tokenbuf, |
| 3449 | const unsigned int bufsize, |
| 3450 | const MOJOSHADER_swizzlecxx . . $ MOJOSHADER_swizzle# *swiz, |
| 3451 | const unsigned int swizcount, |
| 3452 | const MOJOSHADER_samplerMapcxx . . $ MOJOSHADER_samplerMap# *smap, |
| 3453 | const unsigned int smapcount); |
| 3454 | |
| 3455 | /* |
| 3456 | * Increments a shader's internal refcount. To decrement the refcount, call |
| 3457 | * MOJOSHADER_glDeleteShader(). |
| 3458 | * |
| 3459 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3460 | * context from multiple threads, you must protect this call with whatever |
| 3461 | * thread synchronization technique you have for your other D3D calls. |
| 3462 | */ |
| 3463 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_d3d11ShaderAddRefcxx . . $ MOJOSHADER_d3d11ShaderAddRef(a305b531231927d0).(MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# *shader); |
| 3464 | |
| 3465 | /* |
| 3466 | * Get the MOJOSHADER_parseData structure that was produced from the |
| 3467 | * call to MOJOSHADER_d3d11CompileShader(). |
| 3468 | * |
| 3469 | * This data is read-only, and you should NOT attempt to free it. This |
| 3470 | * pointer remains valid until the shader is deleted. |
| 3471 | */ |
| 3472 | DECLSPECcxx . . $ `<built-in>:410:9`! const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *MOJOSHADER_d3d11GetShaderParseDatacxx . . $ MOJOSHADER_d3d11GetShaderParseData(5dbe98bea29395d4).( |
| 3473 | MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# *shader); |
| 3474 | |
| 3475 | /* |
| 3476 | * This binds individual shaders together, to be linked into a single working |
| 3477 | * program once MOJOSHADER_d3d11ProgramReady is called. |
| 3478 | * |
| 3479 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3480 | * context from multiple threads, you must protect this call with whatever |
| 3481 | * thread synchronization technique you have for your other D3D calls. |
| 3482 | */ |
| 3483 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_d3d11BindShaderscxx . . $ MOJOSHADER_d3d11BindShaders(8b3e2c412178e030).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *context, |
| 3484 | MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# *vshader, |
| 3485 | MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# *pshader); |
| 3486 | |
| 3487 | /* |
| 3488 | * This queries for the shaders currently bound to the active context. |
| 3489 | * |
| 3490 | * This function is only for convenience, specifically for compatibility with |
| 3491 | * the effects API. |
| 3492 | * |
| 3493 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3494 | * context from multiple threads, you must protect this call with whatever |
| 3495 | * thread synchronization technique you have for your other D3D calls. |
| 3496 | */ |
| 3497 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_d3d11GetBoundShaderscxx . . $ MOJOSHADER_d3d11GetBoundShaders(2d9176ebe4998bd).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *context, |
| 3498 | MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# **vshader, |
| 3499 | MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# **pshader); |
| 3500 | |
| 3501 | /* |
| 3502 | * Fills register pointers with pointers that are directly used to push uniform |
| 3503 | * data to the D3D11 shader context. |
| 3504 | * |
| 3505 | * This function is really just for the effects API, you should NOT be using |
| 3506 | * this unless you know every single line of MojoShader from memory. |
| 3507 | * |
| 3508 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3509 | * context from multiple threads, you must protect this call with whatever |
| 3510 | * thread synchronization technique you have for your other D3D calls. |
| 3511 | */ |
| 3512 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_d3d11MapUniformBufferMemorycxx . . $ MOJOSHADER_d3d11MapUniformBufferMemory(b3df39790fde8e82).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *context, |
| 3513 | float **vsf, int **vsi, unsigned char **vsb, |
| 3514 | float **psf, int **psi, unsigned char **psb); |
| 3515 | |
| 3516 | /* |
| 3517 | * Tells the context that you are done with the memory mapped by |
| 3518 | * MOJOSHADER_d3d11MapUniformBufferMemory(). |
| 3519 | * |
| 3520 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3521 | * context from multiple threads, you must protect this call with whatever |
| 3522 | * thread synchronization technique you have for your other D3D calls. |
| 3523 | */ |
| 3524 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_d3d11UnmapUniformBufferMemorycxx . . $ MOJOSHADER_d3d11UnmapUniformBufferMemory(f2c4c49af4f817d2).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *context); |
| 3525 | |
| 3526 | /* |
| 3527 | * Return the location of a vertex attribute for the given vertex shader. |
| 3528 | * |
| 3529 | * (usage) and (index) map to Direct3D vertex declaration values: COLOR1 would |
| 3530 | * be MOJOSHADER_USAGE_COLOR and 1. |
| 3531 | * |
| 3532 | * The return value is the index of the attribute to be used when building the |
| 3533 | * input layout object. |
| 3534 | */ |
| 3535 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_d3d11GetVertexAttribLocationcxx . . $ MOJOSHADER_d3d11GetVertexAttribLocation(ee22caea300def2e).(MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# *vert, |
| 3536 | MOJOSHADER_usagecxx . . $ MOJOSHADER_usage# usage, |
| 3537 | int index); |
| 3538 | |
| 3539 | /* |
| 3540 | * Using the given input layout, compiles the vertex shader with input |
| 3541 | * parameters that will be compatible with the incoming vertex data. |
| 3542 | * |
| 3543 | * (inputLayoutHash) is an application-defined value to differentiate unique |
| 3544 | * vertex declarations that will be passed to the vertex shader. |
| 3545 | * (elements) is an array of D3D11_INPUT_ELEMENT_DESCs, with (elementCount) |
| 3546 | * entries. (bytecode) and (bytecodeLength) will be filled with the final |
| 3547 | * compiled D3D11 vertex shader. |
| 3548 | * |
| 3549 | * Returns 0 on success, nonzero on error. |
| 3550 | * |
| 3551 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3552 | * context from multiple threads, you must protect this call with whatever |
| 3553 | * thread synchronization technique you have for your other D3D calls. |
| 3554 | */ |
| 3555 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_d3d11CompileVertexShadercxx . . $ MOJOSHADER_d3d11CompileVertexShader(1ff36b3e89a506f7).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *ctx, |
| 3556 | unsigned long long inputLayoutHash, |
| 3557 | void *elements, int elementCount, |
| 3558 | void **bytecode, int *bytecodeLength); |
| 3559 | |
| 3560 | /* |
| 3561 | * Inform MojoShader that it should commit any pending state and prepare the |
| 3562 | * final shader program object, linking the input/output parameter data to |
| 3563 | * be compatible with the more-strict Shader Model 4 rule set. This must be |
| 3564 | * called after you bind shaders and update any inputs, right before you start |
| 3565 | * drawing, so any outstanding changes made to the shared constants array (etc) |
| 3566 | * can propagate to the shader during this call. |
| 3567 | * |
| 3568 | * Returns 0 on success, nonzero on error. |
| 3569 | * |
| 3570 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3571 | * context from multiple threads, you must protect this call with whatever |
| 3572 | * thread synchronization technique you have for your other D3D calls. |
| 3573 | */ |
| 3574 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_d3d11ProgramReadycxx . . $ MOJOSHADER_d3d11ProgramReady(f514c33008f2d931).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *context, |
| 3575 | unsigned long long inputLayoutHash); |
| 3576 | |
| 3577 | /* |
| 3578 | * Free the resources of a compiled shader. This will delete the shader object |
| 3579 | * and free memory. |
| 3580 | * |
| 3581 | * This call is only as thread safe as your D3D11 context! If you call your |
| 3582 | * context from multiple threads, you must protect this call with whatever |
| 3583 | * thread synchronization technique you have for your other D3D calls. |
| 3584 | */ |
| 3585 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_d3d11DeleteShadercxx . . $ MOJOSHADER_d3d11DeleteShader(c59bbf7a5b61e09d).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *context, |
| 3586 | MOJOSHADER_d3d11Shadercxx . . $ MOJOSHADER_d3d11Shader# *shader); |
| 3587 | |
| 3588 | /* |
| 3589 | * Deinitialize MojoShader's D3D11 shader management. |
| 3590 | * |
| 3591 | * This will clean up resources previously allocated for the active context. |
| 3592 | * |
| 3593 | * This will NOT clean up shaders you created! Please destroy all shaders |
| 3594 | * before calling this function. |
| 3595 | */ |
| 3596 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_d3d11DestroyContextcxx . . $ MOJOSHADER_d3d11DestroyContext(f2c4c49af4f817d2).(MOJOSHADER_d3d11Contextcxx . . $ MOJOSHADER_d3d11Context# *context); |
| 3597 | |
| 3598 | |
| 3599 | /* SDL_GPU interface... */ |
| 3600 | |
| 3601 | typedef struct MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext#; |
| 3602 | typedef struct MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData#; |
| 3603 | typedef struct MOJOSHADER_sdlProgramcxx . . $ MOJOSHADER_sdlProgram# MOJOSHADER_sdlProgramcxx . . $ MOJOSHADER_sdlProgram#; |
| 3604 | |
| 3605 | #ifndef SDL_GPU_H |
| 3606 | typedef struct SDL_GPUDevicecxx . . $ SDL_GPUDevice# SDL_GPUDevicecxx . . $ SDL_GPUDevice#; |
| 3607 | typedef struct SDL_GPUShadercxx . . $ SDL_GPUShader# SDL_GPUShadercxx . . $ SDL_GPUShader#; |
| 3608 | typedef struct SDL_GPUCommandBuffercxx . . $ SDL_GPUCommandBuffer# SDL_GPUCommandBuffercxx . . $ SDL_GPUCommandBuffer#; |
| 3609 | #endif /* SDL_GPU_H */ |
| 3610 | |
| 3611 | /* |
| 3612 | * Call this function to get the 'formatFlags' parameter for |
| 3613 | * SDL_CreateGPUDevice. |
| 3614 | * |
| 3615 | * Returns the SDL_GPUShaderFormatFlagBits for creating the SDL_GPUDevice. |
| 3616 | */ |
| 3617 | DECLSPECcxx . . $ `<built-in>:410:9`! unsigned int MOJOSHADER_sdlGetShaderFormatscxx . . $ MOJOSHADER_sdlGetShaderFormats(db52760e79bf9054).(void); |
| 3618 | |
| 3619 | /* |
| 3620 | * Prepares a context to manage SDL_gpu shaders. |
| 3621 | * |
| 3622 | * You do not need to call this if all you want is MOJOSHADER_parse(). |
| 3623 | * |
| 3624 | * (device) refers to the SDL_GPUDevice. |
| 3625 | * |
| 3626 | * You can only have one MOJOSHADER_sdlContext per actual SDL_gpu context, or |
| 3627 | * undefined behaviour will result. |
| 3628 | * |
| 3629 | * As MojoShader requires some memory to be allocated, you may provide a |
| 3630 | * custom allocator to this function, which will be used to allocate/free |
| 3631 | * memory. They function just like malloc() and free(). We do not use |
| 3632 | * realloc(). If you don't care, pass NULL in for the allocator functions. |
| 3633 | * If your allocator needs instance-specific data, you may supply it with the |
| 3634 | * (malloc_d) parameter. This pointer is passed as-is to your (m) and (f) |
| 3635 | * functions. |
| 3636 | * |
| 3637 | * Returns a new context on success, NULL on error. |
| 3638 | */ |
| 3639 | DECLSPECcxx . . $ `<built-in>:410:9`! MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *MOJOSHADER_sdlCreateContextcxx . . $ MOJOSHADER_sdlCreateContext(168170288ee8e2b8).(SDL_GPUDevicecxx . . $ SDL_GPUDevice# *device, |
| 3640 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, |
| 3641 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 3642 | void *malloc_d); |
| 3643 | |
| 3644 | /* |
| 3645 | * Get any error state we might have picked up. |
| 3646 | * |
| 3647 | * Returns a human-readable string. This string is for debugging purposes, and |
| 3648 | * not guaranteed to be localized, coherent, or user-friendly in any way. |
| 3649 | * It's for programmers! |
| 3650 | * |
| 3651 | * The latest error may remain between calls. New errors replace any existing |
| 3652 | * error. Don't check this string for a sign that an error happened, check |
| 3653 | * return codes instead and use this for explanation when debugging. |
| 3654 | * |
| 3655 | * Do not free the returned string: it's a pointer to a static internal |
| 3656 | * buffer. Do not keep the pointer around, either, as it's likely to become |
| 3657 | * invalid as soon as you call into MojoShader again. |
| 3658 | * |
| 3659 | * This call does NOT require a valid MOJOSHADER_sdlContext to have been made |
| 3660 | * current. The error buffer is shared between contexts, so you can get |
| 3661 | * error results from a failed MOJOSHADER_sdlCreateContext(). |
| 3662 | */ |
| 3663 | DECLSPECcxx . . $ `<built-in>:410:9`! const char *MOJOSHADER_sdlGetErrorcxx . . $ MOJOSHADER_sdlGetError(b647c0f4b31416a4).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx); |
| 3664 | |
| 3665 | /* |
| 3666 | * Deinitialize MojoShader's SDL_gpu shader management. |
| 3667 | * |
| 3668 | * You must call this once, while your SDL_GPUDevice is still valid. This should |
| 3669 | * be the last MOJOSHADER_sdl* function you call until you've prepared a context |
| 3670 | * again. |
| 3671 | * |
| 3672 | * This will clean up resources previously allocated, and may call into SDL_gpu. |
| 3673 | * |
| 3674 | * This will not clean up shaders and programs you created! Please call |
| 3675 | * MOJOSHADER_sdlDeleteShader() and MOJOSHADER_sdlDeleteProgram() to clean |
| 3676 | * those up before calling this function! |
| 3677 | * |
| 3678 | * This function destroys the MOJOSHADER_sdlContext you pass it. |
| 3679 | */ |
| 3680 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlDestroyContextcxx . . $ MOJOSHADER_sdlDestroyContext(f2dde33eec62f75a).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx); |
| 3681 | |
| 3682 | /* |
| 3683 | * Compile a buffer of Direct3D shader bytecode into an SDL_gpu shader module. |
| 3684 | * |
| 3685 | * (tokenbuf) is a buffer of Direct3D shader bytecode. |
| 3686 | * (bufsize) is the size, in bytes, of the bytecode buffer. |
| 3687 | * (swiz), (swizcount), (smap), and (smapcount) are passed to |
| 3688 | * MOJOSHADER_parse() unmolested. |
| 3689 | * |
| 3690 | * Returns NULL on error, or a shader handle on success. |
| 3691 | * |
| 3692 | * Compiled shaders from this function may not be shared between contexts. |
| 3693 | */ |
| 3694 | DECLSPECcxx . . $ `<built-in>:410:9`! MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# *MOJOSHADER_sdlCompileShadercxx . . $ MOJOSHADER_sdlCompileShader(a3334ae3317e9728).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx, |
| 3695 | const char *mainfn, |
| 3696 | const unsigned char *tokenbuf, |
| 3697 | const unsigned int bufsize, |
| 3698 | const MOJOSHADER_swizzlecxx . . $ MOJOSHADER_swizzle# *swiz, |
| 3699 | const unsigned int swizcount, |
| 3700 | const MOJOSHADER_samplerMapcxx . . $ MOJOSHADER_samplerMap# *smap, |
| 3701 | const unsigned int smapcount); |
| 3702 | |
| 3703 | /* |
| 3704 | * Increments a shader's internal refcount. |
| 3705 | * |
| 3706 | * To decrement the refcount, call MOJOSHADER_sdlDeleteShader(). |
| 3707 | */ |
| 3708 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlShaderAddRefcxx . . $ MOJOSHADER_sdlShaderAddRef(252d6b3322dda7de).(MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# *shader); |
| 3709 | |
| 3710 | /* |
| 3711 | * Decrements a shader's internal refcount, and deletes if the refcount is zero. |
| 3712 | * |
| 3713 | * To increment the refcount, call MOJOSHADER_sdlShaderAddRef(). |
| 3714 | */ |
| 3715 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlDeleteShadercxx . . $ MOJOSHADER_sdlDeleteShader(db8c1f552e2b0f55).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx, |
| 3716 | MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# *shader); |
| 3717 | |
| 3718 | /* |
| 3719 | * Get the MOJOSHADER_parseData structure that was produced from the |
| 3720 | * call to MOJOSHADER_sdlCompileShader(). |
| 3721 | * |
| 3722 | * This data is read-only, and you should NOT attempt to free it. This |
| 3723 | * pointer remains valid until the shader is deleted. |
| 3724 | */ |
| 3725 | DECLSPECcxx . . $ `<built-in>:410:9`! const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *MOJOSHADER_sdlGetShaderParseDatacxx . . $ MOJOSHADER_sdlGetShaderParseData(55d909e07dfdb6f0).( |
| 3726 | MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# *shader); |
| 3727 | |
| 3728 | /* |
| 3729 | * Link bound vertex and pixel shader into a working SDL_gpu shader program. |
| 3730 | * (vshader) or (pshader) can NOT be NULL, unlike OpenGL. |
| 3731 | * |
| 3732 | * You can reuse shaders in various combinations across |
| 3733 | * multiple programs, by relinking different pairs. |
| 3734 | * |
| 3735 | * Requires vertex element data for patches. |
| 3736 | * |
| 3737 | * It is illegal to give a vertex shader for (pshader) or a pixel shader |
| 3738 | * for (vshader). |
| 3739 | * |
| 3740 | * Once you have successfully linked a program, you may render with it. |
| 3741 | * |
| 3742 | * Returns NULL on error, or a program handle on success. |
| 3743 | */ |
| 3744 | DECLSPECcxx . . $ `<built-in>:410:9`! MOJOSHADER_sdlProgramcxx . . $ MOJOSHADER_sdlProgram# *MOJOSHADER_sdlLinkProgramcxx . . $ MOJOSHADER_sdlLinkProgram(20800f9449282609).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *context, |
| 3745 | MOJOSHADER_vertexAttributecxx . . $ MOJOSHADER_vertexAttribute# *vertexAttributes, |
| 3746 | int vertexAttributeCount); |
| 3747 | |
| 3748 | /* |
| 3749 | * This binds the program to the active context, and does nothing particularly |
| 3750 | * special until you start working with uniform buffers or shader modules. |
| 3751 | * |
| 3752 | * After binding a program, you should update any uniforms you care about |
| 3753 | * with MOJOSHADER_sdlMapUniformBufferMemory() (etc), set any vertex arrays |
| 3754 | * using MOJOSHADER_sdlGetVertexAttribLocation(), and finally call |
| 3755 | * MOJOSHADER_sdlGetShaders() to get the final modules. Then you may |
| 3756 | * begin building your pipeline state objects. |
| 3757 | */ |
| 3758 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlBindProgramcxx . . $ MOJOSHADER_sdlBindProgram(1cb9feeeda4d6d79).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *context, |
| 3759 | MOJOSHADER_sdlProgramcxx . . $ MOJOSHADER_sdlProgram# *program); |
| 3760 | |
| 3761 | /* |
| 3762 | * Free the resources of a linked program. This will delete the shader modules |
| 3763 | * and free memory. |
| 3764 | * |
| 3765 | * If the program is currently bound by MOJOSHADER_sdlBindProgram(), it will |
| 3766 | * be deleted as soon as it becomes unbound. |
| 3767 | */ |
| 3768 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlDeleteProgramcxx . . $ MOJOSHADER_sdlDeleteProgram(1cb9feeeda4d6d79).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *context, |
| 3769 | MOJOSHADER_sdlProgramcxx . . $ MOJOSHADER_sdlProgram# *program); |
| 3770 | |
| 3771 | /* |
| 3772 | * This "binds" individual shaders, which effectively means the context |
| 3773 | * will store these shaders for later retrieval. No actual binding or |
| 3774 | * pipeline creation is performed. |
| 3775 | * |
| 3776 | * This function is only for convenience, specifically for compatibility |
| 3777 | * with the effects API. |
| 3778 | */ |
| 3779 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlBindShaderscxx . . $ MOJOSHADER_sdlBindShaders(858e83fb45dc400d).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx, |
| 3780 | MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# *vshader, |
| 3781 | MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# *pshader); |
| 3782 | |
| 3783 | /* |
| 3784 | * This queries for the shaders currently bound to the active context. |
| 3785 | * |
| 3786 | * This function is only for convenience, specifically for compatibility |
| 3787 | * with the effects API. |
| 3788 | */ |
| 3789 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlGetBoundShaderDatacxx . . $ MOJOSHADER_sdlGetBoundShaderData(99063ef5e076eaba).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx, |
| 3790 | MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# **vshader, |
| 3791 | MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# **pshader); |
| 3792 | |
| 3793 | /* |
| 3794 | * Fills register pointers with pointers that are directly used to push uniform |
| 3795 | * data to the SDL3 shader context. |
| 3796 | * |
| 3797 | * This function is really just for the effects API, you should NOT be using |
| 3798 | * this unless you know every single line of MojoShader from memory. |
| 3799 | */ |
| 3800 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlMapUniformBufferMemorycxx . . $ MOJOSHADER_sdlMapUniformBufferMemory(a76bb1d1c8ae5a7b).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx, |
| 3801 | float **vsf, int **vsi, unsigned char **vsb, |
| 3802 | float **psf, int **psi, unsigned char **psb); |
| 3803 | |
| 3804 | /* |
| 3805 | * Tells the context that you are done with the memory mapped by |
| 3806 | * MOJOSHADER_sdlMapUniformBufferMemory(). |
| 3807 | */ |
| 3808 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlUnmapUniformBufferMemorycxx . . $ MOJOSHADER_sdlUnmapUniformBufferMemory(f2dde33eec62f75a).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx); |
| 3809 | |
| 3810 | /* |
| 3811 | * Returns the minimum required size of the uniform buffer for this shader. |
| 3812 | * You will need this to fill out the SDL_GPUGraphicsPipelineCreateInfo struct. |
| 3813 | */ |
| 3814 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_sdlGetUniformBufferSizecxx . . $ MOJOSHADER_sdlGetUniformBufferSize(7f1df24a3e4a5bbf).(MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# *shader); |
| 3815 | |
| 3816 | /* |
| 3817 | * Pushes the uniform buffer updates for the currently bound program. |
| 3818 | * |
| 3819 | * This function will record calls to SDL_GPUPush*ShaderUniforms into the |
| 3820 | * passed command buffer. |
| 3821 | */ |
| 3822 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlUpdateUniformBufferscxx . . $ MOJOSHADER_sdlUpdateUniformBuffers(3b7473c9c47314f7).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx, |
| 3823 | SDL_GPUCommandBuffercxx . . $ SDL_GPUCommandBuffer# *cb); |
| 3824 | |
| 3825 | /* |
| 3826 | * Return the location of a vertex attribute for the given shader. |
| 3827 | * |
| 3828 | * (usage) and (index) map to Direct3D vertex declaration values: COLOR1 would |
| 3829 | * be MOJOSHADER_USAGE_COLOR and 1. |
| 3830 | * |
| 3831 | * The return value is the index of the attribute to be used to create |
| 3832 | * an SDL_GPUVertexAttribute, or -1 if the stream is not used. |
| 3833 | */ |
| 3834 | DECLSPECcxx . . $ `<built-in>:410:9`! int MOJOSHADER_sdlGetVertexAttribLocationcxx . . $ MOJOSHADER_sdlGetVertexAttribLocation(3f514944b8bdb685).(MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# *vert, |
| 3835 | MOJOSHADER_usagecxx . . $ MOJOSHADER_usage# usage, |
| 3836 | int index); |
| 3837 | |
| 3838 | /* |
| 3839 | * Get the SDL_GPUShaderModules from the currently bound shader program. |
| 3840 | */ |
| 3841 | DECLSPECcxx . . $ `<built-in>:410:9`! void MOJOSHADER_sdlGetShaderscxx . . $ MOJOSHADER_sdlGetShaders(cc82cd4a3f2758a1).(MOJOSHADER_sdlContextcxx . . $ MOJOSHADER_sdlContext# *ctx, |
| 3842 | SDL_GPUShadercxx . . $ SDL_GPUShader# **vshader, |
| 3843 | SDL_GPUShadercxx . . $ SDL_GPUShader# **pshader); |
| 3844 | |
| 3845 | /* |
| 3846 | * Gets the number of sampler slots needed by a given shader module. |
| 3847 | */ |
| 3848 | DECLSPECcxx . . $ `<built-in>:410:9`! unsigned int MOJOSHADER_sdlGetSamplerSlotscxx . . $ MOJOSHADER_sdlGetSamplerSlots(7dd9226b19c7c341).(MOJOSHADER_sdlShaderDatacxx . . $ MOJOSHADER_sdlShaderData# *shader); |
| 3849 | |
| 3850 | |
| 3851 | /* Effects interface... */ |
| 3852 | #include "mojoshader_effects.h"cxx . . $ `<file>/mojoshader_effects.h`/ |
| 3853 | |
| 3854 | |
| 3855 | #ifdef __cplusplus |
| 3856 | } |
| 3857 | #endif |
| 3858 | |
| 3859 | #endif /* include-once blocker. */ |
| 3860 | |
| 3861 | /* end of mojoshader.h ... */ |
| 3862 |