-
Notifications
You must be signed in to change notification settings - Fork 5
/
DirectX11 Engine 2019.txt
1559 lines (1559 loc) · 100 KB
/
DirectX11 Engine 2019.txt
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
VertexBuffer *VB;
IndexBuffer *IB;
mfloat4x4 mWorld;
uint front, back;
std::array<Entry, 32> BufferQueue;
std::array<Entry, 96> BufferStaging;
Entry CurrentProcess;
StructuredBuffer<Pivot> *sbPivot;
std::vector<float3> vertex;
std::vector<uint> index;
uint front, back;
uint _IndexCount;
uint _VertexCount;
uint _Pivot1;
uint _StartIndex;
float3 n;
float p;
Plane p;
return p;
Pivot e;
break;
break;
break;
break;
break;
return Pivot;
RenderTarget<2, 0, true, CascadeMaxNum, WillHaveMSAA> *rtCSM;
Shader *shCSM;
ConstantBuffer *cbCSM;
mfloat3 mShadowBoundCenter;
float1 mShadowBoundRadius;
mfloat4x4 World2Shadow;
float1 fFOV, fAspect;
float4x4 LightWorld;
using namespace std::string_literals;
else return;
else return;
mfloat3 Center;
float1 Radius;
mfloat3 Offset;
bool Res;
using namespace std::string_literals;
using namespace DirectX;
mfloat4x4 mCascadeTrans, mCascadeScale;
extern _DirectX *gDirectX;
float _CameraNear;
float _CameraFar;
3, 7, 6,
3, 6, 2,
4, 0, 1,
4, 1, 5,
4, 7, 3,
4, 3, 0,
1, 2, 6,
1, 6, 5,
5, 6, 7,
5, 7, 4,
0, 3, 2,
0, 2, 1
float3 Origin, Size;
Shader *shDownScaleDepthCS;
Texture *_DepthDS, *_DepthDS_Read;
ConstantBuffer *cbDownscaling;
float fWidth;
float fHeight;
return vResult;
__m128i tmp;
return tmp;
__m128i tmp;
return tmp;
__m128 X;
__m128 Y;
__m128 Z;
__m128 W;
continue;
__m128i mask;
__m128 previousDepth;
__m128 depthMask;
__m128i finalMask;
return false;
delete _DepthDS;
delete _DepthDS_Read;
delete cbDownscaling;
delete shDownScaleDepthCS;
to create per RT buffer */
return;
return;
D3D11_MAPPED_SUBRESOURCE Mapped;
static std::vector<CallbackResize*> gResizables;
float1 _Adaptation;
float1 _BloomThreshold;
float2 _Alignment;
float1 _MiddleGrey;
float1 _LumWhiteSqr;
float1 _BloomScale;
float1 _Alignment2;
float2 _DoFFarValues;
float1 _ColorScale;
float1 _RadiusScale;
float1 _BokehThreshold;
uint1 _RenderFlags;
float4 _Color;
float2 _Position;
float1 _Radius;
D3D11_DRAW_INSTANCED_INDIRECT_ARGS _Args;
float3 _Padding;
ConstantBuffer *cbDownScale;
ConstantBuffer *cbFinalPass;
ConstantBuffer *cbGeometry;
BlendState *bsAdditive;
Sampler *_LinearSampler;
float fWidth;
float fHeight;
std::vector<float4> _LumData;
std::vector<float4> _ALumData;
std::vector<float4> _PLumData;
_IndirectArgs _Indirect;
D3D11_BLEND_DESC pDesc;
D3D11_SAMPLER_DESC pSamplerDesc;
delete bsAdditive;
delete _LinearSampler;
delete shLuminanceDownScale1;
delete shLuminanceDownScale2;
delete shHorizontalFilter;
delete shVerticalFilter;
delete shBloomReveal;
delete shEmptyShader;
delete shHDRTonemap;
delete shBokeh;
delete shBloom;
delete sbILuminance;
delete sbALuminance;
delete sbBokehIndirect;
delete abBokeh;
delete cbDownScale;
delete cbFinalPass;
delete cbGeometry;
delete _HDRDS;
delete _Bloom;
delete _Bloom2;
delete _Blur;
delete _BlurOut;
delete _BokehTex;
to create per RT buffer */
mfloat4x4 mInvViewProj;
float fMinFadeDist;
float fMaxFadeDist;
Shader *shOITCreateLinkedLists;
Shader *shOITFinal;
mfloat4x4 _InvViewProj;
float3 _CameraPos;
float1 _MinFadeDist2;
float1 _MaxFadeDist2;
float3 _Padding0;
ConstantBuffer *cbDataBuffer;
DepthStencilState *dssNoWrite, *dssWrite;
BlendState *bsMaskZero, *bsNoBlend;
RasterState *rsNoCulling;
TopologyState *tState;
mfloat4x4 mViewTmp, mProjTmp;
D3D11_BLEND_DESC bsDesc;
to create per RT buffer */
to create per RT buffer */
float4 _Empty;
Texture *_BlueNoise;
Texture *_SSAOInter;
Texture *_SSAO;
ConstantBuffer *cbBlurArgs;
float fWidth;
float fHeight;
delete shDownscaleDepthNormal;
delete shHorizontalFilter;
delete shVerticalFilter;
delete shSSAO;
delete cbDownscaling;
delete cbBlurArgs;
delete sbDepthNDS;
delete _BlueNoise;
delete _SSAOInter;
delete _SSAO;
to create per RT buffer */
float4x4 dest;
float4 _Color;
float1 _Offset;
float1 _Scale;
BlendState *bsAdditive;
BlendState *bsNoColor;
DepthStencilState *dssDepthNoWrite;
Query *qOcclusion;
Query *qPredicate;
Texture *_Corona;
Texture *_Aperture0;
StructuredBuffer<LensFlare> *sbLensFlares;
std::vector<LensFlare> lf;
D3D11_BLEND_DESC pDesc;
D3D11_DEPTH_STENCIL_DESC pDSSDesc;
D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP,
D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS
delete sbLensFlares;
delete qOcclusion;
delete qPredicate;
delete _Corona;
delete _Aperture0;
delete bsAdditive;
delete bsNoColor;
delete dssDepthNoWrite;
float1 _ViewAngleThreshold;
float1 _EdgeDistThreshold;
float1 _DepthBias;
float1 _ReflScale;
float4 _ProjValues;
ConstantBuffer *cbSSLRSettings;
Shader *shSSLR;
Texture *mSSLRTex;
float fWidth;
float fHeight;
to create per RT buffer */
using namespace DirectX;
using namespace DirectX;
return *cb;
return *cb;
float ViewW, ViewH;
float3 pPos, pRot;
mfloat4x4 mProj, mView, mWorld;
ConstantBuffer *cb;
CameraConfig cfg;
mfloat4x4 mWorld;
mfloat4x4 mView;
mfloat4x4 mProj;
mfloat4 vPosition;
D3D11_BUFFER_DESC pDesc;
ID3D11Buffer *pBuff;
UINT Stride, Offset, Number;
D3D11_MAPPED_SUBRESOURCE res;
HRESULT hr;
return NULL;
D3D_FEATURE_LEVEL level;
HRESULT res;
D3D_FEATURE_LEVEL_12_1,
D3D_FEATURE_LEVEL_12_0,
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0
D3D_DRIVER_TYPE_HARDWARE,
D3D_DRIVER_TYPE_WARP,
D3D_DRIVER_TYPE_REFERENCE
DXGI_ADAPTER_DESC1 desc;
DXGI_HDR_METADATA_HDR10 pHDRMeta;
ID3D11Texture2D *BackBufferColor;
D3D11_RENDER_TARGET_VIEW_DESC pDesc;
D3D11_VIEWPORT vp;
D3D11_RASTERIZER_DESC rDesc;
D3D11_RASTERIZER_DESC rDesc2;
D3D11_SHADER_RESOURCE_VIEW_DESC pDesc1;
return 0;
const char *error;
return true;
return cfg;
int BufferCount;
int Width, Height;
bool Windowed, UseHDR;
bool DeferredContext;
int RefreshRate;
HWND m_hwnd;
bool Ansel;
bool MSAA;
friend class RendererBase;
friend class RendererDeferred;
DXGI_OUTPUT_DESC1 pDescHDR;
IDXGISwapChain1 *gSwapchain;
IDXGISwapChain4 *gSwapchain4;
IDXGIOutput *gOutput;
IDXGIOutput6 *gOutput6;
ID3D11Texture2D *gDSVTex;
ID3D11DepthStencilState *pDSS_Default, *pDSS_Default_NoDepthWrite, *pDSS_Default_InvDepth;
ID3D11RasterizerState *gRSDefault, *gRSDefaultWriteframe;
DirectXConfig cfg;
D3D11_DEPTH_STENCIL_VIEW_DESC pDesc2;
D3D11_TEXTURE2D_DESC pTex2DDesc;
D3D11_DEPTH_STENCIL_DESC pDSD;
DXGI_SWAP_CHAIN_DESC1 scd;
DXGI_SWAP_CHAIN_FULLSCREEN_DESC pSCFDesc;
ID3D11Device *gDevice;
ID3D11DeviceContext *gContext;
ID3D11Device1 *gDeviceN;
ID3D11DeviceContext1 *gContextN;
ID3D11DeviceContext1 *gContextDeferred;
ID3D11Debug *gDebug;
bool gPause, gAnselSessionIsActive;
DirectX::XMMATRIX gViewBackup, gView;
return info;
return info;
friend class HighLevel;
static _DirectX* gDirectX;
ID3D11ShaderResourceView *pSRV;
D3D11_BUFFER_DESC desc;
D3D11_SUBRESOURCE_DATA data;
return;
return il;
ID3D11InputLayout *il;
std::vector<D3D11_INPUT_ELEMENT_DESC> descs;
D3D11_QUERY_DESC pDesc;
case D3D11_QUERY_EVENT:
case D3D11_QUERY_OCCLUSION_PREDICATE:
case D3D11_QUERY_SO_OVERFLOW_PREDICATE:
case D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0:
case D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1:
case D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2:
case D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3:
break;
case D3D11_QUERY_TIMESTAMP_DISJOINT:
break;
case D3D11_QUERY_PIPELINE_STATISTICS:
break;
case D3D11_QUERY_SO_STATISTICS:
case D3D11_QUERY_SO_STATISTICS_STREAM0:
case D3D11_QUERY_SO_STATISTICS_STREAM1:
case D3D11_QUERY_SO_STATISTICS_STREAM2:
case D3D11_QUERY_SO_STATISTICS_STREAM3:
break;
QueryValue v;
return v;
bool bLastValue;
UINT64 iLastValue;
D3D11_QUERY_DATA_TIMESTAMP_DISJOINT *tLastValue;
D3D11_QUERY_DATA_PIPELINE_STATISTICS *pLastValue;
D3D11_QUERY_DATA_SO_STATISTICS *sLastValue;
ID3D11Query *pQuery;
Bool,
Integer,
Timestamp,
Pipeline,
Statictics
void* pData;
HRESULT hr;
return 1;
return 1;
case GeometrySO:
return 0;
delete pl;
return;
case Geometry :
return;
std::vector<D3D11_INPUT_ELEMENT_DESC> q;
return S_FALSE;
D3D11_SHADER_DESC shaderDesc;
std::vector<D3D11_INPUT_ELEMENT_DESC> inputLayoutDesc;
D3D11_SIGNATURE_PARAMETER_DESC paramDesc;
continue;
D3D11_INPUT_ELEMENT_DESC elementDesc;
case DXGI_FORMAT_R32_UINT:
case DXGI_FORMAT_R32_SINT:
case DXGI_FORMAT_R32_FLOAT:
break;
case DXGI_FORMAT_R32G32_UINT:
case DXGI_FORMAT_R32G32_SINT:
case DXGI_FORMAT_R32G32_FLOAT:
break;
case DXGI_FORMAT_R32G32B32_UINT:
case DXGI_FORMAT_R32G32B32_SINT:
case DXGI_FORMAT_R32G32B32_FLOAT:
break;
case DXGI_FORMAT_R32G32B32A32_UINT:
case DXGI_FORMAT_R32G32B32A32_SINT:
case DXGI_FORMAT_R32G32B32A32_FLOAT:
break;
return hr;
int tmp;
ID3D11InputLayout *IL;
return true;
return false;
int tmp;
ID3D11InputLayout *IL;
return true;
return false;
LgDefault, LgMesh
ID3D11VertexShader *sVertex;
ID3D11PixelShader *sPixel;
ID3D11GeometryShader *sGeometry;
ID3D11HullShader *sHull;
ID3D11DomainShader *sDomain;
ID3D11ComputeShader *sCompute;
PolygonLayout *pl;
static ID3D11ShaderTraceFactory *gFactory;
ID3D11ShaderTrace *pTrace;
ID3D11ShaderResourceView *pSRV;
ID3D11UnorderedAccessView *pUAV;
return;
return;
return;
D3D11_MAPPED_SUBRESOURCE res;
HRESULT hr;
return NULL;
D3D11_SUBRESOURCE_DATA data;
return;
ID3D11ShaderResourceView *pSRV;
return mState;
return Index;
return true;
return true;
XINPUT_VIBRATION mVibState;
XINPUT_VIBRATION mVibState;
XINPUT_GAMEPAD_A,
XINPUT_GAMEPAD_B,
XINPUT_GAMEPAD_X,
XINPUT_GAMEPAD_Y,
XINPUT_GAMEPAD_DPAD_UP,
XINPUT_GAMEPAD_DPAD_DOWN,
XINPUT_GAMEPAD_DPAD_LEFT,
XINPUT_GAMEPAD_DPAD_RIGHT,
XINPUT_GAMEPAD_LEFT_SHOULDER,
XINPUT_GAMEPAD_RIGHT_SHOULDER,
XINPUT_GAMEPAD_LEFT_THUMB,
XINPUT_GAMEPAD_RIGHT_THUMB,
XINPUT_GAMEPAD_START,
XINPUT_GAMEPAD_BACK
A, B, X, Y,
DPad_Up, DPad_Down, DPad_Left, DPad_Right,
ShoulderL, ShoulderR,
ThumbstickL, ThumbstickR,
Start, Back,
_StickL, _StickR
return &iKeyboard;
return &iMouse;
Keyboard iKeyboard;
Mouse iMouse;
enum Keys
struct State
bool Reserved00 : 1;
bool Reserved01 : 1;
bool Reserved02 : 1;
bool Reserved03 : 1;
bool Reserved04 : 1;
bool Reserved05 : 1;
bool Reserved06 : 1;
bool Reserved07 : 1;
bool Reserved10 : 1;
bool Reserved11 : 1;
bool Reserved12 : 1;
bool Reserved20 : 1;
bool Reserved21 : 1;
bool Reserved30 : 1;
bool Reserved31 : 1;
bool Reserved32 : 1;
bool Reserved40 : 1;
bool Reserved41 : 1;
bool Reserved50 : 1;
bool Reserved60 : 1;
bool Reserved70 : 1;
bool Reserved71 : 1;
bool Reserved80 : 1;
bool Reserved81 : 1;
bool Reserved82 : 1;
bool Reserved83 : 1;
bool Reserved84 : 1;
bool Reserved85 : 1;
bool Reserved90 : 1;
bool Reserved100 : 1;
bool Reserved110 : 1;
bool Reserved111 : 1;
bool Reserved112 : 1;
bool Reserved113 : 1;
bool Reserved114 : 1;
bool Reserved115 : 1;
bool Reserved116 : 1;
bool Reserved117 : 1;
bool Reserved120 : 1;
bool Reserved121 : 1;
bool Reserved122 : 1;
bool Reserved123 : 1;
bool Reserved124 : 1;
bool Reserved125 : 1;
bool Reserved130 : 1;
bool Reserved131 : 1;
bool Reserved132 : 1;
bool Reserved133 : 1;
bool Reserved134 : 1;
bool Reserved135 : 1;
bool Reserved136 : 1;
bool Reserved137 : 1;
bool Reserved140 : 1;
bool Reserved141 : 1;
bool Reserved150 : 1;
bool Reserved151 : 1;
bool Reserved152 : 1;
bool Reserved153 : 1;
bool Reserved154 : 1;
bool Reserved155 : 1;
bool Reserved156 : 1;
bool Reserved160 : 1;
bool Reserved161 : 1;
bool Reserved162 : 1;
bool Reserved163 : 1;
bool Reserved164 : 1;
bool Reserved165 : 1;
bool Reserved166 : 1;
bool Reserved167 : 1;
bool Reserved170 : 1;
bool Reserved171 : 1;
bool Reserved172 : 1;
bool Reserved173 : 1;
bool Reserved174 : 1;
bool Reserved175 : 1;
bool Reserved176 : 1;
bool Reserved177 : 1;
bool Reserved180 : 1;
bool Reserved181 : 1;
bool Reserved182 : 1;
bool Reserved190 : 1;
bool Reserved191 : 1;
bool Reserved200 : 1;
bool Reserved201 : 1;
bool Reserved210 : 1;
bool Reserved211 : 1;
bool Reserved220 : 1;
bool Reserved221 : 1;
bool Reserved222 : 1;
bool Reserved223 : 1;
bool Reserved224 : 1;
bool Reserved225 : 1;
bool Reserved226 : 1;
bool Reserved227 : 1;
bool Reserved230 : 1;
bool Reserved231 : 1;
bool Reserved232 : 1;
bool Reserved240 : 1;
bool Reserved250 : 1;
bool Reserved260 : 1;
State mState;
State mLastState;
ButtonState Reserved00;
ButtonState Reserved01;
ButtonState Reserved02;
ButtonState Reserved03;
ButtonState Reserved04;
ButtonState Reserved05;
ButtonState Reserved06;
ButtonState Reserved07;
ButtonState Reserved10;
ButtonState Reserved11;
ButtonState Reserved12;
ButtonState Reserved20;
ButtonState Reserved21;
ButtonState Reserved30;
ButtonState Reserved31;
ButtonState Reserved32;
ButtonState Reserved40;
ButtonState Reserved41;
ButtonState Reserved50;
ButtonState Reserved60;
ButtonState Reserved70;
ButtonState Reserved71;
ButtonState Reserved80;
ButtonState Reserved81;
ButtonState Reserved82;
ButtonState Reserved83;
ButtonState Reserved84;
ButtonState Reserved85;
ButtonState Reserved90;
ButtonState Reserved100;
ButtonState Reserved110;
ButtonState Reserved111;
ButtonState Reserved112;
ButtonState Reserved113;
ButtonState Reserved114;
ButtonState Reserved115;
ButtonState Reserved116;
ButtonState Reserved117;
ButtonState Reserved120;
ButtonState Reserved121;
ButtonState Reserved122;
ButtonState Reserved123;
ButtonState Reserved124;
ButtonState Reserved125;
ButtonState Reserved130;
ButtonState Reserved131;
ButtonState Reserved132;
ButtonState Reserved133;
ButtonState Reserved134;
ButtonState Reserved135;
ButtonState Reserved136;
ButtonState Reserved137;
ButtonState Reserved140;
ButtonState Reserved141;
ButtonState Reserved150;
ButtonState Reserved151;
ButtonState Reserved152;
ButtonState Reserved153;
ButtonState Reserved154;
ButtonState Reserved155;
ButtonState Reserved156;
ButtonState Reserved160;
ButtonState Reserved161;
ButtonState Reserved162;
ButtonState Reserved163;
ButtonState Reserved164;
ButtonState Reserved165;
ButtonState Reserved166;
ButtonState Reserved167;
ButtonState Reserved170;
ButtonState Reserved171;
ButtonState Reserved172;
ButtonState Reserved173;
ButtonState Reserved174;
ButtonState Reserved175;
ButtonState Reserved176;
ButtonState Reserved177;
ButtonState Reserved180;
ButtonState Reserved181;
ButtonState Reserved182;
ButtonState Reserved190;
ButtonState Reserved191;
ButtonState Reserved200;
ButtonState Reserved201;
ButtonState Reserved210;
ButtonState Reserved211;
ButtonState Reserved220;
ButtonState Reserved221;
ButtonState Reserved222;
ButtonState Reserved223;
ButtonState Reserved224;
ButtonState Reserved225;
ButtonState Reserved226;
ButtonState Reserved227;
ButtonState Reserved230;
ButtonState Reserved231;
ButtonState Reserved232;
ButtonState Reserved240;
ButtonState Reserved250;
ButtonState Reserved260;
return ButtonState::UP;
1, 2, 10, 20, 40
Left,
Right,
Middle,
X1,
X2,
Count,
uint32_t val;
uint32_t mLeftButton : 1;
uint32_t mRightButton : 1;
uint32_t mMiddleButton : 1;
uint32_t mX1Button : 1;
uint32_t mX2Button : 1;
State mState;
State mLastState;
bool bIsFocused;
HWND m_hwnd;
ButtonState mLeftButton;
ButtonState mRightButton;
ButtonState mMiddleButton;
ButtonState mX1Button;
ButtonState mX2Button;
case MouseButton::Left : return mLeftButton;
case MouseButton::Right : return mRightButton;
case MouseButton::Middle: return mMiddleButton;
case MouseButton::X1 : return mX1Button;
case MouseButton::X2 : return mX2Button;
return ButtonState::UP;
VertexBuffer *vb;
IndexBuffer *ib;
delete m;
bool bDiffuse;
bool bNormals;
bool bOpacity;
bool bSpecular;
static Texture *gDefaultTexture, *gDefaultTextureOpacity, *gDefaultTextureSpecular;
static ID3D11ShaderResourceView* gNullRes;
Diffuse, Normal, Bump, Opacity, Specular, Rougness
aiString str;
eTextureType type;
std::vector<Mesh*> MeshBuffer;
std::vector<tTuple*> FilenameBuffer;
std::vector<aiString> FNB_Diffuse, FNB_Normal, FNB_Opacity, FNB_Specular, FNB_Rougness;
std::vector<Texture*> DiffuseTextureBuffer, NormalTextureBuffer, OpacityTextureBuffer, SpecularTextureBuffer,
RougnessTextureBuffer;
std::vector<int> DiffuseMapIndex, NormalMapIndex, OpacityMapIndex, SpecularMapIndex, RougnessMapIndex;
int num, mVertexSize;
ConstantBuffer *cbBoolTexturesInst;
bool bDiffuse;
bool bNormals;
bool bOpacity;
bool bSpecular;
bool bCubemap;
Assimp::Importer importer;
return;
case eTextureType::Diffuse:
break;
case eTextureType::Normal:
break;
case eTextureType::Opacity:
break;
case eTextureType::Specular:
break;
case eTextureType::Rougness:
break;
std::vector<int> indices;
aiString tFname;
return mesh;
Model *mModel;
Shader *shShader;
static ID3DUserDefinedAnnotation *gUDAnnotation;
static bool gInitialized;
static std::array<Query*, gRangeProfilerStackSize> gQStackDisjoint;
static std::array<Query*, gRangeProfilerStackSize> gQStackTimestampBegin;
static std::array<Query*, gRangeProfilerStackSize> gQStackTimestampEnd;
static std::array<UINT64, gRangeProfilerStackSize> gStackTime;
static uint gStackPos;
return;
UINT delta;
delete g_shMSAADepthResolve;
delete g_MSAAConstantBuffer;
extern _DirectX *gDirectX;
std::variant<bool, ID3D11DepthStencilView*, ID3D11RenderTargetView*> pView;
std::variant<bool, ID3D11Texture1D*, ID3D11Texture2D*, ID3D11Texture3D*> pTexture;
std::variant<DXGI_FORMAT, UINT> mFormat;
uint32_t mFlags;
ID3D11UnorderedAccessView *pUAV;
ID3D11ShaderResourceView *pSRV;
static Shader* g_shMSAADepthResolve;
static ConstantBuffer* g_MSAAConstantBuffer;
static uint32_t gPacked;
case 1:
case 1:
case 1:
break;
break;
return nullptr;
to create per RT buffer */
friend class RenderTarget;
UINT mWidth, mHeight, mDepth;
D3D11_VIEWPORT mViewPort;
std::array<UINT, 2 * DepthBuffer + BufferNum> mMSAASamples;
const char* mName;
to create per RT buffer */
return _3D;
ID3D11DepthStencilView* _DSV;
ID3D11RenderTargetView* _RTV;
ID3D11Texture1D* _1D;
ID3D11Texture2D* _2D;
ID3D11Texture3D* _3D;
DXGI_FORMAT formatTex, formatDSV, formatSRV;
case 64u:
break;
case 32u:
break;
case 24u:
break;
case 16u:
break;
D3D11_SRV_DIMENSION_UNKNOWN
return Out;
to create per RT buffer */
case Shader::Compute :
break;
return;
case Shader::Compute :
break;
float3 _AmbientLightColor;
float _AmbientLightStrengh;
float3 _FogColor;
float1 _FogDensity;
float3 _FogHighlightColor;
float1 _FogHeightFalloff;
float3 _FogSunDir;
float1 _FogStartDepth;
return b;
using namespace DirectX;
uint32 mKeyboardKey;
MouseButton mMouseButton;
GamepadButtonState mGamepadButton;
return *this;
std::vector<InputControl> mAssignedControls;
VertexBuffer *mVBPosition;
VertexBuffer *mVBTexcoord;
VertexBuffer *mVBNormal;
VertexBuffer *mVBTangent;
IndexBuffer *mIndexBuffer;
VertexBuffer *mVBWeights;
VertexBuffer *mVBJoints;
float2 _LightPadding;
mfloat4x4 mWorld;
float padding0;
float padding1;
float padding2;
float3 vDirection;
float fVelocity;
float fAcceleration;
float3 Padding0;
float3 _WorldLightPosition;
float ___padding0;
float3 _WorldLightDirection;
float ___padding1;
float3 _WorldLightColor;
float ___padding2;
ID3D11SamplerState *pSampler;
using namespace LunaEngine;
using namespace DirectX;
extern Window *gWindow;
extern _DirectX *gDirectX;
extern Mouse *gMouse;
extern Keyboard *gKeyboard;
using namespace DirectX;
using namespace DirectX;
StaticMeshRenderSystem *gStaticMeshRenderSystem;
VelocityIntegrationSystem *gVelocityIntegrationSystem;
AnimatedMeshRenderSystem *gAnimatedMeshRenderSystem;
MovementControlIntegrationSystem *gMovementControlIntegrationSystem;
friend StaticMeshRenderSystem;
Texture *mSkybox;
EntityHandleList mPointLightStaticList, mPointLightDynamicList;
StructuredBuffer<PointLightBuff> *sbPointLightStaticBuffer, *sbPointLightDynamicBuffer;
return mat;
return transform;
Assimp::Importer importer;
std::vector<MeshStaticComponent> mMeshList;
std::vector<MaterialComponent> mMatList;
LoaderTextureList mTextureFileList;
case aiTextureType_NORMALS:
EntityHandleList list;
return list;
std::vector<MaterialComponent>* MatList,
LoaderTextureList* TextureList,
std::vector<MaterialComponent>* MatList,
LoaderTextureList* TextureList,
std::vector<float3> Position;
std::vector<float2> Texcoord;
std::vector<float3> Normal;
std::vector<float3> Tangent;
std::vector<uint32_t> Index;
ai_real alpha;
aiString fname;
return true;
return true;
return mesh;
AmbientLightComponent ambient;
WorldLightComponent world;
delete cb;
EntityHandleList new_list;
return new_list;
float4x4 mInvViewF;
return E;
return E;
std::vector<PointLightBuff> lights;
return sbPointLightDynamicBuffer;
std::vector<PointLightBuff> lights;
return sbPointLightStaticBuffer;
return list;
return list;
ID3D11Texture1D* _1D;
ID3D11Texture2D* _2D;
ID3D11Texture3D* _3D;
uint32_t MipMaps, uint32_t BindFlags, uint32_t CPUAccess, D3D11_USAGE Usage,
uint32_t SampleCount, uint32_t Quality, uint32_t Misc, D3D11_SUBRESOURCE_DATA* subres,
D3D11_BOX src;
continue;
D3D11_SRV_DIMENSION_UNKNOWN
D3D11_RTV_DIMENSION_UNKNOWN
return Out;
D3D11_RASTERIZER_DESC pDesc;
D3D11_BLEND_DESC pDesc;
D3D11_DEPTH_STENCIL_DESC pDesc;
uint32_t w, uint32_t h, uint32_t d, uint32_t ArraySize,
delete;
D3D11_SUBRESOURCE_DATA *SubResource;
uint32_t n;
using namespace tinyddsloader;
DDSFile dds;
return;
return;
D3D11_VIEWPORT vp;
return tex;
return tex;
return tex;
case TResizeFlag::Clear:
case TResizeFlag::Keep:
case TResizeFlag::Stretch:
break;
default:
break;
return;
Keep,
Stretch,
Clear
std::variant<bool, ID3D11Texture1D*, ID3D11Texture2D*, ID3D11Texture3D*> pTexture;
DXGI_FORMAT mFormat;
uint32_t mFlags;
ID3D11UnorderedAccessView *pUAV;
ID3D11ShaderResourceView *pSRV;
static uint32_t mMaxMipMapLevels;
static Shader* shTransformRTV;
static Shader* shTransformUAV;
static ConstantBuffer* cbTransform;
static ConstantBuffer* cbCamera;
static Sampler* gPointSampler;
static Sampler* gLinearSampler;
static BlendState* bsSimple;
static RasterState* rsSimple;
static DepthStencilState* dsSimple;
uint32_t mFlags;
uint32_t mWidth, mHeight, mDepth;
std::string mName;
return _3D;
using namespace std::string_literals;
static T *gState;
static T *gStateOld;
extern _DirectX* gDirectX;
Topology mTopology;
static Topology gState;
static Topology gStateOld;
return;
std::string line, fullLine;
int id;
float u0, v0, u1, v1;
float xOffset, yOffset;
float sizeX, sizeY;
float xStep;
bool bSDF;
Texture *tFont;
Sampler *sFont;
std::vector<Character> aChars;
float mWidth, mHeight;
const char* mText;
delete txt;
case TextFlags::TextAlignment_H_Left : break;
case TextFlags::TextAlignment_V_Top : break;
TextFactory *mFactory;
Camera *mCamera;
float mScale, mInvWidth, mInvHeight, mXScale, mYScale;
CameraConfig mCameraCfg;
D3D11_VIEWPORT mViewPort;
Vertex_PT v;
continue;
continue;
delete old;
delete cbSDFSettings;
delete cbTextEffects;
DirectX::XMFLOAT4 _Color;
Shader *mShader;
ConstantBuffer *cbTextEffects, *cbSDFSettings;
return size;
char* data;
int _mRefCounter;
static TimerLog *gTimerLog;
using namespace std;
wostringstream wstm;
using namespace std;
ostringstream stm;
float ret;
return ret;
uint32_t ret;
return ret;
case DXGI_FORMAT_R32G32B32A32_TYPELESS:
case DXGI_FORMAT_R32G32B32A32_FLOAT:
case DXGI_FORMAT_R32G32B32A32_UINT:
case DXGI_FORMAT_R32G32B32A32_SINT:
case DXGI_FORMAT_R16G16B16A16_TYPELESS:
case DXGI_FORMAT_R16G16B16A16_FLOAT:
case DXGI_FORMAT_R16G16B16A16_UNORM:
case DXGI_FORMAT_R16G16B16A16_UINT:
case DXGI_FORMAT_R16G16B16A16_SNORM:
case DXGI_FORMAT_R16G16B16A16_SINT:
case DXGI_FORMAT_R10G10B10A2_TYPELESS:
case DXGI_FORMAT_R10G10B10A2_UNORM:
case DXGI_FORMAT_R10G10B10A2_UINT:
case DXGI_FORMAT_R8G8B8A8_TYPELESS:
case DXGI_FORMAT_R8G8B8A8_UNORM:
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
case DXGI_FORMAT_R8G8B8A8_UINT:
case DXGI_FORMAT_R8G8B8A8_SNORM:
case DXGI_FORMAT_R8G8B8A8_SINT:
case DXGI_FORMAT_R9G9B9E5_SHAREDEXP:
case DXGI_FORMAT_B8G8R8A8_UNORM:
case DXGI_FORMAT_B8G8R8X8_UNORM:
case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM:
case DXGI_FORMAT_B8G8R8A8_TYPELESS:
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
case DXGI_FORMAT_B8G8R8X8_TYPELESS:
case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
case DXGI_FORMAT_B5G5R5A1_UNORM:
case DXGI_FORMAT_B4G4R4A4_UNORM:
return 4;
case DXGI_FORMAT_R32G32B32_TYPELESS:
case DXGI_FORMAT_R32G32B32_FLOAT:
case DXGI_FORMAT_R32G32B32_UINT:
case DXGI_FORMAT_R32G32B32_SINT:
case DXGI_FORMAT_R32G8X24_TYPELESS:
case DXGI_FORMAT_R11G11B10_FLOAT:
case DXGI_FORMAT_B5G6R5_UNORM:
return 3;
case DXGI_FORMAT_R32G32_TYPELESS:
case DXGI_FORMAT_R32G32_FLOAT:
case DXGI_FORMAT_R32G32_UINT:
case DXGI_FORMAT_R32G32_SINT:
case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
case DXGI_FORMAT_R16G16_TYPELESS:
case DXGI_FORMAT_R16G16_FLOAT:
case DXGI_FORMAT_R16G16_UNORM:
case DXGI_FORMAT_R16G16_UINT: