| 1 | #cxx . . $ `<file>/mojoshader_internal.h`/ifndef _INCLUDE_MOJOSHADER_INTERNAL_H_cxx . . $ `mojoshader_internal.h:2:9`! |
| 2 | #define _INCLUDE_MOJOSHADER_INTERNAL_H_cxx . . $ `mojoshader_internal.h:2:9`! |
| 3 | |
| 4 | #ifndef __MOJOSHADER_INTERNAL__cxx . . $ `mojoshader_sdlgpu.c:10:9`! |
| 5 | #error Do not include this header from your applications. |
| 6 | #endif |
| 7 | |
| 8 | // Shader bytecode format is described at MSDN: |
| 9 | // http://msdn.microsoft.com/en-us/library/ff569705.aspx |
| 10 | |
| 11 | #ifdef MOJOSHADER_USE_SDL_STDLIB |
| 12 | #ifdef USE_SDL3 /* Private define, for now */ |
| 13 | #include <SDL3/SDL_assert.h> |
| 14 | #include <SDL3/SDL_endian.h> |
| 15 | #include <SDL3/SDL_stdinc.h> |
| 16 | #include <SDL3/SDL_loadso.h> |
| 17 | #else |
| 18 | #include <SDL_assert.h> |
| 19 | #include <SDL_endian.h> |
| 20 | #include <SDL_stdinc.h> |
| 21 | #include <SDL_loadso.h> |
| 22 | #endif |
| 23 | #include <math.h> /* Needed for isinf/isnan :( */ |
| 24 | |
| 25 | /* FIXME: These includes are needed for alloca :( */ |
| 26 | #include <stdlib.h> |
| 27 | #if defined(__linux__) || defined(__sun) |
| 28 | #include <alloca.h> |
| 29 | #endif |
| 30 | #ifdef _MSC_VER |
| 31 | #include <malloc.h> |
| 32 | #endif |
| 33 | |
| 34 | /* stdint.h */ |
| 35 | typedef Uint8 uint8; |
| 36 | typedef Uint16 uint16; |
| 37 | typedef Uint32 uint32; |
| 38 | typedef Sint32 int32; |
| 39 | typedef Sint64 int64; |
| 40 | typedef Uint64 uint64; |
| 41 | |
| 42 | /* assert.h */ |
| 43 | #define assert SDL_assert |
| 44 | |
| 45 | /* stdlib.h */ |
| 46 | #define malloc SDL_malloc |
| 47 | #define free SDL_free |
| 48 | |
| 49 | /* stdio.h */ |
| 50 | #define sscanf SDL_sscanf |
| 51 | #ifdef snprintf |
| 52 | #undef snprintf |
| 53 | #endif |
| 54 | #define snprintf SDL_snprintf |
| 55 | #ifdef vsnprintf |
| 56 | #undef vsnprintf |
| 57 | #endif |
| 58 | #define vsnprintf SDL_vsnprintf |
| 59 | |
| 60 | /* math.h */ |
| 61 | #define acos SDL_acos |
| 62 | #define asin SDL_asin |
| 63 | #define atan SDL_atan |
| 64 | #define atan2 SDL_atan2 |
| 65 | #define cos SDL_cos |
| 66 | #define exp SDL_exp |
| 67 | #define floor SDL_floor |
| 68 | #define log SDL_log |
| 69 | #define sin SDL_sin |
| 70 | #define sqrt SDL_sqrt |
| 71 | |
| 72 | /* string.h */ |
| 73 | #ifdef memcmp |
| 74 | #undef memcmp |
| 75 | #endif |
| 76 | #define memcmp SDL_memcmp |
| 77 | #ifdef memcpy |
| 78 | #undef memcpy |
| 79 | #endif |
| 80 | #define memcpy SDL_memcpy |
| 81 | #ifdef memset |
| 82 | #undef memset |
| 83 | #endif |
| 84 | #define memset SDL_memset |
| 85 | #ifdef strchr |
| 86 | #undef strchr |
| 87 | #endif |
| 88 | #define strchr SDL_strchr |
| 89 | #ifdef strcmp |
| 90 | #undef strcmp |
| 91 | #endif |
| 92 | #define strcmp SDL_strcmp |
| 93 | #ifdef strlen |
| 94 | #undef strlen |
| 95 | #endif |
| 96 | #define strlen SDL_strlen |
| 97 | #ifdef strncmp |
| 98 | #undef strncmp |
| 99 | #endif |
| 100 | #define strncmp SDL_strncmp |
| 101 | #ifdef strstr |
| 102 | #undef strstr |
| 103 | #endif |
| 104 | #define strstr SDL_strstr |
| 105 | #ifdef strcat |
| 106 | #undef strcat |
| 107 | #endif |
| 108 | /* TODO: Move MojoShader away from strcat! This len is awful! */ |
| 109 | #define strcat(dst, src) SDL_strlcat(dst, src, SDL_strlen(src) + 1) |
| 110 | #ifdef strcpy |
| 111 | #undef strcpy |
| 112 | #endif |
| 113 | /* TODO: Move MojoShader away from strcpy! This len is awful! */ |
| 114 | #define strcpy(dst, src) SDL_strlcpy(dst, src, SDL_strlen(src) + 1) |
| 115 | |
| 116 | /* ctype.h */ |
| 117 | #ifdef isalnum |
| 118 | #undef isalnum |
| 119 | #endif |
| 120 | #define isalnum SDL_isalnum |
| 121 | |
| 122 | /* endian.h */ |
| 123 | #define MOJOSHADER_BIG_ENDIAN (SDL_BYTEORDER == SDL_BIG_ENDIAN) |
| 124 | |
| 125 | /* dlfcn.h */ |
| 126 | #define dlopen(a, b) SDL_LoadObject(a) |
| 127 | #define dlclose SDL_UnloadObject |
| 128 | #define dlsym SDL_LoadFunction |
| 129 | #else /* MOJOSHADER_USE_SDL_STDLIB */ |
| 130 | #include <stdio.h> |
| 131 | #include <string.h> |
| 132 | #include <stdlib.h> |
| 133 | #include <stdarg.h> |
| 134 | #include <assert.h> |
| 135 | |
| 136 | #ifdef __BYTE_ORDER__cxx . . $ `<built-in>:47:9`! |
| 137 | #define MOJOSHADER_BIG_ENDIANcxx . . $ `mojoshader_internal.h:137:9`! (__BYTE_ORDER__cxx . . $ `<built-in>:47:9`! == __ORDER_BIG_ENDIAN__cxx . . $ `<built-in>:45:9`!) |
| 138 | #elif defined(__linux__) |
| 139 | #include <endian.h> |
| 140 | #define MOJOSHADER_BIG_ENDIAN (__BYTE_ORDER == __BIG_ENDIAN) |
| 141 | #else |
| 142 | /* TODO: Detect little endian PowerPC? */ |
| 143 | #if defined(__POWERPC__) || defined(__powerpc__) |
| 144 | #define MOJOSHADER_BIG_ENDIAN 1 |
| 145 | #else |
| 146 | #define MOJOSHADER_BIG_ENDIAN 0 |
| 147 | #endif |
| 148 | #endif |
| 149 | #endif /* MOJOSHADER_USE_SDL_STDLIB */ |
| 150 | |
| 151 | #include "mojoshader.h"cxx . . $ `<file>/mojoshader.h`/ |
| 152 | |
| 153 | #define DEBUG_LEXERcxx . . $ `mojoshader_internal.h:153:9`! 0 |
| 154 | #define DEBUG_PREPROCESSORcxx . . $ `mojoshader_internal.h:154:9`! 0 |
| 155 | #define DEBUG_ASSEMBLER_PARSERcxx . . $ `mojoshader_internal.h:155:9`! 0 |
| 156 | #define DEBUG_COMPILER_PARSERcxx . . $ `mojoshader_internal.h:156:9`! 0 |
| 157 | #define DEBUG_TOKENIZERcxx . . $ `mojoshader_internal.h:157:9`! \ |
| 158 | (DEBUG_PREPROCESSOR || DEBUG_ASSEMBLER_PARSER || DEBUG_LEXER) |
| 159 | |
| 160 | // This is the highest shader version we currently support. |
| 161 | |
| 162 | #define MAX_SHADER_MAJORcxx . . $ `mojoshader_internal.h:162:9`! 3 |
| 163 | #define MAX_SHADER_MINORcxx . . $ `mojoshader_internal.h:163:9`! 255 // vs_3_sw |
| 164 | |
| 165 | |
| 166 | // If SUPPORT_PROFILE_* isn't defined, we assume an implicit desire to support. |
| 167 | // You get all the profiles unless you go out of your way to disable them. |
| 168 | |
| 169 | #ifndef SUPPORT_PROFILE_D3D |
| 170 | #define SUPPORT_PROFILE_D3Dcxx . . $ `mojoshader_internal.h:170:9`! 1 |
| 171 | #endif |
| 172 | |
| 173 | #ifndef SUPPORT_PROFILE_BYTECODE |
| 174 | #define SUPPORT_PROFILE_BYTECODEcxx . . $ `mojoshader_internal.h:174:9`! 1 |
| 175 | #endif |
| 176 | |
| 177 | #ifndef SUPPORT_PROFILE_HLSLcxx . . $ `<built-in>:413:9`! |
| 178 | #define SUPPORT_PROFILE_HLSL 1 |
| 179 | #endif |
| 180 | |
| 181 | #ifndef SUPPORT_PROFILE_GLSL |
| 182 | #define SUPPORT_PROFILE_GLSLcxx . . $ `mojoshader_internal.h:182:9`! 1 |
| 183 | #endif |
| 184 | |
| 185 | #ifndef SUPPORT_PROFILE_GLSL120 |
| 186 | #define SUPPORT_PROFILE_GLSL120cxx . . $ `mojoshader_internal.h:186:9`! 1 |
| 187 | #endif |
| 188 | |
| 189 | #ifndef SUPPORT_PROFILE_GLSLES |
| 190 | #define SUPPORT_PROFILE_GLSLEScxx . . $ `mojoshader_internal.h:190:9`! 1 |
| 191 | #endif |
| 192 | |
| 193 | #ifndef SUPPORT_PROFILE_GLSLES3cxx . . $ `<built-in>:413:9`! |
| 194 | #define SUPPORT_PROFILE_GLSLES3 1 |
| 195 | #endif |
| 196 | |
| 197 | #ifndef SUPPORT_PROFILE_ARB1 |
| 198 | #define SUPPORT_PROFILE_ARB1cxx . . $ `mojoshader_internal.h:198:9`! 1 |
| 199 | #endif |
| 200 | |
| 201 | #ifndef SUPPORT_PROFILE_ARB1_NV |
| 202 | #define SUPPORT_PROFILE_ARB1_NVcxx . . $ `mojoshader_internal.h:202:9`! 1 |
| 203 | #endif |
| 204 | |
| 205 | #ifndef SUPPORT_PROFILE_METALcxx . . $ `<built-in>:414:9`! |
| 206 | #define SUPPORT_PROFILE_METAL 1 |
| 207 | #endif |
| 208 | |
| 209 | #ifndef SUPPORT_PROFILE_SPIRV |
| 210 | #define SUPPORT_PROFILE_SPIRVcxx . . $ `mojoshader_internal.h:210:9`! 1 |
| 211 | #endif |
| 212 | |
| 213 | #ifndef SUPPORT_PROFILE_GLSPIRV |
| 214 | #define SUPPORT_PROFILE_GLSPIRVcxx . . $ `mojoshader_internal.h:214:9`! 1 |
| 215 | #endif |
| 216 | |
| 217 | #if SUPPORT_PROFILE_ARB1_NVcxx . . $ `mojoshader_internal.h:202:9`! && !SUPPORT_PROFILE_ARB1cxx . . $ `mojoshader_internal.h:198:9`! |
| 218 | #error nv profiles require arb1 profile. Fix your build. |
| 219 | #endif |
| 220 | |
| 221 | #if SUPPORT_PROFILE_GLSL120cxx . . $ `mojoshader_internal.h:186:9`! && !SUPPORT_PROFILE_GLSLcxx . . $ `mojoshader_internal.h:182:9`! |
| 222 | #error glsl120 profile requires glsl profile. Fix your build. |
| 223 | #endif |
| 224 | |
| 225 | #if SUPPORT_PROFILE_GLSLEScxx . . $ `mojoshader_internal.h:190:9`! && !SUPPORT_PROFILE_GLSLcxx . . $ `mojoshader_internal.h:182:9`! |
| 226 | #error glsles profile requires glsl profile. Fix your build. |
| 227 | #endif |
| 228 | |
| 229 | #if SUPPORT_PROFILE_GLSLES3cxx . . $ `<built-in>:412:9`! && !SUPPORT_PROFILE_GLSLEScxx . . $ `mojoshader_internal.h:190:9`! |
| 230 | #error glsles3 profile requires glsles profile. Fix your build. |
| 231 | #endif |
| 232 | |
| 233 | |
| 234 | #if SUPPORT_PROFILE_GLSPIRVcxx . . $ `mojoshader_internal.h:214:9`! && !SUPPORT_PROFILE_SPIRVcxx . . $ `mojoshader_internal.h:210:9`! |
| 235 | #error glspirv profile requires spirv profile. Fix your build. |
| 236 | #endif |
| 237 | |
| 238 | // Microsoft's preprocessor has some quirks. In some ways, it doesn't work |
| 239 | // like you'd expect a C preprocessor to function. |
| 240 | #ifndef MATCH_MICROSOFT_PREPROCESSOR |
| 241 | #define MATCH_MICROSOFT_PREPROCESSORcxx . . $ `mojoshader_internal.h:241:9`! 1 |
| 242 | #endif |
| 243 | |
| 244 | // Other stuff you can disable... |
| 245 | |
| 246 | #ifdef MOJOSHADER_EFFECT_SUPPORTcxx . . $ `<built-in>:411:9`! |
| 247 | void MOJOSHADER_runPreshadercxx . . $ MOJOSHADER_runPreshader(7af8684942e19562).(const MOJOSHADER_preshadercxx . . $ MOJOSHADER_preshader#*, float*); |
| 248 | #endif |
| 249 | |
| 250 | |
| 251 | // Get basic wankery out of the way here... |
| 252 | |
| 253 | #ifdef _WINDOWS |
| 254 | #define ENDLINE_STR "\r\n" |
| 255 | #else |
| 256 | #define ENDLINE_STRcxx . . $ `mojoshader_internal.h:256:9`! "\n" |
| 257 | #endif |
| 258 | |
| 259 | typedef unsigned int uintcxx . . $ uint#; // this is a printf() helper. don't use for code. |
| 260 | |
| 261 | // Locale-independent float printing replacement for snprintf |
| 262 | size_t MOJOSHADER_printFloatcxx . . $ MOJOSHADER_printFloat(d760c2ad178ccd37).(char *text, size_t maxlen, float arg); |
| 263 | |
| 264 | #ifdef _MSC_VER |
| 265 | #include <float.h> |
| 266 | #define isnan _isnan // !!! FIXME: not a safe replacement! |
| 267 | #if _MSC_VER < 1900 // pre MSVC 2015 |
| 268 | #define isinf(x) (!_finite(x)) // FIXME: not a safe replacement! |
| 269 | #endif |
| 270 | #define va_copy(a, b) a = b |
| 271 | #endif |
| 272 | |
| 273 | #ifndef MOJOSHADER_USE_SDL_STDLIB |
| 274 | #ifdef _MSC_VER |
| 275 | #include <malloc.h> |
| 276 | #define snprintf _snprintf // !!! FIXME: not a safe replacement! |
| 277 | #define vsnprintf _vsnprintf // !!! FIXME: not a safe replacement! |
| 278 | #define strcasecmp stricmp |
| 279 | #define strncasecmp strnicmp |
| 280 | typedef unsigned __int8 uint8; |
| 281 | typedef unsigned __int16 uint16; |
| 282 | typedef unsigned __int32 uint32; |
| 283 | typedef unsigned __int64 uint64; |
| 284 | typedef __int32 int32; |
| 285 | typedef __int64 int64; |
| 286 | #ifdef _WIN64 |
| 287 | typedef __int64 ssize_t; |
| 288 | #elif defined _WIN32 |
| 289 | typedef __int32 ssize_t; |
| 290 | #else |
| 291 | #error Please define your platform. |
| 292 | #endif |
| 293 | // Warning Level 4 considered harmful. :) |
| 294 | #pragma warning(disable: 4100) // "unreferenced formal parameter" |
| 295 | #pragma warning(disable: 4389) // "signed/unsigned mismatch" |
| 296 | #else |
| 297 | #include <stdint.h> |
| 298 | typedef uint8_tcxx . . $ uint8_t# uint8cxx . . $ uint8#; |
| 299 | typedef uint16_tcxx . . $ uint16_t# uint16cxx . . $ uint16#; |
| 300 | typedef uint32_tcxx . . $ uint32_t# uint32cxx . . $ uint32#; |
| 301 | typedef int32_tcxx . . $ int32_t# int32cxx . . $ int32#; |
| 302 | typedef int64_tcxx . . $ int64_t# int64cxx . . $ int64#; |
| 303 | typedef uint64_tcxx . . $ uint64_t# uint64cxx . . $ uint64#; |
| 304 | #endif |
| 305 | #endif /* MOJOSHADER_USE_SDL_STDLIB */ |
| 306 | |
| 307 | #ifdef __GNUC__cxx . . $ `<built-in>:8:9`! |
| 308 | #define ISPRINTFcxx . . $ `mojoshader_internal.h:308:9`!(x,y) __attribute__((format (printf, x, y))) |
| 309 | #else |
| 310 | #define ISPRINTF(x,y) |
| 311 | #endif |
| 312 | |
| 313 | #define STATICARRAYLENcxx . . $ `mojoshader_internal.h:313:9`!(x) ( (sizeof ((x))) / (sizeof ((x)[0])) ) |
| 314 | |
| 315 | |
| 316 | // Byteswap magic... |
| 317 | |
| 318 | #if (defined(__GNUC__cxx . . $ `<built-in>:8:9`!) && MOJOSHADER_BIG_ENDIANcxx . . $ `mojoshader_internal.h:137:9`! && (defined(__POWERPC__) || defined(__powerpc__))) |
| 319 | static inline uint32 SWAP32(uint32 x) |
| 320 | { |
| 321 | __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (x) : "r" (&x)); |
| 322 | return x; |
| 323 | } // SWAP32 |
| 324 | static inline uint16 SWAP16(uint16 x) |
| 325 | { |
| 326 | __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (x) : "r" (&x)); |
| 327 | return x; |
| 328 | } // SWAP16 |
| 329 | #elif MOJOSHADER_BIG_ENDIANcxx . . $ `mojoshader_internal.h:137:9`! |
| 330 | static inline uint32 SWAP32(uint32 x) |
| 331 | { |
| 332 | return ( (((x) >> 24) & 0x000000FF) | (((x) >> 8) & 0x0000FF00) | |
| 333 | (((x) << 8) & 0x00FF0000) | (((x) << 24) & 0xFF000000) ); |
| 334 | } // SWAP32 |
| 335 | static inline uint16 SWAP16(uint16 x) |
| 336 | { |
| 337 | return ( (((x) >> 8) & 0x00FF) | (((x) << 8) & 0xFF00) ); |
| 338 | } // SWAP16 |
| 339 | #else |
| 340 | # define SWAP16cxx . . $ `mojoshader_internal.h:340:12`!(x) (x) |
| 341 | # define SWAP32cxx . . $ `mojoshader_internal.h:341:12`!(x) (x) |
| 342 | #endif |
| 343 | |
| 344 | #define SWAPDBLcxx . . $ `mojoshader_internal.h:344:9`!(x) (x) // !!! FIXME |
| 345 | |
| 346 | static inline int Mincxx . . $ Min(9b79fb6aee4c0440).(const int a, const int b) |
| 347 | { |
| 348 | return ((a < b) ? a : b); |
| 349 | } // Min |
| 350 | |
| 351 | |
| 352 | // Hashtables... |
| 353 | |
| 354 | typedef struct HashTablecxx . . $ HashTable# HashTablecxx . . $ HashTable#; |
| 355 | typedef uint32cxx . . $ uint32# (*HashTable_HashFncxx . . $ HashTable_HashFn#)(const void *key, void *data); |
| 356 | typedef int (*HashTable_KeyMatchFncxx . . $ HashTable_KeyMatchFn#)(const void *a, const void *b, void *data); |
| 357 | typedef void (*HashTable_NukeFncxx . . $ HashTable_NukeFn#)(const void *ctx, const void *key, const void *value, void *data); |
| 358 | |
| 359 | HashTablecxx . . $ HashTable# *hash_createcxx . . $ hash_create(8335872bcb6e2f75).(void *data, const HashTable_HashFncxx . . $ HashTable_HashFn# hashfn, |
| 360 | const HashTable_KeyMatchFncxx . . $ HashTable_KeyMatchFn# keymatchfn, |
| 361 | const HashTable_NukeFncxx . . $ HashTable_NukeFn# nukefn, |
| 362 | const int stackable, |
| 363 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, void *d); |
| 364 | void hash_destroycxx . . $ hash_destroy(801354b631669f34).(HashTablecxx . . $ HashTable# *table, const void *ctx); |
| 365 | int hash_insertcxx . . $ hash_insert(1d30a91d107a3de).(HashTablecxx . . $ HashTable# *table, const void *key, const void *value); |
| 366 | int hash_removecxx . . $ hash_remove(1d30a91d107a3de).(HashTablecxx . . $ HashTable# *table, const void *key, const void *ctx); |
| 367 | int hash_findcxx . . $ hash_find(7ef6c75da24368fe).(const HashTablecxx . . $ HashTable# *table, const void *key, const void **_value); |
| 368 | int hash_itercxx . . $ hash_iter(7424f801a1aef07a).(const HashTablecxx . . $ HashTable# *table, const void *key, const void **_value, void **iter); |
| 369 | int hash_iter_keyscxx . . $ hash_iter_keys(c68c721387e4f0a2).(const HashTablecxx . . $ HashTable# *table, const void **_key, void **iter); |
| 370 | |
| 371 | uint32cxx . . $ uint32# hash_hash_stringcxx . . $ hash_hash_string(3be275e70c14adf4).(const void *sym, void *unused); |
| 372 | int hash_keymatch_stringcxx . . $ hash_keymatch_string(b8f62d2ccbc12f7d).(const void *a, const void *b, void *unused); |
| 373 | |
| 374 | |
| 375 | // String -> String map ... |
| 376 | typedef HashTablecxx . . $ HashTable# StringMapcxx . . $ StringMap#; |
| 377 | StringMapcxx . . $ StringMap# *stringmap_createcxx . . $ stringmap_create(b90973fc0f11569c).(const int copy, MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, |
| 378 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, void *d); |
| 379 | void stringmap_destroycxx . . $ stringmap_destroy(84d7d441182d6029).(StringMapcxx . . $ StringMap# *smap); |
| 380 | int stringmap_insertcxx . . $ stringmap_insert(3a82e30735b2152a).(StringMapcxx . . $ StringMap# *smap, const char *key, const char *value); |
| 381 | int stringmap_removecxx . . $ stringmap_remove(c54b7143281a1e38).(StringMapcxx . . $ StringMap# *smap, const char *key); |
| 382 | int stringmap_findcxx . . $ stringmap_find(798cea8404476ec7).(const StringMapcxx . . $ StringMap# *smap, const char *key, const char **_val); |
| 383 | |
| 384 | |
| 385 | // String caching... |
| 386 | |
| 387 | typedef struct StringCachecxx . . $ StringCache# StringCachecxx . . $ StringCache#; |
| 388 | StringCachecxx . . $ StringCache# *stringcache_createcxx . . $ stringcache_create(b4617f7a2c1625cb).(MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m,MOJOSHADER_freecxx . . $ MOJOSHADER_free# f,void *d); |
| 389 | const char *stringcachecxx . . $ stringcache(9a0b32e58267707a).(StringCachecxx . . $ StringCache# *cache, const char *str); |
| 390 | const char *stringcache_lencxx . . $ stringcache_len(a48eb3d5dcd20ad4).(StringCachecxx . . $ StringCache# *cache, const char *str, |
| 391 | const unsigned int len); |
| 392 | const char *stringcache_fmtcxx . . $ stringcache_fmt(ddf619c92e98f8e4).(StringCachecxx . . $ StringCache# *cache, const char *fmt, ...); |
| 393 | int stringcache_iscachedcxx . . $ stringcache_iscached(4e54f2a32da2e893).(StringCachecxx . . $ StringCache# *cache, const char *str); |
| 394 | void stringcache_destroycxx . . $ stringcache_destroy(a32b2fea73ec6fd5).(StringCachecxx . . $ StringCache# *cache); |
| 395 | |
| 396 | |
| 397 | // Error lists... |
| 398 | |
| 399 | typedef struct ErrorListcxx . . $ ErrorList# ErrorListcxx . . $ ErrorList#; |
| 400 | ErrorListcxx . . $ ErrorList# *errorlist_createcxx . . $ errorlist_create(509ec232261ad79b).(MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, void *d); |
| 401 | int errorlist_addcxx . . $ errorlist_add(347f4457d4600809).(ErrorListcxx . . $ ErrorList# *list, const char *fname, |
| 402 | const int errpos, const char *str); |
| 403 | int errorlist_add_fmtcxx . . $ errorlist_add_fmt(e7685dbd98c501da).(ErrorListcxx . . $ ErrorList# *list, const char *fname, |
| 404 | const int errpos, const char *fmt, ...) ISPRINTFcxx . . $ `mojoshader_internal.h:308:9`!(4,5); |
| 405 | int errorlist_add_vacxx . . $ errorlist_add_va(97218a3e36e3d3b0).(ErrorListcxx . . $ ErrorList# *list, const char *_fname, |
| 406 | const int errpos, const char *fmt, va_listcxx . . $ va_list# va); |
| 407 | int errorlist_countcxx . . $ errorlist_count(11e96bbabc88ab8f).(ErrorListcxx . . $ ErrorList# *list); |
| 408 | MOJOSHADER_errorcxx . . $ MOJOSHADER_error# *errorlist_flattencxx . . $ errorlist_flatten(33ed08000618f0ec).(ErrorListcxx . . $ ErrorList# *list); // resets the list! |
| 409 | void errorlist_destroycxx . . $ errorlist_destroy(a656397e2b0a5308).(ErrorListcxx . . $ ErrorList# *list); |
| 410 | |
| 411 | |
| 412 | |
| 413 | // Dynamic buffers... |
| 414 | |
| 415 | typedef struct BufferBlockcxx . . $ BufferBlock# |
| 416 | { |
| 417 | uint8cxx . . $ uint8# *datacxx . . $ BufferBlock#data.; |
| 418 | size_t bytescxx . . $ BufferBlock#bytes.; |
| 419 | struct BufferBlockcxx . . $ BufferBlock# *nextcxx . . $ BufferBlock#next.; |
| 420 | } BufferBlockcxx . . $ BufferBlock#; |
| 421 | typedef struct Buffercxx . . $ Buffer# |
| 422 | { |
| 423 | size_t total_bytescxx . . $ Buffer#total_bytes.; |
| 424 | BufferBlockcxx . . $ BufferBlock# *headcxx . . $ Buffer#head.; |
| 425 | BufferBlockcxx . . $ BufferBlock# *tailcxx . . $ Buffer#tail.; |
| 426 | size_t block_sizecxx . . $ Buffer#block_size.; |
| 427 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# mcxx . . $ Buffer#m.; |
| 428 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# fcxx . . $ Buffer#f.; |
| 429 | void *dcxx . . $ Buffer#d.; |
| 430 | } Buffercxx . . $ Buffer#; |
| 431 | Buffercxx . . $ Buffer# *buffer_createcxx . . $ buffer_create(76a014b9fd4a8dd).(size_t blksz,MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m,MOJOSHADER_freecxx . . $ MOJOSHADER_free# f,void *d); |
| 432 | char *buffer_reservecxx . . $ buffer_reserve(52966bd6b1ee8fbe).(Buffercxx . . $ Buffer# *buffer, const size_t len); |
| 433 | int buffer_appendcxx . . $ buffer_append(e4e8268775a9929a).(Buffercxx . . $ Buffer# *buffer, const void *_data, size_t len); |
| 434 | int buffer_append_fmtcxx . . $ buffer_append_fmt(32cad238001a2625).(Buffercxx . . $ Buffer# *buffer, const char *fmt, ...) ISPRINTFcxx . . $ `mojoshader_internal.h:308:9`!(2,3); |
| 435 | int buffer_append_vacxx . . $ buffer_append_va(70652df479affa1f).(Buffercxx . . $ Buffer# *buffer, const char *fmt, va_listcxx . . $ va_list# va); |
| 436 | size_t buffer_sizecxx . . $ buffer_size(ecc380cc53efe3bc).(Buffercxx . . $ Buffer# *buffer); |
| 437 | void buffer_emptycxx . . $ buffer_empty(bc6579b1763bded2).(Buffercxx . . $ Buffer# *buffer); |
| 438 | char *buffer_flattencxx . . $ buffer_flatten(4b7117bbdee3d5c9).(Buffercxx . . $ Buffer# *buffer); |
| 439 | char *buffer_mergecxx . . $ buffer_merge(ec59a92c7b10b67c).(Buffercxx . . $ Buffer# **buffers, const size_t n, size_t *_len); |
| 440 | void buffer_destroycxx . . $ buffer_destroy(bc6579b1763bded2).(Buffercxx . . $ Buffer# *buffer); |
| 441 | void buffer_patchcxx . . $ buffer_patch(b50c5e09500c0639).(Buffercxx . . $ Buffer# *buffer, const size_t start, |
| 442 | const void *data, const size_t len); |
| 443 | |
| 444 | |
| 445 | |
| 446 | // This is the ID for a D3DXSHADER_CONSTANTTABLE in the bytecode comments. |
| 447 | #define CTAB_IDcxx . . $ `mojoshader_internal.h:447:9`! 0x42415443 // 0x42415443 == 'CTAB' |
| 448 | #define CTAB_SIZEcxx . . $ `mojoshader_internal.h:448:9`! 28 // sizeof (D3DXSHADER_CONSTANTTABLE). |
| 449 | #define CINFO_SIZEcxx . . $ `mojoshader_internal.h:449:9`! 20 // sizeof (D3DXSHADER_CONSTANTINFO). |
| 450 | #define CTYPEINFO_SIZEcxx . . $ `mojoshader_internal.h:450:9`! 16 // sizeof (D3DXSHADER_TYPEINFO). |
| 451 | #define CMEMBERINFO_SIZEcxx . . $ `mojoshader_internal.h:451:9`! 8 // sizeof (D3DXSHADER_STRUCTMEMBERINFO) |
| 452 | |
| 453 | // Preshader magic values... |
| 454 | #define PRES_IDcxx . . $ `mojoshader_internal.h:454:9`! 0x53455250 // 0x53455250 == 'PRES' |
| 455 | #define PRSI_IDcxx . . $ `mojoshader_internal.h:455:9`! 0x49535250 // 0x49535250 == 'PRSI' |
| 456 | #define CLIT_IDcxx . . $ `mojoshader_internal.h:456:9`! 0x54494C43 // 0x54494C43 == 'CLIT' |
| 457 | #define FXLC_IDcxx . . $ `mojoshader_internal.h:457:9`! 0x434C5846 // 0x434C5846 == 'FXLC' |
| 458 | |
| 459 | // we need to reference these by explicit value occasionally... |
| 460 | #define OPCODE_RCPcxx . . $ `mojoshader_internal.h:460:9`! 6 |
| 461 | #define OPCODE_RSQcxx . . $ `mojoshader_internal.h:461:9`! 7 |
| 462 | #define OPCODE_RETcxx . . $ `mojoshader_internal.h:462:9`! 28 |
| 463 | #define OPCODE_IFcxx . . $ `mojoshader_internal.h:463:9`! 40 |
| 464 | #define OPCODE_IFCcxx . . $ `mojoshader_internal.h:464:9`! 41 |
| 465 | #define OPCODE_BREAKcxx . . $ `mojoshader_internal.h:465:9`! 44 |
| 466 | #define OPCODE_BREAKCcxx . . $ `mojoshader_internal.h:466:9`! 45 |
| 467 | #define OPCODE_TEXLDcxx . . $ `mojoshader_internal.h:467:9`! 66 |
| 468 | #define OPCODE_SETPcxx . . $ `mojoshader_internal.h:468:9`! 94 |
| 469 | |
| 470 | // TEXLD becomes a different instruction with these instruction controls. |
| 471 | #define CONTROL_TEXLDcxx . . $ `mojoshader_internal.h:471:9`! 0 |
| 472 | #define CONTROL_TEXLDPcxx . . $ `mojoshader_internal.h:472:9`! 1 |
| 473 | #define CONTROL_TEXLDBcxx . . $ `mojoshader_internal.h:473:9`! 2 |
| 474 | |
| 475 | // #define this to force app to supply an allocator, so there's no reference |
| 476 | // to the C runtime's malloc() and free()... |
| 477 | #if MOJOSHADER_FORCE_ALLOCATOR |
| 478 | #define MOJOSHADER_internal_malloc NULL |
| 479 | #define MOJOSHADER_internal_free NULL |
| 480 | #else |
| 481 | void * MOJOSHADERCALLcxx . . $ `mojoshader.h:42:9`! MOJOSHADER_internal_malloccxx . . $ MOJOSHADER_internal_malloc(d0e8a54466770ee5).(int bytes, void *d); |
| 482 | void MOJOSHADERCALLcxx . . $ `mojoshader.h:42:9`! MOJOSHADER_internal_freecxx . . $ MOJOSHADER_internal_free(6c58c5e2437d25a2).(void *ptr, void *d); |
| 483 | #endif |
| 484 | |
| 485 | #if MOJOSHADER_FORCE_INCLUDE_CALLBACKS |
| 486 | #define MOJOSHADER_internal_include_open NULL |
| 487 | #define MOJOSHADER_internal_include_close NULL |
| 488 | #else |
| 489 | int MOJOSHADER_internal_include_opencxx . . $ MOJOSHADER_internal_include_open(9cde37b2e1024d73).(MOJOSHADER_includeTypecxx . . $ MOJOSHADER_includeType# inctype, |
| 490 | const char *fname, const char *parent, |
| 491 | const char **outdata, |
| 492 | unsigned int *outbytes, |
| 493 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, |
| 494 | void *d); |
| 495 | |
| 496 | void MOJOSHADER_internal_include_closecxx . . $ MOJOSHADER_internal_include_close(55a28120764a5ba3).(const char *data, MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, |
| 497 | MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, void *d); |
| 498 | #endif |
| 499 | |
| 500 | |
| 501 | // result modifiers. |
| 502 | // !!! FIXME: why isn't this an enum? |
| 503 | #define MOD_SATURATEcxx . . $ `mojoshader_internal.h:503:9`! 0x01 |
| 504 | #define MOD_PPcxx . . $ `mojoshader_internal.h:504:9`! 0x02 |
| 505 | #define MOD_CENTROIDcxx . . $ `mojoshader_internal.h:505:9`! 0x04 |
| 506 | |
| 507 | typedef enumcxx . . $ $anonymous_type_32753e8ce5863620_0# |
| 508 | { |
| 509 | REG_TYPE_TEMPcxx . . $ REG_TYPE_TEMP. = 0, |
| 510 | REG_TYPE_INPUTcxx . . $ REG_TYPE_INPUT. = 1, |
| 511 | REG_TYPE_CONSTcxx . . $ REG_TYPE_CONST. = 2, |
| 512 | REG_TYPE_ADDRESScxx . . $ REG_TYPE_ADDRESS. = 3, |
| 513 | REG_TYPE_TEXTUREcxx . . $ REG_TYPE_TEXTURE. = 3, // ALSO 3! |
| 514 | REG_TYPE_RASTOUTcxx . . $ REG_TYPE_RASTOUT. = 4, |
| 515 | REG_TYPE_ATTROUTcxx . . $ REG_TYPE_ATTROUT. = 5, |
| 516 | REG_TYPE_TEXCRDOUTcxx . . $ REG_TYPE_TEXCRDOUT. = 6, |
| 517 | REG_TYPE_OUTPUTcxx . . $ REG_TYPE_OUTPUT. = 6, // ALSO 6! |
| 518 | REG_TYPE_CONSTINTcxx . . $ REG_TYPE_CONSTINT. = 7, |
| 519 | REG_TYPE_COLOROUTcxx . . $ REG_TYPE_COLOROUT. = 8, |
| 520 | REG_TYPE_DEPTHOUTcxx . . $ REG_TYPE_DEPTHOUT. = 9, |
| 521 | REG_TYPE_SAMPLERcxx . . $ REG_TYPE_SAMPLER. = 10, |
| 522 | REG_TYPE_CONST2cxx . . $ REG_TYPE_CONST2. = 11, |
| 523 | REG_TYPE_CONST3cxx . . $ REG_TYPE_CONST3. = 12, |
| 524 | REG_TYPE_CONST4cxx . . $ REG_TYPE_CONST4. = 13, |
| 525 | REG_TYPE_CONSTBOOLcxx . . $ REG_TYPE_CONSTBOOL. = 14, |
| 526 | REG_TYPE_LOOPcxx . . $ REG_TYPE_LOOP. = 15, |
| 527 | REG_TYPE_TEMPFLOAT16cxx . . $ REG_TYPE_TEMPFLOAT16. = 16, |
| 528 | REG_TYPE_MISCTYPEcxx . . $ REG_TYPE_MISCTYPE. = 17, |
| 529 | REG_TYPE_LABELcxx . . $ REG_TYPE_LABEL. = 18, |
| 530 | REG_TYPE_PREDICATEcxx . . $ REG_TYPE_PREDICATE. = 19, |
| 531 | REG_TYPE_MAXcxx . . $ REG_TYPE_MAX. = 19 |
| 532 | } RegisterTypecxx . . $ RegisterType#; |
| 533 | |
| 534 | typedef enumcxx . . $ $anonymous_type_32753e8ce5863620_1# |
| 535 | { |
| 536 | TEXTURE_TYPE_2Dcxx . . $ TEXTURE_TYPE_2D. = 2, |
| 537 | TEXTURE_TYPE_CUBEcxx . . $ TEXTURE_TYPE_CUBE. = 3, |
| 538 | TEXTURE_TYPE_VOLUMEcxx . . $ TEXTURE_TYPE_VOLUME. = 4, |
| 539 | } TextureTypecxx . . $ TextureType#; |
| 540 | |
| 541 | typedef enumcxx . . $ $anonymous_type_32753e8ce5863620_2# |
| 542 | { |
| 543 | RASTOUT_TYPE_POSITIONcxx . . $ RASTOUT_TYPE_POSITION. = 0, |
| 544 | RASTOUT_TYPE_FOGcxx . . $ RASTOUT_TYPE_FOG. = 1, |
| 545 | RASTOUT_TYPE_POINT_SIZEcxx . . $ RASTOUT_TYPE_POINT_SIZE. = 2, |
| 546 | RASTOUT_TYPE_MAXcxx . . $ RASTOUT_TYPE_MAX. = 2 |
| 547 | } RastOutTypecxx . . $ RastOutType#; |
| 548 | |
| 549 | typedef enumcxx . . $ $anonymous_type_32753e8ce5863620_3# |
| 550 | { |
| 551 | MISCTYPE_TYPE_POSITIONcxx . . $ MISCTYPE_TYPE_POSITION. = 0, |
| 552 | MISCTYPE_TYPE_FACEcxx . . $ MISCTYPE_TYPE_FACE. = 1, |
| 553 | MISCTYPE_TYPE_MAXcxx . . $ MISCTYPE_TYPE_MAX. = 1 |
| 554 | } MiscTypeTypecxx . . $ MiscTypeType#; |
| 555 | |
| 556 | // source modifiers. |
| 557 | typedef enumcxx . . $ $anonymous_type_32753e8ce5863620_4# |
| 558 | { |
| 559 | SRCMOD_NONEcxx . . $ SRCMOD_NONE., |
| 560 | SRCMOD_NEGATEcxx . . $ SRCMOD_NEGATE., |
| 561 | SRCMOD_BIAScxx . . $ SRCMOD_BIAS., |
| 562 | SRCMOD_BIASNEGATEcxx . . $ SRCMOD_BIASNEGATE., |
| 563 | SRCMOD_SIGNcxx . . $ SRCMOD_SIGN., |
| 564 | SRCMOD_SIGNNEGATEcxx . . $ SRCMOD_SIGNNEGATE., |
| 565 | SRCMOD_COMPLEMENTcxx . . $ SRCMOD_COMPLEMENT., |
| 566 | SRCMOD_X2cxx . . $ SRCMOD_X2., |
| 567 | SRCMOD_X2NEGATEcxx . . $ SRCMOD_X2NEGATE., |
| 568 | SRCMOD_DZcxx . . $ SRCMOD_DZ., |
| 569 | SRCMOD_DWcxx . . $ SRCMOD_DW., |
| 570 | SRCMOD_ABScxx . . $ SRCMOD_ABS., |
| 571 | SRCMOD_ABSNEGATEcxx . . $ SRCMOD_ABSNEGATE., |
| 572 | SRCMOD_NOTcxx . . $ SRCMOD_NOT., |
| 573 | SRCMOD_TOTALcxx . . $ SRCMOD_TOTAL. |
| 574 | } SourceModcxx . . $ SourceMod#; |
| 575 | |
| 576 | |
| 577 | typedef structcxx . . $ $anonymous_type_32753e8ce5863620_5# |
| 578 | { |
| 579 | const uint32cxx . . $ uint32# *tokencxx . . $ $anonymous_type_32753e8ce5863620_5#token.; // this is the unmolested token in the stream. |
| 580 | int regnumcxx . . $ $anonymous_type_32753e8ce5863620_5#regnum.; |
| 581 | int relativecxx . . $ $anonymous_type_32753e8ce5863620_5#relative.; |
| 582 | int writemaskcxx . . $ $anonymous_type_32753e8ce5863620_5#writemask.; // xyzw or rgba (all four, not split out). |
| 583 | int writemask0cxx . . $ $anonymous_type_32753e8ce5863620_5#writemask0.; // x or red |
| 584 | int writemask1cxx . . $ $anonymous_type_32753e8ce5863620_5#writemask1.; // y or green |
| 585 | int writemask2cxx . . $ $anonymous_type_32753e8ce5863620_5#writemask2.; // z or blue |
| 586 | int writemask3cxx . . $ $anonymous_type_32753e8ce5863620_5#writemask3.; // w or alpha |
| 587 | int orig_writemaskcxx . . $ $anonymous_type_32753e8ce5863620_5#orig_writemask.; // writemask before mojoshader tweaks it. |
| 588 | int result_modcxx . . $ $anonymous_type_32753e8ce5863620_5#result_mod.; |
| 589 | int result_shiftcxx . . $ $anonymous_type_32753e8ce5863620_5#result_shift.; |
| 590 | RegisterTypecxx . . $ RegisterType# regtypecxx . . $ $anonymous_type_32753e8ce5863620_5#regtype.; |
| 591 | } DestArgInfocxx . . $ DestArgInfo#; |
| 592 | |
| 593 | // NOTE: This will NOT know a dcl_psize or dcl_fog output register should be |
| 594 | // scalar! This function doesn't have access to that information. |
| 595 | static inline int scalar_registercxx . . $ scalar_register(cf871eb7ac624acc).(const MOJOSHADER_shaderTypecxx . . $ MOJOSHADER_shaderType# shader_type, |
| 596 | const RegisterTypecxx . . $ RegisterType# regtype, const int regnum) |
| 597 | { |
| 598 | switch (regtype) |
| 599 | { |
| 600 | case REG_TYPE_RASTOUTcxx . . $ REG_TYPE_RASTOUT.: |
| 601 | if (((const RastOutTypecxx . . $ RastOutType#) regnum) == RASTOUT_TYPE_FOGcxx . . $ RASTOUT_TYPE_FOG.) |
| 602 | return 1; |
| 603 | else if (((const RastOutTypecxx . . $ RastOutType#) regnum) == RASTOUT_TYPE_POINT_SIZEcxx . . $ RASTOUT_TYPE_POINT_SIZE.) |
| 604 | return 1; |
| 605 | return 0; |
| 606 | |
| 607 | case REG_TYPE_DEPTHOUTcxx . . $ REG_TYPE_DEPTHOUT.: |
| 608 | case REG_TYPE_CONSTBOOLcxx . . $ REG_TYPE_CONSTBOOL.: |
| 609 | case REG_TYPE_LOOPcxx . . $ REG_TYPE_LOOP.: |
| 610 | return 1; |
| 611 | |
| 612 | case REG_TYPE_MISCTYPEcxx . . $ REG_TYPE_MISCTYPE.: |
| 613 | if ( ((const MiscTypeTypecxx . . $ MiscTypeType#) regnum) == MISCTYPE_TYPE_FACEcxx . . $ MISCTYPE_TYPE_FACE. ) |
| 614 | return 1; |
| 615 | return 0; |
| 616 | |
| 617 | case REG_TYPE_PREDICATEcxx . . $ REG_TYPE_PREDICATE.: |
| 618 | return (shader_type == MOJOSHADER_TYPE_PIXELcxx . . $ MOJOSHADER_TYPE_PIXEL.) ? 1 : 0; |
| 619 | |
| 620 | default: break; |
| 621 | } // switch |
| 622 | |
| 623 | return 0; |
| 624 | } // scalar_register |
| 625 | |
| 626 | |
| 627 | extern MOJOSHADER_errorcxx . . $ MOJOSHADER_error# MOJOSHADER_out_of_mem_errorcxx . . $ MOJOSHADER_out_of_mem_error.; |
| 628 | extern MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# MOJOSHADER_out_of_mem_datacxx . . $ MOJOSHADER_out_of_mem_data.; |
| 629 | |
| 630 | |
| 631 | // preprocessor stuff. |
| 632 | |
| 633 | typedef enumcxx . . $ $anonymous_type_32753e8ce5863620_6# |
| 634 | { |
| 635 | TOKEN_UNKNOWNcxx . . $ TOKEN_UNKNOWN. = 256, // start past ASCII character values. |
| 636 | |
| 637 | // These are all C-like constructs. Tokens < 256 may be single |
| 638 | // chars (like '+' or whatever). These are just multi-char sequences |
| 639 | // (like "+=" or whatever). |
| 640 | TOKEN_IDENTIFIERcxx . . $ TOKEN_IDENTIFIER., |
| 641 | TOKEN_INT_LITERALcxx . . $ TOKEN_INT_LITERAL., |
| 642 | TOKEN_FLOAT_LITERALcxx . . $ TOKEN_FLOAT_LITERAL., |
| 643 | TOKEN_STRING_LITERALcxx . . $ TOKEN_STRING_LITERAL., |
| 644 | TOKEN_RSHIFTASSIGNcxx . . $ TOKEN_RSHIFTASSIGN., |
| 645 | TOKEN_LSHIFTASSIGNcxx . . $ TOKEN_LSHIFTASSIGN., |
| 646 | TOKEN_ADDASSIGNcxx . . $ TOKEN_ADDASSIGN., |
| 647 | TOKEN_SUBASSIGNcxx . . $ TOKEN_SUBASSIGN., |
| 648 | TOKEN_MULTASSIGNcxx . . $ TOKEN_MULTASSIGN., |
| 649 | TOKEN_DIVASSIGNcxx . . $ TOKEN_DIVASSIGN., |
| 650 | TOKEN_MODASSIGNcxx . . $ TOKEN_MODASSIGN., |
| 651 | TOKEN_XORASSIGNcxx . . $ TOKEN_XORASSIGN., |
| 652 | TOKEN_ANDASSIGNcxx . . $ TOKEN_ANDASSIGN., |
| 653 | TOKEN_ORASSIGNcxx . . $ TOKEN_ORASSIGN., |
| 654 | TOKEN_INCREMENTcxx . . $ TOKEN_INCREMENT., |
| 655 | TOKEN_DECREMENTcxx . . $ TOKEN_DECREMENT., |
| 656 | TOKEN_RSHIFTcxx . . $ TOKEN_RSHIFT., |
| 657 | TOKEN_LSHIFTcxx . . $ TOKEN_LSHIFT., |
| 658 | TOKEN_ANDANDcxx . . $ TOKEN_ANDAND., |
| 659 | TOKEN_ORORcxx . . $ TOKEN_OROR., |
| 660 | TOKEN_LEQcxx . . $ TOKEN_LEQ., |
| 661 | TOKEN_GEQcxx . . $ TOKEN_GEQ., |
| 662 | TOKEN_EQLcxx . . $ TOKEN_EQL., |
| 663 | TOKEN_NEQcxx . . $ TOKEN_NEQ., |
| 664 | TOKEN_HASHcxx . . $ TOKEN_HASH., |
| 665 | TOKEN_HASHHASHcxx . . $ TOKEN_HASHHASH., |
| 666 | |
| 667 | // This is returned if the preprocessor isn't stripping comments. Note |
| 668 | // that in asm files, the ';' counts as a single-line comment, same as |
| 669 | // "//". Note that both eat newline tokens: all of the ones inside a |
| 670 | // multiline comment, and the ending newline on a single-line comment. |
| 671 | TOKEN_MULTI_COMMENTcxx . . $ TOKEN_MULTI_COMMENT., |
| 672 | TOKEN_SINGLE_COMMENTcxx . . $ TOKEN_SINGLE_COMMENT., |
| 673 | |
| 674 | // This is returned at the end of input...no more to process. |
| 675 | TOKEN_EOIcxx . . $ TOKEN_EOI., |
| 676 | |
| 677 | // This is returned for char sequences we think are bogus. You'll have |
| 678 | // to judge for yourself. In most cases, you'll probably just fail with |
| 679 | // bogus syntax without explicitly checking for this token. |
| 680 | TOKEN_BAD_CHARScxx . . $ TOKEN_BAD_CHARS., |
| 681 | |
| 682 | // This is returned if there's an error condition (the error is returned |
| 683 | // as a NULL-terminated string from preprocessor_nexttoken(), instead |
| 684 | // of actual token data). You can continue getting tokens after this |
| 685 | // is reported. It happens for things like missing #includes, etc. |
| 686 | TOKEN_PREPROCESSING_ERRORcxx . . $ TOKEN_PREPROCESSING_ERROR., |
| 687 | |
| 688 | // These are all caught by the preprocessor. Caller won't ever see them, |
| 689 | // except TOKEN_PP_PRAGMA. |
| 690 | // They control the preprocessor (#includes new files, etc). |
| 691 | TOKEN_PP_INCLUDEcxx . . $ TOKEN_PP_INCLUDE., |
| 692 | TOKEN_PP_LINEcxx . . $ TOKEN_PP_LINE., |
| 693 | TOKEN_PP_DEFINEcxx . . $ TOKEN_PP_DEFINE., |
| 694 | TOKEN_PP_UNDEFcxx . . $ TOKEN_PP_UNDEF., |
| 695 | TOKEN_PP_IFcxx . . $ TOKEN_PP_IF., |
| 696 | TOKEN_PP_IFDEFcxx . . $ TOKEN_PP_IFDEF., |
| 697 | TOKEN_PP_IFNDEFcxx . . $ TOKEN_PP_IFNDEF., |
| 698 | TOKEN_PP_ELSEcxx . . $ TOKEN_PP_ELSE., |
| 699 | TOKEN_PP_ELIFcxx . . $ TOKEN_PP_ELIF., |
| 700 | TOKEN_PP_ENDIFcxx . . $ TOKEN_PP_ENDIF., |
| 701 | TOKEN_PP_ERRORcxx . . $ TOKEN_PP_ERROR., // caught, becomes TOKEN_PREPROCESSING_ERROR |
| 702 | TOKEN_PP_PRAGMAcxx . . $ TOKEN_PP_PRAGMA., |
| 703 | TOKEN_INCOMPLETE_COMMENTcxx . . $ TOKEN_INCOMPLETE_COMMENT., // caught, becomes TOKEN_PREPROCESSING_ERROR |
| 704 | TOKEN_PP_UNARY_MINUScxx . . $ TOKEN_PP_UNARY_MINUS., // used internally, never returned. |
| 705 | TOKEN_PP_UNARY_PLUScxx . . $ TOKEN_PP_UNARY_PLUS., // used internally, never returned. |
| 706 | } Tokencxx . . $ Token#; |
| 707 | |
| 708 | |
| 709 | // This is opaque. |
| 710 | struct Preprocessorcxx . . $ Preprocessor#; |
| 711 | typedef struct Preprocessorcxx . . $ Preprocessor# Preprocessorcxx . . $ Preprocessor#; |
| 712 | |
| 713 | typedef struct Conditionalcxx . . $ Conditional# |
| 714 | { |
| 715 | Tokencxx . . $ Token# typecxx . . $ Conditional#type.; |
| 716 | int linenumcxx . . $ Conditional#linenum.; |
| 717 | int skippingcxx . . $ Conditional#skipping.; |
| 718 | int chosencxx . . $ Conditional#chosen.; |
| 719 | struct Conditionalcxx . . $ Conditional# *nextcxx . . $ Conditional#next.; |
| 720 | } Conditionalcxx . . $ Conditional#; |
| 721 | |
| 722 | typedef struct Definecxx . . $ Define# |
| 723 | { |
| 724 | const char *identifiercxx . . $ Define#identifier.; |
| 725 | const char *definitioncxx . . $ Define#definition.; |
| 726 | const char *originalcxx . . $ Define#original.; |
| 727 | const char **parameterscxx . . $ Define#parameters.; |
| 728 | int paramcountcxx . . $ Define#paramcount.; |
| 729 | struct Definecxx . . $ Define# *nextcxx . . $ Define#next.; |
| 730 | } Definecxx . . $ Define#; |
| 731 | |
| 732 | typedef struct IncludeStatecxx . . $ IncludeState# |
| 733 | { |
| 734 | const char *filenamecxx . . $ IncludeState#filename.; |
| 735 | const char *source_basecxx . . $ IncludeState#source_base.; |
| 736 | const char *sourcecxx . . $ IncludeState#source.; |
| 737 | const char *tokencxx . . $ IncludeState#token.; |
| 738 | unsigned int tokenlencxx . . $ IncludeState#tokenlen.; |
| 739 | Tokencxx . . $ Token# tokenvalcxx . . $ IncludeState#tokenval.; |
| 740 | int pushedbackcxx . . $ IncludeState#pushedback.; |
| 741 | const unsigned char *lexer_markercxx . . $ IncludeState#lexer_marker.; |
| 742 | int report_whitespacecxx . . $ IncludeState#report_whitespace.; |
| 743 | int report_commentscxx . . $ IncludeState#report_comments.; |
| 744 | int asm_commentscxx . . $ IncludeState#asm_comments.; |
| 745 | unsigned int orig_lengthcxx . . $ IncludeState#orig_length.; |
| 746 | unsigned int bytes_leftcxx . . $ IncludeState#bytes_left.; |
| 747 | unsigned int linecxx . . $ IncludeState#line.; |
| 748 | Conditionalcxx . . $ Conditional# *conditional_stackcxx . . $ IncludeState#conditional_stack.; |
| 749 | MOJOSHADER_includeClosecxx . . $ MOJOSHADER_includeClose# close_callbackcxx . . $ IncludeState#close_callback.; |
| 750 | struct IncludeStatecxx . . $ IncludeState# *nextcxx . . $ IncludeState#next.; |
| 751 | } IncludeStatecxx . . $ IncludeState#; |
| 752 | |
| 753 | Tokencxx . . $ Token# preprocessor_lexercxx . . $ preprocessor_lexer(8ba9ccf957ce270e).(IncludeStatecxx . . $ IncludeState# *s); |
| 754 | |
| 755 | // This will only fail if the allocator fails, so it doesn't return any |
| 756 | // error code...NULL on failure. |
| 757 | Preprocessorcxx . . $ Preprocessor# *preprocessor_startcxx . . $ preprocessor_start(fe09b360a3765e51).(const char *fname, const char *source, |
| 758 | unsigned int sourcelen, |
| 759 | MOJOSHADER_includeOpencxx . . $ MOJOSHADER_includeOpen# open_callback, |
| 760 | MOJOSHADER_includeClosecxx . . $ MOJOSHADER_includeClose# close_callback, |
| 761 | const MOJOSHADER_preprocessorDefinecxx . . $ MOJOSHADER_preprocessorDefine# *defines, |
| 762 | unsigned int define_count, int asm_comments, |
| 763 | MOJOSHADER_malloccxx . . $ MOJOSHADER_malloc# m, MOJOSHADER_freecxx . . $ MOJOSHADER_free# f, void *d); |
| 764 | |
| 765 | void preprocessor_endcxx . . $ preprocessor_end(6ea2c074d6a2e4a5).(Preprocessorcxx . . $ Preprocessor# *pp); |
| 766 | int preprocessor_outofmemorycxx . . $ preprocessor_outofmemory(89412f1ea05b9d49).(Preprocessorcxx . . $ Preprocessor# *pp); |
| 767 | const char *preprocessor_nexttokencxx . . $ preprocessor_nexttoken(54702bdd7e600a37).(Preprocessorcxx . . $ Preprocessor# *_ctx, |
| 768 | unsigned int *_len, Tokencxx . . $ Token# *_token); |
| 769 | const char *preprocessor_sourceposcxx . . $ preprocessor_sourcepos(bfac73c25c55600f).(Preprocessorcxx . . $ Preprocessor# *pp, unsigned int *pos); |
| 770 | |
| 771 | |
| 772 | void MOJOSHADER_print_debug_tokencxx . . $ MOJOSHADER_print_debug_token(167137f298c266d4).(const char *subsystem, const char *token, |
| 773 | const unsigned int tokenlen, |
| 774 | const Tokencxx . . $ Token# tokenval); |
| 775 | |
| 776 | |
| 777 | #if SUPPORT_PROFILE_SPIRVcxx . . $ `mojoshader_internal.h:210:9`! |
| 778 | // Patching SPIR-V binaries before linking is needed to ensure locations do not |
| 779 | // overlap between shader stages. Unfortunately, OpDecorate takes Literal, so we |
| 780 | // can't use Result <id> from OpSpecConstant and leave this up to specialization |
| 781 | // mechanism. |
| 782 | // Patch table must be propagated from parsing to program linking, but since |
| 783 | // MOJOSHADER_parseData is public and I'd like to avoid changing ABI and exposing |
| 784 | // this, it is appended to MOJOSHADER_parseData::output using postflight buffer. |
| 785 | typedef struct SpirvPatchEntrycxx . . $ SpirvPatchEntry# |
| 786 | { |
| 787 | uint32cxx . . $ uint32# offsetcxx . . $ SpirvPatchEntry#offset.; |
| 788 | int32cxx . . $ int32# locationcxx . . $ SpirvPatchEntry#location.; |
| 789 | } SpirvPatchEntrycxx . . $ SpirvPatchEntry#; |
| 790 | |
| 791 | typedef struct SpirvPatchTablecxx . . $ SpirvPatchTable# |
| 792 | { |
| 793 | // Patches for uniforms |
| 794 | SpirvPatchEntrycxx . . $ SpirvPatchEntry# vpflipcxx . . $ SpirvPatchTable#vpflip.; |
| 795 | SpirvPatchEntrycxx . . $ SpirvPatchEntry# array_vec4cxx . . $ SpirvPatchTable#array_vec4.; |
| 796 | SpirvPatchEntrycxx . . $ SpirvPatchEntry# array_ivec4cxx . . $ SpirvPatchTable#array_ivec4.; |
| 797 | SpirvPatchEntrycxx . . $ SpirvPatchEntry# array_boolcxx . . $ SpirvPatchTable#array_bool.; |
| 798 | SpirvPatchEntrycxx . . $ SpirvPatchEntry# samplerscxx . . $ SpirvPatchTable#samplers.[16]; |
| 799 | int32cxx . . $ int32# location_countcxx . . $ SpirvPatchTable#location_count.; |
| 800 | |
| 801 | // TEXCOORD0 is patched to PointCoord if VS outputs PointSize. |
| 802 | // In `helpers`: [OpDecorate|id|Location|0xDEADBEEF] -> [OpDecorate|id|BuiltIn|PointCoord] |
| 803 | // Offset derived from attrib_offsets[TEXCOORD][0]. |
| 804 | uint32cxx . . $ uint32# pointcoord_var_offsetcxx . . $ SpirvPatchTable#pointcoord_var_offset.; // in `mainline_intro`, [OpVariable|tid|id|StorageClass], patch tid to pvec2i |
| 805 | uint32cxx . . $ uint32# pointcoord_load_offsetcxx . . $ SpirvPatchTable#pointcoord_load_offset.; // in `mainline_top`, [OpLoad|tid|id|src_id], patch tid to vec2 |
| 806 | uint32cxx . . $ uint32# tid_pvec2icxx . . $ SpirvPatchTable#tid_pvec2i.; |
| 807 | uint32cxx . . $ uint32# tid_vec2cxx . . $ SpirvPatchTable#tid_vec2.; |
| 808 | uint32cxx . . $ uint32# tid_pvec4icxx . . $ SpirvPatchTable#tid_pvec4i.; |
| 809 | |
| 810 | /// Patches for TEXCOORD0 and vertex attribute types |
| 811 | uint32cxx . . $ uint32# tid_vec4cxx . . $ SpirvPatchTable#tid_vec4.; |
| 812 | uint32cxx . . $ uint32# tid_ivec4cxx . . $ SpirvPatchTable#tid_ivec4.; |
| 813 | uint32cxx . . $ uint32# tid_uvec4cxx . . $ SpirvPatchTable#tid_uvec4.; |
| 814 | |
| 815 | // Patches for vertex attribute types |
| 816 | uint32cxx . . $ uint32# tid_vec4_pcxx . . $ SpirvPatchTable#tid_vec4_p.; |
| 817 | uint32cxx . . $ uint32# tid_ivec4_pcxx . . $ SpirvPatchTable#tid_ivec4_p.; |
| 818 | uint32cxx . . $ uint32# tid_uvec4_pcxx . . $ SpirvPatchTable#tid_uvec4_p.; |
| 819 | uint32cxx . . $ uint32# attrib_type_offsetscxx . . $ SpirvPatchTable#attrib_type_offsets.[MOJOSHADER_USAGE_TOTALcxx . . $ MOJOSHADER_USAGE_TOTAL.][16]; |
| 820 | structcxx . . $ SpirvPatchTable#$anonymous_type_7# |
| 821 | { |
| 822 | uint32cxx . . $ uint32# num_loadscxx . . $ SpirvPatchTable#$anonymous_type_7#num_loads.; |
| 823 | uint32cxx . . $ uint32# *load_typescxx . . $ SpirvPatchTable#$anonymous_type_7#load_types.; |
| 824 | uint32cxx . . $ uint32# *load_opcodescxx . . $ SpirvPatchTable#$anonymous_type_7#load_opcodes.; |
| 825 | } attrib_type_load_offsetscxx . . $ SpirvPatchTable#attrib_type_load_offsets.[MOJOSHADER_USAGE_TOTALcxx . . $ MOJOSHADER_USAGE_TOTAL.][16]; |
| 826 | |
| 827 | // Patches for linking vertex output/pixel input |
| 828 | uint32cxx . . $ uint32# attrib_offsetscxx . . $ SpirvPatchTable#attrib_offsets.[MOJOSHADER_USAGE_TOTALcxx . . $ MOJOSHADER_USAGE_TOTAL.][16]; |
| 829 | uint32cxx . . $ uint32# output_offsetscxx . . $ SpirvPatchTable#output_offsets.[16]; |
| 830 | } SpirvPatchTablecxx . . $ SpirvPatchTable#; |
| 831 | |
| 832 | void MOJOSHADER_spirv_link_attributescxx . . $ MOJOSHADER_spirv_link_attributes(8985aed79211bd0).(const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *vertex, |
| 833 | const MOJOSHADER_parseDatacxx . . $ MOJOSHADER_parseData# *pixel, |
| 834 | int is_glspirv); |
| 835 | #endif |
| 836 | |
| 837 | #endif // _INCLUDE_MOJOSHADER_INTERNAL_H_ |
| 838 | |
| 839 | |
| 840 | #if MOJOSHADER_DO_INSTRUCTION_TABLEcxx . . $ `mojoshader.c:2034:13`! |
| 841 | // These have to be in the right order! Arrays are indexed by the value |
| 842 | // of the instruction token. |
| 843 | |
| 844 | // INSTRUCTION_STATE means this opcode has to update the state machine |
| 845 | // (we're entering an ELSE block, etc). INSTRUCTION means there's no |
| 846 | // state, just go straight to the emitters. |
| 847 | |
| 848 | // !!! FIXME: Some of these MOJOSHADER_TYPE_ANYs need to have their scope |
| 849 | // !!! FIXME: reduced to just PIXEL or VERTEX. |
| 850 | |
| 851 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(NOP, "NOP", 1, NULL, MOJOSHADER_TYPE_ANY, 0xF) |
| 852 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(MOV, "MOV", 1, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 853 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(ADD, "ADD", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 854 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(SUB, "SUB", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 855 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(MAD, "MAD", 1, DSSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 856 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(MUL, "MUL", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 857 | INSTRUCTION_STATEcxx . . $ state_RCP(612dd59919e2530e).(RCP, "RCP", 1, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 858 | INSTRUCTION_STATEcxx . . $ state_RSQ(612dd59919e2530e).(RSQ, "RSQ", 1, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 859 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(DP3, "DP3", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 860 | INSTRUCTION_STATEcxx . . $ parse_args_DSS(c6cdb7a367dd06c9).(DP4, "DP4", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 861 | INSTRUCTIONcxx . . $ parse_args_DSS(c6cdb7a367dd06c9).(MIN, "MIN", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 862 | INSTRUCTIONcxx . . $ parse_args_DSS(c6cdb7a367dd06c9).(MAX, "MAX", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 863 | INSTRUCTIONcxx . . $ parse_args_DSS(c6cdb7a367dd06c9).(SLT, "SLT", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 864 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(SGE, "SGE", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 865 | INSTRUCTIONcxx . . $ parse_args_DS(c6cdb7a367dd06c9).(EXP, "EXP", 1, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 866 | INSTRUCTION_STATEcxx . . $ parse_args_DS(c6cdb7a367dd06c9).(LOG, "LOG", 1, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 867 | INSTRUCTIONcxx . . $ parse_args_DS(c6cdb7a367dd06c9).(LIT, "LIT", 3, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 868 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(DST, "DST", 1, DSS, MOJOSHADER_TYPE_VERTEX, 0xF) |
| 869 | INSTRUCTIONcxx . . $ parse_args_DSSS(c6cdb7a367dd06c9).(LRP, "LRP", 2, DSSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 870 | INSTRUCTION_STATEcxx . . $ state_FRC(612dd59919e2530e).(FRC, "FRC", 1, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 871 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(M4X4, "M4X4", 4, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 872 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(M4X3, "M4X3", 3, DSS, MOJOSHADER_TYPE_ANY, 0x7) |
| 873 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(M3X4, "M3X4", 4, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 874 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(M3X3, "M3X3", 3, DSS, MOJOSHADER_TYPE_ANY, 0x7) |
| 875 | INSTRUCTION_STATEcxx . . $ parse_args_DSS(c6cdb7a367dd06c9).(M3X2, "M3X2", 2, DSS, MOJOSHADER_TYPE_ANY, 0x3) |
| 876 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(CALL, "CALL", 2, S, MOJOSHADER_TYPE_ANY, 0xF) |
| 877 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(CALLNZ, "CALLNZ", 3, SS, MOJOSHADER_TYPE_ANY, 0xF) |
| 878 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(LOOP, "LOOP", 3, SS, MOJOSHADER_TYPE_ANY, 0xF) |
| 879 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(RET, "RET", 1, NULL, MOJOSHADER_TYPE_ANY, 0xF) |
| 880 | INSTRUCTION_STATEcxx . . $ state_ENDLOOP(612dd59919e2530e).(ENDLOOP, "ENDLOOP", 2, NULL, MOJOSHADER_TYPE_ANY, 0xF) |
| 881 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(LABEL, "LABEL", 0, S, MOJOSHADER_TYPE_ANY, 0xF) |
| 882 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(DCL, "DCL", 0, DCL, MOJOSHADER_TYPE_ANY, 0xF) |
| 883 | INSTRUCTION_STATEcxx . . $ state_POW(612dd59919e2530e).(POW, "POW", 3, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 884 | INSTRUCTIONcxx . . $ parse_args_DSS(c6cdb7a367dd06c9).(CRS, "CRS", 2, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 885 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(SGN, "SGN", 3, DSSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 886 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(ABS, "ABS", 1, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 887 | INSTRUCTIONcxx . . $ parse_args_DS(c6cdb7a367dd06c9).(NRM, "NRM", 3, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 888 | INSTRUCTION_STATEcxx . . $ parse_args_SINCOS(c6cdb7a367dd06c9).(SINCOS, "SINCOS", 8, SINCOS, MOJOSHADER_TYPE_ANY, 0xF) |
| 889 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(REP, "REP", 3, S, MOJOSHADER_TYPE_ANY, 0xF) |
| 890 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(ENDREP, "ENDREP", 2, NULL, MOJOSHADER_TYPE_ANY, 0xF) |
| 891 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(IF, "IF", 3, S, MOJOSHADER_TYPE_ANY, 0xF) |
| 892 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(IFC, "IF", 3, SS, MOJOSHADER_TYPE_ANY, 0xF) |
| 893 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(ELSE, "ELSE", 1, NULL, MOJOSHADER_TYPE_ANY, 0xF) // !!! FIXME: state! |
| 894 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(ENDIF, "ENDIF", 1, NULL, MOJOSHADER_TYPE_ANY, 0xF) // !!! FIXME: state! |
| 895 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(BREAK, "BREAK", 1, NULL, MOJOSHADER_TYPE_ANY, 0xF) |
| 896 | INSTRUCTION_STATEcxx . . $ parse_args_SS(c6cdb7a367dd06c9).(BREAKC, "BREAK", 3, SS, MOJOSHADER_TYPE_ANY, 0xF) |
| 897 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_VERTEX.(MOVA, "MOVA", 1, DS, MOJOSHADER_TYPE_VERTEX, 0xF) |
| 898 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(DEFB, "DEFB", 0, DEFB, MOJOSHADER_TYPE_ANY, 0xF) |
| 899 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(DEFI, "DEFI", 0, DEFI, MOJOSHADER_TYPE_ANY, 0xF) |
| 900 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 901 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 902 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 903 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 904 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 905 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 906 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_UNKNOWN.(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 907 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 908 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 909 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 910 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 911 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 912 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 913 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_UNKNOWN.(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 914 | INSTRUCTIONcxx . . $ parse_args_NULL(c6cdb7a367dd06c9).(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 915 | INSTRUCTION_STATEcxx . . $ parse_args_TEXCRD(c6cdb7a367dd06c9).(TEXCRD, "TEXCRD", 1, TEXCRD, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 916 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_PIXEL.(TEXKILL, "TEXKILL", 2, D, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 917 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(TEXLD, "TEXLD", 1, TEXLD, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 918 | INSTRUCTION_STATEcxx . . $ state_TEXBEM(612dd59919e2530e).(TEXBEM, "TEXBEM", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 919 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_PIXEL.(TEXBEML, "TEXBEML", 2, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 920 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_PIXEL.(TEXREG2AR, "TEXREG2AR", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 921 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_PIXEL.(TEXREG2GB, "TEXREG2GB", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 922 | INSTRUCTION_STATEcxx . . $ state_TEXM3X2PAD(612dd59919e2530e).(TEXM3X2PAD, "TEXM3X2PAD", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 923 | INSTRUCTION_STATEcxx . . $ state_TEXM3X2TEX(612dd59919e2530e).(TEXM3X2TEX, "TEXM3X2TEX", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 924 | INSTRUCTION_STATEcxx . . $ parse_args_DS(c6cdb7a367dd06c9).(TEXM3X3PAD, "TEXM3X3PAD", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 925 | INSTRUCTION_STATEcxx . . $ state_TEXM3X3TEX(612dd59919e2530e).(TEXM3X3TEX, "TEXM3X3TEX", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 926 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN, 0xF) |
| 927 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(TEXM3X3SPEC, "TEXM3X3SPEC", 1, DSS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 928 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_PIXEL.(TEXM3X3VSPEC, "TEXM3X3VSPEC", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 929 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_ANY.(EXPP, "EXPP", 1, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 930 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(LOGP, "LOGP", 1, DS, MOJOSHADER_TYPE_ANY, 0xF) |
| 931 | INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`!(CND, "CND", 1, DSSS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 932 | INSTRUCTION_STATEcxx . . $ parse_args_DEF(c6cdb7a367dd06c9).(DEF, "DEF", 0, DEF, MOJOSHADER_TYPE_ANY, 0xF) |
| 933 | INSTRUCTIONcxx . . $ parse_args_DS(c6cdb7a367dd06c9).(TEXREG2RGB, "TEXREG2RGB", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 934 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(TEXDP3TEX, "TEXDP3TEX", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 935 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(TEXM3X2DEPTH, "TEXM3X2DEPTH", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 936 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_PIXEL.(TEXDP3, "TEXDP3", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 937 | INSTRUCTION_STATEcxx . . $ state_TEXM3X3(612dd59919e2530e).(TEXM3X3, "TEXM3X3", 1, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 938 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(TEXDEPTH, "TEXDEPTH", 1, D, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 939 | INSTRUCTION_STATEcxx . . $ state_CMP(612dd59919e2530e).(CMP, "CMP", 1, DSSS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 940 | INSTRUCTIONcxx . . $ MOJOSHADER_TYPE_PIXEL.(BEM, "BEM", 2, DSS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 941 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_PIXEL.(DP2ADD, "DP2ADD", 2, DSSS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 942 | INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`!(DSX, "DSX", 2, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 943 | INSTRUCTIONcxx . . $ parse_args_DS(c6cdb7a367dd06c9).(DSY, "DSY", 2, DS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 944 | INSTRUCTIONcxx . . $ parse_args_DSSSS(c6cdb7a367dd06c9).(TEXLDD, "TEXLDD", 3, DSSSS, MOJOSHADER_TYPE_PIXEL, 0xF) |
| 945 | INSTRUCTION_STATEcxx . . $ MOJOSHADER_TYPE_ANY.(SETP, "SETP", 1, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 946 | INSTRUCTION_STATEcxx . . $ parse_args_DSS(c6cdb7a367dd06c9).(TEXLDL, "TEXLDL", 2, DSS, MOJOSHADER_TYPE_ANY, 0xF) |
| 947 | INSTRUCTION_STATEcxx . . $ parse_args_S(c6cdb7a367dd06c9).(BREAKP, "BREAKP", 3, S, MOJOSHADER_TYPE_ANY, 0xF) |
| 948 | |
| 949 | #undef MOJOSHADER_DO_INSTRUCTION_TABLEcxx . . $ `mojoshader.c:2034:13`! |
| 950 | #undef INSTRUCTIONcxx . . $ `mojoshader.c:2030:13`! |
| 951 | #undef INSTRUCTION_STATEcxx . . $ `mojoshader.c:2026:13`! |
| 952 | |
| 953 | #endif |
| 954 | |
| 955 | // end of mojoshader_internal.h ... |
| 956 |