Skip to content

Latest commit

 

History

History
1662 lines (1348 loc) · 45.6 KB

d3d2glsl.c

File metadata and controls

1662 lines (1348 loc) · 45.6 KB
 
Feb 10, 2008
Feb 10, 2008
1
2
3
4
5
6
7
8
/**
* d3d2glsl; generate GLSL programs from bytecode of compiled Direct3D shaders.
*
* Please see the file LICENSE.txt in the source's root directory.
*
* This file written by Ryan C. Gordon.
*/
Mar 14, 2008
Mar 14, 2008
9
10
// !!! FIXME: I keep changing coding styles for symbols and typedefs.
Feb 10, 2008
Feb 10, 2008
11
12
13
// Shader bytecode format is described at MSDN:
// http://msdn2.microsoft.com/en-us/library/ms800307.aspx
Feb 9, 2008
Feb 9, 2008
14
#include <stdio.h>
Mar 9, 2008
Mar 9, 2008
15
#include <string.h>
Feb 9, 2008
Feb 9, 2008
16
#include <stdlib.h>
Feb 9, 2008
Feb 9, 2008
17
#include <stdint.h>
Mar 9, 2008
Mar 9, 2008
18
#include <stdarg.h>
Feb 9, 2008
Feb 9, 2008
19
Feb 12, 2008
Feb 12, 2008
20
21
#include "d3d2glsl.h"
Mar 16, 2008
Mar 16, 2008
22
23
24
25
26
// This is the highest shader version we currently support.
#define MAX_SHADER_MAJOR 3
#define MAX_SHADER_MINOR 0
Mar 14, 2008
Mar 14, 2008
27
28
29
// You get all the profiles unless you go out of your way to disable them.
Mar 11, 2008
Mar 11, 2008
30
31
32
33
34
35
36
37
#ifndef SUPPORT_PROFILE_D3D
#define SUPPORT_PROFILE_D3D 1
#endif
#ifndef SUPPORT_PROFILE_GLSL
#define SUPPORT_PROFILE_GLSL 1
#endif
Mar 14, 2008
Mar 14, 2008
38
39
40
41
42
43
44
// Get basic wankery out of the way here...
typedef unsigned int uint; // this is a printf() helper. don't use for code.
typedef uint8_t uint8;
typedef uint32_t uint32;
Mar 9, 2008
Mar 9, 2008
45
46
47
48
49
50
#ifdef __GNUC__
#define ISPRINTF(x,y) __attribute__((format (printf, x, y)))
#else
#define ISPRINTF(x,y)
#endif
Mar 11, 2008
Mar 11, 2008
51
52
#define STATICARRAYLEN(x) ( (sizeof ((x))) / (sizeof ((x)[0])) )
Mar 14, 2008
Mar 14, 2008
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Byteswap magic...
#if ((defined __GNUC__) && (defined __POWERPC__))
static inline uint32 SWAP32(uint32 x)
{
__asm__ __volatile__("lwbrx %0,0,%1" : "=r" (x) : "r" (&x));
return x;
} // SWAP32
#elif defined(__POWERPC__)
static inline uint32 SWAP32(uint32 x)
{
return ( (((x) >> 24) & 0x000000FF) | (((x) >> 8) & 0x0000FF00) |
(((x) << 8) & 0x00FF0000) | (((x) << 24) & 0xFF000000) );
} // SWAP32
#else
# define SWAP32(x) (x)
#endif
Feb 9, 2008
Feb 9, 2008
72
Mar 16, 2008
Mar 16, 2008
73
74
75
76
77
78
79
80
81
82
// Shader model version magic.
static inline uint32 ver_ui32(const uint8 major, const uint8 minor)
{
return ( (((uint32) major) << 16) | (((minor) == 0xFF) ? 0 : (minor)) );
} // version_ui32
#define SHADER_VERSION_SUPPORTED(maj, min) \
(ver_ui32(maj, min) <= ver_ui32(MAX_SHADER_MAJOR, MAX_SHADER_MINOR))
Mar 11, 2008
Mar 11, 2008
83
// predeclare.
Mar 14, 2008
Mar 14, 2008
84
typedef struct Context Context;
Mar 11, 2008
Mar 11, 2008
85
86
// one emit function for each opcode in each profile.
Mar 14, 2008
Mar 14, 2008
87
typedef void (*emit_function)(Context *ctx);
Mar 11, 2008
Mar 11, 2008
88
89
// one emit function for comments in each profile.
Mar 14, 2008
Mar 14, 2008
90
typedef void (*emit_comment)(Context *ctx, const char *str);
Mar 11, 2008
Mar 11, 2008
91
92
// one emit function for starting output in each profile.
Mar 14, 2008
Mar 14, 2008
93
typedef void (*emit_start)(Context *ctx);
Mar 11, 2008
Mar 11, 2008
94
95
// one emit function for ending output in each profile.
Mar 14, 2008
Mar 14, 2008
96
typedef void (*emit_end)(Context *ctx);
Mar 11, 2008
Mar 11, 2008
97
Mar 16, 2008
Mar 16, 2008
98
99
100
// one args function for each possible sequence of opcode arguments.
typedef int (*args_function)(Context *ctx);
Mar 11, 2008
Mar 11, 2008
101
// one state function for each opcode where we have state machine updates.
Mar 14, 2008
Mar 14, 2008
102
typedef int (*state_function)(Context *ctx);
Mar 11, 2008
Mar 11, 2008
103
104
105
106
107
108
109
110
111
typedef struct
{
const char *name;
emit_start start_emitter;
emit_end end_emitter;
emit_comment comment_emitter;
} D3D2GLSL_profile;
Mar 11, 2008
Mar 11, 2008
112
Mar 12, 2008
Mar 12, 2008
113
114
115
116
117
118
119
120
121
typedef enum
{
SHADER_TYPE_UNKNOWN = -1,
SHADER_TYPE_PIXEL,
SHADER_TYPE_VERTEX,
SHADER_TYPE_TOTAL
} D3D2GLSL_shaderType;
Mar 14, 2008
Mar 14, 2008
122
123
124
125
126
127
128
129
130
// A simple linked list of strings, so we can build the final output without
// realloc()ing for each new line, and easily insert lines into the middle
// of the output without much trouble.
typedef struct OutputList
{
char *str;
struct OutputList *next;
} OutputList;
Mar 16, 2008
Mar 16, 2008
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
typedef struct
{
int regnum;
int relative;
int writemask;
int result_mod;
int result_shift;
int regtype;
} DestArgInfo;
typedef struct
{
int regnum;
int relative;
int swizzle_x;
int swizzle_y;
int swizzle_z;
int swizzle_w;
int src_mod;
int regtype;
} SourceArgInfo;
Mar 9, 2008
Mar 9, 2008
155
#define D3D2GLSL_SCRATCH_BUFFER_SIZE 256
Mar 12, 2008
Mar 12, 2008
156
#define D3D2GLSL_SCRATCH_BUFFERS 10
Mar 9, 2008
Mar 9, 2008
157
Mar 9, 2008
Mar 9, 2008
158
// Context...this is state that changes as we parse through a shader...
Mar 14, 2008
Mar 14, 2008
159
struct Context
Mar 9, 2008
Mar 9, 2008
160
{
Mar 14, 2008
Mar 14, 2008
161
162
D3D2GLSL_malloc malloc;
D3D2GLSL_free free;
Mar 9, 2008
Mar 9, 2008
163
164
const uint32 *tokens;
uint32 tokencount;
Mar 14, 2008
Mar 14, 2008
165
166
167
168
169
170
171
172
173
OutputList output;
OutputList *output_tail;
int output_len; // total strlen; prevents walking the list just to malloc.
const char *endline;
int endline_len;
const char *failstr;
char scratch[D3D2GLSL_SCRATCH_BUFFERS][D3D2GLSL_SCRATCH_BUFFER_SIZE];
int scratchidx; // current scratch buffer.
int profileid;
Mar 11, 2008
Mar 11, 2008
174
const D3D2GLSL_profile *profile;
Mar 12, 2008
Mar 12, 2008
175
176
177
D3D2GLSL_shaderType shader_type;
uint32 major_ver;
uint32 minor_ver;
Mar 16, 2008
Mar 16, 2008
178
179
DestArgInfo dest_args[1];
SourceArgInfo source_args[4];
Mar 11, 2008
Mar 11, 2008
180
181
182
};
Mar 14, 2008
Mar 14, 2008
183
static inline char *get_scratch_buffer(Context *ctx)
Mar 9, 2008
Mar 9, 2008
184
{
Mar 14, 2008
Mar 14, 2008
185
186
ctx->scratchidx = (ctx->scratchidx + 1) % D3D2GLSL_SCRATCH_BUFFERS;
return ctx->scratch[ctx->scratchidx];
Mar 9, 2008
Mar 9, 2008
187
188
} // get_scratch_buffer
Feb 10, 2008
Feb 10, 2008
189
Mar 9, 2008
Mar 9, 2008
190
191
// Special-case return values from the parsing pipeline...
#define FAIL (-1)
Feb 10, 2008
Feb 10, 2008
192
#define END_OF_STREAM (-2)
Mar 9, 2008
Mar 9, 2008
193
Mar 14, 2008
Mar 14, 2008
194
195
196
197
198
199
200
201
202
203
204
static const char *out_of_mem_string = "Out of memory";
static inline int out_of_memory(Context *ctx)
{
if (ctx->failstr == NULL)
ctx->failstr = out_of_mem_string; // fail() would call malloc().
return FAIL;
} // out_of_memory
static int failf(Context *ctx, const char *fmt, ...) ISPRINTF(2,3);
static int failf(Context *ctx, const char *fmt, ...)
Feb 10, 2008
Feb 10, 2008
205
{
Mar 9, 2008
Mar 9, 2008
206
207
if (ctx->failstr == NULL) // don't change existing error.
{
Mar 14, 2008
Mar 14, 2008
208
char *scratch = get_scratch_buffer(ctx);
Mar 9, 2008
Mar 9, 2008
209
210
va_list ap;
va_start(ap, fmt);
Mar 14, 2008
Mar 14, 2008
211
const int len = vsnprintf(scratch,D3D2GLSL_SCRATCH_BUFFER_SIZE,fmt,ap);
Mar 9, 2008
Mar 9, 2008
212
213
va_end(ap);
Mar 14, 2008
Mar 14, 2008
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
char *failstr = (char *) ctx->malloc(len + 1);
if (failstr == NULL)
out_of_memory(ctx);
else
{
// see comments about scratch buffer overflow in output_line().
if (len < D3D2GLSL_SCRATCH_BUFFER_SIZE)
strcpy(failstr, scratch); // copy it over.
else
{
va_start(ap, fmt);
vsnprintf(failstr, len + 1, fmt, ap); // rebuild it.
va_end(ap);
} // else
ctx->failstr = failstr;
} // else
Mar 9, 2008
Mar 9, 2008
230
231
232
233
234
235
} // if
return FAIL;
} // failf
Mar 14, 2008
Mar 14, 2008
236
static inline int fail(Context *ctx, const char *reason)
Mar 9, 2008
Mar 9, 2008
237
238
239
240
241
{
return failf(ctx, "%s", reason);
} // fail
Mar 14, 2008
Mar 14, 2008
242
243
static int output_line(Context *ctx, const char *fmt, ...) ISPRINTF(2,3);
static int output_line(Context *ctx, const char *fmt, ...)
Mar 9, 2008
Mar 9, 2008
244
245
246
247
{
if (ctx->failstr != NULL)
return FAIL; // we failed previously, don't go on...
Mar 14, 2008
Mar 14, 2008
248
249
250
251
252
OutputList *item = (OutputList *) ctx->malloc(sizeof (OutputList));
if (item == NULL)
return out_of_memory(ctx);
char *scratch = get_scratch_buffer(ctx);
Mar 9, 2008
Mar 9, 2008
253
254
va_list ap;
va_start(ap, fmt);
Mar 14, 2008
Mar 14, 2008
255
const int len = vsnprintf(scratch, D3D2GLSL_SCRATCH_BUFFER_SIZE, fmt, ap);
Mar 9, 2008
Mar 9, 2008
256
257
va_end(ap);
Mar 14, 2008
Mar 14, 2008
258
259
item->str = (char *) ctx->malloc(len + 1);
if (item->str == NULL)
Mar 9, 2008
Mar 9, 2008
260
{
Mar 14, 2008
Mar 14, 2008
261
262
free(item);
return out_of_memory(ctx);
Mar 9, 2008
Mar 9, 2008
263
264
} // if
Mar 14, 2008
Mar 14, 2008
265
266
267
268
269
270
271
272
273
274
275
// If we overflowed our scratch buffer, that's okay. We were going to
// allocate anyhow...the scratch buffer just lets us avoid a second
// run of vsnprintf().
if (len < D3D2GLSL_SCRATCH_BUFFER_SIZE)
strcpy(item->str, scratch); // copy it over.
else
{
va_start(ap, fmt);
vsnprintf(item->str, len + 1, fmt, ap); // rebuild it.
va_end(ap);
} // else
Mar 9, 2008
Mar 9, 2008
276
Mar 14, 2008
Mar 14, 2008
277
278
279
280
item->next = NULL;
ctx->output_tail->next = item;
ctx->output_tail = item;
ctx->output_len += len + ctx->endline_len;
Mar 9, 2008
Mar 9, 2008
281
282
283
284
return 0;
} // output_line
Mar 12, 2008
Mar 12, 2008
285
Mar 14, 2008
Mar 14, 2008
286
// if SUPPORT_PROFILE_* isn't defined, we assume an implicit desire to support.
Mar 12, 2008
Mar 12, 2008
287
288
289
290
291
292
293
294
295
#define AT_LEAST_ONE_PROFILE 0
#if !SUPPORT_PROFILE_D3D
#define PROFILE_EMITTER_D3D(op)
#else
#undef AT_LEAST_ONE_PROFILE
#define AT_LEAST_ONE_PROFILE 1
#define PROFILE_EMITTER_D3D(op) emit_D3D_##op,
Mar 16, 2008
Mar 16, 2008
296
static char *make_D3D_destarg_string(Context *ctx, const int idx)
Mar 12, 2008
Mar 12, 2008
297
298
{
char *retval = NULL;
Mar 16, 2008
Mar 16, 2008
299
300
301
if (idx >= STATICARRAYLEN(ctx->dest_args))
{
fail(ctx, "Too many destination args");
Mar 12, 2008
Mar 12, 2008
302
return "";
Mar 16, 2008
Mar 16, 2008
303
} // if
Mar 12, 2008
Mar 12, 2008
304
305
306
307
308
retval = get_scratch_buffer(ctx);
strcpy(retval, "DST"); // !!! FIXME
return retval;
Mar 16, 2008
Mar 16, 2008
309
} // make_D3D_destarg_string
Mar 12, 2008
Mar 12, 2008
310
311
Mar 16, 2008
Mar 16, 2008
312
static char *make_D3D_sourcearg_string(Context *ctx, const int idx)
Mar 12, 2008
Mar 12, 2008
313
314
{
char *retval = NULL;
Mar 16, 2008
Mar 16, 2008
315
316
317
if (idx >= STATICARRAYLEN(ctx->source_args))
{
fail(ctx, "Too many source args");
Mar 12, 2008
Mar 12, 2008
318
return "";
Mar 16, 2008
Mar 16, 2008
319
} // if
Mar 12, 2008
Mar 12, 2008
320
321
322
323
324
retval = get_scratch_buffer(ctx);
strcpy(retval, "SRC"); // !!! FIXME
return retval;
Mar 16, 2008
Mar 16, 2008
325
} // make_D3D_sourcearg_string
Mar 12, 2008
Mar 12, 2008
326
Mar 12, 2008
Mar 12, 2008
327
Mar 14, 2008
Mar 14, 2008
328
static void emit_D3D_start(Context *ctx)
Mar 12, 2008
Mar 12, 2008
329
330
331
{
const uint major = (uint) ctx->major_ver;
const uint minor = (uint) ctx->minor_ver;
Mar 14, 2008
Mar 14, 2008
332
Mar 12, 2008
Mar 12, 2008
333
334
335
if (ctx->shader_type == SHADER_TYPE_PIXEL)
output_line(ctx, "ps_%u_%u", major, minor);
else if (ctx->shader_type == SHADER_TYPE_VERTEX)
Mar 14, 2008
Mar 14, 2008
336
337
338
339
340
341
342
343
344
{
char minorstr[16];
if (minor == 0xFF)
strcpy(minorstr, "sw");
else
snprintf(minorstr, sizeof (minorstr), "%u", (uint) minor);
output_line(ctx, "vs_%u_%s", major, minorstr);
} // else if
Mar 11, 2008
Mar 11, 2008
345
else
Mar 12, 2008
Mar 12, 2008
346
347
348
349
{
failf(ctx, "Shader type %u unsupported in this profile.",
(uint) ctx->shader_type);
} // else
Mar 11, 2008
Mar 11, 2008
350
351
} // emit_D3D_start
Mar 12, 2008
Mar 12, 2008
352
Mar 14, 2008
Mar 14, 2008
353
static void emit_D3D_end(Context *ctx)
Mar 11, 2008
Mar 11, 2008
354
355
356
{
output_line(ctx, "END");
} // emit_D3D_end
Mar 11, 2008
Mar 11, 2008
357
Mar 12, 2008
Mar 12, 2008
358
Mar 14, 2008
Mar 14, 2008
359
static void emit_D3D_comment(Context *ctx, const char *str)
Feb 9, 2008
Feb 9, 2008
360
{
Mar 11, 2008
Mar 11, 2008
361
362
output_line(ctx, "; %s", str);
} // emit_D3D_comment
Feb 9, 2008
Feb 9, 2008
363
364
Mar 14, 2008
Mar 14, 2008
365
static void emit_D3D_RESERVED(Context *ctx)
Feb 9, 2008
Feb 9, 2008
366
{
Mar 11, 2008
Mar 11, 2008
367
368
369
// do nothing; fails in the state machine.
} // emit_D3D_RESERVED
Mar 12, 2008
Mar 12, 2008
370
371
372
373
// Generic D3D opcode emitters. A list of macros generate all the entry points
// that call into these...
Mar 14, 2008
Mar 14, 2008
374
static void emit_D3D_opcode_d(Context *ctx, const char *opcode)
Mar 12, 2008
Mar 12, 2008
375
{
Mar 16, 2008
Mar 16, 2008
376
377
const char *dst0 = make_D3D_destarg_string(ctx, 0);
output_line(ctx, "%s %s", opcode, dst0);
Mar 12, 2008
Mar 12, 2008
378
379
380
} // emit_D3D_opcode_d
Mar 14, 2008
Mar 14, 2008
381
static void emit_D3D_opcode_s(Context *ctx, const char *opcode)
Mar 12, 2008
Mar 12, 2008
382
{
Mar 16, 2008
Mar 16, 2008
383
384
const char *src0 = make_D3D_destarg_string(ctx, 0);
output_line(ctx, "%s %s", opcode, src0);
Mar 12, 2008
Mar 12, 2008
385
386
387
} // emit_D3D_opcode_s
Mar 14, 2008
Mar 14, 2008
388
static void emit_D3D_opcode_ss(Context *ctx, const char *opcode)
Mar 12, 2008
Mar 12, 2008
389
{
Mar 16, 2008
Mar 16, 2008
390
391
392
const char *src0 = make_D3D_sourcearg_string(ctx, 0);
const char *src1 = make_D3D_sourcearg_string(ctx, 1);
output_line(ctx, "%s %s, %s", opcode, src0, src1);
Mar 12, 2008
Mar 12, 2008
393
394
395
} // emit_D3D_opcode_s
Mar 14, 2008
Mar 14, 2008
396
static void emit_D3D_opcode_ds(Context *ctx, const char *opcode)
Mar 12, 2008
Mar 12, 2008
397
{
Mar 16, 2008
Mar 16, 2008
398
399
400
const char *dst0 = make_D3D_destarg_string(ctx, 0);
const char *src0 = make_D3D_sourcearg_string(ctx, 0);
output_line(ctx, "%s %s, %s", opcode, dst0, src0);
Mar 12, 2008
Mar 12, 2008
401
402
403
} // emit_D3D_opcode_ds
Mar 14, 2008
Mar 14, 2008
404
static void emit_D3D_opcode_dss(Context *ctx, const char *opcode)
Mar 12, 2008
Mar 12, 2008
405
{
Mar 16, 2008
Mar 16, 2008
406
407
408
409
const char *dst0 = make_D3D_destarg_string(ctx, 0);
const char *src0 = make_D3D_sourcearg_string(ctx, 0);
const char *src1 = make_D3D_sourcearg_string(ctx, 1);
output_line(ctx, "%s %s, %s, %s", opcode, dst0, src0, src1);
Mar 12, 2008
Mar 12, 2008
410
411
412
} // emit_D3D_opcode_dss
Mar 14, 2008
Mar 14, 2008
413
static void emit_D3D_opcode_dsss(Context *ctx, const char *opcode)
Mar 12, 2008
Mar 12, 2008
414
{
Mar 16, 2008
Mar 16, 2008
415
416
417
418
419
const char *dst0 = make_D3D_destarg_string(ctx, 0);
const char *src0 = make_D3D_sourcearg_string(ctx, 0);
const char *src1 = make_D3D_sourcearg_string(ctx, 1);
const char *src2 = make_D3D_sourcearg_string(ctx, 2);
output_line(ctx, "%s %s, %s, %s, %s", opcode, dst0, src0, src1, src2);
Mar 12, 2008
Mar 12, 2008
420
421
422
} // emit_D3D_opcode_dsss
Mar 14, 2008
Mar 14, 2008
423
static void emit_D3D_opcode_dssss(Context *ctx, const char *opcode)
Mar 12, 2008
Mar 12, 2008
424
{
Mar 16, 2008
Mar 16, 2008
425
426
427
428
429
430
const char *dst0 = make_D3D_destarg_string(ctx, 0);
const char *src0 = make_D3D_sourcearg_string(ctx, 0);
const char *src1 = make_D3D_sourcearg_string(ctx, 1);
const char *src2 = make_D3D_sourcearg_string(ctx, 2);
const char *src3 = make_D3D_sourcearg_string(ctx, 3);
output_line(ctx,"%s %s, %s, %s, %s, %s",opcode,dst0,src0,src1,src2,src3);
Mar 12, 2008
Mar 12, 2008
431
432
433
434
} // emit_D3D_opcode_dssss
#define EMIT_D3D_OPCODE_FUNC(op) \
Mar 14, 2008
Mar 14, 2008
435
static void emit_D3D_##op(Context *ctx) { \
Mar 12, 2008
Mar 12, 2008
436
437
438
output_line(ctx, #op); \
}
#define EMIT_D3D_OPCODE_D_FUNC(op) \
Mar 14, 2008
Mar 14, 2008
439
static void emit_D3D_##op(Context *ctx) { \
Mar 12, 2008
Mar 12, 2008
440
441
442
emit_D3D_opcode_d(ctx, #op); \
}
#define EMIT_D3D_OPCODE_S_FUNC(op) \
Mar 14, 2008
Mar 14, 2008
443
static void emit_D3D_##op(Context *ctx) { \
Mar 12, 2008
Mar 12, 2008
444
445
446
emit_D3D_opcode_s(ctx, #op); \
}
#define EMIT_D3D_OPCODE_SS_FUNC(op) \
Mar 14, 2008
Mar 14, 2008
447
static void emit_D3D_##op(Context *ctx) { \
Mar 12, 2008
Mar 12, 2008
448
449
450
emit_D3D_opcode_ss(ctx, #op); \
}
#define EMIT_D3D_OPCODE_DS_FUNC(op) \
Mar 14, 2008
Mar 14, 2008
451
static void emit_D3D_##op(Context *ctx) { \
Mar 12, 2008
Mar 12, 2008
452
453
454
emit_D3D_opcode_ds(ctx, #op); \
}
#define EMIT_D3D_OPCODE_DSS_FUNC(op) \
Mar 14, 2008
Mar 14, 2008
455
static void emit_D3D_##op(Context *ctx) { \
Mar 12, 2008
Mar 12, 2008
456
457
458
emit_D3D_opcode_dss(ctx, #op); \
}
#define EMIT_D3D_OPCODE_DSSS_FUNC(op) \
Mar 14, 2008
Mar 14, 2008
459
static void emit_D3D_##op(Context *ctx) { \
Mar 12, 2008
Mar 12, 2008
460
461
462
emit_D3D_opcode_dsss(ctx, #op); \
}
#define EMIT_D3D_OPCODE_DSSSS_FUNC(op) \
Mar 14, 2008
Mar 14, 2008
463
static void emit_D3D_##op(Context *ctx) { \
Mar 12, 2008
Mar 12, 2008
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
emit_D3D_opcode_dssss(ctx, #op); \
}
EMIT_D3D_OPCODE_FUNC(NOP)
EMIT_D3D_OPCODE_DS_FUNC(MOV)
EMIT_D3D_OPCODE_DSS_FUNC(ADD)
EMIT_D3D_OPCODE_DSS_FUNC(SUB)
EMIT_D3D_OPCODE_DSSS_FUNC(MAD)
EMIT_D3D_OPCODE_DSS_FUNC(MUL)
EMIT_D3D_OPCODE_DS_FUNC(RCP)
EMIT_D3D_OPCODE_DS_FUNC(RSQ)
EMIT_D3D_OPCODE_DSS_FUNC(DP3)
EMIT_D3D_OPCODE_DSS_FUNC(DP4)
EMIT_D3D_OPCODE_DSS_FUNC(MIN)
EMIT_D3D_OPCODE_DSS_FUNC(MAX)
EMIT_D3D_OPCODE_DSS_FUNC(SLT)
EMIT_D3D_OPCODE_DSS_FUNC(SGE)
EMIT_D3D_OPCODE_DS_FUNC(EXP)
EMIT_D3D_OPCODE_DS_FUNC(LOG)
EMIT_D3D_OPCODE_DS_FUNC(LIT)
EMIT_D3D_OPCODE_DSS_FUNC(DST)
EMIT_D3D_OPCODE_DSSS_FUNC(LRP)
EMIT_D3D_OPCODE_DS_FUNC(FRC)
EMIT_D3D_OPCODE_DSS_FUNC(M4X4)
EMIT_D3D_OPCODE_DSS_FUNC(M4X3)
EMIT_D3D_OPCODE_DSS_FUNC(M3X4)
EMIT_D3D_OPCODE_DSS_FUNC(M3X3)
EMIT_D3D_OPCODE_DSS_FUNC(M3X2)
EMIT_D3D_OPCODE_S_FUNC(CALL)
EMIT_D3D_OPCODE_SS_FUNC(CALLNZ)
Mar 16, 2008
Mar 16, 2008
494
EMIT_D3D_OPCODE_SS_FUNC(LOOP)
Mar 12, 2008
Mar 12, 2008
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
EMIT_D3D_OPCODE_FUNC(RET)
EMIT_D3D_OPCODE_FUNC(ENDLOOP)
EMIT_D3D_OPCODE_S_FUNC(LABEL)
EMIT_D3D_OPCODE_FUNC(DCL) // !!! FIXME!
EMIT_D3D_OPCODE_DSS_FUNC(POW)
EMIT_D3D_OPCODE_DSS_FUNC(CRS)
EMIT_D3D_OPCODE_DSSS_FUNC(SGN)
EMIT_D3D_OPCODE_DS_FUNC(ABS)
EMIT_D3D_OPCODE_DS_FUNC(NRM)
EMIT_D3D_OPCODE_DS_FUNC(SINCOS)
EMIT_D3D_OPCODE_S_FUNC(REP)
EMIT_D3D_OPCODE_FUNC(ENDREP)
EMIT_D3D_OPCODE_S_FUNC(IF)
EMIT_D3D_OPCODE_SS_FUNC(IFC)
EMIT_D3D_OPCODE_FUNC(ELSE)
EMIT_D3D_OPCODE_FUNC(ENDIF)
EMIT_D3D_OPCODE_FUNC(BREAK)
EMIT_D3D_OPCODE_SS_FUNC(BREAKC)
EMIT_D3D_OPCODE_DS_FUNC(MOVA)
EMIT_D3D_OPCODE_FUNC(DEFB) // !!! FIXME!
EMIT_D3D_OPCODE_FUNC(DEFI) // !!! FIXME!
EMIT_D3D_OPCODE_FUNC(TEXCOORD) // !!! FIXME!
EMIT_D3D_OPCODE_D_FUNC(TEXKILL)
EMIT_D3D_OPCODE_FUNC(TEX) // !!! FIXME!
EMIT_D3D_OPCODE_DS_FUNC(TEXBEM)
EMIT_D3D_OPCODE_DS_FUNC(TEXBEML)
EMIT_D3D_OPCODE_DS_FUNC(TEXREG2AR)
EMIT_D3D_OPCODE_DS_FUNC(TEXREG2GB)
EMIT_D3D_OPCODE_DS_FUNC(TEXM3X2PAD)
EMIT_D3D_OPCODE_DS_FUNC(TEXM3X2TEX)
EMIT_D3D_OPCODE_DS_FUNC(TEXM3X3PAD)
EMIT_D3D_OPCODE_DS_FUNC(TEXM3X3TEX)
EMIT_D3D_OPCODE_DSS_FUNC(TEXM3X3SPEC)
EMIT_D3D_OPCODE_DS_FUNC(TEXM3X3VSPEC)
EMIT_D3D_OPCODE_DS_FUNC(EXPP)
EMIT_D3D_OPCODE_DS_FUNC(LOGP)
EMIT_D3D_OPCODE_DSSS_FUNC(CND)
EMIT_D3D_OPCODE_FUNC(DEF) // !!! FIXME!
EMIT_D3D_OPCODE_DS_FUNC(TEXREG2RGB)
EMIT_D3D_OPCODE_DS_FUNC(TEXDP3TEX)
EMIT_D3D_OPCODE_DS_FUNC(TEXM3X2DEPTH)
EMIT_D3D_OPCODE_DS_FUNC(TEXDP3)
EMIT_D3D_OPCODE_DS_FUNC(TEXM3X3)
EMIT_D3D_OPCODE_D_FUNC(TEXDEPTH)
EMIT_D3D_OPCODE_DSSS_FUNC(CMP)
EMIT_D3D_OPCODE_DSS_FUNC(BEM)
EMIT_D3D_OPCODE_DSSS_FUNC(DP2ADD)
EMIT_D3D_OPCODE_DS_FUNC(DSX)
EMIT_D3D_OPCODE_DS_FUNC(DSY)
EMIT_D3D_OPCODE_DSSSS_FUNC(TEXLDD)
EMIT_D3D_OPCODE_DSS_FUNC(SETP)
EMIT_D3D_OPCODE_DSS_FUNC(TEXLDL)
Mar 16, 2008
Mar 16, 2008
547
EMIT_D3D_OPCODE_S_FUNC(BREAKP)
Mar 12, 2008
Mar 12, 2008
548
549
550
551
552
553
554
555
556
557
#undef EMIT_D3D_OPCODE_FUNC
#undef EMIT_D3D_OPCODE_D_FUNC
#undef EMIT_D3D_OPCODE_S_FUNC
#undef EMIT_D3D_OPCODE_SS_FUNC
#undef EMIT_D3D_OPCODE_DS_FUNC
#undef EMIT_D3D_OPCODE_DSS_FUNC
#undef EMIT_D3D_OPCODE_DSSS_FUNC
#undef EMIT_D3D_OPCODE_DSSSS_FUNC
Mar 11, 2008
Mar 11, 2008
558
559
560
561
562
#endif // SUPPORT_PROFILE_D3D
#if !SUPPORT_PROFILE_GLSL
Mar 11, 2008
Mar 11, 2008
563
#define PROFILE_EMITTER_GLSL(op)
Mar 11, 2008
Mar 11, 2008
564
565
566
#else
#undef AT_LEAST_ONE_PROFILE
#define AT_LEAST_ONE_PROFILE 1
Mar 11, 2008
Mar 11, 2008
567
568
#define PROFILE_EMITTER_GLSL(op) emit_GLSL_##op,
Mar 14, 2008
Mar 14, 2008
569
static void emit_GLSL_start(Context *ctx)
Mar 11, 2008
Mar 11, 2008
570
{
Mar 12, 2008
Mar 12, 2008
571
572
573
574
575
576
577
578
579
580
581
582
const uint major = (uint) ctx->major_ver;
const uint minor = (uint) ctx->minor_ver;
if (ctx->shader_type == SHADER_TYPE_PIXEL)
output_line(ctx, "// Pixel shader, version %u.%u", major, minor);
else if (ctx->shader_type == SHADER_TYPE_VERTEX)
output_line(ctx, "// Vertex shader, version %u.%u", major, minor);
else
{
failf(ctx, "Shader type %u unsupported in this profile.",
(uint) ctx->shader_type);
} // else
Mar 11, 2008
Mar 11, 2008
583
584
585
output_line(ctx, "void main() {");
} // emit_GLSL_start
Mar 14, 2008
Mar 14, 2008
586
static void emit_GLSL_end(Context *ctx)
Mar 11, 2008
Mar 11, 2008
587
588
589
{
output_line(ctx, "}");
} // emit_GLSL_end
Feb 9, 2008
Feb 9, 2008
590
Mar 14, 2008
Mar 14, 2008
591
static void emit_GLSL_comment(Context *ctx, const char *str)
Mar 11, 2008
Mar 11, 2008
592
593
594
595
{
output_line(ctx, "// %s", str);
} // emit_GLSL_comment
Mar 14, 2008
Mar 14, 2008
596
static void emit_GLSL_NOP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
597
598
599
600
{
// no-op is a no-op. :)
} // emit_GLSL_NOP
Mar 14, 2008
Mar 14, 2008
601
static void emit_GLSL_MOV(Context *ctx)
Mar 11, 2008
Mar 11, 2008
602
603
604
605
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_MOV
Mar 14, 2008
Mar 14, 2008
606
static void emit_GLSL_ADD(Context *ctx)
Mar 11, 2008
Mar 11, 2008
607
608
609
610
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_ADD
Mar 14, 2008
Mar 14, 2008
611
static void emit_GLSL_SUB(Context *ctx)
Mar 11, 2008
Mar 11, 2008
612
613
614
615
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_SUB
Mar 14, 2008
Mar 14, 2008
616
static void emit_GLSL_MAD(Context *ctx)
Mar 11, 2008
Mar 11, 2008
617
618
619
620
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_MAD
Mar 14, 2008
Mar 14, 2008
621
static void emit_GLSL_MUL(Context *ctx)
Mar 11, 2008
Mar 11, 2008
622
623
624
625
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_MUL
Mar 14, 2008
Mar 14, 2008
626
static void emit_GLSL_RCP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
627
628
629
630
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_RCP
Mar 14, 2008
Mar 14, 2008
631
static void emit_GLSL_RSQ(Context *ctx)
Mar 11, 2008
Mar 11, 2008
632
633
634
635
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_RSQ
Mar 14, 2008
Mar 14, 2008
636
static void emit_GLSL_DP3(Context *ctx)
Mar 11, 2008
Mar 11, 2008
637
638
639
640
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DP3
Mar 14, 2008
Mar 14, 2008
641
static void emit_GLSL_DP4(Context *ctx)
Mar 11, 2008
Mar 11, 2008
642
643
644
645
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DP4
Mar 14, 2008
Mar 14, 2008
646
static void emit_GLSL_MIN(Context *ctx)
Mar 11, 2008
Mar 11, 2008
647
648
649
650
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_MIN
Mar 14, 2008
Mar 14, 2008
651
static void emit_GLSL_MAX(Context *ctx)
Mar 11, 2008
Mar 11, 2008
652
653
654
655
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_MAX
Mar 14, 2008
Mar 14, 2008
656
static void emit_GLSL_SLT(Context *ctx)
Mar 11, 2008
Mar 11, 2008
657
658
659
660
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_SLT
Mar 14, 2008
Mar 14, 2008
661
static void emit_GLSL_SGE(Context *ctx)
Mar 11, 2008
Mar 11, 2008
662
663
664
665
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_SGE
Mar 14, 2008
Mar 14, 2008
666
static void emit_GLSL_EXP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
667
668
669
670
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_EXP
Mar 14, 2008
Mar 14, 2008
671
static void emit_GLSL_LOG(Context *ctx)
Mar 11, 2008
Mar 11, 2008
672
673
674
675
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_LOG
Mar 14, 2008
Mar 14, 2008
676
static void emit_GLSL_LIT(Context *ctx)
Mar 11, 2008
Mar 11, 2008
677
678
679
680
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_LIT
Mar 14, 2008
Mar 14, 2008
681
static void emit_GLSL_DST(Context *ctx)
Mar 11, 2008
Mar 11, 2008
682
683
684
685
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DST
Mar 14, 2008
Mar 14, 2008
686
static void emit_GLSL_LRP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
687
688
689
690
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_LRP
Mar 14, 2008
Mar 14, 2008
691
static void emit_GLSL_FRC(Context *ctx)
Mar 11, 2008
Mar 11, 2008
692
693
694
695
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_FRC
Mar 14, 2008
Mar 14, 2008
696
static void emit_GLSL_M4X4(Context *ctx)
Mar 11, 2008
Mar 11, 2008
697
698
699
700
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_M4X4
Mar 14, 2008
Mar 14, 2008
701
static void emit_GLSL_M4X3(Context *ctx)
Mar 11, 2008
Mar 11, 2008
702
703
704
705
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_M4X3
Mar 14, 2008
Mar 14, 2008
706
static void emit_GLSL_M3X4(Context *ctx)
Mar 11, 2008
Mar 11, 2008
707
708
709
710
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_M3X4
Mar 14, 2008
Mar 14, 2008
711
static void emit_GLSL_M3X3(Context *ctx)
Mar 11, 2008
Mar 11, 2008
712
713
714
715
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_M3X3
Mar 14, 2008
Mar 14, 2008
716
static void emit_GLSL_M3X2(Context *ctx)
Mar 11, 2008
Mar 11, 2008
717
718
719
720
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_M3X2
Mar 14, 2008
Mar 14, 2008
721
static void emit_GLSL_CALL(Context *ctx)
Mar 11, 2008
Mar 11, 2008
722
723
724
725
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_CALL
Mar 14, 2008
Mar 14, 2008
726
static void emit_GLSL_CALLNZ(Context *ctx)
Mar 11, 2008
Mar 11, 2008
727
728
729
730
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_CALLNZ
Mar 14, 2008
Mar 14, 2008
731
static void emit_GLSL_LOOP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
732
733
734
735
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_LOOP
Mar 14, 2008
Mar 14, 2008
736
static void emit_GLSL_RET(Context *ctx)
Mar 11, 2008
Mar 11, 2008
737
738
739
740
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_RET
Mar 14, 2008
Mar 14, 2008
741
static void emit_GLSL_ENDLOOP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
742
743
744
745
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_ENDLOOP
Mar 14, 2008
Mar 14, 2008
746
static void emit_GLSL_LABEL(Context *ctx)
Mar 11, 2008
Mar 11, 2008
747
748
749
750
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_LABEL
Mar 14, 2008
Mar 14, 2008
751
static void emit_GLSL_DCL(Context *ctx)
Mar 11, 2008
Mar 11, 2008
752
753
754
755
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DCL
Mar 14, 2008
Mar 14, 2008
756
static void emit_GLSL_POW(Context *ctx)
Mar 11, 2008
Mar 11, 2008
757
758
759
760
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_POW
Mar 14, 2008
Mar 14, 2008
761
static void emit_GLSL_CRS(Context *ctx)
Mar 11, 2008
Mar 11, 2008
762
763
764
765
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_CRS
Mar 14, 2008
Mar 14, 2008
766
static void emit_GLSL_SGN(Context *ctx)
Mar 11, 2008
Mar 11, 2008
767
768
769
770
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_SGN
Mar 14, 2008
Mar 14, 2008
771
static void emit_GLSL_ABS(Context *ctx)
Mar 11, 2008
Mar 11, 2008
772
773
774
775
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_ABS
Mar 14, 2008
Mar 14, 2008
776
static void emit_GLSL_NRM(Context *ctx)
Mar 11, 2008
Mar 11, 2008
777
778
779
780
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_NRM
Mar 14, 2008
Mar 14, 2008
781
static void emit_GLSL_SINCOS(Context *ctx)
Mar 11, 2008
Mar 11, 2008
782
783
784
785
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_SINCOS
Mar 14, 2008
Mar 14, 2008
786
static void emit_GLSL_REP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
787
788
789
790
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_REP
Mar 14, 2008
Mar 14, 2008
791
static void emit_GLSL_ENDREP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
792
793
794
795
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_ENDREP
Mar 14, 2008
Mar 14, 2008
796
static void emit_GLSL_IF(Context *ctx)
Mar 11, 2008
Mar 11, 2008
797
798
799
800
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_IF
Mar 14, 2008
Mar 14, 2008
801
static void emit_GLSL_IFC(Context *ctx)
Mar 11, 2008
Mar 11, 2008
802
803
804
805
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_IFC
Mar 14, 2008
Mar 14, 2008
806
static void emit_GLSL_ELSE(Context *ctx)
Mar 11, 2008
Mar 11, 2008
807
808
809
810
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_ELSE
Mar 14, 2008
Mar 14, 2008
811
static void emit_GLSL_ENDIF(Context *ctx)
Mar 11, 2008
Mar 11, 2008
812
813
814
815
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_ENDIF
Mar 14, 2008
Mar 14, 2008
816
static void emit_GLSL_BREAK(Context *ctx)
Mar 11, 2008
Mar 11, 2008
817
818
819
820
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_BREAK
Mar 14, 2008
Mar 14, 2008
821
static void emit_GLSL_BREAKC(Context *ctx)
Mar 11, 2008
Mar 11, 2008
822
823
824
825
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_BREAKC
Mar 14, 2008
Mar 14, 2008
826
static void emit_GLSL_MOVA(Context *ctx)
Mar 11, 2008
Mar 11, 2008
827
828
829
830
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_MOVA
Mar 14, 2008
Mar 14, 2008
831
static void emit_GLSL_DEFB(Context *ctx)
Mar 11, 2008
Mar 11, 2008
832
833
834
835
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DEFB
Mar 14, 2008
Mar 14, 2008
836
static void emit_GLSL_DEFI(Context *ctx)
Mar 11, 2008
Mar 11, 2008
837
838
839
840
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DEFI
Mar 14, 2008
Mar 14, 2008
841
static void emit_GLSL_TEXCOORD(Context *ctx)
Mar 11, 2008
Mar 11, 2008
842
843
844
845
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXCOORD
Mar 14, 2008
Mar 14, 2008
846
static void emit_GLSL_TEXKILL(Context *ctx)
Mar 11, 2008
Mar 11, 2008
847
848
849
850
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXKILL
Mar 14, 2008
Mar 14, 2008
851
static void emit_GLSL_TEX(Context *ctx)
Mar 11, 2008
Mar 11, 2008
852
853
854
855
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEX
Mar 14, 2008
Mar 14, 2008
856
static void emit_GLSL_TEXBEM(Context *ctx)
Mar 11, 2008
Mar 11, 2008
857
858
859
860
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXBEM
Mar 14, 2008
Mar 14, 2008
861
static void emit_GLSL_TEXBEML(Context *ctx)
Mar 11, 2008
Mar 11, 2008
862
863
864
865
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXBEML
Mar 14, 2008
Mar 14, 2008
866
static void emit_GLSL_TEXREG2AR(Context *ctx)
Mar 11, 2008
Mar 11, 2008
867
868
869
870
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXREG2AR
Mar 14, 2008
Mar 14, 2008
871
static void emit_GLSL_TEXREG2GB(Context *ctx)
Mar 11, 2008
Mar 11, 2008
872
873
874
875
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXREG2GB
Mar 14, 2008
Mar 14, 2008
876
static void emit_GLSL_TEXM3X2PAD(Context *ctx)
Mar 11, 2008
Mar 11, 2008
877
878
879
880
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXM3X2PAD
Mar 14, 2008
Mar 14, 2008
881
static void emit_GLSL_TEXM3X2TEX(Context *ctx)
Mar 11, 2008
Mar 11, 2008
882
883
884
885
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXM3X2TEX
Mar 14, 2008
Mar 14, 2008
886
static void emit_GLSL_TEXM3X3PAD(Context *ctx)
Mar 11, 2008
Mar 11, 2008
887
888
889
890
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXM3X3PAD
Mar 14, 2008
Mar 14, 2008
891
static void emit_GLSL_TEXM3X3TEX(Context *ctx)
Mar 11, 2008
Mar 11, 2008
892
893
894
895
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXM3X3TEX
Mar 14, 2008
Mar 14, 2008
896
static void emit_GLSL_TEXM3X3SPEC(Context *ctx)
Mar 11, 2008
Mar 11, 2008
897
898
899
900
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXM3X3SPEC
Mar 14, 2008
Mar 14, 2008
901
static void emit_GLSL_TEXM3X3VSPEC(Context *ctx)
Mar 11, 2008
Mar 11, 2008
902
903
904
905
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXM3X3VSPEC
Mar 14, 2008
Mar 14, 2008
906
static void emit_GLSL_EXPP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
907
908
909
910
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_EXPP
Mar 14, 2008
Mar 14, 2008
911
static void emit_GLSL_LOGP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
912
913
914
915
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_LOGP
Mar 14, 2008
Mar 14, 2008
916
static void emit_GLSL_CND(Context *ctx)
Mar 11, 2008
Mar 11, 2008
917
918
919
920
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_CND
Mar 14, 2008
Mar 14, 2008
921
static void emit_GLSL_DEF(Context *ctx)
Mar 11, 2008
Mar 11, 2008
922
923
924
925
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DEF
Mar 14, 2008
Mar 14, 2008
926
static void emit_GLSL_TEXREG2RGB(Context *ctx)
Mar 11, 2008
Mar 11, 2008
927
928
929
930
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXREG2RGB
Mar 14, 2008
Mar 14, 2008
931
static void emit_GLSL_TEXDP3TEX(Context *ctx)
Mar 11, 2008
Mar 11, 2008
932
933
934
935
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXDP3TEX
Mar 14, 2008
Mar 14, 2008
936
static void emit_GLSL_TEXM3X2DEPTH(Context *ctx)
Mar 11, 2008
Mar 11, 2008
937
938
939
940
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXM3X2DEPTH
Mar 14, 2008
Mar 14, 2008
941
static void emit_GLSL_TEXDP3(Context *ctx)
Mar 11, 2008
Mar 11, 2008
942
943
944
945
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXDP3
Mar 14, 2008
Mar 14, 2008
946
static void emit_GLSL_TEXM3X3(Context *ctx)
Mar 11, 2008
Mar 11, 2008
947
948
949
950
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXM3X3
Mar 14, 2008
Mar 14, 2008
951
static void emit_GLSL_TEXDEPTH(Context *ctx)
Mar 11, 2008
Mar 11, 2008
952
953
954
955
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXDEPTH
Mar 14, 2008
Mar 14, 2008
956
static void emit_GLSL_CMP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
957
958
959
960
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_CMP
Mar 14, 2008
Mar 14, 2008
961
static void emit_GLSL_BEM(Context *ctx)
Mar 11, 2008
Mar 11, 2008
962
963
964
965
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_BEM
Mar 14, 2008
Mar 14, 2008
966
static void emit_GLSL_DP2ADD(Context *ctx)
Mar 11, 2008
Mar 11, 2008
967
968
969
970
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DP2ADD
Mar 14, 2008
Mar 14, 2008
971
static void emit_GLSL_DSX(Context *ctx)
Mar 11, 2008
Mar 11, 2008
972
973
974
975
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DSX
Mar 14, 2008
Mar 14, 2008
976
static void emit_GLSL_DSY(Context *ctx)
Mar 11, 2008
Mar 11, 2008
977
978
979
980
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_DSY
Mar 14, 2008
Mar 14, 2008
981
static void emit_GLSL_TEXLDD(Context *ctx)
Mar 11, 2008
Mar 11, 2008
982
983
984
985
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXLDD
Mar 14, 2008
Mar 14, 2008
986
static void emit_GLSL_SETP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
987
988
989
990
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_SETP
Mar 14, 2008
Mar 14, 2008
991
static void emit_GLSL_TEXLDL(Context *ctx)
Mar 11, 2008
Mar 11, 2008
992
993
994
995
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_TEXLDL
Mar 14, 2008
Mar 14, 2008
996
static void emit_GLSL_BREAKP(Context *ctx)
Mar 11, 2008
Mar 11, 2008
997
998
999
1000
{
fail(ctx, "unimplemented."); // !!! FIXME
} // emit_GLSL_BREAKP