-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.d
3598 lines (3272 loc) · 138 KB
/
package.d
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
/+
+ ┌==============================┐
+ │ AUTO GENERATED! DO NOT EDIT! │
+ └==============================┘
+/
module bgfx;
import bindbc.bgfx.config;
import bindbc.common.types: c_int64, c_uint64, va_list;
static import bgfx.fakeenum;
enum uint apiVersion = 127;
alias ViewID = ushort;
enum invalidHandle(T) = T(ushort.max);
alias ReleaseFn = void function(void* ptr, void* userData);
///Memory release callback.
///Color RGB/alpha/depth write. When it's not specified write will be disabled.
alias StateWrite_ = ulong;
enum StateWrite: StateWrite_{
r = 0x0000_0000_0000_0001, ///Enable R write.
g = 0x0000_0000_0000_0002, ///Enable G write.
b = 0x0000_0000_0000_0004, ///Enable B write.
a = 0x0000_0000_0000_0008, ///Enable alpha write.
z = 0x0000_0040_0000_0000, ///Enable depth write.
rgb = 0x0000_0000_0000_0007, ///Enable RGB write.
mask = 0x0000_0040_0000_000F, ///Write all channels mask.
}
///Depth test state. When `BGFX_STATE_DEPTH_` is not specified depth test will be disabled.
alias StateDepthTest_ = ulong;
enum StateDepthTest: StateDepthTest_{
less = 0x0000_0000_0000_0010, ///Enable depth test, less.
lEqual = 0x0000_0000_0000_0020, ///Enable depth test, less or equal.
equal = 0x0000_0000_0000_0030, ///Enable depth test, equal.
gEqual = 0x0000_0000_0000_0040, ///Enable depth test, greater or equal.
greater = 0x0000_0000_0000_0050, ///Enable depth test, greater.
notEqual = 0x0000_0000_0000_0060, ///Enable depth test, not equal.
never = 0x0000_0000_0000_0070, ///Enable depth test, never.
always = 0x0000_0000_0000_0080, ///Enable depth test, always.
shift = 4, ///Depth test state bit shift
mask = 0x0000_0000_0000_00F0, ///Depth test state bit mask
}
/**
Use BGFX_STATE_BLEND_FUNC(_src, _dst) or BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)
helper macros.
*/
alias StateBlend_ = ulong;
enum StateBlend: StateBlend_{
zero = 0x0000_0000_0000_1000, ///0, 0, 0, 0
one = 0x0000_0000_0000_2000, ///1, 1, 1, 1
srcColor = 0x0000_0000_0000_3000, ///Rs, Gs, Bs, As
srcColour = srcColor,
invSrcColor = 0x0000_0000_0000_4000, ///1-Rs, 1-Gs, 1-Bs, 1-As
invSrcColour = invSrcColor,
srcAlpha = 0x0000_0000_0000_5000, ///As, As, As, As
invSrcAlpha = 0x0000_0000_0000_6000, ///1-As, 1-As, 1-As, 1-As
dstAlpha = 0x0000_0000_0000_7000, ///Ad, Ad, Ad, Ad
invDstAlpha = 0x0000_0000_0000_8000, ///1-Ad, 1-Ad, 1-Ad ,1-Ad
dstColor = 0x0000_0000_0000_9000, ///Rd, Gd, Bd, Ad
dstColour = dstColor,
invDstColor = 0x0000_0000_0000_A000, ///1-Rd, 1-Gd, 1-Bd, 1-Ad
invDstColour = invDstColor,
srcAlphaSat = 0x0000_0000_0000_B000, ///f, f, f, 1; f = min(As, 1-Ad)
factor = 0x0000_0000_0000_C000, ///Blend factor
invFactor = 0x0000_0000_0000_D000, ///1-Blend factor
shift = 12, ///Blend state bit shift
mask = 0x0000_0000_0FFF_F000, ///Blend state bit mask
}
/**
Use BGFX_STATE_BLEND_EQUATION(_equation) or BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)
helper macros.
*/
alias StateBlendEquation_ = ulong;
enum StateBlendEquation: StateBlendEquation_{
add = 0x0000_0000_0000_0000, ///Blend add: src + dst.
sub = 0x0000_0000_1000_0000, ///Blend subtract: src - dst.
revSub = 0x0000_0000_2000_0000, ///Blend reverse subtract: dst - src.
min = 0x0000_0000_3000_0000, ///Blend min: min(src, dst).
max = 0x0000_0000_4000_0000, ///Blend max: max(src, dst).
shift = 28, ///Blend equation bit shift
mask = 0x0000_0003_F000_0000, ///Blend equation bit mask
}
///Cull state. When `BGFX_STATE_CULL_*` is not specified culling will be disabled.
alias StateCull_ = ulong;
enum StateCull: StateCull_{
cw = 0x0000_0010_0000_0000, ///Cull clockwise triangles.
ccw = 0x0000_0020_0000_0000, ///Cull counter-clockwise triangles.
acw = ccw,
shift = 36, ///Culling mode bit shift
mask = 0x0000_0030_0000_0000, ///Culling mode bit mask
}
///Alpha reference value.
alias StateAlphaRef_ = ulong;
enum StateAlphaRef: StateAlphaRef_{
shift = 40, ///Alpha reference bit shift
mask = 0x0000_FF00_0000_0000, ///Alpha reference bit mask
}
StateAlphaRef_ toStateAlphaRef(ulong v) nothrow @nogc pure @safe{ return (v << StateAlphaRef.shift) & StateAlphaRef.mask; }
alias StatePT_ = ulong;
enum StatePT: StatePT_{
triStrip = 0x0001_0000_0000_0000, ///Tristrip.
lines = 0x0002_0000_0000_0000, ///Lines.
lineStrip = 0x0003_0000_0000_0000, ///Line strip.
points = 0x0004_0000_0000_0000, ///Points.
shift = 48, ///Primitive type bit shift
mask = 0x0007_0000_0000_0000, ///Primitive type bit mask
}
///Point size value.
alias StatePointSize_ = ulong;
enum StatePointSize: StatePointSize_{
shift = 52, ///Point size bit shift
mask = 0x00F0_0000_0000_0000, ///Point size bit mask
}
StatePointSize_ toStatePointSize(ulong v) nothrow @nogc pure @safe{ return (v << StatePointSize.shift) & StatePointSize.mask; }
/**
Enable MSAA write when writing into MSAA frame buffer.
This flag is ignored when not writing into MSAA frame buffer.
*/
alias State_ = ulong;
enum State: State_{
msaa = 0x0100_0000_0000_0000, ///Enable MSAA rasterization.
lineAA = 0x0200_0000_0000_0000, ///Enable line AA rasterization.
conservativeRaster = 0x0400_0000_0000_0000, ///Enable conservative rasterization.
none = 0x0000_0000_0000_0000, ///No state.
frontCCW = 0x0000_0080_0000_0000, ///Front counter-clockwise (default is clockwise).
frontACW = frontCCW,
blendIndependent = 0x0000_0004_0000_0000, ///Enable blend independent.
blendAlphaToCoverage = 0x0000_0008_0000_0000, ///Enable alpha to coverage.
/**
Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).
*/
default_ = StateWrite.rgb | StateWrite.a | StateWrite.z | StateDepthTest.less | StateCull.cw | State.msaa,
mask = 0xFFFF_FFFF_FFFF_FFFF, ///State bit mask
}
///Do not use!
alias StateReserved_ = ulong;
enum StateReserved: StateReserved_{
shift = 61,
mask = 0xE000_0000_0000_0000,
}
///Set stencil ref value.
alias StencilFuncRef_ = uint;
enum StencilFuncRef: StencilFuncRef_{
shift = 0,
mask = 0x0000_00FF,
}
StencilFuncRef_ toStencilFuncRef(uint v) nothrow @nogc pure @safe{ return (v << StencilFuncRef.shift) & StencilFuncRef.mask; }
///Set stencil rmask value.
alias StencilFuncRMask_ = uint;
enum StencilFuncRMask: StencilFuncRMask_{
shift = 8,
mask = 0x0000_FF00,
}
StencilFuncRMask_ toStencilFuncRMask(uint v) nothrow @nogc pure @safe{ return (v << StencilFuncRMask.shift) & StencilFuncRMask.mask; }
deprecated("Please use `StencilFuncRMask_` instead. To be removed in v1.5.0.")
alias StencilFuncRmask_ = StencilFuncRMask_;
deprecated("Please use `StencilFuncRMask` instead. To be removed in v1.5.0.")
alias StencilFuncRmask = StencilFuncRMask;
deprecated("Please use `toStencilFuncRMask` instead. To be removed in v1.5.0.")
alias toStencilFuncRmask = toStencilFuncRMask;
alias Stencil_ = uint;
enum Stencil: Stencil_{
none = 0x0000_0000,
mask = 0xFFFF_FFFF,
default_ = 0x0000_0000,
}
alias StencilTest_ = uint;
enum StencilTest: StencilTest_{
less = 0x0001_0000, ///Enable stencil test, less.
lEqual = 0x0002_0000, ///Enable stencil test, less or equal.
equal = 0x0003_0000, ///Enable stencil test, equal.
gEqual = 0x0004_0000, ///Enable stencil test, greater or equal.
greater = 0x0005_0000, ///Enable stencil test, greater.
notEqual = 0x0006_0000, ///Enable stencil test, not equal.
never = 0x0007_0000, ///Enable stencil test, never.
always = 0x0008_0000, ///Enable stencil test, always.
shift = 16, ///Stencil test bit shift
mask = 0x000F_0000, ///Stencil test bit mask
}
alias StencilOpFailS_ = uint;
enum StencilOpFailS: StencilOpFailS_{
zero = 0x0000_0000, ///Zero.
keep = 0x0010_0000, ///Keep.
replace = 0x0020_0000, ///Replace.
incr = 0x0030_0000, ///Increment and wrap.
incrSat = 0x0040_0000, ///Increment and clamp.
decr = 0x0050_0000, ///Decrement and wrap.
decrSat = 0x0060_0000, ///Decrement and clamp.
invert = 0x0070_0000, ///Invert.
shift = 20, ///Stencil operation fail bit shift
mask = 0x00F0_0000, ///Stencil operation fail bit mask
}
alias StencilOpFailZ_ = uint;
enum StencilOpFailZ: StencilOpFailZ_{
zero = 0x0000_0000, ///Zero.
keep = 0x0100_0000, ///Keep.
replace = 0x0200_0000, ///Replace.
incr = 0x0300_0000, ///Increment and wrap.
incrSat = 0x0400_0000, ///Increment and clamp.
decr = 0x0500_0000, ///Decrement and wrap.
decrSat = 0x0600_0000, ///Decrement and clamp.
invert = 0x0700_0000, ///Invert.
shift = 24, ///Stencil operation depth fail bit shift
mask = 0x0F00_0000, ///Stencil operation depth fail bit mask
}
alias StencilOpPassZ_ = uint;
enum StencilOpPassZ: StencilOpPassZ_{
zero = 0x0000_0000, ///Zero.
keep = 0x1000_0000, ///Keep.
replace = 0x2000_0000, ///Replace.
incr = 0x3000_0000, ///Increment and wrap.
incrSat = 0x4000_0000, ///Increment and clamp.
decr = 0x5000_0000, ///Decrement and wrap.
decrSat = 0x6000_0000, ///Decrement and clamp.
invert = 0x7000_0000, ///Invert.
shift = 28, ///Stencil operation depth pass bit shift
mask = 0xF000_0000, ///Stencil operation depth pass bit mask
}
alias Clear_ = ushort;
enum Clear: Clear_{
none = 0x0000, ///No clear flags.
color = 0x0001, ///Clear color.
colour = color,
depth = 0x0002, ///Clear depth.
stencil = 0x0004, ///Clear stencil.
discardColor0 = 0x0008, ///Discard frame buffer attachment 0.
discardColour0 = discardColor0,
discardColor1 = 0x0010, ///Discard frame buffer attachment 1.
discardColour1 = discardColor1,
discardColor2 = 0x0020, ///Discard frame buffer attachment 2.
discardColour2 = discardColor2,
discardColor3 = 0x0040, ///Discard frame buffer attachment 3.
discardColour3 = discardColor3,
discardColor4 = 0x0080, ///Discard frame buffer attachment 4.
discardColour4 = discardColor4,
discardColor5 = 0x0100, ///Discard frame buffer attachment 5.
discardColour5 = discardColor5,
discardColor6 = 0x0200, ///Discard frame buffer attachment 6.
discardColour6 = discardColor6,
discardColor7 = 0x0400, ///Discard frame buffer attachment 7.
discardColour7 = discardColor7,
discardDepth = 0x0800, ///Discard frame buffer depth attachment.
discardStencil = 0x1000, ///Discard frame buffer stencil attachment.
discardColorMask = 0x07F8,
discardColourMask = discardColorMask,
discardMask = 0x1FF8,
}
/**
Rendering state discard. When state is preserved in submit, rendering states can be discarded
on a finer grain.
*/
alias Discard_ = ubyte;
enum Discard: Discard_{
none = 0x00, ///Preserve everything.
bindings = 0x01, ///Discard texture sampler and buffer bindings.
indexBuffer = 0x02, ///Discard index buffer.
instanceData = 0x04, ///Discard instance data.
state = 0x08, ///Discard state and uniform bindings.
transform = 0x10, ///Discard transform.
vertexStreams = 0x20, ///Discard vertex streams.
all = 0xFF, ///Discard all states.
}
alias Debug_ = uint;
enum Debug: Debug_{
none = 0x0000_0000, ///No debug.
wireframe = 0x0000_0001, ///Enable wireframe for all primitives.
/**
Enable infinitely fast hardware test. No draw calls will be submitted to driver.
It's useful when profiling to quickly assess bottleneck between CPU and GPU.
*/
ifh = 0x0000_0002,
stats = 0x0000_0004, ///Enable statistics display.
text = 0x0000_0008, ///Enable debug text display.
profiler = 0x0000_0010, ///Enable profiler. This causes per-view statistics to be collected, available through `bgfx::Stats::ViewStats`. This is unrelated to the profiler functions in `bgfx::CallbackI`.
}
alias BufferComputeFormat_ = ushort;
enum BufferComputeFormat: BufferComputeFormat_{
_8x1 = 0x0001, ///1 8-bit value
_8x2 = 0x0002, ///2 8-bit values
_8x4 = 0x0003, ///4 8-bit values
_16x1 = 0x0004, ///1 16-bit value
_16x2 = 0x0005, ///2 16-bit values
_16x4 = 0x0006, ///4 16-bit values
_32x1 = 0x0007, ///1 32-bit value
_32x2 = 0x0008, ///2 32-bit values
_32x4 = 0x0009, ///4 32-bit values
shift = 0,
mask = 0x000F,
}
alias BufferComputeType_ = ushort;
enum BufferComputeType: BufferComputeType_{
int_ = 0x0010, ///Type `int`.
uint_ = 0x0020, ///Type `uint`.
float_ = 0x0030, ///Type `float`.
shift = 4,
mask = 0x0030,
}
alias Buffer_ = ushort;
enum Buffer: Buffer_{
none = 0x0000,
computeRead = 0x0100, ///Buffer will be read by shader.
computeWrite = 0x0200, ///Buffer will be used for writing.
drawIndirect = 0x0400, ///Buffer will be used for storing draw indirect commands.
allowResize = 0x0800, ///Allow dynamic index/vertex buffer resize during update.
index32 = 0x1000, ///Index buffer contains 32-bit indices.
computeReadWrite = 0x0300,
}
alias Texture_ = ulong;
enum Texture: Texture_{
none = 0x0000_0000_0000_0000,
msaaSample = 0x0000_0008_0000_0000, ///Texture will be used for MSAA sampling.
rt = 0x0000_0010_0000_0000, ///Render target no MSAA.
computeWrite = 0x0000_1000_0000_0000, ///Texture will be used for compute write.
srgb = 0x0000_2000_0000_0000, ///Sample texture as sRGB.
blitDst = 0x0000_4000_0000_0000, ///Texture will be used as blit destination.
readBack = 0x0000_8000_0000_0000, ///Texture will be used for read back from GPU.
}
alias TextureRTMSAA_ = ulong;
enum TextureRTMSAA: TextureRTMSAA_{
x2 = 0x0000_0020_0000_0000, ///Render target MSAAx2 mode.
x4 = 0x0000_0030_0000_0000, ///Render target MSAAx4 mode.
x8 = 0x0000_0040_0000_0000, ///Render target MSAAx8 mode.
x16 = 0x0000_0050_0000_0000, ///Render target MSAAx16 mode.
shift = 36,
mask = 0x0000_0070_0000_0000,
}
alias TextureRT_ = ulong;
enum TextureRT: TextureRT_{
writeOnly = 0x0000_0080_0000_0000, ///Render target will be used for writing
shift = 36,
mask = 0x0000_00F0_0000_0000,
}
///Sampler flags.
alias SamplerU_ = uint;
enum SamplerU: SamplerU_{
mirror = 0x0000_0001, ///Wrap U mode: Mirror
clamp = 0x0000_0002, ///Wrap U mode: Clamp
border = 0x0000_0003, ///Wrap U mode: Border
shift = 0,
mask = 0x0000_0003,
}
alias SamplerV_ = uint;
enum SamplerV: SamplerV_{
mirror = 0x0000_0004, ///Wrap V mode: Mirror
clamp = 0x0000_0008, ///Wrap V mode: Clamp
border = 0x0000_000C, ///Wrap V mode: Border
shift = 2,
mask = 0x0000_000C,
}
alias SamplerW_ = uint;
enum SamplerW: SamplerW_{
mirror = 0x0000_0010, ///Wrap W mode: Mirror
clamp = 0x0000_0020, ///Wrap W mode: Clamp
border = 0x0000_0030, ///Wrap W mode: Border
shift = 4,
mask = 0x0000_0030,
}
alias SamplerMin_ = uint;
enum SamplerMin: SamplerMin_{
point = 0x0000_0040, ///Min sampling mode: Point
anisotropic = 0x0000_0080, ///Min sampling mode: Anisotropic
shift = 6,
mask = 0x0000_00C0,
}
alias SamplerMag_ = uint;
enum SamplerMag: SamplerMag_{
point = 0x0000_0100, ///Mag sampling mode: Point
anisotropic = 0x0000_0200, ///Mag sampling mode: Anisotropic
shift = 8,
mask = 0x0000_0300,
}
alias SamplerMIP_ = uint;
enum SamplerMIP: SamplerMIP_{
point = 0x0000_0400, ///Mip sampling mode: Point
shift = 10,
mask = 0x0000_0400,
}
alias SamplerCompare_ = uint;
enum SamplerCompare: SamplerCompare_{
less = 0x0001_0000, ///Compare when sampling depth texture: less.
lEqual = 0x0002_0000, ///Compare when sampling depth texture: less or equal.
equal = 0x0003_0000, ///Compare when sampling depth texture: equal.
gEqual = 0x0004_0000, ///Compare when sampling depth texture: greater or equal.
greater = 0x0005_0000, ///Compare when sampling depth texture: greater.
notEqual = 0x0006_0000, ///Compare when sampling depth texture: not equal.
never = 0x0007_0000, ///Compare when sampling depth texture: never.
always = 0x0008_0000, ///Compare when sampling depth texture: always.
shift = 16,
mask = 0x000F_0000,
}
alias SamplerBorderColor_ = uint;
enum SamplerBorderColor: SamplerBorderColor_{
shift = 24,
mask = 0x0F00_0000,
}
alias SamplerBorderColour = SamplerBorderColor;
SamplerBorderColor_ toSamplerBorderColor(uint v) nothrow @nogc pure @safe{ return (v << SamplerBorderColor.shift) & SamplerBorderColor.mask; }
alias toSamplerBorderColour = toSamplerBorderColor;
alias SamplerReserved_ = uint;
enum SamplerReserved: SamplerReserved_{
shift = 28,
mask = 0xF000_0000,
}
alias Sampler_ = uint;
enum Sampler: Sampler_{
none = 0x0000_0000,
sampleStencil = 0x0010_0000, ///Sample stencil instead of depth.
point = SamplerMin.point | SamplerMag.point | SamplerMIP.point,
uvwMirror = SamplerU.mirror | SamplerV.mirror | SamplerW.mirror,
uvwClamp = SamplerU.clamp | SamplerV.clamp | SamplerW.clamp,
uvwBorder = SamplerU.border | SamplerV.border | SamplerW.border,
bitsMask = SamplerU.mask | SamplerV.mask | SamplerW.mask | SamplerMin.mask | SamplerMag.mask | SamplerMIP.mask | SamplerCompare.mask,
}
alias ResetMSAA_ = uint;
enum ResetMSAA: ResetMSAA_{
x2 = 0x0000_0010, ///Enable 2x MSAA.
x4 = 0x0000_0020, ///Enable 4x MSAA.
x8 = 0x0000_0030, ///Enable 8x MSAA.
x16 = 0x0000_0040, ///Enable 16x MSAA.
shift = 4,
mask = 0x0000_0070,
}
alias Reset_ = uint;
enum Reset: Reset_{
none = 0x0000_0000, ///No reset flags.
fullscreen = 0x0000_0001, ///Not supported yet.
vsync = 0x0000_0080, ///Enable V-Sync.
maxAnisotropy = 0x0000_0100, ///Turn on/off max anisotropy.
capture = 0x0000_0200, ///Begin screen capture.
flushAfterRender = 0x0000_2000, ///Flush rendering after submitting to GPU.
/**
This flag specifies where flip occurs. Default behaviour is that flip occurs
before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
*/
flipAfterRender = 0x0000_4000,
srgbBackbuffer = 0x0000_8000, ///Enable sRGB backbuffer.
hdr10 = 0x0001_0000, ///Enable HDR10 rendering.
hiDPI = 0x0002_0000, ///Enable HiDPI rendering.
depthClamp = 0x0004_0000, ///Enable depth clamp.
suspend = 0x0008_0000, ///Suspend rendering.
transparentBackbuffer = 0x0010_0000, ///Transparent backbuffer. Availability depends on: `BGFX_CAPS_TRANSPARENT_BACKBUFFER`.
}
alias ResetFullscreen_ = uint;
enum ResetFullscreen: ResetFullscreen_{
shift = 0,
mask = 0x0000_0001,
}
alias ResetReserved_ = uint;
enum ResetReserved: ResetReserved_{
shift = 31, ///Internal bit shift
mask = 0x8000_0000, ///Internal bit mask
}
alias CapFlags_ = ulong;
enum CapFlags: CapFlags_{
alphaToCoverage = 0x0000_0000_0000_0001, ///Alpha to coverage is supported.
blendIndependent = 0x0000_0000_0000_0002, ///Blend independent is supported.
compute = 0x0000_0000_0000_0004, ///Compute shaders are supported.
conservativeRaster = 0x0000_0000_0000_0008, ///Conservative rasterization is supported.
drawIndirect = 0x0000_0000_0000_0010, ///Draw indirect is supported.
fragmentDepth = 0x0000_0000_0000_0020, ///Fragment depth is available in fragment shader.
fragmentOrdering = 0x0000_0000_0000_0040, ///Fragment ordering is available in fragment shader.
graphicsDebugger = 0x0000_0000_0000_0080, ///Graphics debugger is present.
hdr10 = 0x0000_0000_0000_0100, ///HDR10 rendering is supported.
hiDPI = 0x0000_0000_0000_0200, ///HiDPI rendering is supported.
imageRW = 0x0000_0000_0000_0400, ///Image Read/Write is supported.
index32 = 0x0000_0000_0000_0800, ///32-bit indices are supported.
instancing = 0x0000_0000_0000_1000, ///Instancing is supported.
occlusionQuery = 0x0000_0000_0000_2000, ///Occlusion query is supported.
rendererMultithreaded = 0x0000_0000_0000_4000, ///Renderer is on separate thread.
swapChain = 0x0000_0000_0000_8000, ///Multiple windows are supported.
texture2DArray = 0x0000_0000_0001_0000, ///2D texture array is supported.
texture3D = 0x0000_0000_0002_0000, ///3D textures are supported.
textureBlit = 0x0000_0000_0004_0000, ///Texture blit is supported.
transparentBackbuffer = 0x0000_0000_0008_0000, ///Transparent back buffer supported.
textureCompareReserved = 0x0000_0000_0010_0000,
textureCompareLEqual = 0x0000_0000_0020_0000, ///Texture compare less equal mode is supported.
textureCubeArray = 0x0000_0000_0040_0000, ///Cubemap texture array is supported.
textureDirectAccess = 0x0000_0000_0080_0000, ///CPU direct access to GPU texture memory.
textureReadBack = 0x0000_0000_0100_0000, ///Read-back texture is supported.
vertexAttribHalf = 0x0000_0000_0200_0000, ///Vertex attribute half-float is supported.
vertexAttribUint10 = 0x0000_0000_0400_0000, ///Vertex attribute 10_10_10_2 is supported.
vertexID = 0x0000_0000_0800_0000, ///Rendering with VertexID only is supported.
primitiveID = 0x0000_0000_1000_0000, ///PrimitiveID is available in fragment shader.
viewportLayerArray = 0x0000_0000_2000_0000, ///Viewport layer is available in vertex shader.
drawIndirectCount = 0x0000_0000_4000_0000, ///Draw indirect with indirect count is supported.
textureCompareAll = 0x0000_0000_0030_0000, ///All texture compare modes are supported.
}
alias CapsFormat_ = uint;
enum CapsFormat: CapsFormat_{
textureNone = 0x0000_0000, ///Texture format is not supported.
texture2D = 0x0000_0001, ///Texture format is supported.
texture2DSRGB = 0x0000_0002, ///Texture as sRGB format is supported.
texture2DEmulated = 0x0000_0004, ///Texture format is emulated.
texture3D = 0x0000_0008, ///Texture format is supported.
texture3DSRGB = 0x0000_0010, ///Texture as sRGB format is supported.
texture3DEmulated = 0x0000_0020, ///Texture format is emulated.
textureCube = 0x0000_0040, ///Texture format is supported.
textureCubeSRGB = 0x0000_0080, ///Texture as sRGB format is supported.
textureCubeEmulated = 0x0000_0100, ///Texture format is emulated.
textureVertex = 0x0000_0200, ///Texture format can be used from vertex shader.
textureImageRead = 0x0000_0400, ///Texture format can be used as image and read from.
textureImageWrite = 0x0000_0800, ///Texture format can be used as image and written to.
textureFramebuffer = 0x0000_1000, ///Texture format can be used as frame buffer.
textureFramebufferMSAA = 0x0000_2000, ///Texture format can be used as MSAA frame buffer.
textureMSAA = 0x0000_4000, ///Texture can be sampled as MSAA.
textureMIPAutogen = 0x0000_8000, ///Texture format supports auto-generated mips.
}
alias Resolve_ = ubyte;
enum Resolve: Resolve_{
none = 0x00, ///No resolve flags.
autoGenMIPs = 0x01, ///Auto-generate mip maps on resolve.
}
alias PCIID_ = ushort;
enum PCIID: PCIID_{
none = 0x0000, ///Autoselect adapter.
softwareRasterizer = 0x0001, ///Software rasterizer.
softwareRasteriser = softwareRasterizer,
amd = 0x1002, ///AMD adapter.
apple = 0x106B, ///Apple adapter.
intel = 0x8086, ///Intel adapter.
nvidia = 0x10DE, ///nVidia adapter.
microsoft = 0x1414, ///Microsoft adapter.
arm = 0x13B5, ///ARM adapter.
}
alias CubeMap_ = ubyte;
enum CubeMap: CubeMap_{
positiveX = 0x00, ///Cubemap +x.
negativeX = 0x01, ///Cubemap -x.
positiveY = 0x02, ///Cubemap +y.
negativeY = 0x03, ///Cubemap -y.
positiveZ = 0x04, ///Cubemap +z.
negativeZ = 0x05, ///Cubemap -z.
}
///Fatal error enum.
enum Fatal: bgfx.fakeenum.Fatal.Enum{
debugCheck = bgfx.fakeenum.Fatal.Enum.debugCheck,
invalidShader = bgfx.fakeenum.Fatal.Enum.invalidShader,
unableToInitialize = bgfx.fakeenum.Fatal.Enum.unableToInitialize,
unableToInitialise = bgfx.fakeenum.Fatal.Enum.unableToInitialize,
unableToCreateTexture = bgfx.fakeenum.Fatal.Enum.unableToCreateTexture,
deviceLost = bgfx.fakeenum.Fatal.Enum.deviceLost,
count = bgfx.fakeenum.Fatal.Enum.count,
}
///Renderer backend type enum.
enum RendererType: bgfx.fakeenum.RendererType.Enum{
noop = bgfx.fakeenum.RendererType.Enum.noop,
agc = bgfx.fakeenum.RendererType.Enum.agc,
direct3D11 = bgfx.fakeenum.RendererType.Enum.direct3D11,
direct3D12 = bgfx.fakeenum.RendererType.Enum.direct3D12,
gnm = bgfx.fakeenum.RendererType.Enum.gnm,
metal = bgfx.fakeenum.RendererType.Enum.metal,
nvn = bgfx.fakeenum.RendererType.Enum.nvn,
openGLES = bgfx.fakeenum.RendererType.Enum.openGLES,
openGL = bgfx.fakeenum.RendererType.Enum.openGL,
vulkan = bgfx.fakeenum.RendererType.Enum.vulkan,
count = bgfx.fakeenum.RendererType.Enum.count,
}
///Access mode enum.
enum Access: bgfx.fakeenum.Access.Enum{
read = bgfx.fakeenum.Access.Enum.read,
write = bgfx.fakeenum.Access.Enum.write,
readWrite = bgfx.fakeenum.Access.Enum.readWrite,
count = bgfx.fakeenum.Access.Enum.count,
}
///Vertex attribute enum.
enum Attrib: bgfx.fakeenum.Attrib.Enum{
position = bgfx.fakeenum.Attrib.Enum.position,
normal = bgfx.fakeenum.Attrib.Enum.normal,
tangent = bgfx.fakeenum.Attrib.Enum.tangent,
bitangent = bgfx.fakeenum.Attrib.Enum.bitangent,
color0 = bgfx.fakeenum.Attrib.Enum.color0,
colour0 = bgfx.fakeenum.Attrib.Enum.color0,
color1 = bgfx.fakeenum.Attrib.Enum.color1,
colour1 = bgfx.fakeenum.Attrib.Enum.color1,
color2 = bgfx.fakeenum.Attrib.Enum.color2,
colour2 = bgfx.fakeenum.Attrib.Enum.color2,
color3 = bgfx.fakeenum.Attrib.Enum.color3,
colour3 = bgfx.fakeenum.Attrib.Enum.color3,
indices = bgfx.fakeenum.Attrib.Enum.indices,
weight = bgfx.fakeenum.Attrib.Enum.weight,
texCoord0 = bgfx.fakeenum.Attrib.Enum.texCoord0,
texCoord1 = bgfx.fakeenum.Attrib.Enum.texCoord1,
texCoord2 = bgfx.fakeenum.Attrib.Enum.texCoord2,
texCoord3 = bgfx.fakeenum.Attrib.Enum.texCoord3,
texCoord4 = bgfx.fakeenum.Attrib.Enum.texCoord4,
texCoord5 = bgfx.fakeenum.Attrib.Enum.texCoord5,
texCoord6 = bgfx.fakeenum.Attrib.Enum.texCoord6,
texCoord7 = bgfx.fakeenum.Attrib.Enum.texCoord7,
count = bgfx.fakeenum.Attrib.Enum.count,
}
///Vertex attribute type enum.
enum AttribType: bgfx.fakeenum.AttribType.Enum{
uint8 = bgfx.fakeenum.AttribType.Enum.uint8,
uint10 = bgfx.fakeenum.AttribType.Enum.uint10,
int16 = bgfx.fakeenum.AttribType.Enum.int16,
half = bgfx.fakeenum.AttribType.Enum.half,
float_ = bgfx.fakeenum.AttribType.Enum.float_,
count = bgfx.fakeenum.AttribType.Enum.count,
}
/**
Texture format enum.
Notation:
RGBA16S
^ ^ ^
| | +-- [ ]Unorm
| | [F]loat
| | [S]norm
| | [I]nt
| | [U]int
| +---- Number of bits per component
+-------- Components
@attention Availability depends on Caps (see: formats).
*/
enum TextureFormat: bgfx.fakeenum.TextureFormat.Enum{
bc1 = bgfx.fakeenum.TextureFormat.Enum.bc1,
bc2 = bgfx.fakeenum.TextureFormat.Enum.bc2,
bc3 = bgfx.fakeenum.TextureFormat.Enum.bc3,
bc4 = bgfx.fakeenum.TextureFormat.Enum.bc4,
bc5 = bgfx.fakeenum.TextureFormat.Enum.bc5,
bc6h = bgfx.fakeenum.TextureFormat.Enum.bc6h,
bc7 = bgfx.fakeenum.TextureFormat.Enum.bc7,
etc1 = bgfx.fakeenum.TextureFormat.Enum.etc1,
etc2 = bgfx.fakeenum.TextureFormat.Enum.etc2,
etc2a = bgfx.fakeenum.TextureFormat.Enum.etc2a,
etc2a1 = bgfx.fakeenum.TextureFormat.Enum.etc2a1,
ptc12 = bgfx.fakeenum.TextureFormat.Enum.ptc12,
ptc14 = bgfx.fakeenum.TextureFormat.Enum.ptc14,
ptc12a = bgfx.fakeenum.TextureFormat.Enum.ptc12a,
ptc14a = bgfx.fakeenum.TextureFormat.Enum.ptc14a,
ptc22 = bgfx.fakeenum.TextureFormat.Enum.ptc22,
ptc24 = bgfx.fakeenum.TextureFormat.Enum.ptc24,
atc = bgfx.fakeenum.TextureFormat.Enum.atc,
atce = bgfx.fakeenum.TextureFormat.Enum.atce,
atci = bgfx.fakeenum.TextureFormat.Enum.atci,
astc4x4 = bgfx.fakeenum.TextureFormat.Enum.astc4x4,
astc5x4 = bgfx.fakeenum.TextureFormat.Enum.astc5x4,
astc5x5 = bgfx.fakeenum.TextureFormat.Enum.astc5x5,
astc6x5 = bgfx.fakeenum.TextureFormat.Enum.astc6x5,
astc6x6 = bgfx.fakeenum.TextureFormat.Enum.astc6x6,
astc8x5 = bgfx.fakeenum.TextureFormat.Enum.astc8x5,
astc8x6 = bgfx.fakeenum.TextureFormat.Enum.astc8x6,
astc8x8 = bgfx.fakeenum.TextureFormat.Enum.astc8x8,
astc10x5 = bgfx.fakeenum.TextureFormat.Enum.astc10x5,
astc10x6 = bgfx.fakeenum.TextureFormat.Enum.astc10x6,
astc10x8 = bgfx.fakeenum.TextureFormat.Enum.astc10x8,
astc10x10 = bgfx.fakeenum.TextureFormat.Enum.astc10x10,
astc12x10 = bgfx.fakeenum.TextureFormat.Enum.astc12x10,
astc12x12 = bgfx.fakeenum.TextureFormat.Enum.astc12x12,
unknown = bgfx.fakeenum.TextureFormat.Enum.unknown,
r1 = bgfx.fakeenum.TextureFormat.Enum.r1,
a8 = bgfx.fakeenum.TextureFormat.Enum.a8,
r8 = bgfx.fakeenum.TextureFormat.Enum.r8,
r8i = bgfx.fakeenum.TextureFormat.Enum.r8i,
r8u = bgfx.fakeenum.TextureFormat.Enum.r8u,
r8s = bgfx.fakeenum.TextureFormat.Enum.r8s,
r16 = bgfx.fakeenum.TextureFormat.Enum.r16,
r16i = bgfx.fakeenum.TextureFormat.Enum.r16i,
r16u = bgfx.fakeenum.TextureFormat.Enum.r16u,
r16f = bgfx.fakeenum.TextureFormat.Enum.r16f,
r16s = bgfx.fakeenum.TextureFormat.Enum.r16s,
r32i = bgfx.fakeenum.TextureFormat.Enum.r32i,
r32u = bgfx.fakeenum.TextureFormat.Enum.r32u,
r32f = bgfx.fakeenum.TextureFormat.Enum.r32f,
rg8 = bgfx.fakeenum.TextureFormat.Enum.rg8,
rg8i = bgfx.fakeenum.TextureFormat.Enum.rg8i,
rg8u = bgfx.fakeenum.TextureFormat.Enum.rg8u,
rg8s = bgfx.fakeenum.TextureFormat.Enum.rg8s,
rg16 = bgfx.fakeenum.TextureFormat.Enum.rg16,
rg16i = bgfx.fakeenum.TextureFormat.Enum.rg16i,
rg16u = bgfx.fakeenum.TextureFormat.Enum.rg16u,
rg16f = bgfx.fakeenum.TextureFormat.Enum.rg16f,
rg16s = bgfx.fakeenum.TextureFormat.Enum.rg16s,
rg32i = bgfx.fakeenum.TextureFormat.Enum.rg32i,
rg32u = bgfx.fakeenum.TextureFormat.Enum.rg32u,
rg32f = bgfx.fakeenum.TextureFormat.Enum.rg32f,
rgb8 = bgfx.fakeenum.TextureFormat.Enum.rgb8,
rgb8i = bgfx.fakeenum.TextureFormat.Enum.rgb8i,
rgb8u = bgfx.fakeenum.TextureFormat.Enum.rgb8u,
rgb8s = bgfx.fakeenum.TextureFormat.Enum.rgb8s,
rgb9e5f = bgfx.fakeenum.TextureFormat.Enum.rgb9e5f,
bgra8 = bgfx.fakeenum.TextureFormat.Enum.bgra8,
rgba8 = bgfx.fakeenum.TextureFormat.Enum.rgba8,
rgba8i = bgfx.fakeenum.TextureFormat.Enum.rgba8i,
rgba8u = bgfx.fakeenum.TextureFormat.Enum.rgba8u,
rgba8s = bgfx.fakeenum.TextureFormat.Enum.rgba8s,
rgba16 = bgfx.fakeenum.TextureFormat.Enum.rgba16,
rgba16i = bgfx.fakeenum.TextureFormat.Enum.rgba16i,
rgba16u = bgfx.fakeenum.TextureFormat.Enum.rgba16u,
rgba16f = bgfx.fakeenum.TextureFormat.Enum.rgba16f,
rgba16s = bgfx.fakeenum.TextureFormat.Enum.rgba16s,
rgba32i = bgfx.fakeenum.TextureFormat.Enum.rgba32i,
rgba32u = bgfx.fakeenum.TextureFormat.Enum.rgba32u,
rgba32f = bgfx.fakeenum.TextureFormat.Enum.rgba32f,
b5g6r5 = bgfx.fakeenum.TextureFormat.Enum.b5g6r5,
r5g6b5 = bgfx.fakeenum.TextureFormat.Enum.r5g6b5,
bgra4 = bgfx.fakeenum.TextureFormat.Enum.bgra4,
rgba4 = bgfx.fakeenum.TextureFormat.Enum.rgba4,
bgr5a1 = bgfx.fakeenum.TextureFormat.Enum.bgr5a1,
rgb5a1 = bgfx.fakeenum.TextureFormat.Enum.rgb5a1,
rgb10a2 = bgfx.fakeenum.TextureFormat.Enum.rgb10a2,
rg11b10f = bgfx.fakeenum.TextureFormat.Enum.rg11b10f,
unknownDepth = bgfx.fakeenum.TextureFormat.Enum.unknownDepth,
d16 = bgfx.fakeenum.TextureFormat.Enum.d16,
d24 = bgfx.fakeenum.TextureFormat.Enum.d24,
d24s8 = bgfx.fakeenum.TextureFormat.Enum.d24s8,
d32 = bgfx.fakeenum.TextureFormat.Enum.d32,
d16f = bgfx.fakeenum.TextureFormat.Enum.d16f,
d24f = bgfx.fakeenum.TextureFormat.Enum.d24f,
d32f = bgfx.fakeenum.TextureFormat.Enum.d32f,
d0s8 = bgfx.fakeenum.TextureFormat.Enum.d0s8,
count = bgfx.fakeenum.TextureFormat.Enum.count,
}
///Uniform type enum.
enum UniformType: bgfx.fakeenum.UniformType.Enum{
sampler = bgfx.fakeenum.UniformType.Enum.sampler,
end = bgfx.fakeenum.UniformType.Enum.end,
vec4 = bgfx.fakeenum.UniformType.Enum.vec4,
mat3 = bgfx.fakeenum.UniformType.Enum.mat3,
mat4 = bgfx.fakeenum.UniformType.Enum.mat4,
count = bgfx.fakeenum.UniformType.Enum.count,
}
///Backbuffer ratio enum.
enum BackbufferRatio: bgfx.fakeenum.BackbufferRatio.Enum{
equal = bgfx.fakeenum.BackbufferRatio.Enum.equal,
half = bgfx.fakeenum.BackbufferRatio.Enum.half,
quarter = bgfx.fakeenum.BackbufferRatio.Enum.quarter,
eighth = bgfx.fakeenum.BackbufferRatio.Enum.eighth,
sixteenth = bgfx.fakeenum.BackbufferRatio.Enum.sixteenth,
double_ = bgfx.fakeenum.BackbufferRatio.Enum.double_,
count = bgfx.fakeenum.BackbufferRatio.Enum.count,
}
///Occlusion query result.
enum OcclusionQueryResult: bgfx.fakeenum.OcclusionQueryResult.Enum{
invisible = bgfx.fakeenum.OcclusionQueryResult.Enum.invisible,
visible = bgfx.fakeenum.OcclusionQueryResult.Enum.visible,
noResult = bgfx.fakeenum.OcclusionQueryResult.Enum.noResult,
count = bgfx.fakeenum.OcclusionQueryResult.Enum.count,
}
///Primitive topology.
enum Topology: bgfx.fakeenum.Topology.Enum{
triList = bgfx.fakeenum.Topology.Enum.triList,
triStrip = bgfx.fakeenum.Topology.Enum.triStrip,
lineList = bgfx.fakeenum.Topology.Enum.lineList,
lineStrip = bgfx.fakeenum.Topology.Enum.lineStrip,
pointList = bgfx.fakeenum.Topology.Enum.pointList,
count = bgfx.fakeenum.Topology.Enum.count,
}
///Topology conversion function.
enum TopologyConvert: bgfx.fakeenum.TopologyConvert.Enum{
triListFlipWinding = bgfx.fakeenum.TopologyConvert.Enum.triListFlipWinding,
triStripFlipWinding = bgfx.fakeenum.TopologyConvert.Enum.triStripFlipWinding,
triListToLineList = bgfx.fakeenum.TopologyConvert.Enum.triListToLineList,
triStripToTriList = bgfx.fakeenum.TopologyConvert.Enum.triStripToTriList,
lineStripToLineList = bgfx.fakeenum.TopologyConvert.Enum.lineStripToLineList,
count = bgfx.fakeenum.TopologyConvert.Enum.count,
}
///Topology sort order.
enum TopologySort: bgfx.fakeenum.TopologySort.Enum{
directionFrontToBackMin = bgfx.fakeenum.TopologySort.Enum.directionFrontToBackMin,
directionFrontToBackAvg = bgfx.fakeenum.TopologySort.Enum.directionFrontToBackAvg,
directionFrontToBackMax = bgfx.fakeenum.TopologySort.Enum.directionFrontToBackMax,
directionBackToFrontMin = bgfx.fakeenum.TopologySort.Enum.directionBackToFrontMin,
directionBackToFrontAvg = bgfx.fakeenum.TopologySort.Enum.directionBackToFrontAvg,
directionBackToFrontMax = bgfx.fakeenum.TopologySort.Enum.directionBackToFrontMax,
distanceFrontToBackMin = bgfx.fakeenum.TopologySort.Enum.distanceFrontToBackMin,
distanceFrontToBackAvg = bgfx.fakeenum.TopologySort.Enum.distanceFrontToBackAvg,
distanceFrontToBackMax = bgfx.fakeenum.TopologySort.Enum.distanceFrontToBackMax,
distanceBackToFrontMin = bgfx.fakeenum.TopologySort.Enum.distanceBackToFrontMin,
distanceBackToFrontAvg = bgfx.fakeenum.TopologySort.Enum.distanceBackToFrontAvg,
distanceBackToFrontMax = bgfx.fakeenum.TopologySort.Enum.distanceBackToFrontMax,
count = bgfx.fakeenum.TopologySort.Enum.count,
}
///View mode sets draw call sort order.
enum ViewMode: bgfx.fakeenum.ViewMode.Enum{
default_ = bgfx.fakeenum.ViewMode.Enum.default_,
sequential = bgfx.fakeenum.ViewMode.Enum.sequential,
depthAscending = bgfx.fakeenum.ViewMode.Enum.depthAscending,
depthDescending = bgfx.fakeenum.ViewMode.Enum.depthDescending,
count = bgfx.fakeenum.ViewMode.Enum.count,
}
///Native window handle type.
enum NativeWindowHandleType: bgfx.fakeenum.NativeWindowHandleType.Enum{
default_ = bgfx.fakeenum.NativeWindowHandleType.Enum.default_,
wayland = bgfx.fakeenum.NativeWindowHandleType.Enum.wayland,
count = bgfx.fakeenum.NativeWindowHandleType.Enum.count,
}
///Render frame enum.
enum RenderFrame: bgfx.fakeenum.RenderFrame.Enum{
noContext = bgfx.fakeenum.RenderFrame.Enum.noContext,
render = bgfx.fakeenum.RenderFrame.Enum.render,
timeout = bgfx.fakeenum.RenderFrame.Enum.timeout,
exiting = bgfx.fakeenum.RenderFrame.Enum.exiting,
count = bgfx.fakeenum.RenderFrame.Enum.count,
}
extern(C++, "bgfx") struct DynamicIndexBufferHandle{
ushort idx;
}
extern(C++, "bgfx") struct DynamicVertexBufferHandle{
ushort idx;
}
extern(C++, "bgfx") struct FrameBufferHandle{
ushort idx;
}
extern(C++, "bgfx") struct IndexBufferHandle{
ushort idx;
}
extern(C++, "bgfx") struct IndirectBufferHandle{
ushort idx;
}
extern(C++, "bgfx") struct OcclusionQueryHandle{
ushort idx;
}
extern(C++, "bgfx") struct ProgramHandle{
ushort idx;
}
extern(C++, "bgfx") struct ShaderHandle{
ushort idx;
}
extern(C++, "bgfx") struct TextureHandle{
ushort idx;
}
extern(C++, "bgfx") struct UniformHandle{
ushort idx;
}
extern(C++, "bgfx") struct VertexBufferHandle{
ushort idx;
}
extern(C++, "bgfx") struct VertexLayoutHandle{
ushort idx;
}
pragma(inline,true) nothrow @nogc pure @safe{
StateBlend_ blendFuncSeparate(StateBlend_ srcRGB, StateBlend_ dstRGB, StateBlend_ srcA, StateBlend_ dstA){
return (srcRGB | ((dstRGB) << 4)) | ((srcA | (dstA << 4)) << 8);
}
///Blend equation separate.
StateBlendEquation_ blendEquationSeparate(StateBlendEquation_ equationRGB, StateBlendEquation_ equationA){
return equationRGB | (equationA << 3);
}
///Blend function.
StateBlend_ blendFunc(StateBlend_ src, StateBlend_ dst){ return blendFuncSeparate(src, dst, src, dst); }
///Blend equation.
StateBlendEquation_ blendEquation(StateBlendEquation_ equation){ return blendEquationSeparate(equation, equation); }
///Utility predefined blend modes.
enum StateBlendFunc: StateBlend_{
///Additive blending.
add = blendFunc(StateBlend.one, StateBlend.one),
///Alpha blend.
alpha = blendFunc(StateBlend.srcAlpha, StateBlend.invSrcAlpha),
///Selects darker color of blend.
darken = blendFunc(StateBlend.one, StateBlend.one) | blendEquation(StateBlendEquation.min),
///Selects lighter color of blend.
lighten = blendFunc(StateBlend.one, StateBlend.one) | blendEquation(StateBlendEquation.max),
///Multiplies colors.
multiply = blendFunc(StateBlend.dstColor, StateBlend.zero),
///Opaque pixels will cover the pixels directly below them without any math or algorithm applied to them.
normal = blendFunc(StateBlend.one, StateBlend.invSrcAlpha),
///Multiplies the inverse of the blend and base colors.
screen = blendFunc(StateBlend.one, StateBlend.invSrcColor),
///Decreases the brightness of the base color based on the value of the blend color.
linearBurn = blendFunc(StateBlend.dstColor, StateBlend.invDstColor) | blendEquation(StateBlendEquation.sub),
}
StateBlend_ blendFuncRTx(StateBlend_ src, StateBlend_ dst){
return cast(uint)(src >> StateBlend.shift) | (cast(uint)(dst >> StateBlend.shift) << 4);
}
StateBlend_ blendFuncRTxE(StateBlend_ src, StateBlend_ dst, StateBlendEquation_ equation){
return blendFuncRTx(src, dst) | (cast(uint)(equation >> StateBlendEquation.shift) << 8);
}
StateBlend_ blendFuncRT1(StateBlend_ src, StateBlend_ dst){ return blendFuncRTx(src, dst) << 0; }
StateBlend_ blendFuncRT2(StateBlend_ src, StateBlend_ dst){ return blendFuncRTx(src, dst) << 11; }
StateBlend_ blendFuncRT3(StateBlend_ src, StateBlend_ dst){ return blendFuncRTx(src, dst) << 22; }
StateBlend_ blendFuncRT1E(StateBlend_ src, StateBlend_ dst, StateBlendEquation_ equation){
return blendFuncRTxE(src, dst, equation) << 0;
}
StateBlend_ blendFuncRT2E(StateBlend_ src, StateBlend_ dst, StateBlendEquation_ equation){
return blendFuncRTxE(src, dst, equation) << 11;
}
StateBlend_ blendFuncRT3E(StateBlend_ src, StateBlend_ dst, StateBlendEquation_ equation){
return blendFuncRTxE(src, dst, equation) << 22;
}
}
pragma(inline,true) nothrow @nogc{
/**
* Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
Params:
size = Size to allocate.
*/
Memory alloc(uint size){
auto bad = cast(bgfx.fakeenum.Memory*)bgfx.fakeenum.alloc(__traits(parameters));
return Memory(bad.data[0..bad.size], bad);
}
/**
* Allocate buffer and copy data into it. Data will be freed inside bgfx.
Params:
data = Pointer to data to be copied.
size = Size of data to be copied.
*/
Memory copy(const(void)* data, uint size){
auto bad = cast(bgfx.fakeenum.Memory*)bgfx.fakeenum.copy(__traits(parameters));
return Memory(bad.data[0..bad.size], bad);
}
/**
* Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
* doesn't allocate memory for data. It just copies the _data pointer. You
* can pass `ReleaseFn` function pointer to release this memory after it's