forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MojoShader.cs
3127 lines (2107 loc) · 80.8 KB
/
MojoShader.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
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
494
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
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Runtime.InteropServices;
namespace TwoMGFX
{
internal class MojoShader
{
#if OLD_CONTENT_PROCESSORS
const string mojoshader_dll = "libmojoshader_32.dll";
#else
const string mojoshader_dll = "libmojoshader_64.dll";
#endif
public partial class NativeConstants {
/// _INCL_MOJOSHADER_H_ ->
/// Error generating expression: Value cannot be null.
///Parameter name: node
public const string _INCL_MOJOSHADER_H_ = "";
/// _INCL_MOJOSHADER_VERSION_H_ ->
/// Error generating expression: Value cannot be null.
///Parameter name: node
public const string _INCL_MOJOSHADER_VERSION_H_ = "";
/// MOJOSHADER_VERSION -> 1111
public const int MOJOSHADER_VERSION = 1111;
/// MOJOSHADER_CHANGESET -> "hg-1111:91a6af79b5e4"
public const string MOJOSHADER_CHANGESET = "hg-1111:91a6af79b5e4";
/// MOJOSHADER_POSITION_NONE -> (-3)
public const int MOJOSHADER_POSITION_NONE = -3;
/// MOJOSHADER_POSITION_BEFORE -> (-2)
public const int MOJOSHADER_POSITION_BEFORE = -2;
/// MOJOSHADER_POSITION_AFTER -> (-1)
public const int MOJOSHADER_POSITION_AFTER = -1;
/// MOJOSHADER_PROFILE_D3D -> "d3d"
public const string MOJOSHADER_PROFILE_D3D = "d3d";
/// MOJOSHADER_PROFILE_BYTECODE -> "bytecode"
public const string MOJOSHADER_PROFILE_BYTECODE = "bytecode";
/// MOJOSHADER_PROFILE_GLSL -> "glsl"
public const string MOJOSHADER_PROFILE_GLSL = "glsl";
/// MOJOSHADER_PROFILE_GLSL120 -> "glsl120"
public const string MOJOSHADER_PROFILE_GLSL120 = "glsl120";
/// MOJOSHADER_PROFILE_ARB1 -> "arb1"
public const string MOJOSHADER_PROFILE_ARB1 = "arb1";
/// MOJOSHADER_PROFILE_NV2 -> "nv2"
public const string MOJOSHADER_PROFILE_NV2 = "nv2";
/// MOJOSHADER_PROFILE_NV3 -> "nv3"
public const string MOJOSHADER_PROFILE_NV3 = "nv3";
/// MOJOSHADER_PROFILE_NV4 -> "nv4"
public const string MOJOSHADER_PROFILE_NV4 = "nv4";
/// MOJOSHADER_SRC_PROFILE_HLSL_VS_1_1 -> "hlsl_vs_1_1"
public const string MOJOSHADER_SRC_PROFILE_HLSL_VS_1_1 = "hlsl_vs_1_1";
/// MOJOSHADER_SRC_PROFILE_HLSL_VS_2_0 -> "hlsl_vs_2_0"
public const string MOJOSHADER_SRC_PROFILE_HLSL_VS_2_0 = "hlsl_vs_2_0";
/// MOJOSHADER_SRC_PROFILE_HLSL_VS_3_0 -> "hlsl_vs_3_0"
public const string MOJOSHADER_SRC_PROFILE_HLSL_VS_3_0 = "hlsl_vs_3_0";
/// MOJOSHADER_SRC_PROFILE_HLSL_PS_1_1 -> "hlsl_ps_1_1"
public const string MOJOSHADER_SRC_PROFILE_HLSL_PS_1_1 = "hlsl_ps_1_1";
/// MOJOSHADER_SRC_PROFILE_HLSL_PS_1_2 -> "hlsl_ps_1_2"
public const string MOJOSHADER_SRC_PROFILE_HLSL_PS_1_2 = "hlsl_ps_1_2";
/// MOJOSHADER_SRC_PROFILE_HLSL_PS_1_3 -> "hlsl_ps_1_3"
public const string MOJOSHADER_SRC_PROFILE_HLSL_PS_1_3 = "hlsl_ps_1_3";
/// MOJOSHADER_SRC_PROFILE_HLSL_PS_1_4 -> "hlsl_ps_1_4"
public const string MOJOSHADER_SRC_PROFILE_HLSL_PS_1_4 = "hlsl_ps_1_4";
/// MOJOSHADER_SRC_PROFILE_HLSL_PS_2_0 -> "hlsl_ps_2_0"
public const string MOJOSHADER_SRC_PROFILE_HLSL_PS_2_0 = "hlsl_ps_2_0";
/// MOJOSHADER_SRC_PROFILE_HLSL_PS_3_0 -> "hlsl_ps_3_0"
public const string MOJOSHADER_SRC_PROFILE_HLSL_PS_3_0 = "hlsl_ps_3_0";
// MOJOSHADER_AST_DATATYPE_CONST -> (1 << 31)
public const int MOJOSHADER_AST_DATATYPE_CONST = (1) << (31);
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_uniform {
/// MOJOSHADER_uniformType->Anonymous_cf91fd71_65e4_4c31_a6d5_9488d7f3d32a
public MOJOSHADER_uniformType type;
/// int
public int index;
/// int
public int array_count;
/// int
public int constant;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string name;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_constant {
/// MOJOSHADER_uniformType->Anonymous_cf91fd71_65e4_4c31_a6d5_9488d7f3d32a
public MOJOSHADER_uniformType type;
/// int
public int index;
/// Anonymous_5371dd6a_e42a_47c1_91d1_a2af9a8283be
public Anonymous_5371dd6a_e42a_47c1_91d1_a2af9a8283be value;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_sampler {
/// MOJOSHADER_samplerType->Anonymous_a752a39b_b479_42b0_9502_e39ba7d86100
public MOJOSHADER_samplerType type;
/// int
public int index;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string name;
/// int
public int texbem;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_samplerMap {
/// int
public int index;
/// MOJOSHADER_samplerType->Anonymous_a752a39b_b479_42b0_9502_e39ba7d86100
public MOJOSHADER_samplerType type;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_attribute {
/// MOJOSHADER_usage->Anonymous_9c01433d_7bb5_4c50_bf77_e65cef0661b5
public MOJOSHADER_usage usage;
/// int
public int index;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string name;
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
public struct MOJOSHADER_swizzle {
/// MOJOSHADER_usage->Anonymous_9c01433d_7bb5_4c50_bf77_e65cef0661b5
public MOJOSHADER_usage usage;
/// unsigned int
public uint index;
/// unsigned char[4]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=4)]
public string swizzles;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_symbolTypeInfo {
/// MOJOSHADER_symbolClass->Anonymous_681c4b26_94f7_4142_a8e9_b970fe0b60df
public MOJOSHADER_symbolClass parameter_class;
/// MOJOSHADER_symbolType->Anonymous_d8534f21_7f44_465d_8843_40a435dbb54a
public MOJOSHADER_symbolType parameter_type;
/// unsigned int
public uint rows;
/// unsigned int
public uint columns;
/// unsigned int
public uint elements;
/// unsigned int
public uint member_count;
/// MOJOSHADER_symbolStructMember*
public IntPtr members;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_symbolStructMember {
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string name;
/// MOJOSHADER_symbolTypeInfo
public MOJOSHADER_symbolTypeInfo info;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_symbol {
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string name;
/// MOJOSHADER_symbolRegisterSet->Anonymous_9ff7ac54_131c_43b0_a295_9830d24ac76b
public MOJOSHADER_symbolRegisterSet register_set;
/// unsigned int
public uint register_index;
/// unsigned int
public uint register_count;
/// MOJOSHADER_symbolTypeInfo
public MOJOSHADER_symbolTypeInfo info;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_error {
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string error;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string filename;
/// int
public int error_position;
}
public enum MOJOSHADER_preshaderOpcode {
MOJOSHADER_PRESHADEROP_NOP,
MOJOSHADER_PRESHADEROP_MOV,
MOJOSHADER_PRESHADEROP_NEG,
MOJOSHADER_PRESHADEROP_RCP,
MOJOSHADER_PRESHADEROP_FRC,
MOJOSHADER_PRESHADEROP_EXP,
MOJOSHADER_PRESHADEROP_LOG,
MOJOSHADER_PRESHADEROP_RSQ,
MOJOSHADER_PRESHADEROP_SIN,
MOJOSHADER_PRESHADEROP_COS,
MOJOSHADER_PRESHADEROP_ASIN,
MOJOSHADER_PRESHADEROP_ACOS,
MOJOSHADER_PRESHADEROP_ATAN,
MOJOSHADER_PRESHADEROP_MIN,
MOJOSHADER_PRESHADEROP_MAX,
MOJOSHADER_PRESHADEROP_LT,
MOJOSHADER_PRESHADEROP_GE,
MOJOSHADER_PRESHADEROP_ADD,
MOJOSHADER_PRESHADEROP_MUL,
MOJOSHADER_PRESHADEROP_ATAN2,
MOJOSHADER_PRESHADEROP_DIV,
MOJOSHADER_PRESHADEROP_CMP,
MOJOSHADER_PRESHADEROP_MOVC,
MOJOSHADER_PRESHADEROP_DOT,
MOJOSHADER_PRESHADEROP_NOISE,
MOJOSHADER_PRESHADEROP_SCALAR_OPS,
/// MOJOSHADER_PRESHADEROP_MIN_SCALAR -> MOJOSHADER_PRESHADEROP_SCALAR_OPS
MOJOSHADER_PRESHADEROP_MIN_SCALAR = MOJOSHADER_preshaderOpcode.MOJOSHADER_PRESHADEROP_SCALAR_OPS,
MOJOSHADER_PRESHADEROP_MAX_SCALAR,
MOJOSHADER_PRESHADEROP_LT_SCALAR,
MOJOSHADER_PRESHADEROP_GE_SCALAR,
MOJOSHADER_PRESHADEROP_ADD_SCALAR,
MOJOSHADER_PRESHADEROP_MUL_SCALAR,
MOJOSHADER_PRESHADEROP_ATAN2_SCALAR,
MOJOSHADER_PRESHADEROP_DIV_SCALAR,
MOJOSHADER_PRESHADEROP_DOT_SCALAR,
MOJOSHADER_PRESHADEROP_NOISE_SCALAR,
}
public enum MOJOSHADER_preshaderOperandType {
/// MOJOSHADER_PRESHADEROPERAND_LITERAL -> 1
MOJOSHADER_PRESHADEROPERAND_LITERAL = 1,
/// MOJOSHADER_PRESHADEROPERAND_INPUT -> 2
MOJOSHADER_PRESHADEROPERAND_INPUT = 2,
/// MOJOSHADER_PRESHADEROPERAND_OUTPUT -> 4
MOJOSHADER_PRESHADEROPERAND_OUTPUT = 4,
/// MOJOSHADER_PRESHADEROPERAND_TEMP -> 7
MOJOSHADER_PRESHADEROPERAND_TEMP = 7,
/// MOJOSHADER_PRESHADEROPERAND_UNKN -> 0xff
MOJOSHADER_PRESHADEROPERAND_UNKN = 255,
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_preshaderOperand {
/// MOJOSHADER_preshaderOperandType
public MOJOSHADER_preshaderOperandType type;
/// unsigned int
public uint index;
/// int
public int indexingType;
/// unsigned int
public uint indexingIndex;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_preshaderInstruction {
/// MOJOSHADER_preshaderOpcode
public MOJOSHADER_preshaderOpcode opcode;
/// unsigned int
public uint element_count;
/// unsigned int
public uint operand_count;
/// MOJOSHADER_preshaderOperand[4]
[MarshalAs(UnmanagedType.ByValArray, SizeConst=4, ArraySubType=UnmanagedType.Struct)]
public MOJOSHADER_preshaderOperand[] operands;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_preshader {
/// unsigned int
public uint literal_count;
/// double*
public IntPtr literals;
/// unsigned int
public uint temp_count;
/// unsigned int
public uint symbol_count;
/// MOJOSHADER_symbol*
public IntPtr symbols;
/// unsigned int
public uint instruction_count;
/// MOJOSHADER_preshaderInstruction*
public IntPtr instructions;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_parseData {
/// int
public int error_count;
/// MOJOSHADER_error*
public IntPtr errors;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string profile;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string output;
/// int
public int output_len;
/// int
public int instruction_count;
/// MOJOSHADER_shaderType->Anonymous_96517ad6_cc69_4542_8537_054e63919d54
public MOJOSHADER_shaderType shader_type;
/// int
public int major_ver;
/// int
public int minor_ver;
/// int
public int uniform_count;
/// MOJOSHADER_uniform*
public IntPtr uniforms;
/// int
public int constant_count;
/// MOJOSHADER_constant*
public IntPtr constants;
/// int
public int sampler_count;
/// MOJOSHADER_sampler*
public IntPtr samplers;
/// int
public int attribute_count;
/// MOJOSHADER_attribute*
public IntPtr attributes;
/// int
public int output_count;
/// MOJOSHADER_attribute*
public IntPtr outputs;
/// int
public int swizzle_count;
/// MOJOSHADER_swizzle*
public IntPtr swizzles;
/// int
public int symbol_count;
/// MOJOSHADER_symbol*
public IntPtr symbols;
/// MOJOSHADER_preshader*
public IntPtr preshader;
/// MOJOSHADER_malloc
public IntPtr malloc;
/// MOJOSHADER_free
public IntPtr free;
/// void*
public IntPtr malloc_data;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_effectParam {
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string name;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string semantic;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_effectState {
/// unsigned int
public uint type;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_effectPass {
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string name;
/// unsigned int
public uint state_count;
/// MOJOSHADER_effectState*
public IntPtr states;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_effectTechnique {
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string name;
/// unsigned int
public uint pass_count;
/// MOJOSHADER_effectPass*
public IntPtr passes;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_effectTexture {
/// unsigned int
public uint param;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string name;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_effectShader {
/// unsigned int
public uint technique;
/// unsigned int
public uint pass;
/// MOJOSHADER_parseData*
public IntPtr shader;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_effect {
/// int
public int error_count;
/// MOJOSHADER_error*
public IntPtr errors;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string profile;
/// int
public int param_count;
/// MOJOSHADER_effectParam*
public IntPtr @params;
/// int
public int technique_count;
/// MOJOSHADER_effectTechnique*
public IntPtr techniques;
/// int
public int texture_count;
/// MOJOSHADER_effectTexture*
public IntPtr textures;
/// int
public int shader_count;
/// MOJOSHADER_effectShader*
public IntPtr shaders;
/// MOJOSHADER_malloc
public IntPtr malloc;
/// MOJOSHADER_free
public IntPtr free;
/// void*
public IntPtr malloc_data;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_preprocessorDefine {
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string identifier;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string definition;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_preprocessData {
/// int
public int error_count;
/// MOJOSHADER_error*
public IntPtr errors;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string output;
/// int
public int output_len;
/// MOJOSHADER_malloc
public IntPtr malloc;
/// MOJOSHADER_free
public IntPtr free;
/// void*
public IntPtr malloc_data;
}
/// Return Type: int
///inctype: MOJOSHADER_includeType->Anonymous_f1eed39d_7d1b_46d4_972e_a3229d15c26e
///fname: char*
///parent: char*
///outdata: char**
///outbytes: unsigned int*
///m: MOJOSHADER_malloc
///f: MOJOSHADER_free
///d: void*
public delegate int MOJOSHADER_includeOpen(MOJOSHADER_includeType inctype, [In()] [MarshalAs(UnmanagedType.LPStr)] string fname, [In()] [MarshalAs(UnmanagedType.LPStr)] string parent, ref IntPtr outdata, ref uint outbytes, IntPtr m, IntPtr f, IntPtr d);
/// Return Type: void
///data: char*
///m: MOJOSHADER_malloc
///f: MOJOSHADER_free
///d: void*
public delegate void MOJOSHADER_includeClose([In()] [MarshalAs(UnmanagedType.LPStr)] string data, IntPtr m, IntPtr f, IntPtr d);
public enum MOJOSHADER_astDataTypeType {
MOJOSHADER_AST_DATATYPE_NONE,
MOJOSHADER_AST_DATATYPE_BOOL,
MOJOSHADER_AST_DATATYPE_INT,
MOJOSHADER_AST_DATATYPE_UINT,
MOJOSHADER_AST_DATATYPE_FLOAT,
MOJOSHADER_AST_DATATYPE_FLOAT_SNORM,
MOJOSHADER_AST_DATATYPE_FLOAT_UNORM,
MOJOSHADER_AST_DATATYPE_HALF,
MOJOSHADER_AST_DATATYPE_DOUBLE,
MOJOSHADER_AST_DATATYPE_STRING,
MOJOSHADER_AST_DATATYPE_SAMPLER_1D,
MOJOSHADER_AST_DATATYPE_SAMPLER_2D,
MOJOSHADER_AST_DATATYPE_SAMPLER_3D,
MOJOSHADER_AST_DATATYPE_SAMPLER_CUBE,
MOJOSHADER_AST_DATATYPE_SAMPLER_STATE,
MOJOSHADER_AST_DATATYPE_SAMPLER_COMPARISON_STATE,
MOJOSHADER_AST_DATATYPE_STRUCT,
MOJOSHADER_AST_DATATYPE_ARRAY,
MOJOSHADER_AST_DATATYPE_VECTOR,
MOJOSHADER_AST_DATATYPE_MATRIX,
MOJOSHADER_AST_DATATYPE_BUFFER,
MOJOSHADER_AST_DATATYPE_FUNCTION,
MOJOSHADER_AST_DATATYPE_USER,
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_astDataTypeStructMember {
/// MOJOSHADER_astDataType*
public IntPtr datatype;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public string identifier;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_astDataTypeStruct {
/// MOJOSHADER_astDataTypeType
public MOJOSHADER_astDataTypeType type;
/// MOJOSHADER_astDataTypeStructMember*
public IntPtr members;
/// int
public int member_count;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_astDataTypeArray {
/// MOJOSHADER_astDataTypeType
public MOJOSHADER_astDataTypeType type;
/// MOJOSHADER_astDataType*
public IntPtr @base;
/// int
public int elements;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_astDataTypeMatrix {
/// MOJOSHADER_astDataTypeType
public MOJOSHADER_astDataTypeType type;
/// MOJOSHADER_astDataType*
public IntPtr @base;
/// int
public int rows;
/// int
public int columns;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_astDataTypeBuffer {
/// MOJOSHADER_astDataTypeType
public MOJOSHADER_astDataTypeType type;
/// MOJOSHADER_astDataType*
public IntPtr @base;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_astDataTypeFunction {
/// MOJOSHADER_astDataTypeType
public MOJOSHADER_astDataTypeType type;
/// MOJOSHADER_astDataType*
public IntPtr retval;
/// MOJOSHADER_astDataType**
public IntPtr @params;
/// int
public int num_params;
/// int
public int intrinsic;
}
[StructLayout(LayoutKind.Sequential)]
public struct MOJOSHADER_astDataTypeUser {
/// MOJOSHADER_astDataTypeType
public MOJOSHADER_astDataTypeType type;
/// MOJOSHADER_astDataType*
public IntPtr details;
/// char*
public IntPtr name;
}
[StructLayout(LayoutKind.Explicit)]
public struct MOJOSHADER_astDataType {
/// MOJOSHADER_astDataTypeType
[FieldOffset(0)]
public MOJOSHADER_astDataTypeType type;
/// MOJOSHADER_astDataTypeArray
[FieldOffset(0)]
public MOJOSHADER_astDataTypeArray array;
/// MOJOSHADER_astDataTypeStruct
[FieldOffset(0)]
public MOJOSHADER_astDataTypeStruct structure;
/// MOJOSHADER_astDataTypeVector->MOJOSHADER_astDataTypeArray
[FieldOffset(0)]
public MOJOSHADER_astDataTypeArray vector;
/// MOJOSHADER_astDataTypeMatrix
[FieldOffset(0)]
public MOJOSHADER_astDataTypeMatrix matrix;
/// MOJOSHADER_astDataTypeBuffer
[FieldOffset(0)]
public MOJOSHADER_astDataTypeBuffer buffer;
/// MOJOSHADER_astDataTypeUser
[FieldOffset(0)]
public MOJOSHADER_astDataTypeUser user;
/// MOJOSHADER_astDataTypeFunction
[FieldOffset(0)]
public MOJOSHADER_astDataTypeFunction function;
}
public enum MOJOSHADER_astNodeType {
MOJOSHADER_AST_OP_START_RANGE,
MOJOSHADER_AST_OP_START_RANGE_UNARY,
MOJOSHADER_AST_OP_PREINCREMENT,
MOJOSHADER_AST_OP_PREDECREMENT,
MOJOSHADER_AST_OP_NEGATE,
MOJOSHADER_AST_OP_COMPLEMENT,
MOJOSHADER_AST_OP_NOT,
MOJOSHADER_AST_OP_POSTINCREMENT,
MOJOSHADER_AST_OP_POSTDECREMENT,
MOJOSHADER_AST_OP_CAST,
MOJOSHADER_AST_OP_END_RANGE_UNARY,
MOJOSHADER_AST_OP_START_RANGE_BINARY,
MOJOSHADER_AST_OP_COMMA,
MOJOSHADER_AST_OP_MULTIPLY,
MOJOSHADER_AST_OP_DIVIDE,
MOJOSHADER_AST_OP_MODULO,
MOJOSHADER_AST_OP_ADD,
MOJOSHADER_AST_OP_SUBTRACT,
MOJOSHADER_AST_OP_LSHIFT,
MOJOSHADER_AST_OP_RSHIFT,
MOJOSHADER_AST_OP_LESSTHAN,
MOJOSHADER_AST_OP_GREATERTHAN,
MOJOSHADER_AST_OP_LESSTHANOREQUAL,
MOJOSHADER_AST_OP_GREATERTHANOREQUAL,
MOJOSHADER_AST_OP_EQUAL,
MOJOSHADER_AST_OP_NOTEQUAL,
MOJOSHADER_AST_OP_BINARYAND,
MOJOSHADER_AST_OP_BINARYXOR,
MOJOSHADER_AST_OP_BINARYOR,
MOJOSHADER_AST_OP_LOGICALAND,
MOJOSHADER_AST_OP_LOGICALOR,
MOJOSHADER_AST_OP_ASSIGN,
MOJOSHADER_AST_OP_MULASSIGN,
MOJOSHADER_AST_OP_DIVASSIGN,
MOJOSHADER_AST_OP_MODASSIGN,
MOJOSHADER_AST_OP_ADDASSIGN,
MOJOSHADER_AST_OP_SUBASSIGN,
MOJOSHADER_AST_OP_LSHIFTASSIGN,
MOJOSHADER_AST_OP_RSHIFTASSIGN,
MOJOSHADER_AST_OP_ANDASSIGN,
MOJOSHADER_AST_OP_XORASSIGN,
MOJOSHADER_AST_OP_ORASSIGN,
MOJOSHADER_AST_OP_DEREF_ARRAY,
MOJOSHADER_AST_OP_END_RANGE_BINARY,
MOJOSHADER_AST_OP_START_RANGE_TERNARY,
MOJOSHADER_AST_OP_CONDITIONAL,
MOJOSHADER_AST_OP_END_RANGE_TERNARY,
MOJOSHADER_AST_OP_START_RANGE_DATA,
MOJOSHADER_AST_OP_IDENTIFIER,
MOJOSHADER_AST_OP_INT_LITERAL,
MOJOSHADER_AST_OP_FLOAT_LITERAL,
MOJOSHADER_AST_OP_STRING_LITERAL,
MOJOSHADER_AST_OP_BOOLEAN_LITERAL,
MOJOSHADER_AST_OP_END_RANGE_DATA,
MOJOSHADER_AST_OP_START_RANGE_MISC,
MOJOSHADER_AST_OP_DEREF_STRUCT,
MOJOSHADER_AST_OP_CALLFUNC,
MOJOSHADER_AST_OP_CONSTRUCTOR,
MOJOSHADER_AST_OP_END_RANGE_MISC,
MOJOSHADER_AST_OP_END_RANGE,
MOJOSHADER_AST_COMPUNIT_START_RANGE,
MOJOSHADER_AST_COMPUNIT_FUNCTION,
MOJOSHADER_AST_COMPUNIT_TYPEDEF,
MOJOSHADER_AST_COMPUNIT_STRUCT,
MOJOSHADER_AST_COMPUNIT_VARIABLE,
MOJOSHADER_AST_COMPUNIT_END_RANGE,
MOJOSHADER_AST_STATEMENT_START_RANGE,
MOJOSHADER_AST_STATEMENT_EMPTY,
MOJOSHADER_AST_STATEMENT_BREAK,
MOJOSHADER_AST_STATEMENT_CONTINUE,
MOJOSHADER_AST_STATEMENT_DISCARD,
MOJOSHADER_AST_STATEMENT_BLOCK,
MOJOSHADER_AST_STATEMENT_EXPRESSION,
MOJOSHADER_AST_STATEMENT_IF,
MOJOSHADER_AST_STATEMENT_SWITCH,
MOJOSHADER_AST_STATEMENT_FOR,