author | Aras Pranckevicius <aras@unity3d.com> |
Tue, 29 Dec 2009 17:29:32 +0200 | |
changeset 800 | cbd232606562 |
parent 756 | 9e06e970a730 |
child 808 | b7196cc07283 |
permissions | -rw-r--r-- |
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
1 |
#ifndef _INCLUDE_MOJOSHADER_INTERNAL_H_ |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
2 |
#define _INCLUDE_MOJOSHADER_INTERNAL_H_ |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
3 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
4 |
#ifndef __MOJOSHADER_INTERNAL__ |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
5 |
#error Do not include this header from your applications. |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
6 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
7 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
8 |
// Shader bytecode format is described at MSDN: |
589
1cf3fc2c5e37
Updated some URLs in the comments.
Ryan C. Gordon <icculus@icculus.org>
parents:
587
diff
changeset
|
9 |
// http://msdn.microsoft.com/en-us/library/ms800307.aspx |
1cf3fc2c5e37
Updated some URLs in the comments.
Ryan C. Gordon <icculus@icculus.org>
parents:
587
diff
changeset
|
10 |
|
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
11 |
#include <stdio.h> |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
12 |
#include <string.h> |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
13 |
#include <stdlib.h> |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
14 |
#include <stdarg.h> |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
15 |
#include <assert.h> |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
16 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
17 |
#include "mojoshader.h" |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
18 |
|
630
e6bd53dd1f91
Allow debug output directly from the lexer, before preprocessor eats.
Ryan C. Gordon <icculus@icculus.org>
parents:
625
diff
changeset
|
19 |
#define DEBUG_LEXER 0 |
587
202354e004fc
Unified some cut-and-paste code.
Ryan C. Gordon <icculus@icculus.org>
parents:
584
diff
changeset
|
20 |
#define DEBUG_PREPROCESSOR 0 |
716
94a804b54078
Cleaned up HLSL parser tracing.
Ryan C. Gordon <icculus@icculus.org>
parents:
703
diff
changeset
|
21 |
#define DEBUG_ASSEMBLER_PARSER 0 |
94a804b54078
Cleaned up HLSL parser tracing.
Ryan C. Gordon <icculus@icculus.org>
parents:
703
diff
changeset
|
22 |
#define DEBUG_COMPILER_PARSER 0 |
630
e6bd53dd1f91
Allow debug output directly from the lexer, before preprocessor eats.
Ryan C. Gordon <icculus@icculus.org>
parents:
625
diff
changeset
|
23 |
#define DEBUG_TOKENIZER \ |
716
94a804b54078
Cleaned up HLSL parser tracing.
Ryan C. Gordon <icculus@icculus.org>
parents:
703
diff
changeset
|
24 |
(DEBUG_PREPROCESSOR || DEBUG_ASSEMBLER_PARSER || DEBUG_LEXER) |
587
202354e004fc
Unified some cut-and-paste code.
Ryan C. Gordon <icculus@icculus.org>
parents:
584
diff
changeset
|
25 |
|
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
26 |
#if (defined(__APPLE__) && defined(__MACH__)) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
27 |
#define PLATFORM_MACOSX 1 |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
28 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
29 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
30 |
// This is the highest shader version we currently support. |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
31 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
32 |
#define MAX_SHADER_MAJOR 3 |
493
e2c930ab84b5
Allow SM3 shaders that are vs_3_x or vs_3_sw.
Ryan C. Gordon <icculus@icculus.org>
parents:
491
diff
changeset
|
33 |
#define MAX_SHADER_MINOR 255 // vs_3_sw |
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
34 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
35 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
36 |
// If SUPPORT_PROFILE_* isn't defined, we assume an implicit desire to support. |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
37 |
// You get all the profiles unless you go out of your way to disable them. |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
38 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
39 |
#ifndef SUPPORT_PROFILE_D3D |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
40 |
#define SUPPORT_PROFILE_D3D 1 |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
41 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
42 |
|
800
cbd232606562
fix passthrough/bytecode define
Aras Pranckevicius <aras@unity3d.com>
parents:
756
diff
changeset
|
43 |
#ifndef SUPPORT_PROFILE_BYTECODE |
484
dfce8e965115
s/PASSTHROUGH/BYTECODE that I missed.
Ryan C. Gordon <icculus@icculus.org>
parents:
470
diff
changeset
|
44 |
#define SUPPORT_PROFILE_BYTECODE 1 |
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
45 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
46 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
47 |
#ifndef SUPPORT_PROFILE_GLSL |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
48 |
#define SUPPORT_PROFILE_GLSL 1 |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
49 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
50 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
51 |
#ifndef SUPPORT_PROFILE_ARB1 |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
52 |
#define SUPPORT_PROFILE_ARB1 1 |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
53 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
54 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
55 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
56 |
// Get basic wankery out of the way here... |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
57 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
58 |
#ifdef _WINDOWS |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
59 |
#define ENDLINE_STR "\r\n" |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
60 |
#else |
700
2213a232d2fb
Removed a semicolon from a #define
Ryan C. Gordon <icculus@icculus.org>
parents:
690
diff
changeset
|
61 |
#define ENDLINE_STR "\n" |
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
62 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
63 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
64 |
typedef unsigned int uint; // this is a printf() helper. don't use for code. |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
65 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
66 |
#ifdef _MSC_VER |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
67 |
#include <malloc.h> |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
68 |
#define snprintf _snprintf |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
69 |
#define strcasecmp stricmp |
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
70 |
typedef unsigned __int8 uint8; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
71 |
typedef unsigned __int16 uint16; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
72 |
typedef unsigned __int32 uint32; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
73 |
typedef __int32 int32; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
74 |
// Warning Level 4 considered harmful. :) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
75 |
#pragma warning(disable: 4100) // "unreferenced formal parameter" |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
76 |
#pragma warning(disable: 4389) // "signed/unsigned mismatch" |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
77 |
#else |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
78 |
#include <stdint.h> |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
79 |
typedef uint8_t uint8; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
80 |
typedef uint16_t uint16; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
81 |
typedef uint32_t uint32; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
82 |
typedef int32_t int32; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
83 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
84 |
|
756
9e06e970a730
Need alloca.h on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
755
diff
changeset
|
85 |
#ifdef sun |
9e06e970a730
Need alloca.h on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
755
diff
changeset
|
86 |
#include <alloca.h> |
9e06e970a730
Need alloca.h on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
755
diff
changeset
|
87 |
#endif |
9e06e970a730
Need alloca.h on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
755
diff
changeset
|
88 |
|
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
89 |
#ifdef __GNUC__ |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
90 |
#define ISPRINTF(x,y) __attribute__((format (printf, x, y))) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
91 |
#else |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
92 |
#define ISPRINTF(x,y) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
93 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
94 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
95 |
#define STATICARRAYLEN(x) ( (sizeof ((x))) / (sizeof ((x)[0])) ) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
96 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
97 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
98 |
// Byteswap magic... |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
99 |
|
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
100 |
#if ((defined __GNUC__) && (defined __POWERPC__)) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
101 |
static inline uint32 SWAP32(uint32 x) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
102 |
{ |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
103 |
__asm__ __volatile__("lwbrx %0,0,%1" : "=r" (x) : "r" (&x)); |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
104 |
return x; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
105 |
} // SWAP32 |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
106 |
static inline uint16 SWAP16(uint16 x) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
107 |
{ |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
108 |
__asm__ __volatile__("lhbrx %0,0,%1" : "=r" (x) : "r" (&x)); |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
109 |
return x; |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
110 |
} // SWAP16 |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
111 |
#elif defined(__POWERPC__) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
112 |
static inline uint32 SWAP32(uint32 x) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
113 |
{ |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
114 |
return ( (((x) >> 24) & 0x000000FF) | (((x) >> 8) & 0x0000FF00) | |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
115 |
(((x) << 8) & 0x00FF0000) | (((x) << 24) & 0xFF000000) ); |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
116 |
} // SWAP32 |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
117 |
static inline uint16 SWAP16(uint16 x) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
118 |
{ |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
119 |
return ( (((x) >> 8) & 0x00FF) | (((x) << 8) & 0xFF00) ); |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
120 |
} // SWAP16 |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
121 |
#else |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
122 |
# define SWAP16(x) (x) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
123 |
# define SWAP32(x) (x) |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
124 |
#endif |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
125 |
|
606
63e7a66ac320
Added support for #error directive to the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
603
diff
changeset
|
126 |
static inline int Min(const int a, const int b) |
63e7a66ac320
Added support for #error directive to the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
603
diff
changeset
|
127 |
{ |
63e7a66ac320
Added support for #error directive to the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
603
diff
changeset
|
128 |
return ((a < b) ? a : b); |
63e7a66ac320
Added support for #error directive to the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
603
diff
changeset
|
129 |
} // Min |
63e7a66ac320
Added support for #error directive to the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
603
diff
changeset
|
130 |
|
732
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
131 |
|
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
132 |
// Hashtables... |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
133 |
|
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
134 |
typedef struct HashTable HashTable; |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
135 |
typedef uint32 (*HashTable_HashFn)(const void *key); |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
136 |
typedef int (*HashTable_KeyMatchFn)(const void *a, const void *b); |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
137 |
typedef void (*HashTable_NukeFn)(const void *key, const void *value); |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
138 |
|
733
1b6d68fabe46
Reworked hashtable create/destroy functions.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
139 |
HashTable *hash_create(const uint32 initial_table_size, |
732
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
140 |
const HashTable_HashFn hashfn, |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
141 |
const HashTable_KeyMatchFn keymatchfn, |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
142 |
const HashTable_NukeFn nukefn, |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
143 |
const int stackable, |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
144 |
MOJOSHADER_malloc m, MOJOSHADER_free f, void *d); |
733
1b6d68fabe46
Reworked hashtable create/destroy functions.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
145 |
void hash_destroy(HashTable *table); |
732
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
146 |
int hash_insert(HashTable *table, const void *key, const void *value); |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
147 |
int hash_remove(HashTable *table, const void *key); |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
148 |
int hash_find(const HashTable *table, const void *key, const void **_value); |
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
149 |
|
734
1f69fc50c79c
Added string hash/compare functions.
Ryan C. Gordon <icculus@icculus.org>
parents:
733
diff
changeset
|
150 |
uint32 hash_hash_string(const void *sym); |
1f69fc50c79c
Added string hash/compare functions.
Ryan C. Gordon <icculus@icculus.org>
parents:
733
diff
changeset
|
151 |
int hash_keymatch_string(const void *a, const void *b); |
732
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
716
diff
changeset
|
152 |
|
524
03eea2f0762c
First (incomplete!) shot at more robust CTAB support.
Ryan C. Gordon <icculus@icculus.org>
parents:
523
diff
changeset
|
153 |
// This is the ID for a D3DXSHADER_CONSTANTTABLE in the bytecode comments. |
03eea2f0762c
First (incomplete!) shot at more robust CTAB support.
Ryan C. Gordon <icculus@icculus.org>
parents:
523
diff
changeset
|
154 |
#define CTAB_ID 0x42415443 // 0x42415443 == 'CTAB' |
03eea2f0762c
First (incomplete!) shot at more robust CTAB support.
Ryan C. Gordon <icculus@icculus.org>
parents:
523
diff
changeset
|
155 |
#define CTAB_SIZE 28 // sizeof (D3DXSHADER_CONSTANTTABLE). |
03eea2f0762c
First (incomplete!) shot at more robust CTAB support.
Ryan C. Gordon <icculus@icculus.org>
parents:
523
diff
changeset
|
156 |
#define CINFO_SIZE 20 // sizeof (D3DXSHADER_CONSTANTINFO). |
03eea2f0762c
First (incomplete!) shot at more robust CTAB support.
Ryan C. Gordon <icculus@icculus.org>
parents:
523
diff
changeset
|
157 |
#define CTYPEINFO_SIZE 16 // sizeof (D3DXSHADER_TYPEINFO). |
03eea2f0762c
First (incomplete!) shot at more robust CTAB support.
Ryan C. Gordon <icculus@icculus.org>
parents:
523
diff
changeset
|
158 |
#define CMEMBERINFO_SIZE 8 // sizeof (D3DXSHADER_STRUCTMEMBERINFO) |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
159 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
160 |
// we need to reference these by explicit value occasionally... |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
161 |
#define OPCODE_RET 28 |
562
c9a2bc5129c9
First shot at reworking assembly parser to use preprocessor/lexer.
Ryan C. Gordon <icculus@icculus.org>
parents:
557
diff
changeset
|
162 |
#define OPCODE_IF 40 |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
163 |
#define OPCODE_IFC 41 |
562
c9a2bc5129c9
First shot at reworking assembly parser to use preprocessor/lexer.
Ryan C. Gordon <icculus@icculus.org>
parents:
557
diff
changeset
|
164 |
#define OPCODE_BREAK 44 |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
165 |
#define OPCODE_BREAKC 45 |
562
c9a2bc5129c9
First shot at reworking assembly parser to use preprocessor/lexer.
Ryan C. Gordon <icculus@icculus.org>
parents:
557
diff
changeset
|
166 |
#define OPCODE_TEXLD 66 |
c9a2bc5129c9
First shot at reworking assembly parser to use preprocessor/lexer.
Ryan C. Gordon <icculus@icculus.org>
parents:
557
diff
changeset
|
167 |
#define OPCODE_SETP 94 |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
168 |
|
519
c9b27381c971
Added TEXLDP/TEXLDP support to the assembler, cleaned up constants.
Ryan C. Gordon <icculus@icculus.org>
parents:
493
diff
changeset
|
169 |
// TEXLD becomes a different instruction with these instruction controls. |
c9b27381c971
Added TEXLDP/TEXLDP support to the assembler, cleaned up constants.
Ryan C. Gordon <icculus@icculus.org>
parents:
493
diff
changeset
|
170 |
#define CONTROL_TEXLD 0 |
c9b27381c971
Added TEXLDP/TEXLDP support to the assembler, cleaned up constants.
Ryan C. Gordon <icculus@icculus.org>
parents:
493
diff
changeset
|
171 |
#define CONTROL_TEXLDP 1 |
c9b27381c971
Added TEXLDP/TEXLDP support to the assembler, cleaned up constants.
Ryan C. Gordon <icculus@icculus.org>
parents:
493
diff
changeset
|
172 |
#define CONTROL_TEXLDB 2 |
c9b27381c971
Added TEXLDP/TEXLDP support to the assembler, cleaned up constants.
Ryan C. Gordon <icculus@icculus.org>
parents:
493
diff
changeset
|
173 |
|
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
174 |
// #define this to force app to supply an allocator, so there's no reference |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
175 |
// to the C runtime's malloc() and free()... |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
176 |
#if MOJOSHADER_FORCE_ALLOCATOR |
553
288ed486e5c3
Renamed internal_malloc() and internal_free().
Ryan C. Gordon <icculus@icculus.org>
parents:
551
diff
changeset
|
177 |
#define MOJOSHADER_internal_malloc NULL |
288ed486e5c3
Renamed internal_malloc() and internal_free().
Ryan C. Gordon <icculus@icculus.org>
parents:
551
diff
changeset
|
178 |
#define MOJOSHADER_internal_free NULL |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
179 |
#else |
553
288ed486e5c3
Renamed internal_malloc() and internal_free().
Ryan C. Gordon <icculus@icculus.org>
parents:
551
diff
changeset
|
180 |
void *MOJOSHADER_internal_malloc(int bytes, void *d); |
288ed486e5c3
Renamed internal_malloc() and internal_free().
Ryan C. Gordon <icculus@icculus.org>
parents:
551
diff
changeset
|
181 |
void MOJOSHADER_internal_free(void *ptr, void *d); |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
182 |
#endif |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
183 |
|
611
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
184 |
#if MOJOSHADER_FORCE_INCLUDE_CALLBACKS |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
185 |
#define MOJOSHADER_internal_include_open NULL |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
186 |
#define MOJOSHADER_internal_include_close NULL |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
187 |
#else |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
188 |
int MOJOSHADER_internal_include_open(MOJOSHADER_includeType inctype, |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
189 |
const char *fname, const char *parent, |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
190 |
const char **outdata, |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
191 |
unsigned int *outbytes, |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
192 |
MOJOSHADER_malloc m, MOJOSHADER_free f, |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
193 |
void *d); |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
194 |
|
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
195 |
void MOJOSHADER_internal_include_close(const char *data, MOJOSHADER_malloc m, |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
196 |
MOJOSHADER_free f, void *d); |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
197 |
#endif |
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
198 |
|
8c2ee1a97ee1
Implemented #include in the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
606
diff
changeset
|
199 |
|
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
200 |
// result modifiers. |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
201 |
// !!! FIXME: why isn't this an enum? |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
202 |
#define MOD_SATURATE 0x01 |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
203 |
#define MOD_PP 0x02 |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
204 |
#define MOD_CENTROID 0x04 |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
205 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
206 |
typedef enum |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
207 |
{ |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
208 |
REG_TYPE_TEMP = 0, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
209 |
REG_TYPE_INPUT = 1, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
210 |
REG_TYPE_CONST = 2, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
211 |
REG_TYPE_ADDRESS = 3, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
212 |
REG_TYPE_TEXTURE = 3, // ALSO 3! |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
213 |
REG_TYPE_RASTOUT = 4, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
214 |
REG_TYPE_ATTROUT = 5, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
215 |
REG_TYPE_TEXCRDOUT = 6, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
216 |
REG_TYPE_OUTPUT = 6, // ALSO 6! |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
217 |
REG_TYPE_CONSTINT = 7, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
218 |
REG_TYPE_COLOROUT = 8, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
219 |
REG_TYPE_DEPTHOUT = 9, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
220 |
REG_TYPE_SAMPLER = 10, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
221 |
REG_TYPE_CONST2 = 11, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
222 |
REG_TYPE_CONST3 = 12, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
223 |
REG_TYPE_CONST4 = 13, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
224 |
REG_TYPE_CONSTBOOL = 14, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
225 |
REG_TYPE_LOOP = 15, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
226 |
REG_TYPE_TEMPFLOAT16 = 16, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
227 |
REG_TYPE_MISCTYPE = 17, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
228 |
REG_TYPE_LABEL = 18, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
229 |
REG_TYPE_PREDICATE = 19, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
230 |
REG_TYPE_MAX = 19 |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
231 |
} RegisterType; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
232 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
233 |
typedef enum |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
234 |
{ |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
235 |
TEXTURE_TYPE_2D = 2, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
236 |
TEXTURE_TYPE_CUBE = 3, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
237 |
TEXTURE_TYPE_VOLUME = 4, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
238 |
} TextureType; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
239 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
240 |
typedef enum |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
241 |
{ |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
242 |
RASTOUT_TYPE_POSITION = 0, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
243 |
RASTOUT_TYPE_FOG = 1, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
244 |
RASTOUT_TYPE_POINT_SIZE = 2, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
245 |
RASTOUT_TYPE_MAX = 2 |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
246 |
} RastOutType; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
247 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
248 |
typedef enum |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
249 |
{ |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
250 |
MISCTYPE_TYPE_POSITION = 0, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
251 |
MISCTYPE_TYPE_FACE = 1, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
252 |
MISCTYPE_TYPE_MAX = 1 |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
253 |
} MiscTypeType; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
254 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
255 |
// source modifiers. |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
256 |
typedef enum |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
257 |
{ |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
258 |
SRCMOD_NONE, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
259 |
SRCMOD_NEGATE, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
260 |
SRCMOD_BIAS, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
261 |
SRCMOD_BIASNEGATE, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
262 |
SRCMOD_SIGN, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
263 |
SRCMOD_SIGNNEGATE, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
264 |
SRCMOD_COMPLEMENT, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
265 |
SRCMOD_X2, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
266 |
SRCMOD_X2NEGATE, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
267 |
SRCMOD_DZ, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
268 |
SRCMOD_DW, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
269 |
SRCMOD_ABS, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
270 |
SRCMOD_ABSNEGATE, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
271 |
SRCMOD_NOT, |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
272 |
SRCMOD_TOTAL |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
273 |
} SourceMod; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
274 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
275 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
276 |
typedef struct |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
277 |
{ |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
278 |
const uint32 *token; // this is the unmolested token in the stream. |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
279 |
int regnum; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
280 |
int relative; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
281 |
int writemask; // xyzw or rgba (all four, not split out). |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
282 |
int writemask0; // x or red |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
283 |
int writemask1; // y or green |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
284 |
int writemask2; // z or blue |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
285 |
int writemask3; // w or alpha |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
286 |
int orig_writemask; // writemask before mojoshader tweaks it. |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
287 |
int result_mod; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
288 |
int result_shift; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
289 |
RegisterType regtype; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
290 |
} DestArgInfo; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
291 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
292 |
|
491
bcc3c215807a
Fixed wrong data from scalar_register().
Ryan C. Gordon <icculus@icculus.org>
parents:
484
diff
changeset
|
293 |
static inline int scalar_register(const MOJOSHADER_shaderType shader_type, |
bcc3c215807a
Fixed wrong data from scalar_register().
Ryan C. Gordon <icculus@icculus.org>
parents:
484
diff
changeset
|
294 |
const RegisterType regtype, const int regnum) |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
295 |
{ |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
296 |
switch (regtype) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
297 |
{ |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
298 |
case REG_TYPE_DEPTHOUT: |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
299 |
case REG_TYPE_CONSTBOOL: |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
300 |
case REG_TYPE_LOOP: |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
301 |
return 1; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
302 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
303 |
case REG_TYPE_MISCTYPE: |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
304 |
if ( ((const MiscTypeType) regnum) == MISCTYPE_TYPE_FACE ) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
305 |
return 1; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
306 |
return 0; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
307 |
|
491
bcc3c215807a
Fixed wrong data from scalar_register().
Ryan C. Gordon <icculus@icculus.org>
parents:
484
diff
changeset
|
308 |
case REG_TYPE_PREDICATE: |
bcc3c215807a
Fixed wrong data from scalar_register().
Ryan C. Gordon <icculus@icculus.org>
parents:
484
diff
changeset
|
309 |
return (shader_type == MOJOSHADER_TYPE_PIXEL) ? 1 : 0; |
bcc3c215807a
Fixed wrong data from scalar_register().
Ryan C. Gordon <icculus@icculus.org>
parents:
484
diff
changeset
|
310 |
|
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
311 |
default: break; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
312 |
} // switch |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
313 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
314 |
return 0; |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
315 |
} // scalar_register |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
316 |
|
523
699696afd731
Allow errors to specify post-processing problems.
Ryan C. Gordon <icculus@icculus.org>
parents:
520
diff
changeset
|
317 |
typedef enum |
699696afd731
Allow errors to specify post-processing problems.
Ryan C. Gordon <icculus@icculus.org>
parents:
520
diff
changeset
|
318 |
{ |
699696afd731
Allow errors to specify post-processing problems.
Ryan C. Gordon <icculus@icculus.org>
parents:
520
diff
changeset
|
319 |
MOJOSHADER_PARSEPHASE_NOTSTARTED, |
699696afd731
Allow errors to specify post-processing problems.
Ryan C. Gordon <icculus@icculus.org>
parents:
520
diff
changeset
|
320 |
MOJOSHADER_PARSEPHASE_WORKING, |
699696afd731
Allow errors to specify post-processing problems.
Ryan C. Gordon <icculus@icculus.org>
parents:
520
diff
changeset
|
321 |
MOJOSHADER_PARSEPHASE_DONE, |
699696afd731
Allow errors to specify post-processing problems.
Ryan C. Gordon <icculus@icculus.org>
parents:
520
diff
changeset
|
322 |
} MOJOSHADER_parsePhase; |
699696afd731
Allow errors to specify post-processing problems.
Ryan C. Gordon <icculus@icculus.org>
parents:
520
diff
changeset
|
323 |
|
551
217200672d64
Make sure internal symbols aren't polluting namespace.
Ryan C. Gordon <icculus@icculus.org>
parents:
542
diff
changeset
|
324 |
extern MOJOSHADER_error MOJOSHADER_out_of_mem_error; |
217200672d64
Make sure internal symbols aren't polluting namespace.
Ryan C. Gordon <icculus@icculus.org>
parents:
542
diff
changeset
|
325 |
extern MOJOSHADER_parseData MOJOSHADER_out_of_mem_data; |
542
a56d3bfd2e36
More work on multiple error messages.
Ryan C. Gordon <icculus@icculus.org>
parents:
524
diff
changeset
|
326 |
|
647 | 327 |
// !!! FIXME: unify all the routines in various modules that deal with these. |
542
a56d3bfd2e36
More work on multiple error messages.
Ryan C. Gordon <icculus@icculus.org>
parents:
524
diff
changeset
|
328 |
typedef struct ErrorList |
a56d3bfd2e36
More work on multiple error messages.
Ryan C. Gordon <icculus@icculus.org>
parents:
524
diff
changeset
|
329 |
{ |
a56d3bfd2e36
More work on multiple error messages.
Ryan C. Gordon <icculus@icculus.org>
parents:
524
diff
changeset
|
330 |
MOJOSHADER_error error; |
a56d3bfd2e36
More work on multiple error messages.
Ryan C. Gordon <icculus@icculus.org>
parents:
524
diff
changeset
|
331 |
struct ErrorList *next; |
a56d3bfd2e36
More work on multiple error messages.
Ryan C. Gordon <icculus@icculus.org>
parents:
524
diff
changeset
|
332 |
} ErrorList; |
a56d3bfd2e36
More work on multiple error messages.
Ryan C. Gordon <icculus@icculus.org>
parents:
524
diff
changeset
|
333 |
|
a56d3bfd2e36
More work on multiple error messages.
Ryan C. Gordon <icculus@icculus.org>
parents:
524
diff
changeset
|
334 |
|
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
335 |
// preprocessor stuff. |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
336 |
|
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
337 |
typedef enum |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
338 |
{ |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
339 |
TOKEN_UNKNOWN = 256, // start past ASCII character values. |
601
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
340 |
|
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
341 |
// These are all C-like constructs. Tokens < 256 may be single |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
342 |
// chars (like '+' or whatever). These are just multi-char sequences |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
343 |
// (like "+=" or whatever). |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
344 |
TOKEN_IDENTIFIER, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
345 |
TOKEN_INT_LITERAL, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
346 |
TOKEN_FLOAT_LITERAL, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
347 |
TOKEN_STRING_LITERAL, |
584
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
348 |
TOKEN_RSHIFTASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
349 |
TOKEN_LSHIFTASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
350 |
TOKEN_ADDASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
351 |
TOKEN_SUBASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
352 |
TOKEN_MULTASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
353 |
TOKEN_DIVASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
354 |
TOKEN_MODASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
355 |
TOKEN_XORASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
356 |
TOKEN_ANDASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
357 |
TOKEN_ORASSIGN, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
358 |
TOKEN_INCREMENT, |
9aea8877564d
Updated lexer for HLSL.
Ryan C. Gordon <icculus@icculus.org>
parents:
564
diff
changeset
|
359 |
TOKEN_DECREMENT, |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
360 |
TOKEN_RSHIFT, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
361 |
TOKEN_LSHIFT, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
362 |
TOKEN_ANDAND, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
363 |
TOKEN_OROR, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
364 |
TOKEN_LEQ, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
365 |
TOKEN_GEQ, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
366 |
TOKEN_EQL, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
367 |
TOKEN_NEQ, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
368 |
TOKEN_HASHHASH, |
601
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
369 |
|
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
370 |
// This is returned at the end of input...no more to process. |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
371 |
TOKEN_EOI, |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
372 |
|
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
373 |
// This is returned for char sequences we think are bogus. You'll have |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
374 |
// to judge for yourself. In most cases, you'll probably just fail with |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
375 |
// bogus syntax without explicitly checking for this token. |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
376 |
TOKEN_BAD_CHARS, |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
377 |
|
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
378 |
// This is returned if there's an error condition (the error is returned |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
379 |
// as a NULL-terminated string from preprocessor_nexttoken(), instead |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
380 |
// of actual token data). You can continue getting tokens after this |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
381 |
// is reported. It happens for things like missing #includes, etc. |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
382 |
TOKEN_PREPROCESSING_ERROR, |
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
383 |
|
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
384 |
// These are all caught by the preprocessor. Caller won't ever see them. |
603
c7a964b1b0eb
More minor comment tweaks.
Ryan C. Gordon <icculus@icculus.org>
parents:
601
diff
changeset
|
385 |
// They control the preprocessor (#includes new files, etc). |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
386 |
TOKEN_PP_INCLUDE, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
387 |
TOKEN_PP_LINE, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
388 |
TOKEN_PP_DEFINE, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
389 |
TOKEN_PP_UNDEF, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
390 |
TOKEN_PP_IF, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
391 |
TOKEN_PP_IFDEF, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
392 |
TOKEN_PP_IFNDEF, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
393 |
TOKEN_PP_ELSE, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
394 |
TOKEN_PP_ELIF, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
395 |
TOKEN_PP_ENDIF, |
601
bb1484be4e1b
Reworked and documented preprocessor tokens.
Ryan C. Gordon <icculus@icculus.org>
parents:
598
diff
changeset
|
396 |
TOKEN_PP_ERROR, // caught, becomes TOKEN_PREPROCESSING_ERROR |
603
c7a964b1b0eb
More minor comment tweaks.
Ryan C. Gordon <icculus@icculus.org>
parents:
601
diff
changeset
|
397 |
TOKEN_INCOMPLETE_COMMENT, // caught, becomes TOKEN_PREPROCESSING_ERROR |
682
ad75eb06ddce
First work on #if directive.
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
398 |
TOKEN_PP_UNARY_MINUS, // used internally, never returned. |
ad75eb06ddce
First work on #if directive.
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
399 |
TOKEN_PP_UNARY_PLUS, // used internally, never returned. |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
400 |
} Token; |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
401 |
|
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
402 |
|
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
403 |
// This is opaque. |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
404 |
struct Preprocessor; |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
405 |
typedef struct Preprocessor Preprocessor; |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
406 |
|
620
1c4cf996004e
Initial work on preprocessor conditionals.
Ryan C. Gordon <icculus@icculus.org>
parents:
612
diff
changeset
|
407 |
typedef struct Conditional |
1c4cf996004e
Initial work on preprocessor conditionals.
Ryan C. Gordon <icculus@icculus.org>
parents:
612
diff
changeset
|
408 |
{ |
1c4cf996004e
Initial work on preprocessor conditionals.
Ryan C. Gordon <icculus@icculus.org>
parents:
612
diff
changeset
|
409 |
Token type; |
1c4cf996004e
Initial work on preprocessor conditionals.
Ryan C. Gordon <icculus@icculus.org>
parents:
612
diff
changeset
|
410 |
int linenum; |
1c4cf996004e
Initial work on preprocessor conditionals.
Ryan C. Gordon <icculus@icculus.org>
parents:
612
diff
changeset
|
411 |
int skipping; |
625
bfb4016d9404
Fixed #else preprocessor directive so it'll work with #elif.
Ryan C. Gordon <icculus@icculus.org>
parents:
620
diff
changeset
|
412 |
int chosen; |
620
1c4cf996004e
Initial work on preprocessor conditionals.
Ryan C. Gordon <icculus@icculus.org>
parents:
612
diff
changeset
|
413 |
struct Conditional *next; |
1c4cf996004e
Initial work on preprocessor conditionals.
Ryan C. Gordon <icculus@icculus.org>
parents:
612
diff
changeset
|
414 |
} Conditional; |
1c4cf996004e
Initial work on preprocessor conditionals.
Ryan C. Gordon <icculus@icculus.org>
parents:
612
diff
changeset
|
415 |
|
678
9fa2eb7d7871
Preprocessor now supports macros with parameters.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
416 |
typedef struct Define |
9fa2eb7d7871
Preprocessor now supports macros with parameters.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
417 |
{ |
9fa2eb7d7871
Preprocessor now supports macros with parameters.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
418 |
const char *identifier; |
9fa2eb7d7871
Preprocessor now supports macros with parameters.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
419 |
const char *definition; |
9fa2eb7d7871
Preprocessor now supports macros with parameters.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
420 |
const char **parameters; |
755
6a7aa96c51c7
Reworked preprocessor macro argument parsing.
Ryan C. Gordon <icculus@icculus.org>
parents:
734
diff
changeset
|
421 |
int paramcount; |
678
9fa2eb7d7871
Preprocessor now supports macros with parameters.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
422 |
struct Define *next; |
9fa2eb7d7871
Preprocessor now supports macros with parameters.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
423 |
} Define; |
9fa2eb7d7871
Preprocessor now supports macros with parameters.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
424 |
|
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
425 |
typedef struct IncludeState |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
426 |
{ |
612
72ccfe69eaf1
Moved filename caching into the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
611
diff
changeset
|
427 |
const char *filename; |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
428 |
int included; |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
429 |
const char *source_base; |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
430 |
const char *source; |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
431 |
const char *token; |
648
243e35876142
Have lexer calculate token size now.
Ryan C. Gordon <icculus@icculus.org>
parents:
647
diff
changeset
|
432 |
unsigned int tokenlen; |
651
05ad72d120a5
Lexer now stores token value to IncludeState.
Ryan C. Gordon <icculus@icculus.org>
parents:
649
diff
changeset
|
433 |
Token tokenval; |
652
3333a0774ccc
Added basic pushback facility to the preprocessor.
Ryan C. Gordon <icculus@icculus.org>
parents:
651
diff
changeset
|
434 |
int pushedback; |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
435 |
const unsigned char *lexer_marker; |
635
be3b428802a1
Try to make #error lexing match gcc's.
Ryan C. Gordon <icculus@icculus.org>
parents:
630
diff
changeset
|
436 |
int report_whitespace; |
690
4710df464f13
Moved asm comment processing into the lexer.
Ryan C. Gordon <icculus@icculus.org>
parents:
682
diff
changeset
|
437 |
int asm_comments; |
642
624ab8696f9b
Enormous amount of tapdancing to handle EOI better in the lexer.
Ryan C. Gordon <icculus@icculus.org>
parents:
635
diff
changeset
|
438 |
unsigned int orig_length; |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
439 |
unsigned int bytes_left; |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
440 |
unsigned int line; |
620
1c4cf996004e
Initial work on preprocessor conditionals.
Ryan C. Gordon <icculus@icculus.org>
parents:
612
diff
changeset
|
441 |
Conditional *conditional_stack; |
678
9fa2eb7d7871
Preprocessor now supports macros with parameters.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
442 |
Define *defines; // temp defines for macros with parameters. |
656
ddb1a0b4c443
Let there be different close callbacks per IncludeState.
Ryan C. Gordon <icculus@icculus.org>
parents:
652
diff
changeset
|
443 |
MOJOSHADER_includeClose close_callback; |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
444 |
struct IncludeState *next; |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
445 |
} IncludeState; |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
446 |
|
649
527cfe6f2d45
Renamed preprocessor_internal_lexer to preprocessor_lexer.
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
447 |
Token preprocessor_lexer(IncludeState *s); |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
448 |
|
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
449 |
// This will only fail if the allocator fails, so it doesn't return any |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
450 |
// error code...NULL on failure. |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
451 |
Preprocessor *preprocessor_start(const char *fname, const char *source, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
452 |
unsigned int sourcelen, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
453 |
MOJOSHADER_includeOpen open_callback, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
454 |
MOJOSHADER_includeClose close_callback, |
658
22695d3d6b98
Should be an array of structs, not an array of pointers to structs.
Ryan C. Gordon <icculus@icculus.org>
parents:
656
diff
changeset
|
455 |
const MOJOSHADER_preprocessorDefine *defines, |
690
4710df464f13
Moved asm comment processing into the lexer.
Ryan C. Gordon <icculus@icculus.org>
parents:
682
diff
changeset
|
456 |
unsigned int define_count, int asm_comments, |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
457 |
MOJOSHADER_malloc m, MOJOSHADER_free f, void *d); |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
458 |
|
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
459 |
void preprocessor_end(Preprocessor *pp); |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
460 |
int preprocessor_outofmemory(Preprocessor *pp); |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
461 |
const char *preprocessor_nexttoken(Preprocessor *_ctx, |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
462 |
unsigned int *_len, Token *_token); |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
463 |
const char *preprocessor_sourcepos(Preprocessor *pp, unsigned int *pos); |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
553
diff
changeset
|
464 |
|
470
7d84d3452125
Bunch More Work on the assembler.
Ryan C. Gordon <icculus@icculus.org>
parents:
468
diff
changeset
|
465 |
|
587
202354e004fc
Unified some cut-and-paste code.
Ryan C. Gordon <icculus@icculus.org>
parents:
584
diff
changeset
|
466 |
void MOJOSHADER_print_debug_token(const char *subsystem, const char *token, |
202354e004fc
Unified some cut-and-paste code.
Ryan C. Gordon <icculus@icculus.org>
parents:
584
diff
changeset
|
467 |
const unsigned int tokenlen, |
202354e004fc
Unified some cut-and-paste code.
Ryan C. Gordon <icculus@icculus.org>
parents:
584
diff
changeset
|
468 |
const Token tokenval); |
202354e004fc
Unified some cut-and-paste code.
Ryan C. Gordon <icculus@icculus.org>
parents:
584
diff
changeset
|
469 |
|
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
470 |
#endif // _INCLUDE_MOJOSHADER_INTERNAL_H_ |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
471 |
|
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
472 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
473 |
#if MOJOSHADER_DO_INSTRUCTION_TABLE |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
474 |
// These have to be in the right order! Arrays are indexed by the value |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
475 |
// of the instruction token. |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
476 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
477 |
// INSTRUCTION_STATE means this opcode has to update the state machine |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
478 |
// (we're entering an ELSE block, etc). INSTRUCTION means there's no |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
479 |
// state, just go straight to the emitters. |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
480 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
481 |
// !!! FIXME: Some of these MOJOSHADER_TYPE_ANYs need to have their scope |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
482 |
// !!! FIXME: reduced to just PIXEL or VERTEX. |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
483 |
|
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
484 |
INSTRUCTION(NOP, "NOP", 1, NULL, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
485 |
INSTRUCTION(MOV, "MOV", 1, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
486 |
INSTRUCTION(ADD, "ADD", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
487 |
INSTRUCTION(SUB, "SUB", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
488 |
INSTRUCTION(MAD, "MAD", 1, DSSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
489 |
INSTRUCTION(MUL, "MUL", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
490 |
INSTRUCTION_STATE(RCP, "RCP", 1, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
491 |
INSTRUCTION(RSQ, "RSQ", 1, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
492 |
INSTRUCTION(DP3, "DP3", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
493 |
INSTRUCTION_STATE(DP4, "DP4", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
494 |
INSTRUCTION(MIN, "MIN", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
495 |
INSTRUCTION(MAX, "MAX", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
496 |
INSTRUCTION(SLT, "SLT", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
497 |
INSTRUCTION(SGE, "SGE", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
498 |
INSTRUCTION(EXP, "EXP", 1, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
499 |
INSTRUCTION_STATE(LOG, "LOG", 1, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
500 |
INSTRUCTION(LIT, "LIT", 3, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
501 |
INSTRUCTION(DST, "DST", 1, DSS, MOJOSHADER_TYPE_VERTEX) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
502 |
INSTRUCTION(LRP, "LRP", 2, DSSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
503 |
INSTRUCTION_STATE(FRC, "FRC", 1, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
504 |
INSTRUCTION_STATE(M4X4, "M4X4", 4, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
505 |
INSTRUCTION_STATE(M4X3, "M4X3", 3, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
506 |
INSTRUCTION_STATE(M3X4, "M3X4", 4, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
507 |
INSTRUCTION_STATE(M3X3, "M3X3", 3, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
508 |
INSTRUCTION_STATE(M3X2, "M3X2", 2, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
509 |
INSTRUCTION_STATE(CALL, "CALL", 2, S, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
510 |
INSTRUCTION_STATE(CALLNZ, "CALLNZ", 3, SS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
511 |
INSTRUCTION_STATE(LOOP, "LOOP", 3, SS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
512 |
INSTRUCTION_STATE(RET, "RET", 1, NULL, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
513 |
INSTRUCTION_STATE(ENDLOOP, "ENDLOOP", 2, NULL, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
514 |
INSTRUCTION_STATE(LABEL, "LABEL", 0, S, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
515 |
INSTRUCTION_STATE(DCL, "DCL", 0, DCL, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
516 |
INSTRUCTION_STATE(POW, "POW", 3, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
517 |
INSTRUCTION(CRS, "CRS", 2, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
518 |
INSTRUCTION(SGN, "SGN", 3, DSSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
519 |
INSTRUCTION(ABS, "ABS", 1, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
520 |
INSTRUCTION(NRM, "NRM", 3, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
521 |
INSTRUCTION_STATE(SINCOS, "SINCOS", 8, SINCOS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
522 |
INSTRUCTION_STATE(REP, "REP", 3, S, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
523 |
INSTRUCTION_STATE(ENDREP, "ENDREP", 2, NULL, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
524 |
INSTRUCTION_STATE(IF, "IF", 3, S, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
525 |
INSTRUCTION_STATE(IFC, "IF", 3, SS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
526 |
INSTRUCTION(ELSE, "ELSE", 1, NULL, MOJOSHADER_TYPE_ANY) // !!! FIXME: state! |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
527 |
INSTRUCTION(ENDIF, "ENDIF", 1, NULL, MOJOSHADER_TYPE_ANY) // !!! FIXME: state! |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
528 |
INSTRUCTION_STATE(BREAK, "BREAK", 1, NULL, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
529 |
INSTRUCTION_STATE(BREAKC, "BREAK", 3, SS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
530 |
INSTRUCTION_STATE(MOVA, "MOVA", 1, DS, MOJOSHADER_TYPE_VERTEX) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
531 |
INSTRUCTION_STATE(DEFB, "DEFB", 0, DEFB, MOJOSHADER_TYPE_ANY) |
467
577a9d07b6bf
DEFI has its own parse_args() now.
Ryan C. Gordon <icculus@icculus.org>
parents:
465
diff
changeset
|
532 |
INSTRUCTION_STATE(DEFI, "DEFI", 0, DEFI, MOJOSHADER_TYPE_ANY) |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
533 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
534 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
535 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
536 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
537 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
538 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
539 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
540 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
541 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
542 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
543 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
544 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
545 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
546 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
547 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
548 |
INSTRUCTION_STATE(TEXCRD, "TEXCRD", 1, TEXCRD, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
549 |
INSTRUCTION_STATE(TEXKILL, "TEXKILL", 2, D, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
550 |
INSTRUCTION_STATE(TEXLD, "TEXLD", 1, TEXLD, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
551 |
INSTRUCTION(TEXBEM, "TEXBEM", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
552 |
INSTRUCTION(TEXBEML, "TEXBEML", 2, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
553 |
INSTRUCTION(TEXREG2AR, "TEXREG2AR", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
554 |
INSTRUCTION(TEXREG2GB, "TEXREG2GB", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
555 |
INSTRUCTION(TEXM3X2PAD, "TEXM3X2PAD", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
556 |
INSTRUCTION(TEXM3X2TEX, "TEXM3X2TEX", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
557 |
INSTRUCTION(TEXM3X3PAD, "TEXM3X3PAD", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
558 |
INSTRUCTION(TEXM3X3TEX, "TEXM3X3TEX", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
559 |
INSTRUCTION(RESERVED, 0, 0, NULL, MOJOSHADER_TYPE_UNKNOWN) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
560 |
INSTRUCTION(TEXM3X3SPEC, "TEXM3X3SPEC", 1, DSS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
561 |
INSTRUCTION(TEXM3X3VSPEC, "TEXM3X3VSPEC", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
562 |
INSTRUCTION(EXPP, "EXPP", 1, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
563 |
INSTRUCTION_STATE(LOGP, "LOGP", 1, DS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
564 |
INSTRUCTION_STATE(CND, "CND", 1, DSSS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
565 |
INSTRUCTION_STATE(DEF, "DEF", 0, DEF, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
566 |
INSTRUCTION(TEXREG2RGB, "TEXREG2RGB", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
567 |
INSTRUCTION(TEXDP3TEX, "TEXDP3TEX", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
568 |
INSTRUCTION(TEXM3X2DEPTH, "TEXM3X2DEPTH", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
569 |
INSTRUCTION(TEXDP3, "TEXDP3", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
570 |
INSTRUCTION(TEXM3X3, "TEXM3X3", 1, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
571 |
INSTRUCTION(TEXDEPTH, "TEXDEPTH", 1, D, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
572 |
INSTRUCTION_STATE(CMP, "CMP", 1, DSSS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
573 |
INSTRUCTION(BEM, "BEM", 2, DSS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
574 |
INSTRUCTION_STATE(DP2ADD, "DP2ADD", 2, DSSS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
575 |
INSTRUCTION(DSX, "DSX", 2, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
576 |
INSTRUCTION(DSY, "DSY", 2, DS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
577 |
INSTRUCTION(TEXLDD, "TEXLDD", 3, DSSSS, MOJOSHADER_TYPE_PIXEL) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
578 |
INSTRUCTION_STATE(SETP, "SETP", 1, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
579 |
INSTRUCTION_STATE(TEXLDL, "TEXLDL", 2, DSS, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
580 |
INSTRUCTION_STATE(BREAKP, "BREAKP", 3, S, MOJOSHADER_TYPE_ANY) |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
581 |
#endif |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
464
diff
changeset
|
582 |
|
464
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
583 |
// end of mojoshader_internal.h ... |
eba4cf79437f
Moved some common stuff to mojoshader_internal.h ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
584 |