nvapi_sys_new 0.1.2

Updated NVAPI bindings
Documentation
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
#include "nvapi_lite_common.h"
#include "nvapi_lite_sli.h"
#include "nvapi_lite_surround.h"
#include "nvapi_lite_stereo.h"
#include "nvapi_lite_d3dext.h"
#include "nvapi_lite_salstart.h"
/************************************************************************************************************************************\
|*                                                                                                                                    *|
|*     Copyright © 2012 NVIDIA Corporation.  All rights reserved.                                                                     *|
|*                                                                                                                                    *|
|*  NOTICE TO USER:                                                                                                                   *|
|*                                                                                                                                    *|
|*  This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws.                                  *|
|*                                                                                                                                    *|
|*  This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA                                     *|
|*  and are being provided solely under the terms and conditions of an NVIDIA software license agreement.                             *|
|*  Otherwise, you have no rights to use or access this software in any manner.                                                       *|
|*                                                                                                                                    *|
|*  If not covered by the applicable NVIDIA software license agreement:                                                               *|
|*  NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE.                                            *|
|*  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.                                                           *|
|*  NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,                                                                     *|
|*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.                       *|
|*  IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,                               *|
|*  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,  WHETHER IN AN ACTION OF CONTRACT,                         *|
|*  NEGLIGENCE OR OTHER TORTIOUS ACTION,  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE.            *|
|*                                                                                                                                    *|
|*  U.S. Government End Users.                                                                                                        *|
|*  This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995),                                       *|
|*  consisting  of "commercial computer  software"  and "commercial computer software documentation"                                  *|
|*  as such terms are  used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item.     *|
|*  Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995),                                          *|
|*  all U.S. Government End Users acquire the software with only those rights set forth herein.                                       *|
|*                                                                                                                                    *|
|*  Any use of this software in individual and commercial software must include,                                                      *|
|*  in the user documentation and internal comments to the code,                                                                      *|
|*  the above Disclaimer (as applicable) and U.S. Government End Users Notice.                                                        *|
|*                                                                                                                                    *|
\************************************************************************************************************************************/

///////////////////////////////////////////////////////////////////////////////
//
// Date: May 11, 2022
// File: nvapi.h
//
// NvAPI provides an interface to NVIDIA devices. This file contains the
// interface constants, structure definitions and function prototypes.
//
//   Target Profile: developer
//  Target Platform: windows
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _NVAPI_H
#define _NVAPI_H


#pragma pack(push, 8) // Make sure we have consistent structure packings


#ifdef __cplusplus
extern "C"
{
#endif
// ====================================================
// Universal NvAPI Definitions
// ====================================================
#ifndef _WIN32
#define __cdecl

#endif

//! @}

//!   \ingroup nvapistatus
#define NVAPI_API_NOT_INTIALIZED NVAPI_API_NOT_INITIALIZED //!< Fix typo in error code


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Initialize
    //
    //! This function initializes the NvAPI library (if not already initialized) but always increments the ref-counter.
    //! This must be called before calling other NvAPI_ functions.
    //! Note: It is now mandatory to call NvAPI_Initialize before calling any other NvAPI.
    //! NvAPI_Unload should be called to unload the NVAPI Library.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \return      This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!              specific meaning for this API, they are listed below.
    //! \retval      NVAPI_LIBRARY_NOT_FOUND  Failed to load the NVAPI support library
    //! \sa nvapistatus
    //! \ingroup nvapifunctions
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Initialize();

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Unload
    //
    //!   DESCRIPTION: Decrements the ref-counter and when it reaches ZERO, unloads NVAPI library.
    //!                This must be called in pairs with NvAPI_Initialize.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //!        If the client wants unload functionality, it is recommended to always call NvAPI_Initialize and NvAPI_Unload in pairs.
    //!
    //!  Unloading NvAPI library is not supported when the library is in a resource locked state.
    //!  Some functions in the NvAPI library initiates an operation or allocates certain resources
    //!  and there are corresponding functions available, to complete the operation or free the
    //!  allocated resources. All such function pairs are designed to prevent unloading NvAPI library.
    //!
    //!  For example, if NvAPI_Unload is called after NvAPI_XXX which locks a resource, it fails with
    //!  NVAPI_ERROR. Developers need to call the corresponding NvAPI_YYY to unlock the resources,
    //!  before calling NvAPI_Unload again.
    //!
    //! \return      This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!              specific meaning for this API, they are listed below.
    //! \retval      NVAPI_API_IN_USE       Atleast an API is still being called hence cannot unload requested driver.
    //!
    //! \ingroup nvapifunctions
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Unload();

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetErrorMessage
    //
    //! This function converts an NvAPI error code into a null terminated string.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \param nr      The error code to convert
    //! \param szDesc  The string corresponding to the error code
    //!
    //! \return NULL terminated string (always, never NULL)
    //! \ingroup nvapifunctions
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetErrorMessage(NvAPI_Status nr, NvAPI_ShortString szDesc);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetInterfaceVersionString
    //
    //! This function returns a string describing the version of the NvAPI library.
    //!               The contents of the string are human readable.  Do not assume a fixed
    //!                format.
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \param  szDesc User readable string giving NvAPI version information
    //!
    //! \return See \ref nvapistatus for the list of possible return values.
    //! \ingroup nvapifunctions
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetInterfaceVersionString(NvAPI_ShortString szDesc);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetInterfaceVersionStringEx
    //
    //! This function returns a string describing the version of the NvAPI library.
    //!               The contents of the string are human readable.  Do not assume a fixed  format.
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 450
    //!
    //! \param  szDesc User readable string giving NvAPI version information
    //!
    //! \return See \ref nvapistatus for the list of possible return values.
    //! \ingroup nvapifunctions
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetInterfaceVersionStringEx(NvAPI_ShortString szDesc);

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //              All display port related data types definition starts
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    // This category is intentionally added before the #ifdef. The #endif should also be in the same scope

#ifndef DISPLAYPORT_STRUCTS_DEFINED
#define DISPLAYPORT_STRUCTS_DEFINED


    //! \ingroup dispcontrol
    //! Used in NV_DISPLAY_PORT_INFO.
    typedef enum _NV_DP_LINK_RATE
    {
        NV_DP_1_62GBPS = 6,
        NV_DP_2_70GBPS = 0xA,
        NV_DP_5_40GBPS = 0x14,
        NV_DP_8_10GBPS = 0x1E,
        // Recommended Intermidiate Link Transfer Rates
        NV_EDP_2_16GBPS = 8,
        NV_EDP_2_43GBPS = 9,
        NV_EDP_3_24GBPS = 0xC,
        NV_EDP_4_32GBPS = 0x10
    } NV_DP_LINK_RATE;

    //! \ingroup dispcontrol
    //! Used in NV_DISPLAY_PORT_INFO.
    typedef enum _NV_DP_LANE_COUNT
    {
        NV_DP_1_LANE = 1,
        NV_DP_2_LANE = 2,
        NV_DP_4_LANE = 4,
    } NV_DP_LANE_COUNT;

    //! \ingroup dispcontrol
    //! Used in NV_DISPLAY_PORT_INFO.
    typedef enum _NV_DP_COLOR_FORMAT
    {
        NV_DP_COLOR_FORMAT_RGB = 0,
        NV_DP_COLOR_FORMAT_YCbCr422,
        NV_DP_COLOR_FORMAT_YCbCr444,
    } NV_DP_COLOR_FORMAT;

    //! \ingroup dispcontrol
    //! Used in NV_DISPLAY_PORT_INFO.
    typedef enum _NV_DP_COLORIMETRY
    {
        NV_DP_COLORIMETRY_RGB = 0,
        NV_DP_COLORIMETRY_YCbCr_ITU601,
        NV_DP_COLORIMETRY_YCbCr_ITU709,
    } NV_DP_COLORIMETRY;

    //! \ingroup dispcontrol
    //! Used in NV_DISPLAY_PORT_INFO.
    typedef enum _NV_DP_DYNAMIC_RANGE
    {
        NV_DP_DYNAMIC_RANGE_VESA = 0,
        NV_DP_DYNAMIC_RANGE_CEA,
    } NV_DP_DYNAMIC_RANGE;

    //! \ingroup dispcontrol
    //! Used in NV_DISPLAY_PORT_INFO.
    typedef enum _NV_DP_BPC
    {
        NV_DP_BPC_DEFAULT = 0,
        NV_DP_BPC_6,
        NV_DP_BPC_8,
        NV_DP_BPC_10,
        NV_DP_BPC_12,
        NV_DP_BPC_16,
    } NV_DP_BPC;

#endif //#ifndef DISPLAYPORT_STRUCTS_DEFINED

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //              All display port related data types definitions end
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetEDID
    //
    //! \fn NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID)
    //!  This function returns the EDID data for the specified GPU handle and connection bit mask.
    //!  displayOutputId should have exactly 1 bit set to indicate a single display. See \ref handles.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 85
    //!
    //! \retval    NVAPI_INVALID_ARGUMENT              pEDID is NULL; displayOutputId has 0 or > 1 bits set
    //! \retval    NVAPI_OK                           *pEDID contains valid data.
    //! \retval    NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //! \retval    NVAPI_DATA_NOT_FOUND                The requested display does not contain an EDID.
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpu
    //! @{

#define NV_EDID_V1_DATA_SIZE 256


#define NV_EDID_DATA_SIZE NV_EDID_V1_DATA_SIZE


    typedef struct
    {
        NvU32 version; // structure version
        NvU8 EDID_Data[NV_EDID_DATA_SIZE];
    } NV_EDID_V1;

    //! Used in NvAPI_GPU_GetEDID()
    typedef struct
    {
        NvU32 version; //!< Structure version
        NvU8 EDID_Data[NV_EDID_DATA_SIZE];
        NvU32 sizeofEDID;
    } NV_EDID_V2;

    //! Used in NvAPI_GPU_GetEDID()
    typedef struct
    {
        NvU32 version; //!< Structure version
        NvU8 EDID_Data[NV_EDID_DATA_SIZE];
        NvU32 sizeofEDID;
        NvU32 edidId; //!< ID which always returned in a monotonically increasing counter.
                      //!< Across a split-EDID read we need to verify that all calls returned the same edidId.
                      //!< This counter is incremented if we get the updated EDID.
        NvU32 offset; //!< Which 256-byte page of the EDID we want to read. Start at 0.
                      //!< If the read succeeds with edidSize > NV_EDID_DATA_SIZE,
                      //!< call back again with offset+256 until we have read the entire buffer
    } NV_EDID_V3;

    typedef NV_EDID_V3 NV_EDID;

#define NV_EDID_VER1 MAKE_NVAPI_VERSION(NV_EDID_V1, 1)

#define NV_EDID_VER2 MAKE_NVAPI_VERSION(NV_EDID_V2, 2)

#define NV_EDID_VER3 MAKE_NVAPI_VERSION(NV_EDID_V3, 3)

#define NV_EDID_VER NV_EDID_VER3


    //! @}

    //! \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID);

    //! \ingroup gpu
    //! Used in NV_GPU_CONNECTOR_DATA
    typedef enum _NV_GPU_CONNECTOR_TYPE
    {
        NVAPI_GPU_CONNECTOR_VGA_15_PIN = 0x00000000,
        NVAPI_GPU_CONNECTOR_TV_COMPOSITE = 0x00000010,
        NVAPI_GPU_CONNECTOR_TV_SVIDEO = 0x00000011,
        NVAPI_GPU_CONNECTOR_TV_HDTV_COMPONENT = 0x00000013,
        NVAPI_GPU_CONNECTOR_TV_SCART = 0x00000014,
        NVAPI_GPU_CONNECTOR_TV_COMPOSITE_SCART_ON_EIAJ4120 = 0x00000016,
        NVAPI_GPU_CONNECTOR_TV_HDTV_EIAJ4120 = 0x00000017,
        NVAPI_GPU_CONNECTOR_PC_POD_HDTV_YPRPB = 0x00000018,
        NVAPI_GPU_CONNECTOR_PC_POD_SVIDEO = 0x00000019,
        NVAPI_GPU_CONNECTOR_PC_POD_COMPOSITE = 0x0000001A,
        NVAPI_GPU_CONNECTOR_DVI_I_TV_SVIDEO = 0x00000020,
        NVAPI_GPU_CONNECTOR_DVI_I_TV_COMPOSITE = 0x00000021,
        NVAPI_GPU_CONNECTOR_DVI_I = 0x00000030,
        NVAPI_GPU_CONNECTOR_DVI_D = 0x00000031,
        NVAPI_GPU_CONNECTOR_ADC = 0x00000032,
        NVAPI_GPU_CONNECTOR_LFH_DVI_I_1 = 0x00000038,
        NVAPI_GPU_CONNECTOR_LFH_DVI_I_2 = 0x00000039,
        NVAPI_GPU_CONNECTOR_SPWG = 0x00000040,
        NVAPI_GPU_CONNECTOR_OEM = 0x00000041,
        NVAPI_GPU_CONNECTOR_DISPLAYPORT_EXTERNAL = 0x00000046,
        NVAPI_GPU_CONNECTOR_DISPLAYPORT_INTERNAL = 0x00000047,
        NVAPI_GPU_CONNECTOR_DISPLAYPORT_MINI_EXT = 0x00000048,
        NVAPI_GPU_CONNECTOR_HDMI_A = 0x00000061,
        NVAPI_GPU_CONNECTOR_HDMI_C_MINI = 0x00000063,
        NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_1 = 0x00000064,
        NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_2 = 0x00000065,
        NVAPI_GPU_CONNECTOR_VIRTUAL_WFD = 0x00000070, //!< Deprecated.
        NVAPI_GPU_CONNECTOR_USB_C = 0x00000071,
        NVAPI_GPU_CONNECTOR_UNKNOWN = 0xFFFFFFFF,
    } NV_GPU_CONNECTOR_TYPE;

    ////////////////////////////////////////////////////////////////////////////////
    //
    // NvAPI_TVOutput Information
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup tvapi
    //! Used in NV_DISPLAY_TV_OUTPUT_INFO
    typedef enum _NV_DISPLAY_TV_FORMAT
    {
        NV_DISPLAY_TV_FORMAT_NONE = 0,
        NV_DISPLAY_TV_FORMAT_SD_NTSCM = 0x00000001,
        NV_DISPLAY_TV_FORMAT_SD_NTSCJ = 0x00000002,
        NV_DISPLAY_TV_FORMAT_SD_PALM = 0x00000004,
        NV_DISPLAY_TV_FORMAT_SD_PALBDGH = 0x00000008,
        NV_DISPLAY_TV_FORMAT_SD_PALN = 0x00000010,
        NV_DISPLAY_TV_FORMAT_SD_PALNC = 0x00000020,
        NV_DISPLAY_TV_FORMAT_SD_576i = 0x00000100,
        NV_DISPLAY_TV_FORMAT_SD_480i = 0x00000200,
        NV_DISPLAY_TV_FORMAT_ED_480p = 0x00000400,
        NV_DISPLAY_TV_FORMAT_ED_576p = 0x00000800,
        NV_DISPLAY_TV_FORMAT_HD_720p = 0x00001000,
        NV_DISPLAY_TV_FORMAT_HD_1080i = 0x00002000,
        NV_DISPLAY_TV_FORMAT_HD_1080p = 0x00004000,
        NV_DISPLAY_TV_FORMAT_HD_720p50 = 0x00008000,
        NV_DISPLAY_TV_FORMAT_HD_1080p24 = 0x00010000,
        NV_DISPLAY_TV_FORMAT_HD_1080i50 = 0x00020000,
        NV_DISPLAY_TV_FORMAT_HD_1080p50 = 0x00040000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp30 = 0x00080000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp30_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp30,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp25 = 0x00100000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp25_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp25,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp24 = 0x00200000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp24_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp24,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp24_SMPTE = 0x00400000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp50_3840 = 0x00800000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp60_3840 = 0x00900000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp30_4096 = 0x00A00000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp25_4096 = 0x00B00000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp24_4096 = 0x00C00000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp50_4096 = 0x00D00000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp60_4096 = 0x00E00000,
        NV_DISPLAY_TV_FORMAT_UHD_8Kp24_7680 = 0x01000000,
        NV_DISPLAY_TV_FORMAT_UHD_8Kp25_7680 = 0x02000000,
        NV_DISPLAY_TV_FORMAT_UHD_8Kp30_7680 = 0x04000000,
        NV_DISPLAY_TV_FORMAT_UHD_8Kp48_7680 = 0x08000000,
        NV_DISPLAY_TV_FORMAT_UHD_8Kp50_7680 = 0x09000000,
        NV_DISPLAY_TV_FORMAT_UHD_8Kp60_7680 = 0x0A000000,
        NV_DISPLAY_TV_FORMAT_UHD_8Kp100_7680 = 0x0B000000,
        NV_DISPLAY_TV_FORMAT_UHD_8Kp120_7680 = 0x0C000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp48_3840 = 0x0D000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp48_4096 = 0x0E000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp100_4096 = 0x0F000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp100_3840 = 0x10000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp120_4096 = 0x11000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp120_3840 = 0x12000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp100_5120 = 0x13000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp120_5120 = 0x14000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp24_5120 = 0x15000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp25_5120 = 0x16000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp30_5120 = 0x17000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp48_5120 = 0x18000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp50_5120 = 0x19000000,
        NV_DISPLAY_TV_FORMAT_UHD_4Kp60_5120 = 0x20000000,
        NV_DISPLAY_TV_FORMAT_UHD_10Kp24_10240 = 0x21000000,
        NV_DISPLAY_TV_FORMAT_UHD_10Kp25_10240 = 0x22000000,
        NV_DISPLAY_TV_FORMAT_UHD_10Kp30_10240 = 0x23000000,
        NV_DISPLAY_TV_FORMAT_UHD_10Kp48_10240 = 0x24000000,
        NV_DISPLAY_TV_FORMAT_UHD_10Kp50_10240 = 0x25000000,
        NV_DISPLAY_TV_FORMAT_UHD_10Kp60_10240 = 0x26000000,
        NV_DISPLAY_TV_FORMAT_UHD_10Kp100_10240 = 0x27000000,
        NV_DISPLAY_TV_FORMAT_UHD_10Kp120_10240 = 0x28000000,

        NV_DISPLAY_TV_FORMAT_SD_OTHER = 0x30000000,
        NV_DISPLAY_TV_FORMAT_ED_OTHER = 0x40000000,
        NV_DISPLAY_TV_FORMAT_HD_OTHER = 0x50000000,

        NV_DISPLAY_TV_FORMAT_ANY = 0x80000000,

    } NV_DISPLAY_TV_FORMAT;

//! \ingroup dispcontrol
//! @{
#define NVAPI_MAX_VIEW_TARGET 2

#define NVAPI_ADVANCED_MAX_VIEW_TARGET 4


#ifndef _NV_TARGET_VIEW_MODE_
#define _NV_TARGET_VIEW_MODE_


    //! Used in NvAPI_SetView().
    typedef enum _NV_TARGET_VIEW_MODE
    {
        NV_VIEW_MODE_STANDARD = 0,
        NV_VIEW_MODE_CLONE = 1,
        NV_VIEW_MODE_HSPAN = 2,
        NV_VIEW_MODE_VSPAN = 3,
        NV_VIEW_MODE_DUALVIEW = 4,
        NV_VIEW_MODE_MULTIVIEW = 5,
    } NV_TARGET_VIEW_MODE;
#endif

    //! @}

    // Following definitions are used in NvAPI_SetViewEx.

    //! Scaling modes - used in NvAPI_SetViewEx().
    //! \ingroup dispcontrol
    typedef enum _NV_SCALING
    {
        NV_SCALING_DEFAULT = 0, //!< No change

        // New Scaling Declarations
        NV_SCALING_GPU_SCALING_TO_CLOSEST = 1,                   //!< Balanced  - Full Screen
        NV_SCALING_GPU_SCALING_TO_NATIVE = 2,                    //!< Force GPU - Full Screen
        NV_SCALING_GPU_SCANOUT_TO_NATIVE = 3,                    //!< Force GPU - Centered\No Scaling
        NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE = 5,  //!< Force GPU - Aspect Ratio
        NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_CLOSEST = 6, //!< Balanced  - Aspect Ratio
        NV_SCALING_GPU_SCANOUT_TO_CLOSEST = 7,                   //!< Balanced  - Centered\No Scaling
        NV_SCALING_GPU_INTEGER_ASPECT_SCALING = 8,               //!< Force GPU - Integer Scaling

        // Legacy Declarations
        NV_SCALING_MONITOR_SCALING = NV_SCALING_GPU_SCALING_TO_CLOSEST,
        NV_SCALING_ADAPTER_SCALING = NV_SCALING_GPU_SCALING_TO_NATIVE,
        NV_SCALING_CENTERED = NV_SCALING_GPU_SCANOUT_TO_NATIVE,
        NV_SCALING_ASPECT_SCALING = NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE,

        NV_SCALING_CUSTOMIZED = 255 //!< For future use
    } NV_SCALING;

    //! Rotate modes- used in NvAPI_SetViewEx().

    //! \ingroup dispcontrol
    typedef enum _NV_ROTATE
    {
        NV_ROTATE_0 = 0,
        NV_ROTATE_90 = 1,
        NV_ROTATE_180 = 2,
        NV_ROTATE_270 = 3,
        NV_ROTATE_IGNORED = 4,
    } NV_ROTATE;

//! Color formats- used in NvAPI_SetViewEx().
//! \ingroup dispcontrol
#define NVFORMAT_MAKEFOURCC(ch0, ch1, ch2, ch3)       \

    ((NvU32)(NvU8)(ch0) | ((NvU32)(NvU8)(ch1) << 8) | \
     ((NvU32)(NvU8)(ch2) << 16) | ((NvU32)(NvU8)(ch3) << 24))

    //! Color formats- used in NvAPI_SetViewEx().
    //! \ingroup dispcontrol
    typedef enum _NV_FORMAT
    {
        NV_FORMAT_UNKNOWN = 0,         //!< unknown. Driver will choose one as following value.
        NV_FORMAT_P8 = 41,             //!< for 8bpp mode
        NV_FORMAT_R5G6B5 = 23,         //!< for 16bpp mode
        NV_FORMAT_A8R8G8B8 = 21,       //!< for 32bpp mode
        NV_FORMAT_A16B16G16R16F = 113, //!< for 64bpp(floating point) mode.

    } NV_FORMAT;

    // TV standard

    typedef struct
    {
        float x; //!<  x-coordinate of the viewport top-left point
        float y; //!<  y-coordinate of the viewport top-left point
        float w; //!<  Width of the viewport
        float h; //!<  Height of the viewport
    } NV_VIEWPORTF;

    //! \ingroup dispcontrol
    //! The timing override is not supported yet; must be set to _AUTO. \n

    typedef enum _NV_TIMING_OVERRIDE
    {
        NV_TIMING_OVERRIDE_CURRENT = 0,   //!< get the current timing
        NV_TIMING_OVERRIDE_AUTO,          //!< the timing the driver will use based the current policy
        NV_TIMING_OVERRIDE_EDID,          //!< EDID timing
        NV_TIMING_OVERRIDE_DMT,           //!< VESA DMT timing
        NV_TIMING_OVERRIDE_DMT_RB,        //!< VESA DMT timing with reduced blanking
        NV_TIMING_OVERRIDE_CVT,           //!< VESA CVT timing
        NV_TIMING_OVERRIDE_CVT_RB,        //!< VESA CVT timing with reduced blanking
        NV_TIMING_OVERRIDE_GTF,           //!< VESA GTF timing
        NV_TIMING_OVERRIDE_EIA861,        //!< EIA 861x pre-defined timing
        NV_TIMING_OVERRIDE_ANALOG_TV,     //!< analog SD/HDTV timing
        NV_TIMING_OVERRIDE_CUST,          //!< NV custom timings
        NV_TIMING_OVERRIDE_NV_PREDEFINED, //!< NV pre-defined timing (basically the PsF timings)
        NV_TIMING_OVERRIDE_NV_PSF = NV_TIMING_OVERRIDE_NV_PREDEFINED,
        NV_TIMING_OVERRIDE_NV_ASPR,
        NV_TIMING_OVERRIDE_SDI, //!< Override for SDI timing

        NV_TIMING_OVRRIDE_MAX,
    } NV_TIMING_OVERRIDE;

#ifndef NV_TIMING_STRUCTS_DEFINED
#define NV_TIMING_STRUCTS_DEFINED


    //***********************
    // The Timing Structure
    //***********************
    //
    //! \ingroup dispcontrol
    //!  NVIDIA-specific timing extras \n
    //! Used in NV_TIMING.
    typedef struct tagNV_TIMINGEXT
    {
        NvU32 flag;    //!< Reserved for NVIDIA hardware-based enhancement, such as double-scan.
        NvU16 rr;      //!< Logical refresh rate to present
        NvU32 rrx1k;   //!< Physical vertical refresh rate in 0.001Hz
        NvU32 aspect;  //!< Display aspect ratio Hi(aspect):horizontal-aspect, Low(aspect):vertical-aspect
        NvU16 rep;     //!< Bit-wise pixel repetition factor: 0x1:no pixel repetition; 0x2:each pixel repeats twice horizontally,..
        NvU32 status;  //!< Timing standard
        NvU8 name[40]; //!< Timing name
    } NV_TIMINGEXT;

    //! \ingroup dispcontrol
    //! The very basic timing structure based on the VESA standard:
    //! \code
    //!            |<----------------------------htotal--------------------------->|
    //!             ---------"active" video-------->|<-------blanking------>|<-----
    //!            |<-------hvisible-------->|<-hb->|<-hfp->|<-hsw->|<-hbp->|<-hb->|
    //! --------- -+-------------------------+      |       |       |       |      |
    //!   A      A |                         |      |       |       |       |      |
    //!   :      : |                         |      |       |       |       |      |
    //!   :      : |                         |      |       |       |       |      |
    //!   :vertical|    addressable video    |      |       |       |       |      |
    //!   : visible|                         |      |       |       |       |      |
    //!   :      : |                         |      |       |       |       |      |
    //!   :      : |                         |      |       |       |       |      |
    //! vertical V |                         |      |       |       |       |      |
    //!  total   --+-------------------------+      |       |       |       |      |
    //!   :      vb         border                  |       |       |       |      |
    //!   :      -----------------------------------+       |       |       |      |
    //!   :      vfp        front porch                     |       |       |      |
    //!   :      -------------------------------------------+       |       |      |
    //!   :      vsw        sync width                              |       |      |
    //!   :      ---------------------------------------------------+       |      |
    //!   :      vbp        back porch                                      |      |
    //!   :      -----------------------------------------------------------+      |
    //!   V      vb         border                                                 |
    //! ---------------------------------------------------------------------------+
    //! \endcode
    typedef struct _NV_TIMING
    {
        // VESA scan out timing parameters:
        NvU16 HVisible;    //!< horizontal visible
        NvU16 HBorder;     //!< horizontal border
        NvU16 HFrontPorch; //!< horizontal front porch
        NvU16 HSyncWidth;  //!< horizontal sync width
        NvU16 HTotal;      //!< horizontal total
        NvU8 HSyncPol;     //!< horizontal sync polarity: 1-negative, 0-positive

        NvU16 VVisible;    //!< vertical visible
        NvU16 VBorder;     //!< vertical border
        NvU16 VFrontPorch; //!< vertical front porch
        NvU16 VSyncWidth;  //!< vertical sync width
        NvU16 VTotal;      //!< vertical total
        NvU8 VSyncPol;     //!< vertical sync polarity: 1-negative, 0-positive

        NvU16 interlaced; //!< 1-interlaced, 0-progressive
        NvU32 pclk;       //!< pixel clock in 10 kHz

        // other timing related extras
        NV_TIMINGEXT etc;
    } NV_TIMING;
#endif // NV_TIMING_STRUCTS_DEFINED

//! \addtogroup dispcontrol
//! Timing-related constants
//! @{
#define NV_TIMING_H_SYNC_POSITIVE 0

#define NV_TIMING_H_SYNC_NEGATIVE 1

#define NV_TIMING_H_SYNC_DEFAULT NV_TIMING_H_SYNC_NEGATIVE

//
#define NV_TIMING_V_SYNC_POSITIVE 0

#define NV_TIMING_V_SYNC_NEGATIVE 1

#define NV_TIMING_V_SYNC_DEFAULT NV_TIMING_V_SYNC_POSITIVE

//
#define NV_TIMING_PROGRESSIVE 0

#define NV_TIMING_INTERLACED 1

#define NV_TIMING_INTERLACED_EXTRA_VBLANK_ON_FIELD2 1

#define NV_TIMING_INTERLACED_NO_EXTRA_VBLANK_ON_FIELD2 2

    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_SetView
    //
    //! \fn NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView)
    //!  This function lets the caller modify the target display arrangement of the selected source display handle in any nView mode.
    //!  It can also modify or extend the source display in Dualview mode.
    //!  \note Maps the selected source to the associated target Ids.
    //!  \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 90
    //!
    //! \param [in]  hNvDisplay       NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
    //! \param [in]  pTargetInfo      Pointer to array of NV_VIEW_TARGET_INFO, specifying device properties in this view.
    //!                               The first device entry in the array is the physical primary.
    //!                               The device entry with the lowest source id is the desktop primary.
    //! \param [in]  targetCount      Count of target devices specified in pTargetInfo.
    //! \param [in]  targetView       Target view selected from NV_TARGET_VIEW_MODE.
    //!
    //! \retval  NVAPI_OK               Completed request
    //! \retval  NVAPI_ERROR            Miscellaneous error occurred
    //! \retval  NVAPI_INVALID_ARGUMENT Invalid input parameter.
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup dispcontrol
    //! Used in NvAPI_SetView() and NvAPI_GetView()
    typedef struct
    {
        NvU32 version; //!< (IN) structure version
        NvU32 count;   //!< (IN) target count
        struct
        {
            NvU32 deviceMask;        //!< (IN/OUT) Device mask
            NvU32 sourceId;          //!< (IN/OUT) Source ID - values will be based on the number of heads exposed per GPU.
            NvU32 bPrimary : 1;      //!< (OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
                                     //!< NvAPI_SetView automatically selects the first target in NV_VIEW_TARGET_INFO index 0 as the GPU's primary view.
            NvU32 bInterlaced : 1;   //!< (IN/OUT) Indicates if the timing being used on this monitor is interlaced.
            NvU32 bGDIPrimary : 1;   //!< (IN/OUT) Indicates if this is the desktop GDI primary.
            NvU32 bForceModeSet : 1; //!< (IN) Used only on Win7 and higher during a call to NvAPI_SetView(). Turns off optimization & forces OS to set supplied mode.
        } target[NVAPI_MAX_VIEW_TARGET];
    } NV_VIEW_TARGET_INFO;

//! \ingroup dispcontrol
#define NV_VIEW_TARGET_INFO_VER MAKE_NVAPI_VERSION(NV_VIEW_TARGET_INFO, 2)


    //! \ingroup dispcontrol
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.")
        NVAPI_INTERFACE NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView);

///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME:   NvAPI_SetViewEx
//
//!  \fn NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView)
//!  This function lets caller to modify the display arrangement for selected source display handle in any of the nview modes.
//!  It also allows to modify or extend the source display in dualview mode.
//!   \note Maps the selected source to the associated target Ids.
//!   \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
//!
//! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.
//! SUPPORTED OS:  Windows 7 and higher
//!
//!
//! \since Release: 95
//!
//! \param [in]  hNvDisplay   NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with
//!                           NvAPI_EnumNVidiaDisplayHandle().
//! \param [in]  pPathInfo    Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view.
//!                           The first device entry in the array is the physical primary.
//!                           The device entry with the lowest source id is the desktop primary.
//! \param [in]  pathCount    Count of paths specified in pPathInfo.
//! \param [in]  displayView  Display view selected from NV_TARGET_VIEW_MODE.
//!
//! \retval  NVAPI_OK                Completed request
//! \retval  NVAPI_ERROR             Miscellaneous error occurred
//! \retval  NVAPI_INVALID_ARGUMENT  Invalid input parameter.
//
///////////////////////////////////////////////////////////////////////////////

//! \ingroup dispcontrol
#define NVAPI_MAX_DISPLAY_PATH NVAPI_MAX_VIEW_TARGET


//! \ingroup dispcontrol
#define NVAPI_ADVANCED_MAX_DISPLAY_PATH NVAPI_ADVANCED_MAX_VIEW_TARGET


    //! \ingroup dispcontrol
    //! Used in NV_DISPLAY_PATH_INFO.
    typedef struct
    {
        NvU32 deviceMask;                //!< (IN) Device mask
        NvU32 sourceId;                  //!< (IN) Values will be based on the number of heads exposed per GPU(0, 1?)
        NvU32 bPrimary : 1;              //!< (IN/OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
                                         //!< NvAPI_SetViewEx() automatically selects the first target in NV_DISPLAY_PATH_INFO index 0 as the GPU's primary view.
        NV_GPU_CONNECTOR_TYPE connector; //!< (IN) Specify connector type. For TV only.

        // source mode information
        NvU32 width;           //!< (IN) Width of the mode
        NvU32 height;          //!< (IN) Height of the mode
        NvU32 depth;           //!< (IN) Depth of the mode
        NV_FORMAT colorFormat; //!<      Color format if it needs to be specified. Not used now.

        // rotation setting of the mode
        NV_ROTATE rotation; //!< (IN) Rotation setting.

        // the scaling mode
        NV_SCALING scaling; //!< (IN) Scaling setting

        // Timing info
        NvU32 refreshRate;    //!< (IN) Refresh rate of the mode
        NvU32 interlaced : 1; //!< (IN) Interlaced mode flag

        NV_DISPLAY_TV_FORMAT tvFormat; //!< (IN) To choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE

        // Windows desktop position
        NvU32 posx;            //!< (IN/OUT) X-offset of this display on the Windows desktop
        NvU32 posy;            //!< (IN/OUT) Y-offset of this display on the Windows desktop
        NvU32 bGDIPrimary : 1; //!< (IN/OUT) Indicates if this is the desktop GDI primary.

        NvU32 bForceModeSet : 1; //!< (IN) Used only on Win7 and higher during a call to NvAPI_SetViewEx(). Turns off optimization & forces OS to set supplied mode.
        NvU32 bFocusDisplay : 1; //!< (IN) If set, this display path should have the focus after the GPU topology change
        NvU32 gpuId : 24;        //!< (IN) the physical display/target Gpu id which is the owner of the scan out (for SLI multimon, display from the slave Gpu)

    } NV_DISPLAY_PATH;

    //! \ingroup dispcontrol
    //! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx().
    typedef struct
    {
        NvU32 version; //!< (IN) Structure version
        NvU32 count;   //!< (IN) Path count
        NV_DISPLAY_PATH path[NVAPI_MAX_DISPLAY_PATH];
    } NV_DISPLAY_PATH_INFO_V3;

    //! \ingroup dispcontrol
    //! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx().
    typedef struct
    {
        NvU32 version; //!< (IN) Structure version
        NvU32 count;   //!< (IN) Path count
        NV_DISPLAY_PATH path[NVAPI_ADVANCED_MAX_DISPLAY_PATH];
    } NV_DISPLAY_PATH_INFO;

//! \addtogroup dispcontrol
//! Macro for constructing the version fields of NV_DISPLAY_PATH_INFO
//! @{
#define NV_DISPLAY_PATH_INFO_VER NV_DISPLAY_PATH_INFO_VER4

#define NV_DISPLAY_PATH_INFO_VER4 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO, 4)

#define NV_DISPLAY_PATH_INFO_VER3 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO, 3)

#define NV_DISPLAY_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO, 2)

#define NV_DISPLAY_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO, 1)

    //! @}
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_SetViewEx
    //
    //!  \fn NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView)
    //!  This function lets caller to modify the display arrangement for selected source display handle in any of the nview modes.
    //!  It also allows to modify or extend the source display in dualview mode.
    //!   \note Maps the selected source to the associated target Ids.
    //!   \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 95
    //!
    //! \param [in]  hNvDisplay   NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with
    //!                           NvAPI_EnumNVidiaDisplayHandle().
    //! \param [in]  pPathInfo    Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view.
    //!                           The first device entry in the array is the physical primary.
    //!                           The device entry with the lowest source id is the desktop primary.
    //! \param [in]  pathCount    Count of paths specified in pPathInfo.
    //! \param [in]  displayView  Display view selected from NV_TARGET_VIEW_MODE.
    //!
    //! \retval  NVAPI_OK                Completed request
    //! \retval  NVAPI_ERROR             Miscellaneous error occurred
    //! \retval  NVAPI_INVALID_ARGUMENT  Invalid input parameter.
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup dispcontrol
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.")
        NVAPI_INTERFACE NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView);

    ///////////////////////////////////////////////////////////////////////////////
    // SetDisplayConfig/GetDisplayConfig
    ///////////////////////////////////////////////////////////////////////////////
    //! \ingroup dispcontrol

    typedef struct _NV_POSITION
    {
        NvS32 x;
        NvS32 y;
    } NV_POSITION;

    //! \ingroup dispcontrol
    typedef struct _NV_RESOLUTION
    {
        NvU32 width;
        NvU32 height;
        NvU32 colorDepth;
    } NV_RESOLUTION;

    //! \ingroup dispcontrol
    typedef struct _NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1
    {
        NvU32 version;

        // Rotation and Scaling
        NV_ROTATE rotation; //!< (IN) rotation setting.
        NV_SCALING scaling; //!< (IN) scaling setting.

        // Refresh Rate
        NvU32 refreshRate1K; //!< (IN) Non-interlaced Refresh Rate of the mode, multiplied by 1000, 0 = ignored
                             //!< This is the value which driver reports to the OS.
        // Flags
        NvU32 interlaced : 1; //!< (IN) Interlaced mode flag, ignored if refreshRate == 0
        NvU32 primary : 1;    //!< (IN) Declares primary display in clone configuration. This is *NOT* GDI Primary.
                              //!< Only one target can be primary per source. If no primary is specified, the first
                              //!< target will automatically be primary.
#ifdef NV_PAN_AND_SCAN_DEFINED
        NvU32 isPanAndScanTarget : 1; //!< Whether on this target Pan and Scan is enabled or has to be enabled. Valid only
                                      //!< when the target is part of clone topology.
#else
    NvU32 reservedBit1 : 1;
#endif
        NvU32 disableVirtualModeSupport : 1;
        NvU32 isPreferredUnscaledTarget : 1;
        NvU32 reserved : 27;
        // TV format information
        NV_GPU_CONNECTOR_TYPE connector; //!< Specify connector type. For TV only, ignored if tvFormat == NV_DISPLAY_TV_FORMAT_NONE
        NV_DISPLAY_TV_FORMAT tvFormat;   //!< (IN) to choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE
                                         //!< In case of NvAPI_DISP_GetDisplayConfig(), this field will indicate the currently applied TV format;
                                         //!< if no TV format is applied, this field will have NV_DISPLAY_TV_FORMAT_NONE value.
                                         //!< In case of NvAPI_DISP_SetDisplayConfig(), this field should only be set in case of TVs;
                                         //!< for other displays this field will be ignored and resolution & refresh rate specified in input will be used to apply the TV format.

        // Backend (raster) timing standard
        NV_TIMING_OVERRIDE timingOverride; //!< Ignored if timingOverride == NV_TIMING_OVERRIDE_CURRENT
        NV_TIMING timing;                  //!< Scan out timing, valid only if timingOverride == NV_TIMING_OVERRIDE_CUST
                                           //!< The value NV_TIMING::NV_TIMINGEXT::rrx1k is obtained from the EDID. The driver may
                                           //!< tweak this value for HDTV, stereo, etc., before reporting it to the OS.
    } NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1;

    //! \ingroup dispcontrol
    typedef NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO;

//! \ingroup dispcontrol
#define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1, 1)


//! \ingroup dispcontrol
#define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1


    //! \ingroup dispcontrol
    typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1
    {
        NvU32 displayId;                                     //!< Display ID
        NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO *details; //!< May be NULL if no advanced settings are required. NULL for Non-NVIDIA Display.
    } NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1;

    //! \ingroup dispcontrol
    typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2
    {
        NvU32 displayId;                                     //!< Display ID
        NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO *details; //!< May be NULL if no advanced settings are required
        NvU32 targetId;                                      //!< Windows CCD target ID. Must be present only for non-NVIDIA adapter, for NVIDIA adapter this parameter is ignored.
    } NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2;

    //! \ingroup dispcontrol
    //! As version is not defined for this structure, we will be using version of NV_DISPLAYCONFIG_PATH_INFO
    typedef NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 NV_DISPLAYCONFIG_PATH_TARGET_INFO;

    //! \ingroup dispcontrol
    typedef enum _NV_DISPLAYCONFIG_SPANNING_ORIENTATION
    {
        NV_DISPLAYCONFIG_SPAN_NONE = 0,
        NV_DISPLAYCONFIG_SPAN_HORIZONTAL = 1,
        NV_DISPLAYCONFIG_SPAN_VERTICAL = 2,
    } NV_DISPLAYCONFIG_SPANNING_ORIENTATION;

    //! \ingroup dispcontrol
    typedef struct _NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1
    {
        NV_RESOLUTION resolution;
        NV_FORMAT colorFormat;                                     //!< Ignored at present, must be NV_FORMAT_UNKNOWN (0)
        NV_POSITION position;                                      //!< Is all positions are 0 or invalid, displays will be automatically
                                                                   //!< positioned from left to right with GDI Primary at 0,0, and all
                                                                   //!< other displays in the order of the path array.
        NV_DISPLAYCONFIG_SPANNING_ORIENTATION spanningOrientation; //!< Spanning is only supported on XP
        NvU32 bGDIPrimary : 1;
        NvU32 bSLIFocus : 1;
        NvU32 reserved : 30; //!< Must be 0
    } NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1;

    //! \ingroup dispcontrol
    typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V1
    {
        NvU32 version;
        NvU32 reserved_sourceId; //!< This field is reserved. There is ongoing debate if we need this field.
                                 //!< Identifies sourceIds used by Windows. If all sourceIds are 0,
                                 //!< these will be computed automatically.
        NvU32 targetInfoCount;   //!< Number of elements in targetInfo array
        NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1 *targetInfo;
        NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 *sourceModeInfo; //!< May be NULL if mode info is not important
    } NV_DISPLAYCONFIG_PATH_INFO_V1;

//! \ingroup dispcontrol
//! This define is temporary and must be removed once DVS failure is fixed.
#define _NV_DISPLAYCONFIG_PATH_INFO_V2 _NV_DISPLAYCONFIG_PATH_INFO


    //! \ingroup dispcontrol
    typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V2
    {
        NvU32 version;
        union
        {
            NvU32 sourceId;          //!< Identifies sourceId used by Windows CCD. This can be optionally set.
            NvU32 reserved_sourceId; //!< Only for compatibility
        };

        NvU32 targetInfoCount; //!< Number of elements in targetInfo array
        NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 *targetInfo;
        NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 *sourceModeInfo; //!< May be NULL if mode info is not important
        NvU32 IsNonNVIDIAAdapter : 1;                         //!< True for non-NVIDIA adapter.
        NvU32 reserved : 31;                                  //!< Must be 0
        void *pOSAdapterID;                                   //!< Used by Non-NVIDIA adapter for pointer to OS Adapter of LUID
                                                              //!< type, type casted to void *.
    } NV_DISPLAYCONFIG_PATH_INFO_V2;

//! \ingroup dispcontrol
#define NV_DISPLAYCONFIG_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V1, 1)


//! \ingroup dispcontrol
#define NV_DISPLAYCONFIG_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V2, 2)


#ifndef NV_DISPLAYCONFIG_PATH_INFO_VER

    typedef NV_DISPLAYCONFIG_PATH_INFO_V2 NV_DISPLAYCONFIG_PATH_INFO;

#define NV_DISPLAYCONFIG_PATH_INFO_VER NV_DISPLAYCONFIG_PATH_INFO_VER2


    typedef NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 NV_DISPLAYCONFIG_SOURCE_MODE_INFO;

#endif

    //! \ingroup dispcontrol
    typedef enum _NV_DISPLAYCONFIG_FLAGS
    {
        NV_DISPLAYCONFIG_VALIDATE_ONLY = 0x00000001,
        NV_DISPLAYCONFIG_SAVE_TO_PERSISTENCE = 0x00000002,
        NV_DISPLAYCONFIG_DRIVER_RELOAD_ALLOWED = 0x00000004,  //!< Driver reload is permitted if necessary
        NV_DISPLAYCONFIG_FORCE_MODE_ENUMERATION = 0x00000008, //!< Refresh OS mode list.
        NV_FORCE_COMMIT_VIDPN = 0x00000010,                   //!< Tell OS to avoid optimizing CommitVidPn call during a modeset
    } NV_DISPLAYCONFIG_FLAGS;

#define NVAPI_UNICODE_STRING_MAX 2048

#define NVAPI_BINARY_DATA_MAX 4096


    typedef NvU16 NvAPI_UnicodeString[NVAPI_UNICODE_STRING_MAX];
    typedef const NvU16 *NvAPI_LPCWSTR;

// Common

//! \ingroup gpuclock
//! @{
#define NVAPI_MAX_GPU_CLOCKS 32

#define NVAPI_MAX_GPU_PUBLIC_CLOCKS 32

#define NVAPI_MAX_GPU_PERF_CLOCKS 32

#define NVAPI_MAX_GPU_PERF_VOLTAGES 16

#define NVAPI_MAX_GPU_PERF_PSTATES 16

    //! @}

    //! \ingroup gpuclock
    typedef enum _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID
    {
        NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_CORE = 0,
        NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_UNDEFINED = NVAPI_MAX_GPU_PERF_VOLTAGES,
    } NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID;

    //! \ingroup gpuclock
    typedef enum _NV_GPU_PUBLIC_CLOCK_ID
    {
        NVAPI_GPU_PUBLIC_CLOCK_GRAPHICS = 0,
        NVAPI_GPU_PUBLIC_CLOCK_MEMORY = 4,
        NVAPI_GPU_PUBLIC_CLOCK_PROCESSOR = 7,
        NVAPI_GPU_PUBLIC_CLOCK_VIDEO = 8,
        NVAPI_GPU_PUBLIC_CLOCK_UNDEFINED = NVAPI_MAX_GPU_PUBLIC_CLOCKS,
    } NV_GPU_PUBLIC_CLOCK_ID;

    //! \addtogroup gpupstate
    //! @{

    typedef enum _NV_GPU_PERF_PSTATE_ID
    {
        NVAPI_GPU_PERF_PSTATE_P0 = 0,
        NVAPI_GPU_PERF_PSTATE_P1,
        NVAPI_GPU_PERF_PSTATE_P2,
        NVAPI_GPU_PERF_PSTATE_P3,
        NVAPI_GPU_PERF_PSTATE_P4,
        NVAPI_GPU_PERF_PSTATE_P5,
        NVAPI_GPU_PERF_PSTATE_P6,
        NVAPI_GPU_PERF_PSTATE_P7,
        NVAPI_GPU_PERF_PSTATE_P8,
        NVAPI_GPU_PERF_PSTATE_P9,
        NVAPI_GPU_PERF_PSTATE_P10,
        NVAPI_GPU_PERF_PSTATE_P11,
        NVAPI_GPU_PERF_PSTATE_P12,
        NVAPI_GPU_PERF_PSTATE_P13,
        NVAPI_GPU_PERF_PSTATE_P14,
        NVAPI_GPU_PERF_PSTATE_P15,
        NVAPI_GPU_PERF_PSTATE_UNDEFINED = NVAPI_MAX_GPU_PERF_PSTATES,
        NVAPI_GPU_PERF_PSTATE_ALL,

    } NV_GPU_PERF_PSTATE_ID;

    //! @}

    //! \addtogroup gpupstate
    //! @{

#define NVAPI_MAX_GPU_PSTATE20_PSTATES 16

#define NVAPI_MAX_GPU_PSTATE20_CLOCKS 8

#define NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES 4


    //! Used to identify clock type
    typedef enum
    {
        //! Clock domains that use single frequency value within given pstate
        NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_SINGLE = 0,

        //! Clock domains that allow range of frequency values within given pstate
        NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_RANGE,
    } NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID;

    //! Used to describe both voltage and frequency deltas
    typedef struct
    {
        //! Value of parameter delta (in respective units [kHz, uV])
        NvS32 value;

        struct
        {
            //! Min value allowed for parameter delta (in respective units [kHz, uV])
            NvS32 min;

            //! Max value allowed for parameter delta (in respective units [kHz, uV])
            NvS32 max;
        } valueRange;
    } NV_GPU_PERF_PSTATES20_PARAM_DELTA;

    //! Used to describe single clock entry
    typedef struct
    {
        //! ID of the clock domain
        NV_GPU_PUBLIC_CLOCK_ID domainId;

        //! Clock type ID
        NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID typeId;
        NvU32 bIsEditable : 1;

        //! These bits are reserved for future use (must be always 0)
        NvU32 reserved : 31;

        //! Current frequency delta from nominal settings in (kHz)
        NV_GPU_PERF_PSTATES20_PARAM_DELTA freqDelta_kHz;

        //! Clock domain type dependant information
        union
        {
            struct
            {
                //! Clock frequency within given pstate in (kHz)
                NvU32 freq_kHz;
            } single;

            struct
            {
                //! Min clock frequency within given pstate in (kHz)
                NvU32 minFreq_kHz;

                //! Max clock frequency within given pstate in (kHz)
                NvU32 maxFreq_kHz;

                //! Voltage domain ID and value range in (uV) required for this clock
                NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId;
                NvU32 minVoltage_uV;
                NvU32 maxVoltage_uV;
            } range;
        } data;
    } NV_GPU_PSTATE20_CLOCK_ENTRY_V1;

    //! Used to describe single base voltage entry
    typedef struct
    {
        //! ID of the voltage domain
        NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId;
        NvU32 bIsEditable : 1;

        //! These bits are reserved for future use (must be always 0)
        NvU32 reserved : 31;

        //! Current base voltage settings in [uV]
        NvU32 volt_uV;

        NV_GPU_PERF_PSTATES20_PARAM_DELTA voltDelta_uV; // Current base voltage delta from nominal settings in [uV]
    } NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1;

    //! Used in NvAPI_GPU_GetPstates20() interface call.

    typedef struct
    {
        //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER<n>)
        NvU32 version;

        NvU32 bIsEditable : 1;

        //! These bits are reserved for future use (must be always 0)
        NvU32 reserved : 31;

        //! Number of populated pstates
        NvU32 numPstates;

        //! Number of populated clocks (per pstate)
        NvU32 numClocks;

        //! Number of populated base voltages (per pstate)
        NvU32 numBaseVoltages;

        //! Performance state (P-State) settings
        //! Valid index range is 0 to numPstates-1
        struct
        {
            //! ID of the P-State
            NV_GPU_PERF_PSTATE_ID pstateId;

            NvU32 bIsEditable : 1;

            //! These bits are reserved for future use (must be always 0)
            NvU32 reserved : 31;

            //! Array of clock entries
            //! Valid index range is 0 to numClocks-1
            NV_GPU_PSTATE20_CLOCK_ENTRY_V1 clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS];

            //! Array of baseVoltage entries
            //! Valid index range is 0 to numBaseVoltages-1
            NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES];
        } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES];
    } NV_GPU_PERF_PSTATES20_INFO_V1;

    //! Used in NvAPI_GPU_GetPstates20() interface call.

    typedef struct _NV_GPU_PERF_PSTATES20_INFO_V2
    {
        //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER<n>)
        NvU32 version;

        NvU32 bIsEditable : 1;

        //! These bits are reserved for future use (must be always 0)
        NvU32 reserved : 31;

        //! Number of populated pstates
        NvU32 numPstates;

        //! Number of populated clocks (per pstate)
        NvU32 numClocks;

        //! Number of populated base voltages (per pstate)
        NvU32 numBaseVoltages;

        //! Performance state (P-State) settings
        //! Valid index range is 0 to numPstates-1
        struct
        {
            //! ID of the P-State
            NV_GPU_PERF_PSTATE_ID pstateId;

            NvU32 bIsEditable : 1;

            //! These bits are reserved for future use (must be always 0)
            NvU32 reserved : 31;

            //! Array of clock entries
            //! Valid index range is 0 to numClocks-1
            NV_GPU_PSTATE20_CLOCK_ENTRY_V1 clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS];

            //! Array of baseVoltage entries
            //! Valid index range is 0 to numBaseVoltages-1
            NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES];
        } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES];

        //! OV settings - Please refer to NVIDIA over-volting recommendation to understand impact of this functionality
        //! Valid index range is 0 to numVoltages-1
        struct
        {
            //! Number of populated voltages
            NvU32 numVoltages;

            //! Array of voltage entries
            //! Valid index range is 0 to numVoltages-1
            NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 voltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES];
        } ov;
    } NV_GPU_PERF_PSTATES20_INFO_V2;

    typedef NV_GPU_PERF_PSTATES20_INFO_V2 NV_GPU_PERF_PSTATES20_INFO;

//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V1
#define NV_GPU_PERF_PSTATES20_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V1, 1)


//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V2
#define NV_GPU_PERF_PSTATES20_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V2, 2)


//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V2
#define NV_GPU_PERF_PSTATES20_INFO_VER3 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V2, 3)


//! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO
#define NV_GPU_PERF_PSTATES20_INFO_VER NV_GPU_PERF_PSTATES20_INFO_VER3


    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetDisplayDriverVersion
    //! \fn NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion)
    //! This function returns a struct that describes aspects of the display driver
    //!                build.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \param [in]  hNvDisplay NVIDIA display handle.
    //! \param [out] pVersion Pointer to NV_DISPLAY_DRIVER_VERSION struc
    //!
    //! \retval NVAPI_ERROR
    //! \retval NVAPI_OK
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup driverapi
    //! Used in NvAPI_GetDisplayDriverVersion()
    typedef struct
    {
        NvU32 version; // Structure version
        NvU32 drvVersion;
        NvU32 bldChangeListNum;
        NvAPI_ShortString szBuildBranchString;
        NvAPI_ShortString szAdapterString;
    } NV_DISPLAY_DRIVER_VERSION;

//! \ingroup driverapi
#define NV_DISPLAY_DRIVER_VERSION_VER MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_VERSION, 1)


    //! \ingroup driverapi
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion.")
        NVAPI_INTERFACE NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion);

///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_OGL_ExpertModeSet[Get]
//
//! \name NvAPI_OGL_ExpertModeSet[Get] Functions
//@{
//!  This function configures OpenGL Expert Mode, an API usage feedback and
//!  advice reporting mechanism. The effects of this call are
//!  applied only to the current context, and are reset to the
//!  defaults when the context is destroyed.
//!
//!  \note  This feature is valid at runtime only when GLExpert
//!         functionality has been built into the OpenGL driver
//!         installed on the system. All Windows Vista OpenGL
//!         drivers provided by NVIDIA have this instrumentation
//!         included by default. Windows XP, however, requires a
//!         special display driver available with the NVIDIA
//!         PerfSDK found at developer.nvidia.com.
//!
//!  \note These functions are valid only for the current OpenGL
//!        context. Calling these functions prior to creating a
//!        context and calling MakeCurrent with it will result
//!        in errors and undefined behavior.
//!
//! SUPPORTED OS:  Windows 7 and higher
//!
//!
//! \since Release: 80
//!
//! \param   expertDetailMask  Mask made up of NVAPI_OGLEXPERT_DETAIL bits,
//!                            this parameter specifies the detail level in
//!                            the feedback stream.
//!
//! \param   expertReportMask  Mask made up of NVAPI_OGLEXPERT_REPORT bits,
//!                            this parameter specifies the areas of
//!                            functional interest.
//!
//! \param   expertOutputMask  Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
//!                            this parameter specifies the feedback output
//!                            location.
//!
//! \param   expertCallback    Used in conjunction with OUTPUT_TO_CALLBACK,
//!                            this is a simple callback function the user
//!                            may use to obtain the feedback stream. The
//!                            function will be called once per fully
//!                            qualified feedback stream extry.
//!
//! \retval  NVAPI_API_NOT_INTIALIZED          NVAPI not initialized
//! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND     No NVIDIA GPU found
//! \retval  NVAPI_OPENGL_CONTEXT_NOT_CURRENT  No NVIDIA OpenGL context
//!                                            which supports GLExpert
//!                                            has been made current
//! \retval  NVAPI_ERROR                       OpenGL driver failed to load properly
//! \retval  NVAPI_OK                          Success
//
///////////////////////////////////////////////////////////////////////////////

//! \addtogroup oglapi
//! @{
#define NVAPI_OGLEXPERT_DETAIL_NONE 0x00000000

#define NVAPI_OGLEXPERT_DETAIL_ERROR 0x00000001

#define NVAPI_OGLEXPERT_DETAIL_SWFALLBACK 0x00000002

#define NVAPI_OGLEXPERT_DETAIL_BASIC_INFO 0x00000004

#define NVAPI_OGLEXPERT_DETAIL_DETAILED_INFO 0x00000008

#define NVAPI_OGLEXPERT_DETAIL_PERFORMANCE_WARNING 0x00000010

#define NVAPI_OGLEXPERT_DETAIL_QUALITY_WARNING 0x00000020

#define NVAPI_OGLEXPERT_DETAIL_USAGE_WARNING 0x00000040

#define NVAPI_OGLEXPERT_DETAIL_ALL 0xFFFFFFFF


#define NVAPI_OGLEXPERT_REPORT_NONE 0x00000000

#define NVAPI_OGLEXPERT_REPORT_ERROR 0x00000001

#define NVAPI_OGLEXPERT_REPORT_SWFALLBACK 0x00000002

#define NVAPI_OGLEXPERT_REPORT_PIPELINE_VERTEX 0x00000004

#define NVAPI_OGLEXPERT_REPORT_PIPELINE_GEOMETRY 0x00000008

#define NVAPI_OGLEXPERT_REPORT_PIPELINE_XFB 0x00000010

#define NVAPI_OGLEXPERT_REPORT_PIPELINE_RASTER 0x00000020

#define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAGMENT 0x00000040

#define NVAPI_OGLEXPERT_REPORT_PIPELINE_ROP 0x00000080

#define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAMEBUFFER 0x00000100

#define NVAPI_OGLEXPERT_REPORT_PIPELINE_PIXEL 0x00000200

#define NVAPI_OGLEXPERT_REPORT_PIPELINE_TEXTURE 0x00000400

#define NVAPI_OGLEXPERT_REPORT_OBJECT_BUFFEROBJECT 0x00000800

#define NVAPI_OGLEXPERT_REPORT_OBJECT_TEXTURE 0x00001000

#define NVAPI_OGLEXPERT_REPORT_OBJECT_PROGRAM 0x00002000

#define NVAPI_OGLEXPERT_REPORT_OBJECT_FBO 0x00004000

#define NVAPI_OGLEXPERT_REPORT_FEATURE_SLI 0x00008000

#define NVAPI_OGLEXPERT_REPORT_ALL 0xFFFFFFFF


#define NVAPI_OGLEXPERT_OUTPUT_TO_NONE 0x00000000

#define NVAPI_OGLEXPERT_OUTPUT_TO_CONSOLE 0x00000001

#define NVAPI_OGLEXPERT_OUTPUT_TO_DEBUGGER 0x00000004

#define NVAPI_OGLEXPERT_OUTPUT_TO_CALLBACK 0x00000008

#define NVAPI_OGLEXPERT_OUTPUT_TO_ALL 0xFFFFFFFF


    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION TYPE: NVAPI_OGLEXPERT_CALLBACK
    //
    //!   DESCRIPTION: Used in conjunction with OUTPUT_TO_CALLBACK, this is a simple
    //!                callback function the user may use to obtain the feedback
    //!                stream. The function will be called once per fully qualified
    //!                feedback stream entry.
    //!
    //!   \param   categoryId    Contains the bit from the NVAPI_OGLEXPERT_REPORT
    //!                          mask that corresponds to the current message
    //!   \param   messageId     Unique ID for the current message
    //!   \param   detailLevel   Contains the bit from the NVAPI_OGLEXPERT_DETAIL
    //!                          mask that corresponds to the current message
    //!   \param   objectId      Unique ID of the object that corresponds to the
    //!                          current message
    //!   \param   messageStr    Text string from the current message
    //!
    //!   \ingroup oglapi
    ///////////////////////////////////////////////////////////////////////////////
    typedef void (*NVAPI_OGLEXPERT_CALLBACK)(unsigned int categoryId, unsigned int messageId, unsigned int detailLevel, int objectId, const char *messageStr);

    //! \ingroup oglapi
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    NVAPI_INTERFACE NvAPI_OGL_ExpertModeSet(NvU32 expertDetailLevel,
                                            NvU32 expertReportMask,
                                            NvU32 expertOutputMask,
                                            NVAPI_OGLEXPERT_CALLBACK expertCallback);

    //! \addtogroup oglapi
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    NVAPI_INTERFACE NvAPI_OGL_ExpertModeGet(NvU32 *pExpertDetailLevel,
                                            NvU32 *pExpertReportMask,
                                            NvU32 *pExpertOutputMask,
                                            NVAPI_OGLEXPERT_CALLBACK *pExpertCallback);

    //@}
    ///////////////////////////////////////////////////////////////////////////////
    //
    //! \name NvAPI_OGL_ExpertModeDefaultsSet[Get] Functions
    //!
    //@{
    //!  This function configures OpenGL Expert Mode global defaults. These settings
    //!  apply to any OpenGL application which starts up after these
    //!  values are applied (i.e. these settings *do not* apply to
    //!  currently running applications).
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \param   expertDetailLevel Value which specifies the detail level in
    //!                            the feedback stream. This is a mask made up
    //!                            of NVAPI_OGLEXPERT_LEVEL bits.
    //!
    //! \param   expertReportMask  Mask made up of NVAPI_OGLEXPERT_REPORT bits,
    //!                            this parameter specifies the areas of
    //!                            functional interest.
    //!
    //! \param   expertOutputMask  Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
    //!                            this parameter specifies the feedback output
    //!                            location. Note that using OUTPUT_TO_CALLBACK
    //!                            here is meaningless and has no effect, but
    //!                            using it will not cause an error.
    //!
    //! \return  ::NVAPI_ERROR or ::NVAPI_OK
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup oglapi
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsSet(NvU32 expertDetailLevel,
                                                    NvU32 expertReportMask,
                                                    NvU32 expertOutputMask);

    //! \addtogroup oglapi
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsGet(NvU32 *pExpertDetailLevel,
                                                    NvU32 *pExpertReportMask,
                                                    NvU32 *pExpertOutputMask);
    //@}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_EnumTCCPhysicalGPUs
    //
    //! This function returns an array of physical GPU handles that are in TCC Mode.
    //! Each handle represents a physical GPU present in the system in TCC Mode.
    //! That GPU may not be visible to the OS directly.
    //!
    //! The array nvGPUHandle will be filled with physical GPU handle values. The returned
    //! gpuCount determines how many entries in the array are valid.
    //!
    //! NOTE: Handles enumerated by this API are only valid for NvAPIs that are tagged as TCC_SUPPORTED
    //!       If handle is passed to any other API, it will fail with NVAPI_INVALID_HANDLE
    //!
    //!       For WDDM GPU handles please use NvAPI_EnumPhysicalGPUs()
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //!
    //! \param [out]   nvGPUHandle      Physical GPU array that will contain all TCC Physical GPUs
    //! \param [out]   pGpuCount        count represent the number of valid entries in nvGPUHandle
    //!
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         nvGPUHandle or pGpuCount is NULL
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_EnumTCCPhysicalGPUs(NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_EnumLogicalGPUs
    //
    //! This function returns an array of logical GPU handles.
    //!
    //! Each handle represents one or more GPUs acting in concert as a single graphics device.
    //!
    //! At least one GPU must be present in the system and running an NVIDIA display driver.
    //!
    //! The array nvGPUHandle will be filled with logical GPU handle values.  The returned
    //! gpuCount determines how many entries in the array are valid.
    //!
    //! \note All logical GPUs handles get invalidated on a GPU topology change, so the calling
    //!       application is required to renum the logical GPU handles to get latest physical handle
    //!       mapping after every GPU topology change activated by a call to NvAPI_SetGpuTopologies().
    //!
    //! To detect if SLI rendering is enabled, use NvAPI_D3D_GetCurrentSLIState().
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         nvGPUHandle or pGpuCount is NULL
    //! \retval NVAPI_OK                       One or more handles were returned
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_EnumLogicalGPUs(NvLogicalGpuHandle nvGPUHandle[NVAPI_MAX_LOGICAL_GPUS], NvU32 *pGpuCount);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromDisplay
    //
    //! This function returns an array of physical GPU handles associated with the specified display.
    //!
    //! At least one GPU must be present in the system and running an NVIDIA display driver.
    //!
    //! The array nvGPUHandle will be filled with physical GPU handle values.  The returned
    //! gpuCount determines how many entries in the array are valid.
    //!
    //! If the display corresponds to more than one physical GPU, the first GPU returned
    //! is the one with the attached active output.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         hNvDisp is not valid; nvGPUHandle or pGpuCount is NULL
    //! \retval NVAPI_OK                       One or more handles were returned
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  no NVIDIA GPU driving a display was found
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromDisplay(NvDisplayHandle hNvDisp, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetPhysicalGPUFromUnAttachedDisplay
    //
    //! This function returns a physical GPU handle associated with the specified unattached display.
    //! The source GPU is a physical render GPU which renders the frame buffer but may or may not drive the scan out.
    //!
    //! At least one GPU must be present in the system and running an NVIDIA display driver.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         hNvUnAttachedDisp is not valid or pPhysicalGpu is NULL.
    //! \retval NVAPI_OK                       One or more handles were returned
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvPhysicalGpuHandle *pPhysicalGpu);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetLogicalGPUFromDisplay
    //
    //! This function returns the logical GPU handle associated with the specified display.
    //! At least one GPU must be present in the system and running an NVIDIA display driver.
    //! hNvDisp can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         hNvDisp is not valid; pLogicalGPU is NULL
    //! \retval NVAPI_OK                       One or more handles were returned
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetLogicalGPUFromDisplay(NvDisplayHandle hNvDisp, NvLogicalGpuHandle *pLogicalGPU);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetLogicalGPUFromPhysicalGPU
    //
    //! This function returns the logical GPU handle associated with specified physical GPU handle.
    //! At least one GPU must be present in the system and running an NVIDIA display driver.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         hPhysicalGPU is not valid; pLogicalGPU is NULL
    //! \retval NVAPI_OK                       One or more handles were returned
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetLogicalGPUFromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGPU, NvLogicalGpuHandle *pLogicalGPU);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromLogicalGPU
    //
    //!  This function returns the physical GPU handles associated with the specified logical GPU handle.
    //!  At least one GPU must be present in the system and running an NVIDIA display driver.
    //!
    //!  The array hPhysicalGPU will be filled with physical GPU handle values.  The returned
    //!  gpuCount determines how many entries in the array are valid.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT             hLogicalGPU is not valid; hPhysicalGPU is NULL
    //! \retval NVAPI_OK                           One or more handles were returned
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND      No NVIDIA GPU driving a display was found
    //! \retval NVAPI_EXPECTED_LOGICAL_GPU_HANDLE  hLogicalGPU was not a logical GPU handle
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromLogicalGPU(NvLogicalGpuHandle hLogicalGPU, NvPhysicalGpuHandle hPhysicalGPU[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetPhysicalGPUFromGPUID
    //
    //!  Do not use this function for new software development.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         gpuId is zero or pPhysicalGPU is NULL
    //! \retval NVAPI_OK                       Handle was returned
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromGPUID(NvU32 gpuId, NvPhysicalGpuHandle *pPhysicalGPU);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetGPUIDfromPhysicalGPU
    //
    //!  Do not use this function for new software development.
    //
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 95
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         hPhysicalGpu is NULL or invalid. Re-enumerate the GPU handles.
    //! \retval NVAPI_OK                       Handle was returned
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetGPUIDfromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pGpuId);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetShaderSubPipeCount
    //
    //!   DESCRIPTION: This function retrieves the number of Shader SubPipes on the GPU
    //!                On newer architectures, this corresponds to the number of SM units
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 170
    //!
    //! RETURN STATUS: NVAPI_INVALID_ARGUMENT: pCount is NULL
    //!                NVAPI_OK: *pCount is set
    //!                NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
    //!                NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
    //!
    //! \ingroup   gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetShaderSubPipeCount(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pCount);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetGpuCoreCount
    //
    //!   DESCRIPTION: Retrieves the total number of cores defined for a GPU.
    //!                Returns 0 on architectures that don't define GPU cores.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT              pCount is NULL
    //! \retval ::NVAPI_OK                            *pCount is set
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND       no NVIDIA GPU driving a display was found
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
    //! \retval ::NVAPI_NOT_SUPPORTED                 API call is not supported on current architecture
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetGpuCoreCount(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pCount);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetAllOutputs
    //
    //!  This function returns set of all GPU-output identifiers as a bitmask.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 85
    //!
    //! \retval   NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL.
    //! \retval   NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers.
    //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds.")
        NVAPI_INTERFACE NvAPI_GPU_GetAllOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputs
    //
    //! This function is the same as NvAPI_GPU_GetAllOutputs() but returns only the set of GPU output
    //! identifiers that are connected to display devices.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval   NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL.
    //! \retval   NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers.
    //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
        NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputs
    //
    //!   DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputs() but returns only the set of GPU-output
    //!                identifiers that can be selected in an SLI configuration.
    //!                 NOTE: This function matches NvAPI_GPU_GetConnectedOutputs()
    //!                 - On systems which are not SLI capable.
    //!                 - If the queried GPU is not part of a valid SLI group.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 170
    //!
    //! \retval   NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL
    //! \retval   NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers
    //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
    //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
        NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);

    //! \ingroup gpu
    typedef enum
    {
        NV_MONITOR_CONN_TYPE_UNINITIALIZED = 0,
        NV_MONITOR_CONN_TYPE_VGA,
        NV_MONITOR_CONN_TYPE_COMPONENT,
        NV_MONITOR_CONN_TYPE_SVIDEO,
        NV_MONITOR_CONN_TYPE_HDMI,
        NV_MONITOR_CONN_TYPE_DVI,
        NV_MONITOR_CONN_TYPE_LVDS,
        NV_MONITOR_CONN_TYPE_DP,
        NV_MONITOR_CONN_TYPE_COMPOSITE,
        NV_MONITOR_CONN_TYPE_UNKNOWN = -1
    } NV_MONITOR_CONN_TYPE;

//! \addtogroup gpu
//! @{
#define NV_GPU_CONNECTED_IDS_FLAG_UNCACHED NV_BIT(0)    //!< Get uncached connected devices

#define NV_GPU_CONNECTED_IDS_FLAG_SLI NV_BIT(1)         //!< Get devices such that those can be selected in an SLI configuration

#define NV_GPU_CONNECTED_IDS_FLAG_LIDSTATE NV_BIT(2)    //!< Get devices such that to reflect the Lid State

#define NV_GPU_CONNECTED_IDS_FLAG_FAKE NV_BIT(3)        //!< Get devices that includes the fake connected monitors

#define NV_GPU_CONNECTED_IDS_FLAG_EXCLUDE_MST NV_BIT(4) //!< Excludes devices that are part of the multi stream topology.


    //! @}

    //! \ingroup gpu
    typedef struct _NV_GPU_DISPLAYIDS
    {
        NvU32 version;
        NV_MONITOR_CONN_TYPE connectorType; //!< out: vga, tv, dvi, hdmi and dp. This is reserved for future use and clients should not rely on this information. Instead get the
                                            //!< GPU connector type from NvAPI_GPU_GetConnectorInfo/NvAPI_GPU_GetConnectorInfoEx
        NvU32 displayId;                    //!< this is a unique identifier for each device

        NvU32 isDynamic : 1;             //!< if bit is set then this display is part of MST topology and it's a dynamic
        NvU32 isMultiStreamRootNode : 1; //!< if bit is set then this displayID belongs to a multi stream enabled connector(root node). Note that when multi stream is enabled and
                                         //!< a single multi stream capable monitor is connected to it, the monitor will share the display id with the RootNode.
                                         //!< When there is more than one monitor connected in a multi stream topology, then the root node will have a separate displayId.
        NvU32 isActive : 1;              //!< if bit is set then this display is being actively driven
        NvU32 isCluster : 1;             //!< if bit is set then this display is the representative display
        NvU32 isOSVisible : 1;           //!< if bit is set, then this display is reported to the OS
        NvU32 isWFD : 1;                 //!< Deprecated. Will always return 0.
        NvU32 isConnected : 1;           //!< if bit is set, then this display is connected

        NvU32 reservedInternal : 10;     //!< Do not use
        NvU32 isPhysicallyConnected : 1; //!< if bit is set, then this display is a phycially connected display; Valid only when isConnected bit is set
        NvU32 reserved : 14;             //!< must be zero
    } NV_GPU_DISPLAYIDS;

//! \ingroup gpu
//! Macro for constructing the version field of ::_NV_GPU_DISPLAYIDS
#define NV_GPU_DISPLAYIDS_VER1 MAKE_NVAPI_VERSION(NV_GPU_DISPLAYIDS, 1)

#define NV_GPU_DISPLAYIDS_VER2 MAKE_NVAPI_VERSION(NV_GPU_DISPLAYIDS, 3)


#define NV_GPU_DISPLAYIDS_VER NV_GPU_DISPLAYIDS_VER2


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetConnectedDisplayIds
    //
    //! \code
    //!   DESCRIPTION: Due to space limitation NvAPI_GPU_GetConnectedOutputs can return maximum 32 devices, but
    //!                this is no longer true for DPMST. NvAPI_GPU_GetConnectedDisplayIds will return all
    //!                the connected display devices in the form of displayIds for the associated hPhysicalGpu.
    //!                This function can accept set of flags to request cached, uncached, sli and lid to get the connected devices.
    //!                Default value for flags will be cached .
    //! HOW TO USE: 1) for each PhysicalGpu, make a call to get the number of connected displayId's
    //!                using NvAPI_GPU_GetConnectedDisplayIds by passing the pDisplayIds as NULL
    //!                On call success:
    //!             2) If pDisplayIdCount is greater than 0, allocate memory based on pDisplayIdCount. Then make a call NvAPI_GPU_GetConnectedDisplayIds to populate DisplayIds.
    //!                However, if pDisplayIdCount is 0, do not make this call.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! PARAMETERS:     hPhysicalGpu (IN)  - GPU selection
    //!                 flags        (IN)  - One or more defines from NV_GPU_CONNECTED_IDS_FLAG_* as valid flags.
    //!                 pDisplayIds  (IN/OUT) - Pointer to an NV_GPU_DISPLAYIDS struct, each entry represents a one displayID and its attributes
    //!                 pDisplayIdCount(OUT)- Number of displayId's.
    //!
    //! RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pDisplayIds or pDisplayIdCount is NULL
    //!                NVAPI_OK: *pDisplayIds contains a set of GPU-output identifiers
    //!                NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
    //!                NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
    //! \endcode
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetConnectedDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu, __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS *pDisplayIds, __inout NvU32 *pDisplayIdCount, __in NvU32 flags);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetAllDisplayIds
    //
    //!   DESCRIPTION: This API returns display IDs for all possible outputs on the GPU.
    //!                For DPMST connector, it will return display IDs for all the video sinks in the topology. \n
    //! HOW TO USE: 1. The first call should be made to get the all display ID count. To get the display ID count, send in \n
    //!                  a) hPhysicalGpu    - a valid GPU handle(enumerated using NvAPI_EnumPhysicalGPUs()) as input,      \n
    //!                  b) pDisplayIds     - NULL, as we just want to get the display ID count.                           \n
    //!                  c) pDisplayIdCount - a valid pointer to NvU32, whose value is set to ZERO.                        \n
    //!                If all parameters are correct and this call is successful, this call will return the display ID's count. \n
    //!             2. To get the display ID array, make the second call to NvAPI_GPU_GetAllDisplayIds() with              \n
    //!                  a) hPhysicalGpu    - should be same value which was sent in first call,                           \n
    //!                  b) pDisplayIds     - pointer to the display ID array allocated by caller based on display ID count,    \n
    //!                                       eg. malloc(sizeof(NV_GPU_DISPLAYIDS) * pDisplayIdCount).                     \n
    //!                  c) pDisplayIdCount - a valid pointer to NvU32. This indicates for how many display IDs            \n
    //!                                       the memory is allocated(pDisplayIds) by the caller.                          \n
    //!                If all parameters are correct and this call is successful, this call will return the display ID array and actual
    //!                display ID count (which was obtained in the first call to NvAPI_GPU_GetAllDisplayIds). If the input display ID count is
    //!                less than the actual display ID count, it will overwrite the input and give the pDisplayIdCount as actual count and the
    //!                API will return NVAPI_INSUFFICIENT_BUFFER.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     hPhysicalGpu         GPU selection.
    //! \param [in,out] DisplayIds           Pointer to an array of NV_GPU_DISPLAYIDS structures, each entry represents one displayID
    //!                                      and its attributes.
    //! \param [in,out] pDisplayIdCount      As input, this parameter indicates the number of display's id's for which caller has
    //!                                      allocated the memory. As output, it will return the actual number of display IDs.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!          specific meaning for this API, they are listed below.
    //!
    //! \retval  NVAPI_INSUFFICIENT_BUFFER  When the input buffer(pDisplayIds) is less than the actual number of display IDs, this API
    //!                                     will return NVAPI_INSUFFICIENT_BUFFER.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetAllDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu, __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS *pDisplayIds, __inout NvU32 *pDisplayIdCount);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputsWithLidState
    //
    //!  This function is similar to NvAPI_GPU_GetConnectedOutputs(), and returns the connected display identifiers that are connected
    //!  as an output mask but unlike NvAPI_GPU_GetConnectedOutputs() this API "always" reflects the Lid State in the output mask.
    //!  Thus if you expect the LID close state to be available in the connection mask use this API.
    //!  - If LID is closed then this API will remove the LID panel from the connected display identifiers.
    //!  - If LID is open then this API will reflect the LID panel in the connected display identifiers.
    //!
    //! \note This API should be used on notebook systems and on systems where the LID state is required in the connection
    //!       output mask. On desktop systems the returned identifiers will match NvAPI_GPU_GetConnectedOutputs().
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 95
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL
    //! \retval  NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
        NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputsWithLidState
    //
    //!   DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputsWithLidState() but returns only the set
    //!                of GPU-output identifiers that can be selected in an SLI configuration. With SLI disabled,
    //!                this function matches NvAPI_GPU_GetConnectedOutputsWithLidState().
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 170
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL
    //! \retval  NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
        NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetSystemType
    //
    //! \fn NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType)
    //!  This function identifies whether the GPU is a notebook GPU or a desktop GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 95
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL
    //! \retval  NVAPI_OK                           *pSystemType contains the GPU system type
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpu
    //! Used in NvAPI_GPU_GetSystemType()
    typedef enum
    {
        NV_SYSTEM_TYPE_UNKNOWN = 0,
        NV_SYSTEM_TYPE_LAPTOP = 1,
        NV_SYSTEM_TYPE_DESKTOP = 2,

    } NV_SYSTEM_TYPE;

    //! \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetActiveOutputs
    //
    //!  This function is the same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU output
    //!  identifiers that are actively driving display devices.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 85
    //!
    //! \retval    NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL.
    //! \retval    NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers.
    //! \retval    NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetActiveOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_SetEDID
    //
    //!  Thus function sets the EDID data for the specified GPU handle and connection bit mask.
    //!  User can either send (Gpu handle & output id)  or only display Id in variable displayOutputId parameter & hPhysicalGpu parameter can be default handle (0).
    //!  \note The EDID will be cached across the boot session and will be enumerated to the OS in this call.
    //!        To remove the EDID set sizeofEDID to zero.
    //!        OS and NVAPI connection status APIs will reflect the newly set or removed EDID dynamically.
    //!
    //!                This feature will NOT be supported on the following boards:
    //!                - GeForce
    //!                - Quadro VX
    //!                - Tesla
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 100
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              pEDID is NULL; displayOutputId has 0 or > 1 bits set
    //! \retval  NVAPI_OK                           *pEDID data was applied to the requested displayOutputId.
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle.
    //! \retval  NVAPI_NOT_SUPPORTED                 For the above mentioned GPUs
    //! \retval  NVAPI_INVALID_USER_PRIVILEGE        The application will require Administrator privileges to access this API.
    //!                                              The application can be elevated to a higher permission level by selecting "Run as Administrator".
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_SetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetOutputType
    //
    //! \fn NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType)
    //!  This function returns the output type. User can either specify both 'physical GPU handle and outputId (exactly 1 bit set - see \ref handles)' or
    //!  a valid displayId in the outputId parameter.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \Version Earliest supported ForceWare version: 82.61
    //!
    //! \retval     NVAPI_INVALID_ARGUMENT              outputId, pOutputType is NULL; or if outputId parameter is not displayId and either it has > 1 bit set or hPhysicalGpu is NULL.
    //! \retval     NVAPI_OK                           *pOutputType contains a NvGpuOutputType value
    //! \retval     NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
    //! \retval     NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpu
    //! used in NvAPI_GPU_GetOutputType()
    typedef enum _NV_GPU_OUTPUT_TYPE
    {
        NVAPI_GPU_OUTPUT_UNKNOWN = 0,
        NVAPI_GPU_OUTPUT_CRT = 1, //!<  CRT display device
        NVAPI_GPU_OUTPUT_DFP = 2, //!<  Digital Flat Panel display device
        NVAPI_GPU_OUTPUT_TV = 3,  //!<  TV display device
    } NV_GPU_OUTPUT_TYPE;

    //! \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_ValidateOutputCombination
    //
    //!  This function determines if a set of GPU outputs can be active
    //!  simultaneously.  While a GPU may have <n> outputs, typically they cannot
    //!  all be active at the same time due to internal resource sharing.
    //!
    //!  Given a physical GPU handle and a mask of candidate outputs, this call
    //!  will return NVAPI_OK if all of the specified outputs can be driven
    //!  simultaneously.  It will return NVAPI_INVALID_COMBINATION if they cannot.
    //!
    //!  Use NvAPI_GPU_GetAllOutputs() to determine which outputs are candidates.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 85
    //!
    //! \retval  NVAPI_OK                            Combination of outputs in outputsMask are valid (can be active simultaneously).
    //! \retval  NVAPI_INVALID_COMBINATION           Combination of outputs in outputsMask are NOT valid.
    //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or outputsMask does not have at least 2 bits set.
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_ValidateOutputCombination(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputsMask);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetFullName
    //
    //!  This function retrieves the full GPU name as an ASCII string - for example, "Quadro FX 1400".
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \return  NVAPI_ERROR or NVAPI_OK
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetFullName(NvPhysicalGpuHandle hPhysicalGpu, NvAPI_ShortString szName);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetPCIIdentifiers
    //
    //!  This function returns the PCI identifiers associated with this GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \param   DeviceId      The internal PCI device identifier for the GPU.
    //! \param   SubSystemId   The internal PCI subsystem identifier for the GPU.
    //! \param   RevisionId    The internal PCI device-specific revision identifier for the GPU.
    //! \param   ExtDeviceId   The external PCI device identifier for the GPU.
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or an argument is NULL
    //! \retval  NVAPI_OK                            Arguments are populated with PCI identifiers
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetPCIIdentifiers(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pDeviceId, NvU32 *pSubSystemId, NvU32 *pRevisionId, NvU32 *pExtDeviceId);

    //! \ingroup gpu
    //! Used in NvAPI_GPU_GetGPUType().
    typedef enum _NV_GPU_TYPE
    {
        NV_SYSTEM_TYPE_GPU_UNKNOWN = 0,
        NV_SYSTEM_TYPE_IGPU = 1, //!< Integrated GPU
        NV_SYSTEM_TYPE_DGPU = 2, //!< Discrete GPU
    } NV_GPU_TYPE;

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetGPUType
    //
    //!  DESCRIPTION: This function returns the GPU type (integrated or discrete).
    //!               See ::NV_GPU_TYPE.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 173
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu
    //! \retval  NVAPI_OK                           *pGpuType contains the GPU type
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
    //!
    //!  \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetGPUType(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_TYPE *pGpuType);

    //! \ingroup gpu
    //! Used in NvAPI_GPU_GetBusType()
    typedef enum _NV_GPU_BUS_TYPE
    {
        NVAPI_GPU_BUS_TYPE_UNDEFINED = 0,
        NVAPI_GPU_BUS_TYPE_PCI = 1,
        NVAPI_GPU_BUS_TYPE_AGP = 2,
        NVAPI_GPU_BUS_TYPE_PCI_EXPRESS = 3,
        NVAPI_GPU_BUS_TYPE_FPCI = 4,
        NVAPI_GPU_BUS_TYPE_AXI = 5,
    } NV_GPU_BUS_TYPE;
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetBusType
    //
    //!  This function returns the type of bus associated with this GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \return      This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!              specific meaning for this API, they are listed below.
    //! \retval      NVAPI_INVALID_ARGUMENT             hPhysicalGpu or pBusType is NULL.
    //! \retval      NVAPI_OK                          *pBusType contains bus identifier.
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetBusType(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_BUS_TYPE *pBusType);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetBusId
    //
    //!   DESCRIPTION: Returns the ID of the bus associated with this GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 167
    //!
    //!  \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pBusId is NULL.
    //!  \retval  NVAPI_OK                           *pBusId contains the bus ID.
    //!  \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //!  \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //!
    //!  \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetBusId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetBusSlotId
    //
    //!   DESCRIPTION: Returns the ID of the bus slot associated with this GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 167
    //!
    //!  \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pBusSlotId is NULL.
    //!  \retval  NVAPI_OK                           *pBusSlotId contains the bus slot ID.
    //!  \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //!  \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //!
    //!  \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetBusSlotId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetIRQ
    //
    //!  This function returns the interrupt number associated with this GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pIRQ is NULL.
    //! \retval  NVAPI_OK                           *pIRQ contains interrupt number.
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetIRQ(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pIRQ);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetVbiosRevision
    //
    //!  This function returns the revision of the video BIOS associated with this GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \retval    NVAPI_INVALID_ARGUMENT               hPhysicalGpu or pBiosRevision is NULL.
    //! \retval    NVAPI_OK                            *pBiosRevision contains revision number.
    //! \retval    NVAPI_NVIDIA_DEVICE_NOT_FOUND        No NVIDIA GPU driving a display was found.
    //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE   hPhysicalGpu was not a physical GPU handle.
    //! \ingroup   gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetVbiosRevision(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBiosRevision);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetVbiosOEMRevision
    //
    //!  This function returns the OEM revision of the video BIOS associated with this GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \retval    NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pBiosRevision is NULL
    //! \retval    NVAPI_OK                           *pBiosRevision contains revision number
    //! \retval    NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
    //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
    //! \ingroup   gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetVbiosOEMRevision(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBiosRevision);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetVbiosVersionString
    //
    //!  This function returns the full video BIOS version string in the form of xx.xx.xx.xx.yy where
    //!  - xx numbers come from NvAPI_GPU_GetVbiosRevision() and
    //!  - yy comes from NvAPI_GPU_GetVbiosOEMRevision().
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \retval   NVAPI_INVALID_ARGUMENT              hPhysicalGpu is NULL.
    //! \retval   NVAPI_OK                            szBiosRevision contains version string.
    //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetVbiosVersionString(NvPhysicalGpuHandle hPhysicalGpu, NvAPI_ShortString szBiosRevision);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetAGPAperture
    //
    //!  This function returns the AGP aperture in megabytes.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 455.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \retval   NVAPI_NOT_SUPPORTED
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 455.")
        NVAPI_INTERFACE NvAPI_GPU_GetAGPAperture(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pSize);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetCurrentAGPRate
    //
    //!  This function returns the current AGP Rate (0 = AGP not present, 1 = 1x, 2 = 2x, etc.).
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 455.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \retval   NVAPI_NOT_SUPPORTED
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 455.")
        NVAPI_INTERFACE NvAPI_GPU_GetCurrentAGPRate(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pRate);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetCurrentPCIEDownstreamWidth
    //
    //!  This function returns the number of PCIE lanes being used for the PCIE interface
    //!  downstream from the GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              pWidth is NULL.
    //! \retval  NVAPI_OK                            Call successful.
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetCurrentPCIEDownstreamWidth(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pWidth);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetPhysicalFrameBufferSize
    //
    //!   This function returns the physical size of framebuffer in KB.  This does NOT include any
    //!   system RAM that may be dedicated for use by the GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              pSize is NULL
    //! \retval  NVAPI_OK                            Call successful
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetPhysicalFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pSize);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetVirtualFrameBufferSize
    //
    //!  This function returns the virtual size of framebuffer in KB.  This includes the physical RAM plus any
    //!  system RAM that has been dedicated for use by the GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 90
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              pSize is NULL.
    //! \retval  NVAPI_OK                            Call successful.
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
    //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetVirtualFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pSize);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetQuadroStatus
    //
    //!  This function retrieves the Quadro status for the GPU (1 if Quadro, 0 if GeForce)
    //!
    //!  This API is deprecated and it is recommended to instead query
    //!  NV_GPU_WORKSTATION_FEATURE_TYPE_PROVIZ support from the API
    //!  NvAPI_GPU_QueryWorkstationFeatureSupport.
    //! \deprecated  Do not use this function - it is deprecated in release 460.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \return  NVAPI_ERROR or NVAPI_OK
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 460.")
        NVAPI_INTERFACE NvAPI_GPU_GetQuadroStatus(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pStatus);

    //! \ingroup gpu
    typedef struct _NV_BOARD_INFO
    {
        NvU32 version;     //!< structure version
        NvU8 BoardNum[16]; //!< Board Serial Number

    } NV_BOARD_INFO_V1;

#define NV_BOARD_INFO_VER1 MAKE_NVAPI_VERSION(NV_BOARD_INFO_V1, 1)

#ifndef NV_BOARD_INFO_VER
    //! \ingroup gpu
    typedef NV_BOARD_INFO_V1 NV_BOARD_INFO;
//! \ingroup gpu
//! \ingroup gpu
#define NV_BOARD_INFO_VER NV_BOARD_INFO_VER1

#endif

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetBoardInfo
    //
    //!   DESCRIPTION: This API Retrieves the Board information (a unique GPU Board Serial Number) stored in the InfoROM.
    //!
    //! \param [in]      hPhysicalGpu       Physical GPU Handle.
    //! \param [in,out]  NV_BOARD_INFO      Board Information.
    //!
    //! TCC_SUPPORTED
    //!
    //! \retval ::NVAPI_OK                     completed request
    //! \retval ::NVAPI_ERROR                  miscellaneous error occurred
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  handle passed is not a physical GPU handle
    //! \retval ::NVAPI_API_NOT_INTIALIZED            NVAPI not initialized
    //! \retval ::NVAPI_INVALID_POINTER               pBoardInfo is NULL
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION   the version of the INFO struct is not supported
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetBoardInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_BOARD_INFO *pBoardInfo);

    //! Used in NvAPI_GPU_GetArchInfo()
    typedef struct
    {
        NvU32 version;

        NvU32 architecture;
        NvU32 implementation;
        NvU32 revision;

    } NV_GPU_ARCH_INFO_V1;

    //! NV_GPU_ARCH_INFO() values to identify Architecture level for the GPU.
    typedef enum _NV_GPU_ARCHITECTURE_ID
    {

        NV_GPU_ARCHITECTURE_T2X = 0xE0000020,
        NV_GPU_ARCHITECTURE_T3X = 0xE0000030,
        NV_GPU_ARCHITECTURE_T4X = 0xE0000040,
        NV_GPU_ARCHITECTURE_T12X = 0xE0000040,
        NV_GPU_ARCHITECTURE_NV40 = 0x00000040,
        NV_GPU_ARCHITECTURE_NV50 = 0x00000050,
        NV_GPU_ARCHITECTURE_G78 = 0x00000060,
        NV_GPU_ARCHITECTURE_G80 = 0x00000080,
        NV_GPU_ARCHITECTURE_G90 = 0x00000090,
        NV_GPU_ARCHITECTURE_GT200 = 0x000000A0,
        NV_GPU_ARCHITECTURE_GF100 = 0x000000C0,
        NV_GPU_ARCHITECTURE_GF110 = 0x000000D0,
        NV_GPU_ARCHITECTURE_GK100 = 0x000000E0,
        NV_GPU_ARCHITECTURE_GK110 = 0x000000F0,
        NV_GPU_ARCHITECTURE_GK200 = 0x00000100,
        NV_GPU_ARCHITECTURE_GM000 = 0x00000110,
        NV_GPU_ARCHITECTURE_GM200 = 0x00000120,
        NV_GPU_ARCHITECTURE_GP100 = 0x00000130,
        NV_GPU_ARCHITECTURE_GV100 = 0x00000140,
        NV_GPU_ARCHITECTURE_GV110 = 0x00000150,
        NV_GPU_ARCHITECTURE_TU100 = 0x00000160,
        NV_GPU_ARCHITECTURE_GA100 = 0x00000170,

    } NV_GPU_ARCHITECTURE_ID;

    //! NV_GPU_ARCH_INFO() values to identify GPU Architecture Implementation.
    typedef enum _NV_GPU_ARCH_IMPLEMENTATION_ID
    {

        NV_GPU_ARCH_IMPLEMENTATION_T20 = 0x00000000,

        NV_GPU_ARCH_IMPLEMENTATION_T30 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_T35 = 0x00000005,

        NV_GPU_ARCH_IMPLEMENTATION_T40 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_T124 = 0x00000000,

        NV_GPU_ARCH_IMPLEMENTATION_NV40 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_NV41 = 0x00000001,
        NV_GPU_ARCH_IMPLEMENTATION_NV42 = 0x00000002,
        NV_GPU_ARCH_IMPLEMENTATION_NV43 = 0x00000003,
        NV_GPU_ARCH_IMPLEMENTATION_NV44 = 0x00000004,
        NV_GPU_ARCH_IMPLEMENTATION_NV44A = 0x0000000A,
        NV_GPU_ARCH_IMPLEMENTATION_NV46 = 0x00000006,
        NV_GPU_ARCH_IMPLEMENTATION_NV47 = 0x00000007,
        NV_GPU_ARCH_IMPLEMENTATION_NV49 = 0x00000009,
        NV_GPU_ARCH_IMPLEMENTATION_NV4B = 0x0000000B,
        NV_GPU_ARCH_IMPLEMENTATION_NV4C = 0x0000000C,
        NV_GPU_ARCH_IMPLEMENTATION_NV4E = 0x0000000E,

        NV_GPU_ARCH_IMPLEMENTATION_NV50 = 0x00000000,

        NV_GPU_ARCH_IMPLEMENTATION_NV63 = 0x00000003,
        NV_GPU_ARCH_IMPLEMENTATION_NV67 = 0x00000007,

        NV_GPU_ARCH_IMPLEMENTATION_G84 = 0x00000004,
        NV_GPU_ARCH_IMPLEMENTATION_G86 = 0x00000006,

        NV_GPU_ARCH_IMPLEMENTATION_G92 = 0x00000002,
        NV_GPU_ARCH_IMPLEMENTATION_G94 = 0x00000004,
        NV_GPU_ARCH_IMPLEMENTATION_G96 = 0x00000006,
        NV_GPU_ARCH_IMPLEMENTATION_G98 = 0x00000008,

        NV_GPU_ARCH_IMPLEMENTATION_GT200 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_GT212 = 0x00000002,
        NV_GPU_ARCH_IMPLEMENTATION_GT214 = 0x00000004,
        NV_GPU_ARCH_IMPLEMENTATION_GT215 = 0x00000003,
        NV_GPU_ARCH_IMPLEMENTATION_GT216 = 0x00000005,
        NV_GPU_ARCH_IMPLEMENTATION_GT218 = 0x00000008,
        NV_GPU_ARCH_IMPLEMENTATION_MCP77 = 0x0000000A,
        NV_GPU_ARCH_IMPLEMENTATION_GT21C = 0x0000000B,
        NV_GPU_ARCH_IMPLEMENTATION_MCP79 = 0x0000000C,
        NV_GPU_ARCH_IMPLEMENTATION_GT21A = 0x0000000D,
        NV_GPU_ARCH_IMPLEMENTATION_MCP89 = 0x0000000F,

        NV_GPU_ARCH_IMPLEMENTATION_GF100 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_GF104 = 0x00000004,
        NV_GPU_ARCH_IMPLEMENTATION_GF106 = 0x00000003,
        NV_GPU_ARCH_IMPLEMENTATION_GF108 = 0x00000001,

        NV_GPU_ARCH_IMPLEMENTATION_GF110 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_GF116 = 0x00000006,
        NV_GPU_ARCH_IMPLEMENTATION_GF117 = 0x00000007,
        NV_GPU_ARCH_IMPLEMENTATION_GF118 = 0x00000008,
        NV_GPU_ARCH_IMPLEMENTATION_GF119 = 0x00000009,

        NV_GPU_ARCH_IMPLEMENTATION_GK104 = 0x00000004,
        NV_GPU_ARCH_IMPLEMENTATION_GK106 = 0x00000006,
        NV_GPU_ARCH_IMPLEMENTATION_GK107 = 0x00000007,
        NV_GPU_ARCH_IMPLEMENTATION_GK20A = 0x0000000A,
        NV_GPU_ARCH_IMPLEMENTATION_GK110 = 0x00000000,

        NV_GPU_ARCH_IMPLEMENTATION_GK208 = 0x00000008,

        NV_GPU_ARCH_IMPLEMENTATION_GM204 = 0x00000004,
        NV_GPU_ARCH_IMPLEMENTATION_GM206 = 0x00000006,

        NV_GPU_ARCH_IMPLEMENTATION_GP100 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_GP000 = 0x00000001,
        NV_GPU_ARCH_IMPLEMENTATION_GP102 = 0x00000002,
        NV_GPU_ARCH_IMPLEMENTATION_GP104 = 0x00000004,
        NV_GPU_ARCH_IMPLEMENTATION_GP106 = 0x00000006,
        NV_GPU_ARCH_IMPLEMENTATION_GP107 = 0x00000007,
        NV_GPU_ARCH_IMPLEMENTATION_GP108 = 0x00000008,

        NV_GPU_ARCH_IMPLEMENTATION_GV100 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_GV10B = 0x0000000B,

        NV_GPU_ARCH_IMPLEMENTATION_TU100 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_TU102 = 0x00000002,
        NV_GPU_ARCH_IMPLEMENTATION_TU104 = 0x00000004,
        NV_GPU_ARCH_IMPLEMENTATION_TU106 = 0x00000006,
        NV_GPU_ARCH_IMPLEMENTATION_TU116 = 0x00000008,
        NV_GPU_ARCH_IMPLEMENTATION_TU117 = 0x00000007,
        NV_GPU_ARCH_IMPLEMENTATION_TU000 = 0x00000001,

        NV_GPU_ARCH_IMPLEMENTATION_GA100 = 0x00000000,
        NV_GPU_ARCH_IMPLEMENTATION_GA102 = 0x00000002,
        NV_GPU_ARCH_IMPLEMENTATION_GA104 = 0x00000004,

    } NV_GPU_ARCH_IMPLEMENTATION_ID;

    typedef enum _NV_GPU_CHIP_REVISION
    {
        NV_GPU_CHIP_REV_EMULATION_QT = 0x00000000,   //!< QT chip
        NV_GPU_CHIP_REV_EMULATION_FPGA = 0x00000001, //!< FPGA implementation of the chipset
        NV_GPU_CHIP_REV_A01 = 0x00000011,            //!< First silicon chipset revision
        NV_GPU_CHIP_REV_A02 = 0x00000012,            //!< Second Silicon chipset revision
        NV_GPU_CHIP_REV_A03 = 0x00000013,            //!< Third Silicon chipset revision
        NV_GPU_CHIP_REV_UNKNOWN = 0xffffffff,        //!< Unknown chip revision
    } NV_GPU_CHIP_REVISION;

    //! \ingroup gpu
    //! Used in NvAPI_GPU_GetArchInfo()
    typedef struct
    {
        NvU32 version;

        union
        {
            NvU32 architecture;                     //!< architecture and architecture_id are the same. The former is NvU32 while the latter is an enum made for readability.
            NV_GPU_ARCHITECTURE_ID architecture_id; //!< specifies the architecture level for the GPU.
        };
        union
        {
            NvU32 implementation;                            //!< implementation and implementation_id are the same. The former is NvU32 while the latter is an enum made for readability.
            NV_GPU_ARCH_IMPLEMENTATION_ID implementation_id; //!< specifies the implementation of the architecture for the GPU.
        };
        union
        {
            NvU32 revision;                   //!< revision and revision_id are the same. The former is NvU32 while the latter is an enum made for readability.
            NV_GPU_CHIP_REVISION revision_id; //!< specifies the architecture revision of the GPU.
        };

    } NV_GPU_ARCH_INFO_V2;

    //! \ingroup gpu
    typedef NV_GPU_ARCH_INFO_V2 NV_GPU_ARCH_INFO;

//! \ingroup gpu
#define NV_GPU_ARCH_INFO_VER_1 MAKE_NVAPI_VERSION(NV_GPU_ARCH_INFO_V1, 1)

#define NV_GPU_ARCH_INFO_VER_2 MAKE_NVAPI_VERSION(NV_GPU_ARCH_INFO_V2, 2)

#define NV_GPU_ARCH_INFO_VER NV_GPU_ARCH_INFO_VER_2


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetArchInfo
    //
    //! \fn NvAPI_GPU_GetArchInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_ARCH_INFO *pGpuArchInfo)
    //!  This function retrieves the architecture, implementation and chip revision for the specified GPU .
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //! \since Release: 85
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_GetArchInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_ARCH_INFO *pGpuArchInfo);

///////////////////////////////////////////////////////////////////////////////////
//  I2C API
//  Provides ability to read or write data using I2C protocol.
//  These APIs allow I2C access only to DDC monitors

//! \addtogroup i2capi
//! @{
#define NVAPI_MAX_SIZEOF_I2C_DATA_BUFFER 4096

#define NVAPI_MAX_SIZEOF_I2C_REG_ADDRESS 4

#define NVAPI_DISPLAY_DEVICE_MASK_MAX 24

#define NVAPI_I2C_SPEED_DEPRECATED 0xFFFF


    typedef enum
    {
        NVAPI_I2C_SPEED_DEFAULT, //!< Set i2cSpeedKhz to I2C_SPEED_DEFAULT if default I2C speed is to be chosen, ie.use the current frequency setting.
        NVAPI_I2C_SPEED_3KHZ,
        NVAPI_I2C_SPEED_10KHZ,
        NVAPI_I2C_SPEED_33KHZ,
        NVAPI_I2C_SPEED_100KHZ,
        NVAPI_I2C_SPEED_200KHZ,
        NVAPI_I2C_SPEED_400KHZ,
    } NV_I2C_SPEED;

    //! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()
    typedef struct
    {
        NvU32 version;         //!< The structure version.
        NvU32 displayMask;     //!< The Display Mask of the concerned display.
        NvU8 bIsDDCPort;       //!< This flag indicates either the DDC port (TRUE) or the communication port
                               //!< (FALSE) of the concerned display.
        NvU8 i2cDevAddress;    //!< The address of the I2C slave.  The address should be shifted left by one.  For
                               //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored
                               //!< here as 0xA0.  This matches the position within the byte sent by the master, as
                               //!< the last bit is reserved to specify the read or write direction.
        NvU8 *pbI2cRegAddress; //!< The I2C target register address.  May be NULL, which indicates no register
                               //!< address should be sent.
        NvU32 regAddrSize;     //!< The size in bytes of target register address.  If pbI2cRegAddress is NULL, this
                               //!< field must be 0.
        NvU8 *pbData;          //!< The buffer of data which is to be read or written (depending on the command).
        NvU32 cbSize;          //!< The size of the data buffer, pbData, to be read or written.
        NvU32 i2cSpeed;        //!< The target speed of the transaction (between 28Kbps to 40Kbps; not guaranteed).
    } NV_I2C_INFO_V1;

    //! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()
    typedef struct
    {
        NvU32 version;            //!< The structure version.
        NvU32 displayMask;        //!< The Display Mask of the concerned display.
        NvU8 bIsDDCPort;          //!< This flag indicates either the DDC port (TRUE) or the communication port
                                  //!< (FALSE) of the concerned display.
        NvU8 i2cDevAddress;       //!< The address of the I2C slave.  The address should be shifted left by one.  For
                                  //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored
                                  //!< here as 0xA0.  This matches the position within the byte sent by the master, as
                                  //!< the last bit is reserved to specify the read or write direction.
        NvU8 *pbI2cRegAddress;    //!< The I2C target register address.  May be NULL, which indicates no register
                                  //!< address should be sent.
        NvU32 regAddrSize;        //!< The size in bytes of target register address.  If pbI2cRegAddress is NULL, this
                                  //!< field must be 0.
        NvU8 *pbData;             //!< The buffer of data which is to be read or written (depending on the command).
        NvU32 cbSize;             //!< The size of the data buffer, pbData, to be read or written.
        NvU32 i2cSpeed;           //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED.
        NV_I2C_SPEED i2cSpeedKhz; //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED).
    } NV_I2C_INFO_V2;

    //! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()
    typedef struct
    {
        NvU32 version;            //!< The structure version.
        NvU32 displayMask;        //!< The Display Mask of the concerned display.
        NvU8 bIsDDCPort;          //!< This flag indicates either the DDC port (TRUE) or the communication port
                                  //!< (FALSE) of the concerned display.
        NvU8 i2cDevAddress;       //!< The address of the I2C slave.  The address should be shifted left by one.  For
                                  //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored
                                  //!< here as 0xA0.  This matches the position within the byte sent by the master, as
                                  //!< the last bit is reserved to specify the read or write direction.
        NvU8 *pbI2cRegAddress;    //!< The I2C target register address.  May be NULL, which indicates no register
                                  //!< address should be sent.
        NvU32 regAddrSize;        //!< The size in bytes of target register address.  If pbI2cRegAddress is NULL, this
                                  //!< field must be 0.
        NvU8 *pbData;             //!< The buffer of data which is to be read or written (depending on the command).
        NvU32 cbSize;             //!< The size of the data buffer, pbData, to be read or written.
        NvU32 i2cSpeed;           //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED.
        NV_I2C_SPEED i2cSpeedKhz; //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED).
        NvU8 portId;              //!< The portid on which device is connected (remember to set bIsPortIdSet if this value is set)
                                  //!< Optional for pre-Kepler
        NvU32 bIsPortIdSet;       //!< set this flag on if and only if portid value is set
    } NV_I2C_INFO_V3;

    typedef NV_I2C_INFO_V3 NV_I2C_INFO;

#define NV_I2C_INFO_VER3 MAKE_NVAPI_VERSION(NV_I2C_INFO_V3, 3)

#define NV_I2C_INFO_VER2 MAKE_NVAPI_VERSION(NV_I2C_INFO_V2, 2)

#define NV_I2C_INFO_VER1 MAKE_NVAPI_VERSION(NV_I2C_INFO_V1, 1)


#define NV_I2C_INFO_VER NV_I2C_INFO_VER3

    //! @}

    /***********************************************************************************/

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:  NvAPI_I2CRead
    //
    //!  This function reads the data buffer from the I2C port.
    //!                 The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.
    //!
    //!                 A data buffer size larger than 16 bytes may be rejected if a register address is specified.  In such a case,
    //!                 NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.
    //!
    //!                 If a register address is specified (i.e. regAddrSize is positive), then the transaction will be performed in
    //!                 the combined format described in the I2C specification.  The register address will be written, followed by
    //!                 reading into the data buffer.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 85
    //!
    //! \param [in]   hPhysicalGPU     GPU selection.
    //! \param [out]  NV_I2C_INFO     *pI2cInfo The I2C data input structure
    //!
    //! \retval   NVAPI_OK                            Completed request
    //! \retval   NVAPI_ERROR                         Miscellaneous error occurred.
    //! \retval   NVAPI_HANDLE_INVALIDATED            Handle passed has been invalidated (see user guide).
    //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  Handle passed is not a physical GPU handle.
    //! \retval   NVAPI_INCOMPATIBLE_STRUCT_VERSION   Structure version is not supported.
    //! \retval   NVAPI_INVALID_ARGUMENT - argument does not meet specified requirements
    //! \retval   NVAPI_ARGUMENT_EXCEED_MAX_SIZE - an argument exceeds the maximum
    //!
    //! \ingroup i2capi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_I2CRead(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:  NvAPI_I2CWrite
    //
    //!  This function writes the data buffer to the I2C port.
    //!
    //!                 The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.
    //!
    //!                 A data buffer size larger than 16 bytes may be rejected if a register address is specified.  In such a case,
    //!                 NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.
    //!
    //!                 If a register address is specified (i.e. regAddrSize is positive), then the register address will be written
    //!                 and the data buffer will immediately follow without a restart.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 85
    //!
    //! \param [in]   hPhysicalGPU     GPU selection.
    //! \param [in]   pI2cInfo         The I2C data input structure
    //!
    //! \retval   NVAPI_OK                            Completed request
    //! \retval   NVAPI_ERROR                         Miscellaneous error occurred.
    //! \retval   NVAPI_HANDLE_INVALIDATED            Handle passed has been invalidated (see user guide).
    //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  Handle passed is not a physical GPU handle.
    //! \retval   NVAPI_INCOMPATIBLE_STRUCT_VERSION    Structure version is not supported.
    //! \retval   NVAPI_INVALID_ARGUMENT              Argument does not meet specified requirements
    //! \retval   NVAPI_ARGUMENT_EXCEED_MAX_SIZE      Argument exceeds the maximum
    //!
    //! \ingroup i2capi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_I2CWrite(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_WorkstationFeatureSetup
    //
    //! \fn NvAPI_GPU_WorkstationFeatureSetup(NvPhysicalGpuHandle hPhysicalGpu, NvU32 featureEnableMask, NvU32 featureDisableMask)
    //!   DESCRIPTION: This API configures the driver for a set of workstation features.
    //!                The driver can allocate the memory resources accordingly.
    //!
    //! SUPPORTED OS:  Windows 7
    //!
    //!
    //! \param [in]   hPhysicalGpu       Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved
    //!                                  using NvAPI_EnumPhysicalGPUs. A value of NULL is permitted and applies the same operation
    //!                                  to all GPU handles enumerated by NvAPI_EnumPhysicalGPUs.
    //! \param [in]   featureEnableMask  Mask of features the caller requests to enable for use
    //! \param [in]   featureDisableMask Mask of features the caller requests to disable
    //!
    //!                As a general rule, features in the enable and disable masks are expected to be disjoint, although the disable
    //!                mask has precedence and a feature flagged in both masks will be disabled.
    //!
    //! \retval ::NVAPI_OK                            configuration request succeeded
    //! \retval ::NVAPI_ERROR                         configuration request failed
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu is not a physical GPU handle.
    //! \retval ::NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE  requested feature set does not have all resources allocated for completeness.
    //! \retval ::NVAPI_NO_IMPLEMENTATION             OS below Win7, implemented only for Win7 but returns NVAPI_OK on OS above Win7 to
    //!                                               keep compatibility with apps written against Win7.
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpu
    typedef enum
    {
        NVAPI_GPU_WORKSTATION_FEATURE_MASK_SWAPGROUP = 0x00000001,
        NVAPI_GPU_WORKSTATION_FEATURE_MASK_STEREO = 0x00000010,
        NVAPI_GPU_WORKSTATION_FEATURE_MASK_WARPING = 0x00000100,
        NVAPI_GPU_WORKSTATION_FEATURE_MASK_PIXINTENSITY = 0x00000200,
        NVAPI_GPU_WORKSTATION_FEATURE_MASK_GRAYSCALE = 0x00000400,
        NVAPI_GPU_WORKSTATION_FEATURE_MASK_BPC10 = 0x00001000
    } NVAPI_GPU_WORKSTATION_FEATURE_MASK;

    //! \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureSetup(__in NvPhysicalGpuHandle hPhysicalGpu, __in NvU32 featureEnableMask, __in NvU32 featureDisableMask);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_WorkstationFeatureQuery
    //
    //!   DESCRIPTION: This API queries the current set of workstation features.
    //!
    //! SUPPORTED OS:  Windows 7
    //!
    //!
    //! \param [in]   hPhysicalGpu       Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved
    //!                                  using NvAPI_EnumPhysicalGPUs.
    //! \param [out]  pConfiguredFeatureMask  Mask of features requested for use by client drivers
    //! \param [out]  pConsistentFeatureMask  Mask of features that have all resources allocated for completeness.
    //!
    //! \retval ::NVAPI_OK                            configuration request succeeded
    //! \retval ::NVAPI_ERROR                         configuration request failed
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu is not a physical GPU handle.
    //! \retval ::NVAPI_NO_IMPLEMENTATION             OS below Win7, implemented only for Win7 but returns NVAPI_OK on OS above Win7 to
    //!                                               keep compatibility with apps written against Win7.
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureQuery(__in NvPhysicalGpuHandle hPhysicalGpu, __out_opt NvU32 *pConfiguredFeatureMask, __out_opt NvU32 *pConsistentFeatureMask);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetHDCPSupportStatus
    //
    //! \fn NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus)
    //! DESCRIPTION: This function returns a GPU's HDCP support status.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 175
    //!
    //!  \retval ::NVAPI_OK
    //!  \retval ::NVAPI_ERROR
    //!  \retval ::NVAPI_INVALID_ARGUMENT
    //!  \retval ::NVAPI_HANDLE_INVALIDATED
    //!  \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE
    //!  \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION
    //
    ////////////////////////////////////////////////////////////////////////////////

    //! \addtogroup gpu
    //! @{

    //! HDCP fuse states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS
    typedef enum _NV_GPU_HDCP_FUSE_STATE
    {
        NV_GPU_HDCP_FUSE_STATE_UNKNOWN = 0,
        NV_GPU_HDCP_FUSE_STATE_DISABLED = 1,
        NV_GPU_HDCP_FUSE_STATE_ENABLED = 2,
    } NV_GPU_HDCP_FUSE_STATE;

    //! HDCP key sources - used in NV_GPU_GET_HDCP_SUPPORT_STATUS
    typedef enum _NV_GPU_HDCP_KEY_SOURCE
    {
        NV_GPU_HDCP_KEY_SOURCE_UNKNOWN = 0,
        NV_GPU_HDCP_KEY_SOURCE_NONE = 1,
        NV_GPU_HDCP_KEY_SOURCE_CRYPTO_ROM = 2,
        NV_GPU_HDCP_KEY_SOURCE_SBIOS = 3,
        NV_GPU_HDCP_KEY_SOURCE_I2C_ROM = 4,
        NV_GPU_HDCP_KEY_SOURCE_FUSES = 5,
    } NV_GPU_HDCP_KEY_SOURCE;

    //! HDCP key source states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS
    typedef enum _NV_GPU_HDCP_KEY_SOURCE_STATE
    {
        NV_GPU_HDCP_KEY_SOURCE_STATE_UNKNOWN = 0,
        NV_GPU_HDCP_KEY_SOURCE_STATE_ABSENT = 1,
        NV_GPU_HDCP_KEY_SOURCE_STATE_PRESENT = 2,
    } NV_GPU_HDCP_KEY_SOURCE_STATE;

    //! HDPC support status - used in NvAPI_GPU_GetHDCPSupportStatus()
    typedef struct
    {
        NvU32 version;                                   //! Structure version constucted by macro #NV_GPU_GET_HDCP_SUPPORT_STATUS
        NV_GPU_HDCP_FUSE_STATE hdcpFuseState;            //! GPU's HDCP fuse state
        NV_GPU_HDCP_KEY_SOURCE hdcpKeySource;            //! GPU's HDCP key source
        NV_GPU_HDCP_KEY_SOURCE_STATE hdcpKeySourceState; //! GPU's HDCP key source state
    } NV_GPU_GET_HDCP_SUPPORT_STATUS;

//! Macro for constructing the version for structure NV_GPU_GET_HDCP_SUPPORT_STATUS
#define NV_GPU_GET_HDCP_SUPPORT_STATUS_VER MAKE_NVAPI_VERSION(NV_GPU_GET_HDCP_SUPPORT_STATUS, 1)


    //! @}

    //!  \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus);

    //! \addtogroup gpucuda
    //! @{

    //! defgroup nvcomp_gpu_top NVIDIA Compute GPU Topology Flags
    //! @{

#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_CAPABLE NV_BIT(0)     //!< This is Read only GPU flag - Physics capable GPU.

#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_ENABLE NV_BIT(1)      //!< This is Read/Write GPU flag - Indicates GPU is already enabled for physics.

#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_DEDICATED NV_BIT(2)   //!< This is Read only GPU flag - Physics enabled GPU which is *dedicated* for physics indicates

                                                              //!< this compute capable GPU was automatically made usable for Physx on CUDA.
#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_RECOMMENDED NV_BIT(3) //!< This is Read only GPU flag - Physics GPU which is recommended by the driver.

#define NV_COMPUTE_GPU_TOPOLOGY_CUDA_AVAILABLE NV_BIT(4)      //!< This is Read only GPU flag.

#define NV_COMPUTE_GPU_TOPOLOGY_CUDA_CAPABLE NV_BIT(16)       //!< This is Read only GPU flag.

#define NV_COMPUTE_GPU_TOPOLOGY_CUDA_DISABLED NV_BIT(17)      //!< This is Read only GPU flag.

#define NV_COMPUTE_GPU_TOPOLOGY_PHYSICS_AVAILABLE NV_BIT(21)  //!< This is Read only GPU flag - PhysX is able to use this GPU (PhysX is installed, etc)


    //! @}

    typedef struct
    {
        NvU32 version;  //!< Structure version
        NvU32 gpuCount; //!< Total number of compute-capable GPUs

        struct
        {
            NvPhysicalGpuHandle hPhysicalGpu; //!< Compute-capable physical GPU handle
            NvU32 flags;                      //!< One or more flags from \ref nvcomp_gpu_top

        } computeGpus[NVAPI_MAX_GPU_PER_TOPOLOGY]; //!< Array of compute-capable physical GPUs.

    } NV_COMPUTE_GPU_TOPOLOGY_V1;

    typedef struct _NV_COMPUTE_GPU
    {
        NvPhysicalGpuHandle hPhysicalGpu; //!< Compute-capable physical GPU handle
        NvU32 flags;                      //!< One or more flags from \ref nvcomp_gpu_top

    } NV_COMPUTE_GPU;

    typedef struct _NV_COMPUTE_GPU_TOPOLOGY_V2
    {
        NvU32 version;               //!< Structure version
        NvU32 gpuCount;              //!< Size of array
        NV_COMPUTE_GPU *computeGpus; //!< Array of compute-capable physical GPUs (allocate memory of size of Physical gpuCount of system).

    } NV_COMPUTE_GPU_TOPOLOGY_V2;

//! Macro for constructing the version field of NV_COMPUTE_GPU_TOPOLOGY
#define NV_COMPUTE_GPU_TOPOLOGY_VER1 MAKE_NVAPI_VERSION(NV_COMPUTE_GPU_TOPOLOGY_V1, 1)


#define NV_COMPUTE_GPU_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_COMPUTE_GPU_TOPOLOGY_V2, 2)

    typedef NV_COMPUTE_GPU_TOPOLOGY_V2 NV_COMPUTE_GPU_TOPOLOGY;

    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:  NvAPI_GPU_CudaEnumComputeCapableGpus
    //
    //! DESCRIPTION:   This API enumerates one or more compute-capable GPUs.
    //!                Note that this API is deprecated and should no longer be used for new software development.
    //! \deprecated  Do not use this function - it is deprecated in release 319.
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [inout]      pComputeTopo  Pointer to the structure NV_COMPUTE_GPU_TOPOLOGY.
    //!
    //! \retval ::NVAPI_OK                           The request was completed successfully.
    //!                                              The gpuCount indicates if one or more compute-capable GPUs are found.
    //!                                              gpuCount >= 1 means atleast one compute-capable GPU is found.
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Structure version is not supported, initialize to NV_COMPUTE_GPU_TOPOLOGY_VER.
    //! \retval ::NVAPI_ERROR                        Enumeration of the GPUs failed. Make sure at least one NVIDIA GPU exists in the system.
    //!
    //! \ingroup gpucuda
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 319.")
        NVAPI_INTERFACE NvAPI_GPU_CudaEnumComputeCapableGpus(__inout NV_COMPUTE_GPU_TOPOLOGY *pComputeTopo);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetTachReading
    //
    //!   DESCRIPTION: This API retrieves the fan speed tachometer reading for the specified physical GPU.
    //!
    //!   HOW TO USE:
    //!                 - NvU32 Value = 0;
    //!                 - ret = NvAPI_GPU_GetTachReading(hPhysicalGpu, &Value);
    //!                 - On call success:
    //!                 - Value contains the tachometer reading
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \param [in]    hPhysicalGpu   GPU selection.
    //! \param [out]   pValue         Pointer to a variable to get the tachometer reading
    //!
    //! \retval ::NVAPI_OK - completed request
    //! \retval ::NVAPI_ERROR - miscellaneous error occurred
    //! \retval ::NVAPI_NOT_SUPPORTED - functionality not supported
    //! \retval ::NVAPI_API_NOT_INTIALIZED - nvapi not initialized
    //! \retval ::NVAPI_INVALID_ARGUMENT - invalid argument passed
    //! \retval ::NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
    //!
    //! \ingroup gpucooler
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetTachReading(NvPhysicalGpuHandle hPhysicalGPU, NvU32 *pValue);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_GetECCStatusInfo
    //
    //! \fn NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu,
    //!                                           NV_GPU_ECC_STATUS_INFO *pECCStatusInfo);
    //! DESCRIPTION:     This function returns ECC memory status information.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \param [in]      hPhysicalGpu      A handle identifying the physical GPU for which ECC
    //!                                    status information is to be retrieved.
    //! \param [out]     pECCStatusInfo    A pointer to an ECC status structure.
    //!
    //! \retval ::NVAPI_OK                  The request was completed successfully.
    //! \retval ::NVAPI_ERROR               An unknown error occurred.
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle.
    //! \retval ::NVAPI_INVALID_HANDLE      The provided GPU handle is invalid.
    //! \retval ::NVAPI_HANDLE_INVALIDATED  The provided GPU handle is no longer valid.
    //! \retval ::NVAPI_INVALID_POINTER     An invalid argument pointer was provided.
    //! \retval ::NVAPI_NOT_SUPPORTED       The request is not supported.
    //! \retval ::NVAPI_API_NOT_INTIALIZED  NvAPI was not yet initialized.
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \addtogroup gpuecc
    //! Used in NV_GPU_ECC_STATUS_INFO.
    typedef enum _NV_ECC_CONFIGURATION
    {
        NV_ECC_CONFIGURATION_NOT_SUPPORTED = 0,
        NV_ECC_CONFIGURATION_DEFERRED,  //!< Changes require a POST to take effect
        NV_ECC_CONFIGURATION_IMMEDIATE, //!< Changes can optionally be made to take effect immediately
    } NV_ECC_CONFIGURATION;

    //! \ingroup gpuecc
    //! Used in NvAPI_GPU_GetECCStatusInfo().
    typedef struct
    {
        NvU32 version;                             //!< Structure version
        NvU32 isSupported : 1;                     //!< ECC memory feature support
        NV_ECC_CONFIGURATION configurationOptions; //!< Supported ECC memory feature configuration options
        NvU32 isEnabled : 1;                       //!< Active ECC memory setting
    } NV_GPU_ECC_STATUS_INFO;

//! \ingroup gpuecc
//! Macro for constructing the version field of NV_GPU_ECC_STATUS_INFO
#define NV_GPU_ECC_STATUS_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_STATUS_INFO, 1)


    //! \ingroup gpuecc
    NVAPI_INTERFACE NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu,
                                               NV_GPU_ECC_STATUS_INFO *pECCStatusInfo);

    //! \ingroup gpuecc
    //! Used in NvAPI_GPU_GetECCErrorInfo()/
    typedef struct
    {
        NvU32 version; //!< Structure version
        struct
        {
            NvU64 singleBitErrors; //!< Number of single-bit ECC errors detected since last boot
            NvU64 doubleBitErrors; //!< Number of double-bit ECC errors detected since last boot
        } current;
        struct
        {
            NvU64 singleBitErrors; //!< Number of single-bit ECC errors detected since last counter reset
            NvU64 doubleBitErrors; //!< Number of double-bit ECC errors detected since last counter reset
        } aggregate;
    } NV_GPU_ECC_ERROR_INFO;

//! \ingroup gpuecc
//! Macro for constructing the version field of NV_GPU_ECC_ERROR_INFO
#define NV_GPU_ECC_ERROR_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_ERROR_INFO, 1)


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_GetECCErrorInfo
    //
    //! \fn NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu,
    //!                                          NV_GPU_ECC_ERROR_INFO *pECCErrorInfo);
    //!
    //! DESCRIPTION:     This function returns ECC memory error information.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \param [in]      hPhysicalGpu  A handle identifying the physical GPU for
    //!                                which ECC error information is to be
    //!                                retrieved.
    //! \param [out]     pECCErrorInfo A pointer to an ECC error structure.
    //!
    //! \retval ::NVAPI_OK  The request was completed successfully.
    //! \retval ::NVAPI_ERROR  An unknown error occurred.
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  The provided GPU handle is not a physical GPU handle.
    //! \retval ::NVAPI_INVALID_ARGUMENT  incorrect param value
    //! \retval ::NVAPI_INVALID_POINTER  An invalid argument pointer was provided.
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  structure version is not supported, initialize to NV_GPU_ECC_ERROR_INFO_VER.
    //! \retval ::NVAPI_HANDLE_INVALIDATED  The provided GPU handle is no longer valid.
    //! \retval ::NVAPI_NOT_SUPPORTED  The request is not supported.
    //! \retval ::NVAPI_API_NOT_INTIALIZED  NvAPI was not yet initialized.
    //
    ///////////////////////////////////////////////////////////////////////////////
    //! \ingroup gpuecc

    NVAPI_INTERFACE NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu,
                                              NV_GPU_ECC_ERROR_INFO *pECCErrorInfo);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_ResetECCErrorInfo
    //
    //! DESCRIPTION:     This function resets ECC memory error counters.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \requires Administrator privileges since release 430.39
    //!
    //! \param [in]     hPhysicalGpu     A handle identifying the physical GPU for
    //!                                  which ECC error information is to be
    //!                                  cleared.
    //! \param [in]     bResetCurrent    Reset the current ECC error counters.
    //! \param [in]     bResetAggregate  Reset the aggregate ECC error counters.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!          specific meaning for this API, they are listed below.
    //!
    //! \retval ::NVAPI_INVALID_USER_PRIVILEGE       - The application will require Administrator privileges to access this API.
    //!                                                The application can be elevated to a higher permission level by selecting "Run as Administrator".
    //!
    //! \ingroup gpuecc
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_ResetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bResetCurrent,
                                                NvU8 bResetAggregate);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_GetECCConfigurationInfo
    //
    //! \fn NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu,
    //!                             NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo);
    //! DESCRIPTION:     This function returns ECC memory configuration information.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \param [in]      hPhysicalGpu  A handle identifying the physical GPU for
    //!                                which ECC configuration information
    //!                               is to be retrieved.
    //! \param [out]     pECCConfigurationInfo  A pointer to an ECC
    //!                                                configuration structure.
    //!
    //! \retval ::NVAPI_OK  The request was completed successfully.
    //! \retval ::NVAPI_ERROR  An unknown error occurred.
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  The provided GPU handle is not a physical GPU handle.
    //! \retval ::NVAPI_INVALID_HANDLE  The provided GPU handle is invalid.
    //! \retval ::NVAPI_HANDLE_INVALIDATED  The provided GPU handle is no longer valid.
    //! \retval ::NVAPI_INVALID_POINTER  An invalid argument pointer was provided.
    //! \retval ::NVAPI_NOT_SUPPORTED  The request is not supported.
    //! \retval ::NVAPI_API_NOT_INTIALIZED  NvAPI was not yet initialized.
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpuecc
    //! Used in NvAPI_GPU_GetECCConfigurationInfo().
    typedef struct
    {
        NvU32 version;                //! Structure version
        NvU32 isEnabled : 1;          //! Current ECC configuration stored in non-volatile memory
        NvU32 isEnabledByDefault : 1; //! Factory default ECC configuration (static)
    } NV_GPU_ECC_CONFIGURATION_INFO;

//! \ingroup gpuecc
//! Macro for consstructing the verion field of NV_GPU_ECC_CONFIGURATION_INFO
#define NV_GPU_ECC_CONFIGURATION_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_CONFIGURATION_INFO, 1)


    //! \ingroup gpuecc
    NVAPI_INTERFACE NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu,
                                                      NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_SetECCConfiguration
    //
    //! DESCRIPTION:     This function updates the ECC memory configuration setting.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \requires Administrator privileges since release 430.39
    //!
    //! \param [in]      hPhysicalGpu    A handle identifying the physical GPU for
    //!                                  which to update the ECC configuration
    //!                                  setting.
    //! \param [in]      bEnable         The new ECC configuration setting.
    //! \param [in]      bEnableImmediately   Request that the new setting take effect immediately.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!          specific meaning for this API, they are listed below.
    //!
    //! \retval ::NVAPI_INVALID_CONFIGURATION        - Possibly SLI is enabled. Disable SLI and retry.
    //! \retval ::NVAPI_INVALID_USER_PRIVILEGE       - The application will require Administrator privileges to access this API.
    //!                                                The application can be elevated to a higher permission level by selecting "Run as Administrator".
    //!
    //! \ingroup gpuecc
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_SetECCConfiguration(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bEnable,
                                                  NvU8 bEnableImmediately);

    // The following enum is providing definitions for events signaled by a Quadro Sync (QSYNC) device.
    // QSYNC event broadcast is supported for Windows 10 and later OS.
    typedef enum
    {
        NV_QSYNC_EVENT_NONE = 0,
        NV_QSYNC_EVENT_SYNC_LOSS = 1,      // Frame Lock sync loss event
        NV_QSYNC_EVENT_SYNC_GAIN = 2,      // Frame Lock sync gain event
        NV_QSYNC_EVENT_HOUSESYNC_GAIN = 3, // House cable gain(plug in) event
        NV_QSYNC_EVENT_HOUSESYNC_LOSS = 4, // House cable loss(plug out) event
        NV_QSYNC_EVENT_RJ45_GAIN = 5,      // RJ45 cable gain(plug in) event
        NV_QSYNC_EVENT_RJ45_LOSS = 6,      // RJ45 cable loss(plug out) event
    } NV_QSYNC_EVENT;

    typedef struct
    {
        NV_QSYNC_EVENT qsyncEvent; // One of the value of the enum NV_QSYNC_EVENT
        NvU32 reserved[7];         // Reserved for future use. Do not use this.
    } NV_QSYNC_EVENT_DATA;

    //! Callback for QSYNC event
    typedef void(__cdecl *NVAPI_CALLBACK_QSYNCEVENT)(NV_QSYNC_EVENT_DATA qyncEventData, void *callbackParam);

    //! Enum for Event IDs
    typedef enum
    {
        NV_EVENT_TYPE_NONE = 0,
        NV_EVENT_TYPE_QSYNC = 6,
    } NV_EVENT_TYPE;

    //! Core NV_EVENT_REGISTER_CALLBACK structure declaration
    typedef struct
    {
        NvU32 version;         //!< version field to ensure minimum version compatibility
        NV_EVENT_TYPE eventId; //!< ID of the event being sent
        void *callbackParam;   //!< This value will be passed back to the callback function when an event occurs
        union
        {
            NVAPI_CALLBACK_QSYNCEVENT nvQSYNCEventCallback; //!< Callback function pointer for QSYNC events
        } nvCallBackFunc;

    } NV_EVENT_REGISTER_CALLBACK, *PNV_EVENT_REGISTER_CALLBACK;

//! Macro for constructing the version field of ::NV_EVENT_REGISTER_CALLBACK
#define NV_EVENT_REGISTER_CALLBACK_VERSION MAKE_NVAPI_VERSION(NV_EVENT_REGISTER_CALLBACK, 1)


    //! \ingroup gpu
    typedef enum _NV_GPU_WORKSTATION_FEATURE_TYPE
    {
        NV_GPU_WORKSTATION_FEATURE_TYPE_NVIDIA_RTX_VR_READY = 1,                                               //!< NVIDIA RTX VR Ready
        NV_GPU_WORKSTATION_FEATURE_TYPE_QUADRO_VR_READY = NV_GPU_WORKSTATION_FEATURE_TYPE_NVIDIA_RTX_VR_READY, //!< DEPRECATED name - do not use
        NV_GPU_WORKSTATION_FEATURE_TYPE_PROVIZ = 2,
    } NV_GPU_WORKSTATION_FEATURE_TYPE;

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_GPU_QueryWorkstationFeatureSupport
    //
    //! \fn NvAPI_GPU_QueryWorkstationFeatureSupport(NvPhysicalGpuHandle physicalGpu, NV_GPU_WORKSTATION_FEATURE_TYPE gpuWorkstationFeature)
    //! \code
    //! DESCRIPTION:     Indicates whether a queried workstation feature is supported by the requested GPU.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //! \since Release: 440
    //!
    //! DESCRIPTION:     This API, when called with a valid physical gpu handle as Input, lets caller know whether the given workstation feature is supported by this GPU.
    //!
    //! PARAMETERS:      physicalGpu(IN)            : The handle of the GPU for the which caller wants to get the support information.
    //!                  gpuWorkstationFeature(IN ) : The feature for the GPU in question. One of the values from enum NV_GPU_WORKSTATION_FEATURE_TYPE.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status listed below
    //!
    //! \retval ::NVAPI_OK the queried workstation feature is supported on the given GPU.
    //! \retval ::NVAPI_NO_IMPLEMENTATION the current driver doesn't support this interface.
    //! \retval ::NVAPI_INVALID_HANDLE the incoming physicalGpu handle is invalid.
    //! \retval ::NVAPI_NOT_SUPPORTED the requested gpuWorkstationFeature is not supported in the selected GPU.
    //! \retval ::NVAPI_SETTING_NOT_FOUND the requested gpuWorkstationFeature is unknown to the current driver version.
    //!
    //! \endcode
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_QueryWorkstationFeatureSupport(NvPhysicalGpuHandle physicalGpu, NV_GPU_WORKSTATION_FEATURE_TYPE gpuWorkstationFeature);

    //! \ingroup gpu
    typedef struct
    {
        NvU32 version;          //!< version of this structure
        NvU32 width;            //!< width of the input texture
        NvU32 height;           //!< height of the input texture
        float *blendingTexture; //!< array of floating values building an intensity RGB texture
    } NV_SCANOUT_INTENSITY_DATA_V1;

    //! \ingroup gpu
    typedef struct
    {
        NvU32 version;           //!< version of this structure
        NvU32 width;             //!< width of the input texture
        NvU32 height;            //!< height of the input texture
        float *blendingTexture;  //!< array of floating values building an intensity RGB texture
        float *offsetTexture;    //!< array of floating values building an offset texture
        NvU32 offsetTexChannels; //!< number of channels per pixel in the offset texture
    } NV_SCANOUT_INTENSITY_DATA_V2;

    typedef NV_SCANOUT_INTENSITY_DATA_V2 NV_SCANOUT_INTENSITY_DATA;

//! \ingroup gpu
#define NV_SCANOUT_INTENSITY_DATA_VER1 MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V1, 1)

#define NV_SCANOUT_INTENSITY_DATA_VER2 MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V2, 2)

#define NV_SCANOUT_INTENSITY_DATA_VER NV_SCANOUT_INTENSITY_DATA_VER2


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME: NvAPI_GPU_SetScanoutIntensity
    //
    //!   DESCRIPTION: This API enables and sets up per-pixel intensity feature on the specified display.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]   displayId              combined physical display and GPU identifier of the display to apply the intensity control.
    //! \param [in]   scanoutIntensityData   the intensity texture info.
    //! \param [out]  pbSticky(OUT)           indicates whether the settings will be kept over a reboot.
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
    //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data.
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_INTENSITY_DATA structure version mismatch.
    //! \retval ::NVAPI_OK Feature enabled.
    //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_SetScanoutIntensity(NvU32 displayId, NV_SCANOUT_INTENSITY_DATA *scanoutIntensityData, int *pbSticky);

    //! \ingroup gpu
    typedef struct _NV_SCANOUT_INTENSITY_STATE_DATA
    {
        NvU32 version;  //!< version of this structure
        NvU32 bEnabled; //!< intensity is enabled or not
    } NV_SCANOUT_INTENSITY_STATE_DATA;

//! \ingroup gpu
#define NV_SCANOUT_INTENSITY_STATE_VER MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_STATE_DATA, 1)


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME: NvAPI_GPU_GetScanoutIntensityState
    //
    //!   DESCRIPTION: This API queries current state of the intensity feature on the specified display.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     displayId                       combined physical display and GPU identifier of the display to query the configuration.
    //! \param [in,out] scanoutIntensityStateData       intensity state data.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!          specific meaning for this API, they are listed below.
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
    //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
    //! \retval ::NVAPI_OK Feature enabled.
    //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetScanoutIntensityState(__in NvU32 displayId, __inout NV_SCANOUT_INTENSITY_STATE_DATA *scanoutIntensityStateData);

    //! \ingroup gpu
    typedef enum
    {
        NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLESTRIP_XYUVRQ = 0,
        NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLES_XYUVRQ = 1,
    } NV_GPU_WARPING_VERTICE_FORMAT;

    //! \ingroup gpu
    typedef struct
    {
        NvU32 version;                              //!< version of this structure
        float *vertices;                            //!< width of the input texture
        NV_GPU_WARPING_VERTICE_FORMAT vertexFormat; //!< format of the input vertices
        int numVertices;                            //!< number of the input vertices
        NvSBox *textureRect;                        //!< rectangle in desktop coordinates describing the source area for the warping
    } NV_SCANOUT_WARPING_DATA;

//! \ingroup gpu
#define NV_SCANOUT_WARPING_VER MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_DATA, 1)


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME: NvAPI_GPU_SetScanoutWarping
    //
    //!   DESCRIPTION: This API enables and sets up the warping feature on the specified display.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]    displayId               Combined physical display and GPU identifier of the display to apply the intensity control
    //! \param [in]    scanoutWarpingData      The warping data info
    //! \param [out]   pbSticky                Indicates whether the settings will be kept over a reboot.
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
    //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data.
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_WARPING_DATA structure version mismatch.
    //! \retval ::NVAPI_OK Feature enabled.
    //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_GPU_SetScanoutWarping(NvU32 displayId, NV_SCANOUT_WARPING_DATA *scanoutWarpingData, int *piMaxNumVertices, int *pbSticky);

    //! \ingroup gpu
    typedef struct _NV_SCANOUT_WARPING_STATE_DATA
    {
        NvU32 version;  //!< version of this structure
        NvU32 bEnabled; //!< warping is enabled or not
    } NV_SCANOUT_WARPING_STATE_DATA;

//! \ingroup gpu
#define NV_SCANOUT_WARPING_STATE_VER MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_STATE_DATA, 1)


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME: NvAPI_GPU_GetScanoutWarpingState
    //
    //!   DESCRIPTION: This API queries current state of the warping feature on the specified display.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     displayId                      combined physical display and GPU identifier of the display to query the configuration.
    //! \param [in,out] scanoutWarpingStateData        warping state data.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!          specific meaning for this API, they are listed below.
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
    //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
    //! \retval ::NVAPI_OK Feature enabled.
    //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetScanoutWarpingState(__in NvU32 displayId, __inout NV_SCANOUT_WARPING_STATE_DATA *scanoutWarpingStateData);

    typedef enum
    {
        NV_GPU_SCANOUT_COMPOSITION_PARAMETER_WARPING_RESAMPLING_METHOD = 0
    } NV_GPU_SCANOUT_COMPOSITION_PARAMETER;

    //! This enum defines a collection of possible scanout composition values that can be used to configure
    //! possible scanout composition settings.  (Currently the only parameter defined is the WARPING_RESAMPLING_METHOD).
    typedef enum
    {
        NV_GPU_SCANOUT_COMPOSITION_PARAMETER_SET_TO_DEFAULT = 0, // Set parameter to default value.
        // WARPING_RESAMPLING_METHOD section:
        NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BILINEAR = 0x100,
        NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_TRIANGULAR = 0x101,
        NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BELL_SHAPED = 0x102,
        NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BSPLINE = 0x103,
        NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_TRIANGULAR = 0x104,
        NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BELL_SHAPED = 0x105,
        NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BSPLINE = 0x106
    } NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE;

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME: NvAPI_GPU_SetScanoutCompositionParameter
    //
    //!   DESCRIPTION: This API sets various parameters that configure the scanout composition feature on the specified display.
    //!                (currently there is only one configurable parameter defined: WARPING_RESAMPLING_METHOD,
    //!                 but this function is designed to support the addition of parameters as needed.)
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]    displayId               Combined physical display and GPU identifier of the display to apply the intensity control
    //! \param [in]    parameter               The scanout composition parameter to be set
    //! \param [in]    parameterValue          The data to be set for the specified parameter
    //! \param [in]    pContainer              Additional container for data associated with the specified parameter
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
    //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data.
    //! \retval ::NVAPI_OK Feature enabled.
    //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_GPU_SetScanoutCompositionParameter(NvU32 displayId, NV_GPU_SCANOUT_COMPOSITION_PARAMETER parameter,
                                                             NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE parameterValue, float *pContainer);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME: NvAPI_GPU_GetScanoutCompositionParameter
    //
    //!   DESCRIPTION: This API queries current state of one of the various scanout composition parameters on the specified display.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     displayId           combined physical display and GPU identifier of the display to query the configuration.
    //! \param [in]     parameter           scanout composition parameter to by queried.
    //! \param [out] parameterData          scanout composition parameter data.
    //! \param [out]   pContainer           Additional container for returning data associated with the specified parameter
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!          specific meaning for this API, they are listed below.
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
    //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
    //! \retval ::NVAPI_OK Feature enabled.
    //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetScanoutCompositionParameter(__in NvU32 displayId, __in NV_GPU_SCANOUT_COMPOSITION_PARAMETER parameter,
                                                             __out NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE *parameterData, __out float *pContainer);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME: NvAPI_GPU_GetScanoutConfiguration
    //
    //!   DESCRIPTION: This API queries the desktop and scanout portion of the specified display.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     displayId          combined physical display and GPU identifier of the display to query the configuration.
    //! \param [in,out] desktopRect        desktop area of the display in desktop coordinates.
    //! \param [in,out] scanoutRect        scanout area of the display relative to desktopRect.
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
    //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
    //! \retval ::NVAPI_OK Feature enabled.
    //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfiguration(NvU32 displayId, NvSBox *desktopRect, NvSBox *scanoutRect);

    //! \ingroup gpu
    //! Used in NvAPI_GPU_GetScanoutConfigurationEx().
    typedef struct _NV_SCANOUT_INFORMATION
    {
        NvU32 version; //!< Structure version, needs to be initialized with NV_SCANOUT_INFORMATION_VER.

        NvSBox sourceDesktopRect;         //!< Operating system display device rect in desktop coordinates displayId is scanning out from.
        NvSBox sourceViewportRect;        //!< Area inside the sourceDesktopRect which is scanned out to the display.
        NvSBox targetViewportRect;        //!< Area inside the rect described by targetDisplayWidth/Height sourceViewportRect is scanned out to.
        NvU32 targetDisplayWidth;         //!< Horizontal size of the active resolution scanned out to the display.
        NvU32 targetDisplayHeight;        //!< Vertical size of the active resolution scanned out to the display.
        NvU32 cloneImportance;            //!< If targets are cloned views of the sourceDesktopRect the cloned targets have an importance assigned (0:primary,1 secondary,...).
        NV_ROTATE sourceToTargetRotation; //!< Rotation performed between the sourceViewportRect and the targetViewportRect.
    } NV_SCANOUT_INFORMATION;

#define NV_SCANOUT_INFORMATION_VER MAKE_NVAPI_VERSION(NV_SCANOUT_INFORMATION, 1)


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME: NvAPI_GPU_GetScanoutConfigurationEx
    //
    //!   DESCRIPTION: This API queries the desktop and scanout portion of the specified display.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! \since Release: 331
    //!
    //! \param [in]     displayId            combined physical display and GPU identifier of the display to query the configuration.
    //! \param [in,out] pScanoutInformation  desktop area to displayId mapping information.
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfigurationEx(__in NvU32 displayId, __inout NV_SCANOUT_INFORMATION *pScanoutInformation);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetAdapterIdFromPhysicalGpu
    //
    //!   DESCRIPTION: This API returns the OS-AdapterID from physicalGpu Handle. OS-AdapterID
    //!                is the Adapter ID that is used by Win7 CCD APIs.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]    hPhysicalGpu   PhysicalGpu Handle
    //! \param [out]   pOSAdapterId   Returns OS-AdapterId, it is typed as void * to
    //!                               avoid dependency with windows.h. User must type cast it to LUID.
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT pOSAdapterId is NULL; hPhysicalGpu is invalid
    //! \retval ::NVAPI_OK *pOSAdapterId contains valid data.
    //! \retval ::NVAPI_NOT_SUPPORTED  This API is not supported on the system.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetAdapterIdFromPhysicalGpu(NvPhysicalGpuHandle hPhysicalGpu, void *pOSAdapterId);

    //! \ingroup gpu
    typedef enum _NV_VIRTUALIZATION_MODE
    {
        NV_VIRTUALIZATION_MODE_NONE = 0,     //!< Represents Bare Metal GPU
        NV_VIRTUALIZATION_MODE_NMOS = 1,     //!< Represents GPU-Passthrough
        NV_VIRTUALIZATION_MODE_VGX = 2,      //!< Represents vGPU inside virtual machine
        NV_VIRTUALIZATION_MODE_HOST_VGPU = 3 //!< Represents VGX hypervisor in vGPU mode
    } NV_VIRTUALIZATION_MODE;

    //! \ingroup gpu
    typedef struct _NV_GPU_VIRTUALIZATION_INFO
    {
        NvU32 version; //!< Structure version

        NV_VIRTUALIZATION_MODE virtualizationMode; //!< one of NV_VIRTUALIZATION_MODE.
        NvU32 reserved;                            //!< reserved for future use. Should be set to ZERO.
    } NV_GPU_VIRTUALIZATION_INFO_V1;

    //! \ingroup gpu
    typedef NV_GPU_VIRTUALIZATION_INFO_V1 NV_GPU_VIRTUALIZATION_INFO;

//! \ingroup gpu
#define NV_GPU_VIRTUALIZATION_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_VIRTUALIZATION_INFO_V1, 1)


//! \ingroup gpu
#define NV_GPU_VIRTUALIZATION_INFO_VER NV_GPU_VIRTUALIZATION_INFO_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_GetVirtualizationInfo
    //!
    //!   DESCRIPTION: This API returns virtualization information of the GPU
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 367
    //!
    //! \param [in,out] pVirtualizationInfo         Pointer to NV_GPU_VIRTUALIZATION_INFO structure.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!          specific meaning for this API, they are listed below.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetVirtualizationInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_VIRTUALIZATION_INFO *pVirtualizationInfo);

    //! \ingroup gpu
    typedef struct _NV_LOGICAL_GPU_DATA_V1
    {
        NvU32 version;          //!< [in]  Structure version.
        void *pOSAdapterId;     //!< [out] Returns OS-AdapterId. User must send memory buffer of size atleast equal to the size of LUID structure before calling the NVAPI.
        NvU32 physicalGpuCount; //!< [out] Number of physical GPU handles associated with the specified logical GPU handle.

        NvPhysicalGpuHandle physicalGpuHandles[NVAPI_MAX_PHYSICAL_GPUS]; //!< [out] This array will be filled with physical GPU handles associated with the given logical GPU handle.
                                                                         //!< The array index refers to the Physical Gpu Index (Idx).
                                                                         //!< Idx value is the same as D3D11 MultiGPUDevice GPU index, D3D12 node index, OpenGL GL_NV_gpu_multicast GPU index.
                                                                         //!< When converted to a bit mask (1 << Idx), it matches:
                                                                         //!<    1. Vulkan deviceNodeMask in VkPhysicalDeviceIDProperties
                                                                         //!<    2. CUDA deviceNodeMask returned by cuDeviceGetLuid
        NvU32 reserved[8];                                               //!< Reserved for future use. Should be set to ZERO.
    } NV_LOGICAL_GPU_DATA_V1;

    //! \ingroup gpu
    typedef NV_LOGICAL_GPU_DATA_V1 NV_LOGICAL_GPU_DATA;
#define NV_LOGICAL_GPU_DATA_VER1 MAKE_NVAPI_VERSION(NV_LOGICAL_GPU_DATA_V1, 1)

#define NV_LOGICAL_GPU_DATA_VER NV_LOGICAL_GPU_DATA_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetLogicalGpuInfo
    //
    //!  This function is used to query Logical GPU information.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 421
    //!
    //! \param [in]    hLogicalGpu            logical GPU Handle.
    //! \param [inout] pLogicalGpuData        Pointer to NV_LOGICAL_GPU_DATA structure.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!          specific meaning for this API, they are listed below.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetLogicalGpuInfo(__in NvLogicalGpuHandle hLogicalGpu, __inout NV_LOGICAL_GPU_DATA *pLogicalGpuData);

//! \addtogroup gridlicense
//! @{

//! Maximum  number of supported Feature License
#define NV_LICENSE_MAX_COUNT 3


//! Signature length for GRID License
#define NV_LICENSE_SIGNATURE_SIZE (128)


//! Length for Grid License
#define NV_LICENSE_INFO_MAX_LENGTH (128)


    //! License string
    typedef char NvAPI_LicenseString[NV_LICENSE_INFO_MAX_LENGTH];

    //! Used in NV_LICENSE_FEATURE_DETAILS
    typedef enum _NV_LICENSE_FEATURE_TYPE
    {
        NV_LICENSE_FEATURE_UNKNOWN = 0,
        NV_LICENSE_FEATURE_VGPU = 1,
        NV_LICENSE_FEATURE_NVIDIA_RTX = 2,
        NV_LICENSE_FEATURE_QUADRO = NV_LICENSE_FEATURE_NVIDIA_RTX, //!< DEPRECATED name - do not use
        NV_LICENSE_FEATURE_GAMING = 3,
    } NV_LICENSE_FEATURE_TYPE;

    //! Used in NV_LICENSE_FEATURE_DETAILS
    //!
    //!< The 'status' variable holds any one of the following license expiry status codes :
    //!<   0  -  Expiry information not available
    //!<   1  -  Invalid expiry or error fetching expiry
    //!<   2  -  Valid expiry
    //!<   3  -  Expiry not applicable
    //!<   4  -  Permanent expiry
    typedef struct _NV_LICENSE_EXPIRY_DETAILS
    {
        NvU32 year;  //!< Year value of license expiry
        NvU16 month; //!< Month value of license expiry
        NvU16 day;   //!< Day value of license expiry
        NvU16 hour;  //!< Hour value of license expiry
        NvU16 min;   //!< Minutes value of license expiry
        NvU16 sec;   //!< Seconds value of license expiry

        NvU8 status; //!< License expiry status
    } NV_LICENSE_EXPIRY_DETAILS;

    //! Used in NV_LICENSABLE_FEATURES
    typedef struct _NV_LICENSE_FEATURE_DETAILS_V1
    {
        NvU32 version;                       //!< IN - Structure version.
        NvU32 isEnabled : 1;                 //!< The current state of the licensed feature, true=enabled, false=disabled.
        NvU32 reserved : 31;                 //!< Reserved
        NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature.
        NvAPI_LicenseString licenseInfo;     //!< Deprecated
    } NV_LICENSE_FEATURE_DETAILS_V1;

    typedef struct _NV_LICENSE_FEATURE_DETAILS_V2
    {
        NvU32 version;                       //!< Unused.
        NvU32 isEnabled : 1;                 //!< The current state of the licensed feature, true=enabled, false=disabled.
        NvU32 reserved : 31;                 //!< Reserved
        NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature.
        NvAPI_LicenseString licenseInfo;     //!< Deprecated
        NvAPI_LicenseString productName;     //!< Nvidia Grid licensable product name.
    } NV_LICENSE_FEATURE_DETAILS_V2;

    typedef struct _NV_LICENSE_FEATURE_DETAILS_V3
    {
        NvU32 version;                       //!< Unused.
        NvU32 isEnabled : 1;                 //!< The current state of license, true=licensed, false=unlicensed.
        NvU32 isFeatureEnabled : 1;          //!< The current state of feature, true=enabled, false=disabled.
        NvU32 reserved : 30;                 //!< Reserved
        NV_LICENSE_FEATURE_TYPE featureCode; //!< Feature code that corresponds to the licensable feature.
        NvAPI_LicenseString licenseInfo;     //!< Deprecated
        NvAPI_LicenseString productName;     //!< Nvidia Grid licensable product name.
    } NV_LICENSE_FEATURE_DETAILS_V3;

    typedef struct _NV_LICENSE_FEATURE_DETAILS_V4
    {
        NvU32 version;                           //!< Unused.
        NvU32 isEnabled : 1;                     //!< The current state of license, true=licensed, false=unlicensed.
        NvU32 isFeatureEnabled : 1;              //!< The current state of feature, true=enabled, false=disabled.
        NvU32 reserved : 30;                     //!< Reserved
        NV_LICENSE_FEATURE_TYPE featureCode;     //!< Feature code that corresponds to the licensable feature.
        NvAPI_LicenseString licenseInfo;         //!< Deprecated
        NvAPI_LicenseString productName;         //!< Nvidia Grid licensable product name.
        NV_LICENSE_EXPIRY_DETAILS licenseExpiry; //!< License expiry information.
    } NV_LICENSE_FEATURE_DETAILS_V4;

    typedef NV_LICENSE_FEATURE_DETAILS_V1 NV_LICENSE_FEATURE_DETAILS;

#define NV_LICENSE_FEATURE_DETAILS_VER1 MAKE_NVAPI_VERSION(NV_LICENSE_FEATURE_DETAILS_V1, 1)

#define NV_LICENSE_FEATURE_DETAILS_VER NV_LICENSE_FEATURE_DETAILS_VER1


    //! Licensable features
    typedef struct _NV_LICENSABLE_FEATURES_V1
    {
        NvU32 version;                                                      //!< IN - Structure version.
        NvU32 isLicenseSupported : 1;                                       //!< True if Software Licensing is supported.
        NvU32 reserved : 31;                                                //!< Reserved
        NvU32 licensableFeatureCount;                                       //!< The number of licensable features.
        NvU8 signature[NV_LICENSE_SIGNATURE_SIZE];                          //!< Dynamic signature required for Authentication of the components,
                                                                            //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE
        NV_LICENSE_FEATURE_DETAILS_V1 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features
    } NV_LICENSABLE_FEATURES_V1;

    typedef struct _NV_LICENSABLE_FEATURES_V2
    {
        NvU32 version;                                                      //!< IN - Structure version.
        NvU32 isLicenseSupported : 1;                                       //!< True if Software Licensing is supported.
        NvU32 reserved : 31;                                                //!< Reserved
        NvU32 licensableFeatureCount;                                       //!< The number of licensable features.
        NvU8 signature[NV_LICENSE_SIGNATURE_SIZE];                          //!< Dynamic signature required for Authentication of the components,
                                                                            //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE
        NV_LICENSE_FEATURE_DETAILS_V2 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features
    } NV_LICENSABLE_FEATURES_V2;

    typedef struct _NV_LICENSABLE_FEATURES_V3
    {
        NvU32 version;                                                      //!< IN - Structure version.
        NvU32 isLicenseSupported : 1;                                       //!< True if Software Licensing is supported.
        NvU32 reserved : 31;                                                //!< Reserved
        NvU32 licensableFeatureCount;                                       //!< The number of licensable features.
        NvU8 signature[NV_LICENSE_SIGNATURE_SIZE];                          //!< Dynamic signature required for Authentication of the components,
                                                                            //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE
        NV_LICENSE_FEATURE_DETAILS_V3 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features
    } NV_LICENSABLE_FEATURES_V3;

    typedef struct _NV_LICENSABLE_FEATURES_V4
    {
        NvU32 version;                                                      //!< IN - Structure version.
        NvU32 isLicenseSupported : 1;                                       //!< True if Software Licensing is supported.
        NvU32 reserved : 31;                                                //!< Reserved
        NvU32 licensableFeatureCount;                                       //!< The number of licensable features.
        NvU8 signature[NV_LICENSE_SIGNATURE_SIZE];                          //!< Dynamic signature required for Authentication of the components,
                                                                            //!< signature length limited to NV_LICENSE_SIGNATURE_SIZE
        NV_LICENSE_FEATURE_DETAILS_V4 licenseDetails[NV_LICENSE_MAX_COUNT]; //!< Array of licensable features
    } NV_LICENSABLE_FEATURES_V4;

    typedef NV_LICENSABLE_FEATURES_V4 NV_LICENSABLE_FEATURES;

#define NV_LICENSABLE_FEATURES_VER1 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V1, 1)

#define NV_LICENSABLE_FEATURES_VER2 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V2, 2)

#define NV_LICENSABLE_FEATURES_VER3 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V3, 3)

#define NV_LICENSABLE_FEATURES_VER4 MAKE_NVAPI_VERSION(NV_LICENSABLE_FEATURES_V4, 4)

#define NV_LICENSABLE_FEATURES_VER NV_LICENSABLE_FEATURES_VER4


    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_GetLicensableFeatures
    //
    //!   DESCRIPTION:   This function call identifies whether licenses are supported on this system and if
    //!                  they are supported, returns the details of the features that can be licensed.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \param [in]  hPhysicalGpu                   GPU selection
    //! \param [in,out] pLicensableFeatures         Licensable features information.
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup gridlicense
    /////////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetLicensableFeatures(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_LICENSABLE_FEATURES *pLicensableFeatures);

    typedef struct _NV_GPU_VR_READY_V1
    {
        NvU32 version;       //!< Structure Version.
        NvU32 isVRReady : 1; //!< Is the requested GPU VR ready.
        NvU32 reserved : 31;
    } NV_GPU_VR_READY_V1;

#define NV_GPU_VR_READY_VER1 MAKE_NVAPI_VERSION(NV_GPU_VR_READY_V1, 1)

#define NV_GPU_VR_READY_VER NV_GPU_VR_READY_VER1

    typedef NV_GPU_VR_READY_V1 NV_GPU_VR_READY;

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetVRReadyData
    //
    //! DESCRIPTION: This API will return NVIDIA GPU VR Ready state.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 465
    //!
    //! \param [inout] pGpuVrReadyData - This structure will be filled with required information.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetVRReadyData(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_VR_READY *pGpuVrReadyData);

    //! Used in NvAPI_GPU_GetPerfDecreaseInfo.
    //! Bit masks for knowing the exact reason for performance decrease
    typedef enum _NVAPI_GPU_PERF_DECREASE
    {
        NV_GPU_PERF_DECREASE_NONE = 0,                               //!< No Slowdown detected
        NV_GPU_PERF_DECREASE_REASON_THERMAL_PROTECTION = 0x00000001, //!< Thermal slowdown/shutdown/POR thermal protection
        NV_GPU_PERF_DECREASE_REASON_POWER_CONTROL = 0x00000002,      //!< Power capping / pstate cap
        NV_GPU_PERF_DECREASE_REASON_AC_BATT = 0x00000004,            //!< AC->BATT event
        NV_GPU_PERF_DECREASE_REASON_API_TRIGGERED = 0x00000008,      //!< API triggered slowdown
        NV_GPU_PERF_DECREASE_REASON_INSUFFICIENT_POWER = 0x00000010, //!< Power connector missing
        NV_GPU_PERF_DECREASE_REASON_UNKNOWN = 0x80000000,            //!< Unknown reason
    } NVAPI_GPU_PERF_DECREASE;

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetPerfDecreaseInfo
    //
    //! DESCRIPTION:   This function retrieves - in NvU32 variable - reasons for the current performance decrease.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! \param [in]      hPhysicalGPU    (IN)    - GPU for which performance decrease is to be evaluated.
    //! \param [out]  pPerfDecrInfo    (OUT)    - Pointer to a NvU32 variable containing performance decrease info
    //!
    //! \return      This API can return any of the error codes enumerated in #NvAPI_Status.
    //!
    //! \ingroup gpuPerf
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetPerfDecreaseInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NvU32 *pPerfDecrInfo);

    //! \ingroup gpupstate
    //! Used in NvAPI_GPU_GetPstatesInfoEx()
    typedef struct
    {
        NvU32 version;
        NvU32 flags;      //!< - bit 0 indicates if perfmon is enabled or not
                          //!< - bit 1 indicates if dynamic Pstate is capable or not
                          //!< - bit 2 indicates if dynamic Pstate is enable or not
                          //!< - all other bits must be set to 0
        NvU32 numPstates; //!< The number of available p-states
        NvU32 numClocks;  //!< The number of clock domains supported by each P-State
        struct
        {
            NV_GPU_PERF_PSTATE_ID pstateId; //!< ID of the p-state.
            NvU32 flags;                    //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2
                                            //!< - bit 1 indicates if the Pstate is overclocked or not
                                            //!< - bit 2 indicates if the Pstate is overclockable or not
                                            //!< - all other bits must be set to 0
            struct
            {
                NV_GPU_PUBLIC_CLOCK_ID domainId; //!< ID of the clock domain
                NvU32 flags;                     //!< Reserved. Must be set to 0
                NvU32 freq;                      //!< Clock frequency in kHz

            } clocks[NVAPI_MAX_GPU_PERF_CLOCKS];
        } pstates[NVAPI_MAX_GPU_PERF_PSTATES];

    } NV_GPU_PERF_PSTATES_INFO_V1;

    //! \ingroup gpupstate
    typedef struct
    {
        NvU32 version;
        NvU32 flags;      //!< - bit 0 indicates if perfmon is enabled or not
                          //!< - bit 1 indicates if dynamic Pstate is capable or not
                          //!< - bit 2 indicates if dynamic Pstate is enable or not
                          //!< - all other bits must be set to 0
        NvU32 numPstates; //!< The number of available p-states
        NvU32 numClocks;  //!< The number of clock domains supported by each P-State
        NvU32 numVoltages;
        struct
        {
            NV_GPU_PERF_PSTATE_ID pstateId; //!< ID of the p-state.
            NvU32 flags;                    //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2
                                            //!< - bit 1 indicates if the Pstate is overclocked or not
                                            //!< - bit 2 indicates if the Pstate is overclockable or not
                                            //!< - all other bits must be set to 0
            struct
            {
                NV_GPU_PUBLIC_CLOCK_ID domainId;
                NvU32 flags; //!< bit 0 indicates if this clock is overclockable
                             //!< all other bits must be set to 0
                NvU32 freq;

            } clocks[NVAPI_MAX_GPU_PERF_CLOCKS];
            struct
            {
                NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId; //!< ID of the voltage domain, containing flags and mvolt info
                NvU32 flags;                                 //!< Reserved for future use. Must be set to 0
                NvU32 mvolt;                                 //!< Voltage in mV

            } voltages[NVAPI_MAX_GPU_PERF_VOLTAGES];

        } pstates[NVAPI_MAX_GPU_PERF_PSTATES]; //!< Valid index range is 0 to numVoltages-1

    } NV_GPU_PERF_PSTATES_INFO_V2;

    //! \ingroup gpupstate
    typedef NV_GPU_PERF_PSTATES_INFO_V2 NV_GPU_PERF_PSTATES_INFO;

//! \ingroup gpupstate
//! @{

//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V1
#define NV_GPU_PERF_PSTATES_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V1, 1)


//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V2
#define NV_GPU_PERF_PSTATES_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V2, 2)


//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V2
#define NV_GPU_PERF_PSTATES_INFO_VER3 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V2, 3)


//! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO
#define NV_GPU_PERF_PSTATES_INFO_VER NV_GPU_PERF_PSTATES_INFO_VER3


    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_GetPstatesInfoEx
    //
    //! DESCRIPTION:     This API retrieves all performance states (P-States) information. This is the same as
    //!                  NvAPI_GPU_GetPstatesInfo(), but supports an input flag for various options.
    //!
    //!                  P-States are GPU active/executing performance capability and power consumption states.
    //!
    //!                  P-States ranges from P0 to P15, with P0 being the highest performance/power state, and
    //!                  P15 being the lowest performance/power state. Each P-State, if available, maps to a
    //!                  performance level. Not all P-States are available on a given system. The definitions
    //!                  of each P-State are currently as follows: \n
    //!                  - P0/P1 - Maximum 3D performance
    //!                  - P2/P3 - Balanced 3D performance-power
    //!                  - P8 - Basic HD video playback
    //!                  - P10 - DVD playback
    //!                  - P12 - Minimum idle power consumption
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     hPhysicalGPU       GPU selection.
    //! \param [out]    pPerfPstatesInfo   P-States information retrieved, as detailed below: \n
    //!                  - flags is reserved for future use.
    //!                  - numPstates is the number of available P-States
    //!                  - numClocks is the number of clock domains supported by each P-State
    //!                  - pstates has valid index range from 0 to numPstates - 1
    //!                  - pstates[i].pstateId is the ID of the P-State,
    //!                      containing the following info:
    //!                    - pstates[i].flags containing the following info:
    //!                        - bit 0 indicates if the PCIE limit is GEN1 or GEN2
    //!                        - bit 1 indicates if the Pstate is overclocked or not
    //!                        - bit 2 indicates if the Pstate is overclockable or not
    //!                    - pstates[i].clocks has valid index range from 0 to numClocks -1
    //!                    - pstates[i].clocks[j].domainId is the public ID of the clock domain,
    //!                        containing the following info:
    //!                      - pstates[i].clocks[j].flags containing the following info:
    //!                          bit 0 indicates if the clock domain is overclockable or not
    //!                      - pstates[i].clocks[j].freq is the clock frequency in kHz
    //!                    - pstates[i].voltages has a valid index range from 0 to numVoltages - 1
    //!                    - pstates[i].voltages[j].domainId is the ID of the voltage domain,
    //!                        containing the following info:
    //!                      - pstates[i].voltages[j].flags is reserved for future use.
    //!                      - pstates[i].voltages[j].mvolt is the voltage in mV
    //!                  inputFlags(IN)   - This can be used to select various options:
    //!                    - if bit 0 is set, pPerfPstatesInfo would contain the default settings
    //!                        instead of the current, possibily overclocked settings.
    //!                    - if bit 1 is set, pPerfPstatesInfo would contain the maximum clock
    //!                        frequencies instead of the nominal frequencies.
    //!                    - if bit 2 is set, pPerfPstatesInfo would contain the minimum clock
    //!                        frequencies instead of the nominal frequencies.
    //!                    - all other bits must be set to 0.
    //!
    //! \retval ::NVAPI_OK                            Completed request
    //! \retval ::NVAPI_ERROR                         Miscellaneous error occurred
    //! \retval ::NVAPI_HANDLE_INVALIDATED            Handle passed has been invalidated (see user guide)
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  Handle passed is not a physical GPU handle
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION   The version of the NV_GPU_PERF_PSTATES struct is not supported
    //!
    //! \ingroup gpupstate
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20.")
        NVAPI_INTERFACE NvAPI_GPU_GetPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATES_INFO *pPerfPstatesInfo, NvU32 inputFlags);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_GetPstates20
    //
    //! DESCRIPTION:    This API retrieves all performance states (P-States) 2.0 information.
    //!
    //!                 P-States are GPU active/executing performance capability states.
    //!                 They range from P0 to P15, with P0 being the highest performance state,
    //!                 and P15 being the lowest performance state. Each P-State, if available,
    //!                 maps to a performance level. Not all P-States are available on a given system.
    //!                 The definition of each P-States are currently as follow:
    //!                 - P0/P1 - Maximum 3D performance
    //!                 - P2/P3 - Balanced 3D performance-power
    //!                 - P8 - Basic HD video playback
    //!                 - P10 - DVD playback
    //!                 - P12 - Minimum idle power consumption
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 295
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]   hPhysicalGPU  GPU selection
    //! \param [out]  pPstatesInfo  P-States information retrieved, as documented in declaration above
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API,
    //!          they are listed below.
    //!
    //! \ingroup gpupstate
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetPstates20(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_PERF_PSTATES20_INFO *pPstatesInfo);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_GetCurrentPstate
    //
    //! DESCRIPTION:     This function retrieves the current performance state (P-State).
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 165
    //!
    //! TCC_SUPPORTED
    //!
    //! \param [in]      hPhysicalGPU     GPU selection
    //! \param [out]     pCurrentPstate   The ID of the current P-State of the GPU - see \ref NV_GPU_PERF_PSTATES.
    //!
    //! \retval    NVAPI_OK                             Completed request
    //! \retval    NVAPI_ERROR                          Miscellaneous error occurred.
    //! \retval    NVAPI_HANDLE_INVALIDATED             Handle passed has been invalidated (see user guide).
    //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE   Handle passed is not a physical GPU handle.
    //! \retval    NVAPI_NOT_SUPPORTED                  P-States is not supported on this setup.
    //!
    //! \ingroup   gpupstate
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetCurrentPstate(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATE_ID *pCurrentPstate);

//! \ingroup gpupstate
#define NVAPI_MAX_GPU_UTILIZATIONS 8


    //! \ingroup gpupstate
    //! Used in NvAPI_GPU_GetDynamicPstatesInfoEx().
    typedef struct
    {
        NvU32 version; //!< Structure version
        NvU32 flags;   //!< bit 0 indicates if the dynamic Pstate is enabled or not
        struct
        {
            NvU32 bIsPresent : 1; //!< Set if this utilization domain is present on this GPU
            NvU32 percentage;     //!< Percentage of time where the domain is considered busy in the last 1 second interval
        } utilization[NVAPI_MAX_GPU_UTILIZATIONS];
    } NV_GPU_DYNAMIC_PSTATES_INFO_EX;

//! \ingroup gpupstate
//! Macro for constructing the version field of NV_GPU_DYNAMIC_PSTATES_INFO_EX
#define NV_GPU_DYNAMIC_PSTATES_INFO_EX_VER MAKE_NVAPI_VERSION(NV_GPU_DYNAMIC_PSTATES_INFO_EX, 1)


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetDynamicPstatesInfoEx
    //
    //! DESCRIPTION:   This API retrieves the NV_GPU_DYNAMIC_PSTATES_INFO_EX structure for the specified physical GPU.
    //!                Each domain's info is indexed in the array.  For example:
    //!                - pDynamicPstatesInfo->utilization[NVAPI_GPU_UTILIZATION_DOMAIN_GPU] holds the info for the GPU domain. \p
    //!                There are currently 4 domains for which GPU utilization and dynamic P-State thresholds can be retrieved:
    //!                   graphic engine (GPU), frame buffer (FB), video engine (VID), and bus interface (BUS).
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //!
    //! TCC_SUPPORTED
    //! \since Release: 185
    //!
    //! \retval ::NVAPI_OK
    //! \retval ::NVAPI_ERROR
    //! \retval ::NVAPI_INVALID_ARGUMENT  pDynamicPstatesInfo is NULL
    //! \retval ::NVAPI_HANDLE_INVALIDATED
    //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the INFO struct is not supported
    //!
    //! \ingroup gpupstate
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetDynamicPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_DYNAMIC_PSTATES_INFO_EX *pDynamicPstatesInfoEx);
///////////////////////////////////////////////////////////////////////////////////
//  Thermal API
//  Provides ability to get temperature levels from the various thermal sensors associated with the GPU

//! \ingroup gputhermal
#define NVAPI_MAX_THERMAL_SENSORS_PER_GPU 3


    //! \ingroup gputhermal
    //! Used in NV_GPU_THERMAL_SETTINGS
    typedef enum
    {
        NVAPI_THERMAL_TARGET_NONE = 0,
        NVAPI_THERMAL_TARGET_GPU = 1,          //!< GPU core temperature requires NvPhysicalGpuHandle
        NVAPI_THERMAL_TARGET_MEMORY = 2,       //!< GPU memory temperature requires NvPhysicalGpuHandle
        NVAPI_THERMAL_TARGET_POWER_SUPPLY = 4, //!< GPU power supply temperature requires NvPhysicalGpuHandle
        NVAPI_THERMAL_TARGET_BOARD = 8,        //!< GPU board ambient temperature requires NvPhysicalGpuHandle
        NVAPI_THERMAL_TARGET_VCD_BOARD = 9,    //!< Visual Computing Device Board temperature requires NvVisualComputingDeviceHandle
        NVAPI_THERMAL_TARGET_VCD_INLET = 10,   //!< Visual Computing Device Inlet temperature requires NvVisualComputingDeviceHandle
        NVAPI_THERMAL_TARGET_VCD_OUTLET = 11,  //!< Visual Computing Device Outlet temperature requires NvVisualComputingDeviceHandle

        NVAPI_THERMAL_TARGET_ALL = 15,
        NVAPI_THERMAL_TARGET_UNKNOWN = -1,
    } NV_THERMAL_TARGET;

    //! \ingroup gputhermal
    //! Used in NV_GPU_THERMAL_SETTINGS
    typedef enum
    {
        NVAPI_THERMAL_CONTROLLER_NONE = 0,
        NVAPI_THERMAL_CONTROLLER_GPU_INTERNAL,
        NVAPI_THERMAL_CONTROLLER_ADM1032,
        NVAPI_THERMAL_CONTROLLER_MAX6649,
        NVAPI_THERMAL_CONTROLLER_MAX1617,
        NVAPI_THERMAL_CONTROLLER_LM99,
        NVAPI_THERMAL_CONTROLLER_LM89,
        NVAPI_THERMAL_CONTROLLER_LM64,
        NVAPI_THERMAL_CONTROLLER_ADT7473,
        NVAPI_THERMAL_CONTROLLER_SBMAX6649,
        NVAPI_THERMAL_CONTROLLER_VBIOSEVT,
        NVAPI_THERMAL_CONTROLLER_OS,
        NVAPI_THERMAL_CONTROLLER_UNKNOWN = -1,
    } NV_THERMAL_CONTROLLER;

    //! \ingroup gputhermal
    //! Used in NvAPI_GPU_GetThermalSettings()
    typedef struct
    {
        NvU32 version; //!< structure version
        NvU32 count;   //!< number of associated thermal sensors
        struct
        {
            NV_THERMAL_CONTROLLER controller; //!< internal, ADM1032, MAX6649...
            NvU32 defaultMinTemp;             //!< The min default temperature value of the thermal sensor in degree Celsius
            NvU32 defaultMaxTemp;             //!< The max default temperature value of the thermal sensor in degree Celsius
            NvU32 currentTemp;                //!< The current temperature value of the thermal sensor in degree Celsius
            NV_THERMAL_TARGET target;         //!< Thermal sensor targeted @ GPU, memory, chipset, powersupply, Visual Computing Device, etc.
        } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU];

    } NV_GPU_THERMAL_SETTINGS_V1;

    //! \ingroup gputhermal
    typedef struct
    {
        NvU32 version; //!< structure version
        NvU32 count;   //!< number of associated thermal sensors
        struct
        {
            NV_THERMAL_CONTROLLER controller; //!< internal, ADM1032, MAX6649...
            NvS32 defaultMinTemp;             //!< Minimum default temperature value of the thermal sensor in degree Celsius
            NvS32 defaultMaxTemp;             //!< Maximum default temperature value of the thermal sensor in degree Celsius
            NvS32 currentTemp;                //!< Current temperature value of the thermal sensor in degree Celsius
            NV_THERMAL_TARGET target;         //!< Thermal sensor targeted - GPU, memory, chipset, powersupply, Visual Computing Device, etc
        } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU];

    } NV_GPU_THERMAL_SETTINGS_V2;

    //! \ingroup gputhermal
    typedef NV_GPU_THERMAL_SETTINGS_V2 NV_GPU_THERMAL_SETTINGS;

//! \ingroup gputhermal
//! @{

//! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V1
#define NV_GPU_THERMAL_SETTINGS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V1, 1)


//! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V2
#define NV_GPU_THERMAL_SETTINGS_VER_2 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V2, 2)


//! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS
#define NV_GPU_THERMAL_SETTINGS_VER NV_GPU_THERMAL_SETTINGS_VER_2

    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GPU_GetThermalSettings
    //
    //!  This function retrieves the thermal information of all thermal sensors or specific thermal sensor associated with the selected GPU.
    //!  Thermal sensors are indexed 0 to NVAPI_MAX_THERMAL_SENSORS_PER_GPU-1.
    //!
    //!  - To retrieve specific thermal sensor info, set the sensorIndex to the required thermal sensor index.
    //!  - To retrieve info for all sensors, set sensorIndex to NVAPI_THERMAL_TARGET_ALL.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 85
    //!
    //! \param [in]   hPhysicalGPU      GPU selection.
    //! \param [in]   sensorIndex       Explicit thermal sensor index selection.
    //! \param [out]  pThermalSettings  Array of thermal settings.
    //!
    //! \retval   NVAPI_OK                           Completed request
    //! \retval   NVAPI_ERROR                        Miscellaneous error occurred.
    //! \retval   NVAPI_INVALID_ARGUMENT             pThermalInfo is NULL.
    //! \retval   NVAPI_HANDLE_INVALIDATED           Handle passed has been invalidated (see user guide).
    //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle.
    //! \retval   NVAPI_INCOMPATIBLE_STRUCT_VERSION  The version of the INFO struct is not supported.
    //! \ingroup gputhermal
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetThermalSettings(NvPhysicalGpuHandle hPhysicalGpu, NvU32 sensorIndex, NV_GPU_THERMAL_SETTINGS *pThermalSettings);

    //! \ingroup gpuclock
    //! Used in NvAPI_GPU_GetAllClockFrequencies()
    typedef struct
    {
        NvU32 version;  //!< Structure version
        NvU32 reserved; //!< These bits are reserved for future use.
        struct
        {
            NvU32 bIsPresent : 1; //!< Set if this domain is present on this GPU
            NvU32 reserved : 31;  //!< These bits are reserved for future use.
            NvU32 frequency;      //!< Clock frequency (kHz)
        } domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS];
    } NV_GPU_CLOCK_FREQUENCIES_V1;

#ifndef NV_GPU_MAX_CLOCK_FREQUENCIES
#define NV_GPU_MAX_CLOCK_FREQUENCIES 3

#endif

    //! \ingroup gpuclock
    //! Used in NvAPI_GPU_GetAllClockFrequencies()
    typedef enum
    {
        NV_GPU_CLOCK_FREQUENCIES_CURRENT_FREQ = 0,
        NV_GPU_CLOCK_FREQUENCIES_BASE_CLOCK = 1,
        NV_GPU_CLOCK_FREQUENCIES_BOOST_CLOCK = 2,
        NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NUM = NV_GPU_MAX_CLOCK_FREQUENCIES
    } NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE;

    //! \ingroup gpuclock
    //! Used in NvAPI_GPU_GetAllClockFrequencies()
    typedef struct
    {
        NvU32 version;       //!< Structure version
        NvU32 ClockType : 4; //!< One of NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE. Used to specify the type of clock to be returned.
        NvU32 reserved : 20; //!< These bits are reserved for future use. Must be set to 0.
        NvU32 reserved1 : 8; //!< These bits are reserved.
        struct
        {
            NvU32 bIsPresent : 1; //!< Set if this domain is present on this GPU
            NvU32 reserved : 31;  //!< These bits are reserved for future use.
            NvU32 frequency;      //!< Clock frequency (kHz)
        } domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS];
    } NV_GPU_CLOCK_FREQUENCIES_V2;

    //! \ingroup gpuclock
    //! Used in NvAPI_GPU_GetAllClockFrequencies()
    typedef NV_GPU_CLOCK_FREQUENCIES_V2 NV_GPU_CLOCK_FREQUENCIES;

//! \addtogroup gpuclock
//! @{
#define NV_GPU_CLOCK_FREQUENCIES_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V1, 1)

#define NV_GPU_CLOCK_FREQUENCIES_VER_2 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V2, 2)

#define NV_GPU_CLOCK_FREQUENCIES_VER_3 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V2, 3)

#define NV_GPU_CLOCK_FREQUENCIES_VER NV_GPU_CLOCK_FREQUENCIES_VER_3

    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_GetAllClockFrequencies
    //
    //!   This function retrieves the NV_GPU_CLOCK_FREQUENCIES structure for the specified physical GPU.
    //!
    //!   For each clock domain:
    //!      - bIsPresent is set for each domain that is present on the GPU
    //!      - frequency is the domain's clock freq in kHz
    //!
    //!   Each domain's info is indexed in the array.  For example:
    //!   clkFreqs.domain[NVAPI_GPU_PUBLIC_CLOCK_MEMORY] holds the info for the MEMORY domain.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 295
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API,
    //!          they are listed below.
    //! \retval  NVAPI_INVALID_ARGUMENT     pClkFreqs is NULL.
    //! \ingroup gpuclock
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_GetAllClockFrequencies(__in NvPhysicalGpuHandle hPhysicalGPU, __inout NV_GPU_CLOCK_FREQUENCIES *pClkFreqs);

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_QueryIlluminationSupport
    //!
    //! \fn NvAPI_GPU_QueryIlluminationSupport(__inout  NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo)
    //! DESCRIPTION:   This function reports if the specified illumination attribute is supported.
    //!
    //! \note Only a single GPU can manage an given attribute on a given HW element,
    //!       regardless of how many are attatched. I.E. only one GPU will be used to control
    //!       the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached.
    //!       You should enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 300.05
    //!
    //! \param [in]  hPhysicalGpu        Physical GPU handle
    //! \param       Attribute           An enumeration value specifying the Illumination attribute to be querried
    //! \param [out] pSupported          A boolean indicating if the attribute is supported.
    //!
    //! \return See \ref nvapistatus for the list of possible return values.
    //
    //////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpu
    typedef enum _NV_GPU_ILLUMINATION_ATTRIB
    {
        NV_GPU_IA_LOGO_BRIGHTNESS = 0,
        NV_GPU_IA_SLI_BRIGHTNESS = 1,
    } NV_GPU_ILLUMINATION_ATTRIB;

    //! \ingroup gpu
    typedef struct _NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1
    {

        // IN
        NvU32 version;                        //!< Version of this structure
        NvPhysicalGpuHandle hPhysicalGpu;     //!< The handle of the GPU that you are checking for the specified attribute.
                                              //!< note that this is the GPU that is managing the attribute.
                                              //!< Only a single GPU can manage an given attribute on a given HW element,
                                              //!< regardless of how many are attatched.
                                              //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,
                                              //!< regardless of how many are physicaly attached.
                                              //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
        NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried.
                                              //!<     refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB.

        // OUT
        NvU32 bSupported; //!< A boolean indicating if the attribute is supported.

    } NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1;

    //! \ingroup gpu
    typedef NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM;
//! \ingroup gpu
#define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1, 1)

//! \ingroup gpu
#define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1


    //! \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_QueryIlluminationSupport(__inout NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo);

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_GetIllumination
    //!
    //! \fn NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo)
    //! DESCRIPTION:   This function reports value of the specified illumination attribute.
    //!
    //! \note Only a single GPU can manage an given attribute on a given HW element,
    //!       regardless of how many are attatched. I.E. only one GPU will be used to control
    //!       the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached.
    //!       You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to
    //!       determine which GPU is managing the attribute.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 300.05
    //!
    //! \param [in]  hPhysicalGpu        Physical GPU handle
    //! \param       Attribute           An enumeration value specifying the Illumination attribute to be querried
    //! \param [out] Value               A DWORD containing the current value for the specified attribute.
    //!                                  This is specified as a percentage of the full range of the attribute
    //!                                  (0-100; 0 = off, 100 = full brightness)
    //!
    //! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are:
    //!             NVAPI_INVALID_ARGUMENT The specified attibute is not known to the driver.
    //!             NVAPI_NOT_SUPPORTED:   The specified attribute is not supported on the specified GPU
    //
    //////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpu
    typedef struct _NV_GPU_GET_ILLUMINATION_PARM_V1
    {

        // IN
        NvU32 version;                        //!< Version of this structure
        NvPhysicalGpuHandle hPhysicalGpu;     //!< The handle of the GPU that you are checking for the specified attribute.
                                              //!< Note that this is the GPU that is managing the attribute.
                                              //!< Only a single GPU can manage an given attribute on a given HW element,
                                              //!< regardless of how many are attatched.
                                              //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,
                                              //!< regardless of how many are physicaly attached.
                                              //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
        NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried.
                                              //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB.

        // OUT
        NvU32 Value; //!< A DWORD that will contain the current value of the specified attribute.
                     //! This is specified as a percentage of the full range of the attribute
                     //! (0-100; 0 = off, 100 = full brightness)

    } NV_GPU_GET_ILLUMINATION_PARM_V1;

    //! \ingroup gpu
    typedef NV_GPU_GET_ILLUMINATION_PARM_V1 NV_GPU_GET_ILLUMINATION_PARM;
//! \ingroup gpu
#define NV_GPU_GET_ILLUMINATION_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_GET_ILLUMINATION_PARM_V1, 1)

//! \ingroup gpu
#define NV_GPU_GET_ILLUMINATION_PARM_VER NV_GPU_GET_ILLUMINATION_PARM_VER_1


    //! \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo);

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_SetIllumination
    //!
    //! \fn NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo)
    //! DESCRIPTION:   This function sets the value of the specified illumination attribute.
    //!
    //! \note Only a single GPU can manage an given attribute on a given HW element,
    //!       regardless of how many are attatched. I.E. only one GPU will be used to control
    //!       the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached.
    //!       You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to
    //!       determine which GPU is managing the attribute.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 300.05
    //!
    //! \param [in]  hPhysicalGpu        Physical GPU handle
    //! \param       Attribute           An enumeration value specifying the Illumination attribute to be set
    //! \param       Value               The new value for the specified attribute.
    //!                                  This should be specified as a percentage of the full range of the attribute
    //!                                  (0-100; 0 = off, 100 = full brightness)
    //!                                  If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned.
    //!
    //! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are:
    //!             NVAPI_INVALID_ARGUMENT  The specified attibute is not known to the driver, or the specified value is out of range.
    //!             NVAPI_NOT_SUPPORTED     The specified attribute is not supported on the specified GPU.
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup gpu
    typedef struct _NV_GPU_SET_ILLUMINATION_PARM_V1
    {

        // IN
        NvU32 version;                        //!< Version of this structure
        NvPhysicalGpuHandle hPhysicalGpu;     //!< The handle of the GPU that you are checking for the specified attribute.
                                              //!< Note that this is the GPU that is managing the attribute.
                                              //!< Only a single GPU can manage an given attribute on a given HW element,
                                              //!< regardless of how many are attatched.
                                              //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,
                                              //!< regardless of how many are physicaly attached.
                                              //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
        NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried.
                                              //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB.
        NvU32 Value;                          //!< A DWORD containing the new value for the specified attribute.
                                              //!< This should be specified as a percentage of the full range of the attribute
                                              //!< (0-100; 0 = off, 100 = full brightness)
                                              //!< If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned.

        // OUT

    } NV_GPU_SET_ILLUMINATION_PARM_V1;

    //! \ingroup gpu
    typedef NV_GPU_SET_ILLUMINATION_PARM_V1 NV_GPU_SET_ILLUMINATION_PARM;
//! \ingroup gpu
#define NV_GPU_SET_ILLUMINATION_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_SET_ILLUMINATION_PARM_V1, 1)

//! \ingroup gpu
#define NV_GPU_SET_ILLUMINATION_PARM_VER NV_GPU_SET_ILLUMINATION_PARM_VER_1


    //! \ingroup gpu
    NVAPI_INTERFACE NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo);

    /*!
     * Enumeration of control modes that can be applied to Illumination Zones.
     */
    typedef enum
    {
        NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB = 0,       // deprecated
        NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB, // deprecated

        NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL = 0,
        NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR,

        // Strictly add new control modes above this.
        NV_GPU_CLIENT_ILLUM_CTRL_MODE_INVALID = 0xFF,
    } NV_GPU_CLIENT_ILLUM_CTRL_MODE;

    /*!
     * Enumeration of locations where an Illumination Zone might be present.
     * Encoding used -
     *   1:0 - Number specifier (0)
     *   4:2 - Location (TOP)
     *   7:5 - Type (GPU/SLI)
     */
    typedef enum
    {
        NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_TOP_0 = 0x00,
        NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_FRONT_0 = 0x08,
        NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_BACK_0 = 0x0C,
        NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_SLI_TOP_0 = 0x20,
        NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_INVALID = 0xFFFFFFFF,
    } NV_GPU_CLIENT_ILLUM_ZONE_LOCATION;

    /*!
     * Enumeration of ILLUM_DEVICEs.
     */
    typedef enum
    {
        NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_INVALID = 0,
        NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_MCUV10,
        NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_GPIO_PWM_RGBW_V10,
        NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_GPIO_PWM_SINGLE_COLOR_V10,
    } NV_GPU_CLIENT_ILLUM_DEVICE_TYPE;

    /*!
     * Enumeration of ILLUM_ZONEs.
     */
    typedef enum
    {
        NV_GPU_CLIENT_ILLUM_ZONE_TYPE_INVALID = 0,
        NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB,
        NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED,
        NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGBW,
        NV_GPU_CLIENT_ILLUM_ZONE_TYPE_SINGLE_COLOR,
    } NV_GPU_CLIENT_ILLUM_ZONE_TYPE;

/*!
 * Number of color points for the piecewise linear control mode.
 */
#define NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS 2


    /*!
     * Enumeration of Cycle types for piecewise linear control mode.
     */
    typedef enum
    {
        NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_HALF_HALT = 0,
        NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_HALT,
        NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_REPEAT,
        NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_INVALID = 0xFF,
    } NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE;

#define NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX 32


    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1
     * Describes the static information of illumination device type MCUV10.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10
    {
        /*!
         * I2C Device Index: Pointing to the illumination device in I2C Devices Table.
         */
        NvU8 i2cDevIdx;
    } NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1
     * Describes the static information of illum device type GPIO_PWM_RGBW.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW
    {
        /*!
         * Red drive GPIO pin.
         */
        NvU8 gpioPinRed;

        /*!
         * Green drive GPIO pin.
         */
        NvU8 gpioPinGreen;

        /*!
         * Blue drive GPIO pin.
         */
        NvU8 gpioPinBlue;

        /*!
         * White drive GPIO pin.
         */
        NvU8 gpioPinWhite;
    } NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW;
    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1
     * Describes the static information of illum device type GPIO_PWM_SINGLE_COLOR.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR
    {
        /*!
         * Single Color GPIO pin.
         */
        NvU8 gpioPinSingleColor;
    } NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR;

    /*!
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1
    {
        /*!
         * Type of the illumination device.
         */
        NV_GPU_CLIENT_ILLUM_DEVICE_TYPE type;

        /*!
         * Supported control modes for this illumination device.
         */
        NvU32 ctrlModeMask;

        /*!
         * Union of illumination device info data. Interpreted as per
         * @ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1::type
         */
        union
        {
            //
            // Need to be careful when add/expanding types in this union. If any type
            // exceeds sizeof(rsvd) then rsvd has failed its purpose.
            //
            NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10 mcuv10;
            NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_RGBW gpioPwmRgbwv10;
            NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_GPIO_PWM_SINGLE_COLOR gpioPwmSingleColorv10;

            /*!
             * Reserved bytes for possible future extension of this struct.
             */
            NvU8 rsvd[64];
        } data;

        /*!
         * Reserved for future.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1;

    /*!
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1
    {
        /*!
         * Version of structure. Must always be first member.
         */
        NvU32 version;

        /*!
         * Number of illumination devices present.
         */
        NvU32 numIllumDevices;

        /*!
         * Reserved bytes for possible future extension of this struct.
         */
        NvU8 rsvd[64];

        /*!
         */
        NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 devices[NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX];
    } NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1;

#define NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1, 1)

#define NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER_1

    typedef NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1 NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS;

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesGetInfo
    //!
    //! DESCRIPTION:   This API returns static information about illumination devices on the
    //!                given GPU.
    //
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 400
    //! \param [in]  hPhysicalGpu       The physical GPU handle
    //! \param [out] pIllumDevicesInfo  Pointer to structure containing static
    //!                                 information about illumination devices.
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API,
    //!          they are listed below.
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesGetInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS *pIllumDevicesInfo);

    /*!
     * Structure representing the data required for synchronization.
     */
    typedef struct
    {
        /*!
         * Boolean representing the need for synchronization.
         */
        NvBool bSync;

        /*!
         * Time stamp value required for synchronization.
         */
        NvU64 timeStampms;

        /*!
         * Reserved for future.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1;

    /*!
     * Structure representing the device control parameters of each ILLUM_DEVICE.
     */
    typedef struct
    {
        /*!
         * Type of the illum device.
         */
        NV_GPU_CLIENT_ILLUM_DEVICE_TYPE type;

        /*!
         * Structure containing the synchronization data for the illumination device.
         */
        NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1 syncData;

        /*!
         * Reserved for future.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1;

    typedef NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1 NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL;

    /*!
     * Structure representing the control parameters of ILLUM_DEVICE-s.
     */
    typedef struct
    {
        /*!
         * Version of structure. Must always be first member.
         */
        NvU32 version;

        /*!
         * Number of illumination devices present.
         */
        NvU32 numIllumDevices;

        /*!
         * Reserved bytes for possible future extension of this struct.
         */
        NvU8 rsvd[64];

        /*!
         */
        NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1 devices[NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX];
    } NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1;

#define NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1, 1)

#define NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER_1

    typedef NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1 NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS;

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesGetControl
    //!
    //! DESCRIPTION:   This API gets control parameters about illumination devices on the
    //!                given GPU.
    //
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 400
    //! \param [in]  hPhysicalGpu          The physical GPU handle
    //! \param [inout] pIllumDevicesControl  Pointer to structure containing control
    //!                                 information about illum devices.
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API,
    //!          they are listed below.
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesGetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS *pClientIllumDevicesControl);

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesSetControl
    //!
    //! DESCRIPTION:   This API sets control parameters about illumination devices on the
    //!                given GPU.
    //
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 400
    //! \param [in]  hPhysicalGpu          The physical GPU handle
    //! \param [inout] pClientIllumDevicesControl  Pointer to structure containing control
    //!                                 information about illum devices.
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API,
    //!          they are listed below.
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesSetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS *pClientIllumDevicesControl);

#define NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX 32


    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB
    {
        NvU8 rsvd;
    } NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1
     * Describes the static information of illum zone type RGBW.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW
    {
        NvU8 rsvd;
    } NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1
     * Describes the static information of illum zone type SINGLE_COLOR.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR
    {
        NvU8 rsvd;
    } NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR;

    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1
    {
        NV_GPU_CLIENT_ILLUM_ZONE_TYPE type;

        /*!
         * Index pointing to an Illumination Device that controls this zone.
         */
        NvU8 illumDeviceIdx;

        /*!
         * Provider index for representing logical to physical zone mapping.
         */
        NvU8 provIdx;

        /*!
         * Location of the zone on the board.
         */
        NV_GPU_CLIENT_ILLUM_ZONE_LOCATION zoneLocation;

        union
        {
            //
            // Need to be careful when add/expanding types in this union. If any type
            // exceeds sizeof(rsvd) then rsvd has failed its purpose.
            //
            NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB rgb;
            NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGBW rgbw;
            NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_SINGLE_COLOR singleColor;

            /*!
             * Reserved bytes for possible future extension of this struct.
             */
            NvU8 rsvd[64];
        } data;

        NvU8 rsvd[64];
    } NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1;

    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1
    {
        /*!
         * Version of structure. Must always be first member.
         */
        NvU32 version;

        /*!
         * Number of illumination zones present.
         */
        NvU32 numIllumZones;

        /*!
         * Reserved bytes for possible future extension of this struct.
         */
        NvU8 rsvd[64];
        NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 zones[NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX];
    } NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1;

#define NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1, 1)

#define NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER_1

    typedef NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1 NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS;

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesGetInfo
    //!
    //! DESCRIPTION:   This API returns static information about illumination zones on the
    //!                given GPU.
    //
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 400
    //! \param [in]  hPhysicalGpu     The physical GPU handle
    //! \param [out] pIllumZonesInfo  Pointer to structure containing static
    //!                               information about illumination devices.
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API,
    //!          they are listed below.
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesGetInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS *pIllumZonesInfo);

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB
     * Parameters required to represent control mode of type
     * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS
    {
        /*!
         * Red compenent of color applied to the zone.
         */
        NvU8 colorR;

        /*!
         * Green compenent of color applied to the zone.
         */
        NvU8 colorG;

        /*!
         * Blue compenent of color applied to the zone.
         */
        NvU8 colorB;

        /*!
         * Brightness perecentage value of the zone.
         */
        NvU8 brightnessPct;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB
     * Data required to represent control mode of type
     * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB
    {
        /*!
         * Parameters required to represent control mode of type
         * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
         */
        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS rgbParams;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB;

    /*!
     * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB
     * Data required to represent control mode of type
     * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR
    {
        /*!
         * Type of cycle effect to apply.
         */
        NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE cycleType;

        /*!
         * Number of times to repeat function within group period.
         */
        NvU8 grpCount;

        /*!
         * Time in ms to transition from color A to color B.
         */
        NvU16 riseTimems;

        /*!
         * Time in ms to transition from color B to color A.
         */
        NvU16 fallTimems;

        /*!
         * Time in ms to remain at color A before color A to color B transition.
         */
        NvU16 ATimems;

        /*!
         * Time in ms to remain at color B before color B to color A transition.
         */
        NvU16 BTimems;

        /*!
         * Time in ms to remain idle before next group of repeated function cycles.
         */
        NvU16 grpIdleTimems;

        /*!
         * Time in ms to offset the cycle relative to other zones.
         */
        NvU16 phaseOffsetms;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB
     * Data required to represent control mode of type
     * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB
    {
        /*!
         * Parameters required to represent control mode of type
         * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
         */
        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS rgbParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS];

        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1
     * Describes the control data for illumination zone of type
     * \ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB
    {
        /*!
         * Union of illumination zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB.
         * Interpreted as per ctrlMode.
         */
        union
        {
            //
            // Need to be careful when add/expanding types in this union. If any type
            // exceeds sizeof(rsvd) then rsvd has failed its purpose.
            //
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB manualRGB;
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB piecewiseLinearRGB;

            /*!
             * Reserved bytes for possible future extension of this struct.
             */
            NvU8 rsvd[64];
        } data;

        /*!
         * Reserved for future.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB;

    /*!
     * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED
     * Parameters required to represent control mode of type
     * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGB.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS
    {
        /*!
         * Brightness percentage value of the zone.
         */
        NvU8 brightnessPct;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED
     * Data required to represent control mode of type
     * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED
    {
        /*!
         * Parameters required to represent control mode of type
         * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
         */
        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS colorFixedParams;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED
     * Data required to represent control mode of type
     * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED
    {
        /*!
         * Parameters required to represent control mode of type
         * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
         */
        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS colorFixedParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS];

        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1
     * Describes the control data for illum zone of type
     * \ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED
    {
        /*!
         * Union of illum zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED.
         * Interpreted as per ctrlMode.
         */
        union
        {
            //
            // Need to be careful when add/expanding types in this union. If any type
            // exceeds sizeof(rsvd) then rsvd has failed its purpose.
            //
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED manualColorFixed;
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED piecewiseLinearColorFixed;
            /*!
             * Reserved bytes for possible future extension of this struct.
             */
            NvU8 rsvd[64];
        } data;

        /*!
         * Reserved for future.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED;

    /*!
     * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW
     * Parameters required to represent control mode of type
     * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGBW.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS
    {
        /*!
         * Red component of color applied to the zone.
         */
        NvU8 colorR;

        /*!
         * Green component of color applied to the zone.
         */
        NvU8 colorG;

        /*!
         * Blue component of color applied to the zone.
         */
        NvU8 colorB;

        /*!
         * White component of color applied to the zone.
         */
        NvU8 colorW;

        /*!
         * Brightness percentage value of the zone.
         */
        NvU8 brightnessPct;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS;

    /*!
     * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW
     * Data required to represent control mode of type
     * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGBW.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW
    {
        /*!
         * Parameters required to represent control mode of type
         * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGBW.
         */
        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS rgbwParams;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW;

    /*!
     * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_RGBW
     * Data required to represent control mode of type
     * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGBW.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW
    {
        /*!
         * Parameters required to represent control mode of type
         * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGBW.
         */
        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW_PARAMS rgbwParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS];

        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW;

    /*!
     * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_V1
     * Describes the control data for illum zone of type
     * \ref NV_GPU_ILLUM_ZONE_TYPE_RGBW.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW
    {
        /*!
         * Union of illum zone control data for zone of type NV_GPU_ILLUM_ZONE_TYPE_RGBW.
         * Interpreted as per ctrlMode.
         */
        union
        {
            //
            // Need to be careful when add/expanding types in this union. If any type
            // exceeds sizeof(rsvd) then rsvd has failed its purpose.
            //
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGBW manualRGBW;
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGBW piecewiseLinearRGBW;
            /*!
             * Reserved bytes for possible future extension of this struct.
             */
            NvU8 rsvd[64];
        } data;

        /*!
         * Reserved for future.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW;

    /*!
     * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR
     * Parameters required to represent control mode of type
     * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS
    {
        /*!
         * Brightness percentage value of the zone.
         */
        NvU8 brightnessPct;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS;

    /*!
     * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR
     * Data required to represent control mode of type
     * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR
    {
        /*!
         * Parameters required to represent control mode of type
         * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_SINGLE_COLOR.
         */
        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS singleColorParams;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR;

    /*!
     * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR
     * Data required to represent control mode of type
     * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_SINGLE_COLOR.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR
    {
        /*!
         * Parameters required to represent control mode of type
         * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_SINGLE_COLOR.
         */
        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR_PARAMS singleColorParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS];

        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData;
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR;

    /*!
     * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_V1
     * Describes the control data for illum zone of type
     * \ref NV_GPU_ILLUM_ZONE_TYPE_SINGLE_COLOR.
     */
    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR
    {
        /*!
         * Union of illum zone control data for zone of type NV_GPU_ILLUM_ZONE_TYPE_SINGLE_COLOR.
         * Interpreted as per ctrlMode.
         */
        union
        {
            //
            // Need to be careful when add/expanding types in this union. If any type
            // exceeds sizeof(rsvd) then rsvd has failed its purpose.
            //
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_SINGLE_COLOR manualSingleColor;
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_SINGLE_COLOR piecewiseLinearSingleColor;
            /*!
             * Reserved bytes for possible future extension of this struct.
             */
            NvU8 rsvd[64];
        } data;

        /*!
         * Reserved for future.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR;

    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1
    {
        NV_GPU_CLIENT_ILLUM_ZONE_TYPE type;
        NV_GPU_CLIENT_ILLUM_CTRL_MODE ctrlMode;
        union
        {
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB rgb;
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED colorFixed;
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGBW rgbw;
            NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_SINGLE_COLOR singleColor;
            NvU8 rsvd[64];
        } data;
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1;

    typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1
    {
        NvU32 version;

        /*!
         * Bit field specifying the set of values to retrieve or set
         * - default (NV_TRUE)
         * - currently active (NV_FALSE).
         */
        NvU32 bDefault : 1;
        NvU32 rsvdField : 31;

        /*!
         * Number of illumination zones present.
         */
        NvU32 numIllumZonesControl;

        /*!
         * Reserved bytes for possible future extension of this struct.
         */
        NvU8 rsvd[64];

        NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 zones[NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX];
    } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1;

#define NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1, 1)

#define NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER_1

    typedef NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1 NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS;

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesGetControl
    //!
    //! DESCRIPTION:    Accessor for control information about illumination zones on the
    //!                 given GPU.
    //
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 400
    //! \param [in]  hPhysicalGpu        The physical GPU handle
    //! \param [out] pIllumZonesControl  Pointer to structure containing control
    //!                                  information about illumination zones.
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API,
    //!          they are listed below.
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesGetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS *pIllumZonesControl);

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesSetControl
    //!
    //! DESCRIPTION:   Mutator for control information about illumination zones on the
    //!                given GPU.
    //
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! TCC_SUPPORTED
    //!
    //! \since Release: 400
    //! \param [in]  hPhysicalGpu        The physical GPU handle
    //! \param [out] pIllumZonesControl  Pointer to structure containing control
    //!                                  information about illumination zones.
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API,
    //!          they are listed below.
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesSetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS *pIllumZonesControl);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Event_RegisterCallback
    //
    //! DESCRIPTION:   This API registers the process for events. This API should be called for each eventcallback.
    //!                The handle returned to the client will be common across all eventCallbacks.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  eventCallback  Pointer to NV_EVENT_REGISTER_CALLBACK structure to call
    //!                             on new events
    //! \param [out] phClient       Handle to client for use with
    //!                             unregister function
    //!
    //! \retval ::NVAPI_OK - completed request
    //! \retval ::NVAPI_API_NOT_INTIALIZED - NvAPI not initialized
    //! \retval ::NVAPI_INVALID_ARGUMENT - Invalid argument
    //! \retval ::NVAPI_ERROR - miscellaneous error occurred
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Event_RegisterCallback(PNV_EVENT_REGISTER_CALLBACK eventCallback,
                                                 NvEventHandle *phClient);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Event_UnregisterCallback
    //
    //! DESCRIPTION:   This API unregister an event handle.
    //!                This API should be called only once per process(irrespective of the number of callbacks registered).
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]    hClient  Handle associated with this listeners
    //!                         event queue. Same as returned from
    //!                         NvAPI_Event_RegisterCallback().
    //!
    //! \retval ::NVAPI_OK - completed request
    //! \retval ::NVAPI_API_NOT_INTIALIZED - NvAPI not initialized
    //! \retval ::NVAPI_INVALID_ARGUMENT - Invalid argument
    //! \retval ::NVAPI_ERROR - miscellaneous error occurred
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Event_UnregisterCallback(NvEventHandle hClient);
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_EnumNvidiaDisplayHandle
    //
    //! This function returns the handle of the NVIDIA display specified by the enum
    //!                index (thisEnum). The client should keep enumerating until it
    //!                returns error.
    //!
    //!                Note: Display handles can get invalidated on a modeset, so the calling applications need to
    //!                renum the handles after every modeset.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \param [in]  thisEnum      The index of the NVIDIA display.
    //! \param [out] pNvDispHandle Pointer to the NVIDIA display handle.
    //!
    //! \retval NVAPI_INVALID_ARGUMENT        Either the handle pointer is NULL or enum index too big
    //! \retval NVAPI_OK                      Return a valid NvDisplayHandle based on the enum index
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device found in the system
    //! \retval NVAPI_END_ENUMERATION         No more display device to enumerate
    //! \ingroup disphandle
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_EnumNvidiaDisplayHandle(NvU32 thisEnum, NvDisplayHandle *pNvDispHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_EnumNvidiaUnAttachedDisplayHandle
    //
    //! This function returns the handle of the NVIDIA unattached display specified by the enum
    //!                index (thisEnum). The client should keep enumerating until it
    //!                returns error.
    //!                Note: Display handles can get invalidated on a modeset, so the calling applications need to
    //!                renum the handles after every modeset.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \param [in]  thisEnum                  The index of the NVIDIA display.
    //! \param [out] pNvUnAttachedDispHandle   Pointer to the NVIDIA display handle of the unattached display.
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         Either the handle pointer is NULL or enum index too big
    //! \retval NVAPI_OK                       Return a valid NvDisplayHandle based on the enum index
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA device found in the system
    //! \retval NVAPI_END_ENUMERATION          No more display device to enumerate.
    //! \ingroup disphandle
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_EnumNvidiaUnAttachedDisplayHandle(NvU32 thisEnum, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_CreateDisplayFromUnAttachedDisplay
    //
    //! This function converts the unattached display handle to an active attached display handle.
    //!
    //! At least one GPU must be present in the system and running an NVIDIA display driver.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         hNvUnAttachedDisp is not valid or pNvDisplay is NULL.
    //! \retval NVAPI_OK                       One or more handles were returned
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_CreateDisplayFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvDisplayHandle *pNvDisplay);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayHandle
    //
    //!  This function returns the handle of the NVIDIA display that is associated
    //!  with the given display "name" (such as "\\.\DISPLAY1").
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT         Either argument is NULL
    //! \retval NVAPI_OK                      *pNvDispHandle is now valid
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA device maps to that display name
    //! \ingroup disphandle
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayHandle(const char *szDisplayName, NvDisplayHandle *pNvDispHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle
    //
    //!   DESCRIPTION: This function returns the handle of an unattached NVIDIA display that is
    //!                associated with the given display name (such as "\\DISPLAY1").
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 185
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT          Either argument is NULL.
    //! \retval ::NVAPI_OK                       *pNvUnAttachedDispHandle is now valid.
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND   No NVIDIA device maps to that display name.
    //!
    //! \ingroup disphandle
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle(const char *szDisplayName, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayName
    //
    //!  For a given NVIDIA display handle, this function returns a string (such as "\\.\DISPLAY1") to identify the display.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \retval NVAPI_INVALID_ARGUMENT          Either argument is NULL
    //! \retval NVAPI_OK                       *pNvDispHandle is now valid
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND   No NVIDIA device maps to that display name
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayName(NvDisplayHandle NvDispHandle, NvAPI_ShortString szDisplayName);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetUnAttachedAssociatedDisplayName
    //
    //!  This function returns the display name given, for example, "\\DISPLAY1", using the unattached NVIDIA display handle
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 95
    //!
    //! \retval NVAPI_INVALID_ARGUMENT          Either argument is NULL
    //! \retval NVAPI_OK                       *pNvDispHandle is now valid
    //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND   No NVIDIA device maps to that display name
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetUnAttachedAssociatedDisplayName(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvAPI_ShortString szDisplayName);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_EnableHWCursor
    //
    //!  This function enables hardware cursor support
    //!
    //! SUPPORTED OS:  Windows XP
    //!
    //!
    //!
    //! \since Release: 80
    //!
    //! \return NVAPI_ERROR or NVAPI_OK
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_EnableHWCursor(NvDisplayHandle hNvDisplay);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DisableHWCursor
    //
    //! This function disables hardware cursor support
    //!
    //! SUPPORTED OS:  Windows XP
    //!
    //!
    //! \since Release: 80
    //!
    //! \return  NVAPI_ERROR or NVAPI_OK
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DisableHWCursor(NvDisplayHandle hNvDisplay);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetVBlankCounter
    //
    //!  This function gets the V-blank counter
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 80
    //!
    //! \return NVAPI_ERROR or NVAPI_OK
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetVBlankCounter(NvDisplayHandle hNvDisplay, NvU32 *pCounter);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:  NvAPI_SetRefreshRateOverride
    //
    //!  This function overrides the refresh rate on the given display/outputsMask.
    //!  The new refresh rate can be applied right away in this API call or deferred to be applied with the
    //!  next OS modeset. The override is good for only one modeset (regardless whether it's deferred or immediate).
    //!
    //!
    //! SUPPORTED OS:  Windows XP
    //!
    //!
    //! \since Release: 80
    //!
    //!  \param [in] hNvDisplay    The NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle
    //!                           enumerated from NvAPI_EnumNVidiaDisplayHandle().
    //!  \param [in] outputsMask  A set of bits that identify all target outputs which are associated with the NVIDIA
    //!                           display handle to apply the refresh rate override. When SLI is enabled, the
    //!                           outputsMask only applies to the GPU that is driving the display output.
    //!  \param [in] refreshRate  The override value. "0.0" means cancel the override.
    //!  \param [in] bSetDeferred
    //!              - "0": Apply the refresh rate override immediately in this API call.\p
    //!              - "1": Apply refresh rate at the next OS modeset.
    //!
    //!  \retval  NVAPI_INVALID_ARGUMENT hNvDisplay or outputsMask is invalid
    //!  \retval  NVAPI_OK               The refresh rate override is correct set
    //!  \retval  NVAPI_ERROR            The operation failed
    //!  \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_SetRefreshRateOverride(NvDisplayHandle hNvDisplay, NvU32 outputsMask, float refreshRate, NvU32 bSetDeferred);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetAssociatedDisplayOutputId
    //
    //! This function gets the active outputId associated with the display handle.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 90
    //!
    //! \param [in]  hNvDisplay  NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
    //! \param [out] outputId    The active display output ID associated with the selected display handle hNvDisplay.
    //!                          The outputid will have only one bit set. In the case of Clone or Span mode, this will indicate the
    //!                          display outputId of the primary display that the GPU is driving. See \ref handles.
    //!
    //! \retval  NVAPI_OK                      Call successful.
    //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
    //! \retval  NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle.
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetAssociatedDisplayOutputId(NvDisplayHandle hNvDisplay, NvU32 *pOutputId);

    //! \ingroup dispcontrol
    //! Used in NvAPI_GetDisplayPortInfo().
    typedef struct _NV_DISPLAY_PORT_INFO_V1
    {
        NvU32 version;                              //!< Structure version
        NvU32 dpcd_ver;                             //!< DPCD version of the monitor
        NV_DP_LINK_RATE maxLinkRate;                //!< Maximum supported link rate
        NV_DP_LANE_COUNT maxLaneCount;              //!< Maximum supported lane count
        NV_DP_LINK_RATE curLinkRate;                //!< Current link rate
        NV_DP_LANE_COUNT curLaneCount;              //!< Current lane count
        NV_DP_COLOR_FORMAT colorFormat;             //!< Current color format
        NV_DP_DYNAMIC_RANGE dynamicRange;           //!< Dynamic range
        NV_DP_COLORIMETRY colorimetry;              //!< Ignored in RGB space
        NV_DP_BPC bpc;                              //!< Current bit-per-component
        NvU32 isDp : 1;                             //!< If the monitor is driven by a DisplayPort
        NvU32 isInternalDp : 1;                     //!< If the monitor is driven by an NV Dp transmitter
        NvU32 isColorCtrlSupported : 1;             //!< If the color format change is supported
        NvU32 is6BPCSupported : 1;                  //!< If 6 bpc is supported
        NvU32 is8BPCSupported : 1;                  //!< If 8 bpc is supported
        NvU32 is10BPCSupported : 1;                 //!< If 10 bpc is supported
        NvU32 is12BPCSupported : 1;                 //!< If 12 bpc is supported
        NvU32 is16BPCSupported : 1;                 //!< If 16 bpc is supported
        NvU32 isYCrCb420Supported : 1;              //!< If YCrCb420 is supported
        NvU32 isYCrCb422Supported : 1;              //!< If YCrCb422 is supported
        NvU32 isYCrCb444Supported : 1;              //!< If YCrCb444 is supported
        NvU32 isRgb444SupportedOnCurrentMode : 1;   //!< If Rgb444 is supported on the current mode
        NvU32 isYCbCr444SupportedOnCurrentMode : 1; //!< If YCbCr444 is supported on the current mode
        NvU32 isYCbCr422SupportedOnCurrentMode : 1; //!< If YCbCr422 is supported on the current mode
        NvU32 isYCbCr420SupportedOnCurrentMode : 1; //!< If YCbCr420 is supported on the current mode
        NvU32 is6BPCSupportedOnCurrentMode : 1;     // if 6 bpc is supported On Current Mode
        NvU32 is8BPCSupportedOnCurrentMode : 1;     // if 8 bpc is supported On Current Mode
        NvU32 is10BPCSupportedOnCurrentMode : 1;    // if 10 bpc is supported On Current Mode
        NvU32 is12BPCSupportedOnCurrentMode : 1;    // if 12 bpc is supported On Current Mode
        NvU32 is16BPCSupportedOnCurrentMode : 1;    // if 16 bpc is supported On Current Mode
        NvU32 isMonxvYCC601Capable : 1;             // if xvYCC 601 extended colorimetry is supported
        NvU32 isMonxvYCC709Capable : 1;             // if xvYCC 709 extended colorimetry is supported
        NvU32 isMonsYCC601Capable : 1;              // if sYCC601 extended colorimetry is supported
        NvU32 isMonAdobeYCC601Capable : 1;          // if AdobeYCC601 extended colorimetry is supported
        NvU32 isMonAdobeRGBCapable : 1;             // if AdobeRGB extended colorimetry is supported
        NvU32 isMonBT2020RGBCapable : 1;            // if BT2020 RGB extended colorimetry is supported
        NvU32 isMonBT2020YCCCapable : 1;            // if BT2020 Y'CbCr extended colorimetry is supported
        NvU32 isMonBT2020cYCCCapable : 1;           // if BT2020 cYCbCr (constant luminance) extended colorimetry is supported

        NvU32 reserved : 4; //!< reserved
    } NV_DISPLAY_PORT_INFO_V1;

    typedef NV_DISPLAY_PORT_INFO_V1 NV_DISPLAY_PORT_INFO;

//! Macro for constructing the version field of NV_DISPLAY_PORT_INFO.
#define NV_DISPLAY_PORT_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO, 1)

#define NV_DISPLAY_PORT_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO, 2)

#define NV_DISPLAY_PORT_INFO_VER NV_DISPLAY_PORT_INFO_VER2


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_GetDisplayPortInfo
    //
    //! \fn NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo)
    //! DESCRIPTION:     This function returns the current DisplayPort-related information on the specified device (monitor).
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 165
    //!
    //! \param [in]     hvDisplay     NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
    //!                               This parameter is ignored when the outputId is a NvAPI displayId.
    //! \param [in]     outputId      This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed,
    //!                               it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from
    //!                               NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles.
    //! \param [out]    pInfo         The DisplayPort information
    //!
    //! \retval         NVAPI_OK                Completed request
    //! \retval         NVAPI_ERROR             Miscellaneous error occurred
    //! \retval         NVAPI_INVALID_ARGUMENT  Invalid input parameter.
    //
    ///////////////////////////////////////////////////////////////////////////////
    //! \ingroup        dispcontrol
    NVAPI_INTERFACE NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_SetDisplayPort
    //
    //! \fn NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg)
    //! DESCRIPTION:     This function sets up DisplayPort-related configurations.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release:   165
    //!
    //! \param [in]       hNvDisplay  NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from
    //!                               NvAPI_EnumNVidiaDisplayHandle().
    //! \param [in]       outputId    This display output ID, when it's "0" it means the default outputId generated from the return of
    //!                               NvAPI_GetAssociatedDisplayOutputId(). See \ref handles.
    //! \param [in]       pCfg        The display port config structure. If pCfg is NULL, it means to use the driver's default value to setup.
    //!
    //! \retval           NVAPI_OK                Completed request
    //! \retval           NVAPI_ERROR             Miscellaneous error occurred
    //! \retval           NVAPI_INVALID_ARGUMENT  Invalid input parameter
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup dispcontrol
    //! DisplayPort configuration settings - used in NvAPI_SetDisplayPort().
    typedef struct
    {
        NvU32 version;                    //!< Structure version - 2 is the latest
        NV_DP_LINK_RATE linkRate;         //!< Link rate
        NV_DP_LANE_COUNT laneCount;       //!< Lane count
        NV_DP_COLOR_FORMAT colorFormat;   //!< Color format to set
        NV_DP_DYNAMIC_RANGE dynamicRange; //!< Dynamic range
        NV_DP_COLORIMETRY colorimetry;    //!< Ignored in RGB space
        NV_DP_BPC bpc;                    //!< Bit-per-component
        NvU32 isHPD : 1;                  //!< If the control panel is making this call due to HPD
        NvU32 isSetDeferred : 1;          //!< Requires an OS modeset to finalize the setup if set
        NvU32 isChromaLpfOff : 1;         //!< Force the chroma low_pass_filter to be off
        NvU32 isDitherOff : 1;            //!< Force to turn off dither
        NvU32 testLinkTrain : 1;          //!< If testing mode, skip validation
        NvU32 testColorChange : 1;        //!< If testing mode, skip validation

    } NV_DISPLAY_PORT_CONFIG;

//! \addtogroup dispcontrol
//! @{
//! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG
#define NV_DISPLAY_PORT_CONFIG_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG, 2)

//! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG
#define NV_DISPLAY_PORT_CONFIG_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG, 1)

//! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG
#define NV_DISPLAY_PORT_CONFIG_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG, 2)

    //! @}

    //! \ingroup          dispcontrol
    NVAPI_INTERFACE NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg);

    //! \ingroup dispcontrol
    //! Used in NvAPI_GetHDMISupportInfo().
    typedef struct _NV_HDMI_SUPPORT_INFO_V1
    {
        NvU32 version; //!< Structure version

        NvU32 isGpuHDMICapable : 1;       //!< If the GPU can handle HDMI
        NvU32 isMonUnderscanCapable : 1;  //!< If the monitor supports underscan
        NvU32 isMonBasicAudioCapable : 1; //!< If the monitor supports basic audio
        NvU32 isMonYCbCr444Capable : 1;   //!< If YCbCr 4:4:4 is supported
        NvU32 isMonYCbCr422Capable : 1;   //!< If YCbCr 4:2:2 is supported
        NvU32 isMonxvYCC601Capable : 1;   //!< If xvYCC 601 is supported
        NvU32 isMonxvYCC709Capable : 1;   //!< If xvYCC 709 is supported
        NvU32 isMonHDMI : 1;              //!< If the monitor is HDMI (with IEEE's HDMI registry ID)
        NvU32 reserved : 24;              //!< Reserved.

        NvU32 EDID861ExtRev; //!< Revision number of the EDID 861 extension
    } NV_HDMI_SUPPORT_INFO_V1;

    typedef struct _NV_HDMI_SUPPORT_INFO_V2
    {
        NvU32 version; //!< Structure version

        NvU32 isGpuHDMICapable : 1;        //!< If the GPU can handle HDMI
        NvU32 isMonUnderscanCapable : 1;   //!< If the monitor supports underscan
        NvU32 isMonBasicAudioCapable : 1;  //!< If the monitor supports basic audio
        NvU32 isMonYCbCr444Capable : 1;    //!< If YCbCr 4:4:4 is supported
        NvU32 isMonYCbCr422Capable : 1;    //!< If YCbCr 4:2:2 is supported
        NvU32 isMonxvYCC601Capable : 1;    //!< If xvYCC extended colorimetry 601 is supported
        NvU32 isMonxvYCC709Capable : 1;    //!< If xvYCC extended colorimetry 709 is supported
        NvU32 isMonHDMI : 1;               //!< If the monitor is HDMI (with IEEE's HDMI registry ID)
        NvU32 isMonsYCC601Capable : 1;     //!< if sYCC601 extended colorimetry is supported
        NvU32 isMonAdobeYCC601Capable : 1; //!< if AdobeYCC601 extended colorimetry is supported
        NvU32 isMonAdobeRGBCapable : 1;    //!< if AdobeRGB extended colorimetry is supported
        NvU32 reserved : 21;               //!< Reserved.

        NvU32 EDID861ExtRev; //!< Revision number of the EDID 861 extension
    } NV_HDMI_SUPPORT_INFO_V2;

#define NV_HDMI_SUPPORT_INFO_VER1 MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO_V1, 1)

#define NV_HDMI_SUPPORT_INFO_VER2 MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO_V2, 2)


#ifndef NV_HDMI_SUPPORT_INFO_VER

    typedef NV_HDMI_SUPPORT_INFO_V2 NV_HDMI_SUPPORT_INFO;
#define NV_HDMI_SUPPORT_INFO_VER NV_HDMI_SUPPORT_INFO_VER2


#endif

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_GetHDMISupportInfo
    //
    //! \fn NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo)
    //!   This API returns the current infoframe data on the specified device(monitor).
    //!
    //! \since Release: 95
    //!
    //! \param [in]  hvDisplay  NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
    //!                         This parameter is ignored when the outputId is a NvAPI displayId.
    //! \param [in]  outputId   This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed,
    //!                         it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from
    //!                         NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles.
    //! \param [out] pInfo      The monitor and GPU's HDMI support info
    //!
    //! \retval  NVAPI_OK                Completed request
    //! \retval  NVAPI_ERROR             Miscellaneous error occurred
    //! \retval  NVAPI_INVALID_ARGUMENT  Invalid input parameter.
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup dispcontrol
    NVAPI_INTERFACE NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo);

    //! \ingroup dispcontrol

    typedef enum
    {
        NV_INFOFRAME_CMD_GET_DEFAULT = 0, //!< Returns the fields in the infoframe with values set by the manufacturer - NVIDIA/OEM.
        NV_INFOFRAME_CMD_RESET,           //!< Sets the fields in the infoframe to auto, and infoframe to the default infoframe for use in a set.
        NV_INFOFRAME_CMD_GET,             //!< Get the current infoframe state.
        NV_INFOFRAME_CMD_SET,             //!< Set the current infoframe state (flushed to the monitor), the values are one time and do not persist.
        NV_INFOFRAME_CMD_GET_OVERRIDE,    //!< Get the override infoframe state, non-override fields will be set to value = AUTO, overridden fields will have the current override values.
        NV_INFOFRAME_CMD_SET_OVERRIDE,    //!< Set the override infoframe state, non-override fields will be set to value = AUTO, other values indicate override; persist across modeset/reboot
        NV_INFOFRAME_CMD_GET_PROPERTY,    //!< get properties associated with infoframe (each of the infoframe type will have properties)
        NV_INFOFRAME_CMD_SET_PROPERTY,    //!< set properties associated with infoframe
    } NV_INFOFRAME_CMD;

    typedef enum
    {
        NV_INFOFRAME_PROPERTY_MODE_AUTO = 0,       //!< Driver determines whether to send infoframes.
        NV_INFOFRAME_PROPERTY_MODE_ENABLE,         //!< Driver always sends infoframe.
        NV_INFOFRAME_PROPERTY_MODE_DISABLE,        //!< Driver never sends infoframe.
        NV_INFOFRAME_PROPERTY_MODE_ALLOW_OVERRIDE, //!< Driver only sends infoframe when client requests it via infoframe escape call.
    } NV_INFOFRAME_PROPERTY_MODE;

    //! Returns whether the current monitor is in blacklist or force this monitor to be in blacklist.
    typedef enum
    {
        NV_INFOFRAME_PROPERTY_BLACKLIST_FALSE = 0,
        NV_INFOFRAME_PROPERTY_BLACKLIST_TRUE,
    } NV_INFOFRAME_PROPERTY_BLACKLIST;

    typedef struct
    {
        NvU32 mode : 4;
        NvU32 blackList : 2;
        NvU32 reserved : 10;
        NvU32 version : 8;
        NvU32 length : 8;
    } NV_INFOFRAME_PROPERTY;

    //! Byte1 related
    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NODATA = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_OVERSCAN,
        NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_UNDERSCAN,
        NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_FUTURE,
        NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NOT_PRESENT = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_VERTICAL_PRESENT,
        NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_HORIZONTAL_PRESENT,
        NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_BOTH_PRESENT,
        NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_AFI_ABSENT = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_AFI_PRESENT,
        NV_INFOFRAME_FIELD_VALUE_AVI_AFI_AUTO = 3
    } NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_RGB = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr422,
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr444,
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_FUTURE,
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_F17_FALSE = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_F17_TRUE,
        NV_INFOFRAME_FIELD_VALUE_AVI_F17_AUTO = 3
    } NV_INFOFRAME_FIELD_VALUE_AVI_F17;

    //! Byte2 related
    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NO_AFD = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE01,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE02,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE03,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_LETTERBOX_GT16x9,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE05,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE06,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE07,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_EQUAL_CODEDFRAME = 8,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_4x3,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_16x9,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_14x9,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE12,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_4x3_ON_14x9,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_14x9,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_4x3,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_AUTO = 31,
    } NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NO_DATA = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_4x3,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_16x9,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_FUTURE,
        NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NO_DATA = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_SMPTE_170M,
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_ITUR_BT709,
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_USE_EXTENDED_COLORIMETRY,
        NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY;

    //! Byte 3 related
    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NO_DATA = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_HORIZONTAL,
        NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_VERTICAL,
        NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_BOTH,
        NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_DEFAULT = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_LIMITED_RANGE,
        NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_FULL_RANGE,
        NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_RESERVED,
        NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC601 = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC709,
        NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_SYCC601,
        NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBEYCC601,
        NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBERGB,
        NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED05,
        NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED06,
        NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED07,
        NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_AUTO = 15
    } NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_ITC_VIDEO_CONTENT = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_ITC_ITCONTENT,
        NV_INFOFRAME_FIELD_VALUE_AVI_ITC_AUTO = 3
    } NV_INFOFRAME_FIELD_VALUE_AVI_ITC;

    //! Byte 4 related
    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NONE = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X02,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X03,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X04,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X05,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X06,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X07,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X08,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X09,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X10,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED10,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED11,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED12,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED13,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED14,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED15,
        NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_AUTO = 31
    } NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GRAPHICS = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_PHOTO,
        NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_CINEMA,
        NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GAME,
        NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_LIMITED_RANGE = 0,
        NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_FULL_RANGE,
        NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED02,
        NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED03,
        NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION;

    //! Adding an Auto bit to each field
    typedef struct
    {
        NvU32 vic : 8;
        NvU32 pixelRepeat : 5;
        NvU32 colorSpace : 3;
        NvU32 colorimetry : 3;
        NvU32 extendedColorimetry : 4;
        NvU32 rgbQuantizationRange : 3;
        NvU32 yccQuantizationRange : 3;
        NvU32 itContent : 2;
        NvU32 contentTypes : 3;
        NvU32 scanInfo : 3;
        NvU32 activeFormatInfoPresent : 2;
        NvU32 activeFormatAspectRatio : 5;
        NvU32 picAspectRatio : 3;
        NvU32 nonuniformScaling : 3;
        NvU32 barInfo : 3;
        NvU32 top_bar : 17;
        NvU32 bottom_bar : 17;
        NvU32 left_bar : 17;
        NvU32 right_bar : 17;
        NvU32 Future17 : 2;
        NvU32 Future47 : 2;
    } NV_INFOFRAME_VIDEO;

    //! Byte 1 related
    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_IN_HEADER = 0,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_2,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_3,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_4,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_5,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_6,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_7,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_8,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_AUTO = 15
    } NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_IN_HEADER = 0,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_PCM,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AC3,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG1,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MP3,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG2,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AACLC,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTS,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_ATRAC,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DSD,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_EAC3,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTSHD,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MLP,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DST,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_WMAPRO,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_USE_CODING_EXTENSION_TYPE,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AUTO = 31
    } NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE;

    //! Byte 2 related
    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_IN_HEADER = 0,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_16BITS,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_20BITS,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_24BITS,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_IN_HEADER = 0,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_32000HZ,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_44100HZ,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_48000HZ,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_88200KHZ,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_96000KHZ,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_176400KHZ,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_192000KHZ,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_AUTO = 15
    } NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY;

    //! Byte 3 related
    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_USE_CODING_TYPE = 0,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAAC,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAACV2,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_MPEGSURROUND,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE04,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE05,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE06,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE07,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE08,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE09,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE10,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE11,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE12,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE13,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE14,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE15,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE16,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE17,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE18,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE19,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE20,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE21,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE22,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE23,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE24,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE25,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE26,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE27,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE28,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE29,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE30,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE31,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_AUTO = 63
    } NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE;

    //! Byte 4 related
    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_X_FR_FL = 0,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_LFE_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_X_FR_FL,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_LFE_FR_FL = 0X31,
        // all other values should default to auto
        NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_AUTO = 0x1FF
    } NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION;

    //! Byte 5 related
    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NO_DATA = 0,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_0DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_PLUS10DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_RESERVED03,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_AUTO = 7
    } NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_0DB = 0,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_1DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_2DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_3DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_4DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_5DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_6DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_7DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_8DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_9DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_10DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_11DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_12DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_13DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_14DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_15DB,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_AUTO = 31
    } NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES;

    typedef enum
    {
        NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PERMITTED = 0,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PROHIBITED,
        NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_AUTO = 3
    } NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX;

    typedef struct
    {
        NvU32 codingType : 5;
        NvU32 codingExtensionType : 6;
        NvU32 sampleSize : 3;
        NvU32 sampleRate : 4;
        NvU32 channelCount : 4;
        NvU32 speakerPlacement : 9;
        NvU32 downmixInhibit : 2;
        NvU32 lfePlaybackLevel : 3;
        NvU32 levelShift : 5;
        NvU32 Future12 : 2;
        NvU32 Future2x : 4;
        NvU32 Future3x : 4;
        NvU32 Future52 : 2;
        NvU32 Future6 : 9;
        NvU32 Future7 : 9;
        NvU32 Future8 : 9;
        NvU32 Future9 : 9;
        NvU32 Future10 : 9;
    } NV_INFOFRAME_AUDIO;

    typedef struct
    {
        NvU32 version; //!< version of this structure
        NvU16 size;    //!< size of this structure
        NvU8 cmd;      //!< The actions to perform from NV_INFOFRAME_CMD
        NvU8 type;     //!< type of infoframe

        union
        {
            NV_INFOFRAME_PROPERTY property; //!< This is NVIDIA-specific and corresponds to the property cmds and associated infoframe.
            NV_INFOFRAME_AUDIO audio;
            NV_INFOFRAME_VIDEO video;
        } infoframe;
    } NV_INFOFRAME_DATA;

//! Macro for constructing the version field of ::NV_INFOFRAME_DATA
#define NV_INFOFRAME_DATA_VER MAKE_NVAPI_VERSION(NV_INFOFRAME_DATA, 1)


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_Disp_InfoFrameControl
    //
    //! DESCRIPTION:     This API controls the InfoFrame values.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     displayId         Monitor Identifier
    //! \param [in,out] pInfoframeData    Contains data corresponding to InfoFrame
    //!
    //! \return    This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!            specific meaning for this API, they are listed below.
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Disp_InfoFrameControl(__in NvU32 displayId, __inout NV_INFOFRAME_DATA *pInfoframeData);

    //! \ingroup dispcontrol
    //! @{
    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_Disp_ColorControl
    //
    //! \fn NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData)
    //! DESCRIPTION:    This API controls the Color values.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     displayId         Monitor Identifier
    //! \param [in,out] pColorData        Contains data corresponding to color information
    //!
    //! \return  RETURN STATUS:
    //! ::NVAPI_OK,
    //! ::NVAPI_ERROR,
    //! ::NVAPI_INVALID_ARGUMENT
    //
    ///////////////////////////////////////////////////////////////////////////////

    typedef enum
    {
        NV_COLOR_CMD_GET = 1,
        NV_COLOR_CMD_SET,
        NV_COLOR_CMD_IS_SUPPORTED_COLOR,
        NV_COLOR_CMD_GET_DEFAULT
    } NV_COLOR_CMD;

    //!  See Table 14 of CEA-861E.  Not all of this is supported by the GPU.
    typedef enum
    {
        NV_COLOR_FORMAT_RGB = 0,
        NV_COLOR_FORMAT_YUV422,
        NV_COLOR_FORMAT_YUV444,
        NV_COLOR_FORMAT_YUV420,

        NV_COLOR_FORMAT_DEFAULT = 0xFE,
        NV_COLOR_FORMAT_AUTO = 0xFF
    } NV_COLOR_FORMAT;

    typedef enum
    {
        NV_COLOR_COLORIMETRY_RGB = 0,
        NV_COLOR_COLORIMETRY_YCC601,
        NV_COLOR_COLORIMETRY_YCC709,
        NV_COLOR_COLORIMETRY_XVYCC601,
        NV_COLOR_COLORIMETRY_XVYCC709,
        NV_COLOR_COLORIMETRY_SYCC601,
        NV_COLOR_COLORIMETRY_ADOBEYCC601,
        NV_COLOR_COLORIMETRY_ADOBERGB,
        NV_COLOR_COLORIMETRY_BT2020RGB,
        NV_COLOR_COLORIMETRY_BT2020YCC,
        NV_COLOR_COLORIMETRY_BT2020cYCC,

        NV_COLOR_COLORIMETRY_DEFAULT = 0xFE,
        NV_COLOR_COLORIMETRY_AUTO = 0xFF
    } NV_COLOR_COLORIMETRY;

    typedef enum _NV_DYNAMIC_RANGE
    {
        NV_DYNAMIC_RANGE_VESA = 0x0,
        NV_DYNAMIC_RANGE_CEA = 0x1,

        NV_DYNAMIC_RANGE_AUTO = 0xFF
    } NV_DYNAMIC_RANGE;

    typedef enum _NV_BPC
    {
        NV_BPC_DEFAULT = 0,
        NV_BPC_6 = 1,
        NV_BPC_8 = 2,
        NV_BPC_10 = 3,
        NV_BPC_12 = 4,
        NV_BPC_16 = 5,
    } NV_BPC;

    typedef enum _NV_COLOR_SELECTION_POLICY
    {
        NV_COLOR_SELECTION_POLICY_USER = 0,         //!< app/nvcpl make decision to select the desire color format
        NV_COLOR_SELECTION_POLICY_BEST_QUALITY = 1, //!< driver/ OS make decision to select the best color format
        NV_COLOR_SELECTION_POLICY_DEFAULT = NV_COLOR_SELECTION_POLICY_BEST_QUALITY,
        NV_COLOR_SELECTION_POLICY_UNKNOWN = 0xFF,
    } NV_COLOR_SELECTION_POLICY;

    typedef enum _NV_DESKTOP_COLOR_DEPTH
    {
        NV_DESKTOP_COLOR_DEPTH_DEFAULT = 0x0,                                      // set if the current setting should be kept
        NV_DESKTOP_COLOR_DEPTH_8BPC = 0x1,                                         // 8 bit int per color component (8 bit int alpha)
        NV_DESKTOP_COLOR_DEPTH_10BPC = 0x2,                                        // 10 bit int per color component (2 bit int alpha)
        NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT = 0x3,                                  // 16 bit float per color component (16 bit float alpha)
        NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_WCG = 0x4,                              // 16 bit float per color component (16 bit float alpha) wide color gamut
        NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_HDR = 0x5,                              // 16 bit float per color component (16 bit float alpha) HDR
        NV_DESKTOP_COLOR_DEPTH_MAX_VALUE = NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_HDR, // must be set to highest enum value
    } NV_DESKTOP_COLOR_DEPTH;

    typedef struct _NV_COLOR_DATA_V1
    {
        NvU32 version; //!< Version of this structure
        NvU16 size;    //!< Size of this structure
        NvU8 cmd;
        struct
        {
            NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values.
            NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values.
        } data;
    } NV_COLOR_DATA_V1;

    typedef struct _NV_COLOR_DATA_V2
    {
        NvU32 version; //!< Version of this structure
        NvU16 size;    //!< Size of this structure
        NvU8 cmd;
        struct
        {
            NvU8 colorFormat;  //!< One of NV_COLOR_FORMAT enum values.
            NvU8 colorimetry;  //!< One of NV_COLOR_COLORIMETRY enum values.
            NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values.
        } data;
    } NV_COLOR_DATA_V2;

    typedef struct _NV_COLOR_DATA_V3
    {
        NvU32 version; //!< Version of this structure
        NvU16 size;    //!< Size of this structure
        NvU8 cmd;
        struct
        {
            NvU8 colorFormat;  //!< One of NV_COLOR_FORMAT enum values.
            NvU8 colorimetry;  //!< One of NV_COLOR_COLORIMETRY enum values.
            NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values.
            NV_BPC bpc;        //!< One of NV_BPC enum values.
        } data;
    } NV_COLOR_DATA_V3;

    typedef struct _NV_COLOR_DATA_V4
    {
        NvU32 version; //!< Version of this structure
        NvU16 size;    //!< Size of this structure
        NvU8 cmd;
        struct
        {
            NvU8 colorFormat;                               //!< One of NV_COLOR_FORMAT enum values.
            NvU8 colorimetry;                               //!< One of NV_COLOR_COLORIMETRY enum values.
            NvU8 dynamicRange;                              //!< One of NV_DYNAMIC_RANGE enum values.
            NV_BPC bpc;                                     //!< One of NV_BPC enum values.
            NV_COLOR_SELECTION_POLICY colorSelectionPolicy; //!< One of the color selection policy
        } data;
    } NV_COLOR_DATA_V4;

    typedef struct _NV_COLOR_DATA_V5
    {
        NvU32 version; //!< Version of this structure
        NvU16 size;    //!< Size of this structure
        NvU8 cmd;
        struct
        {
            NvU8 colorFormat;                               //!< One of NV_COLOR_FORMAT enum values.
            NvU8 colorimetry;                               //!< One of NV_COLOR_COLORIMETRY enum values.
            NvU8 dynamicRange;                              //!< One of NV_DYNAMIC_RANGE enum values.
            NV_BPC bpc;                                     //!< One of NV_BPC enum values.
            NV_COLOR_SELECTION_POLICY colorSelectionPolicy; //!< One of the color selection policy
            NV_DESKTOP_COLOR_DEPTH depth;                   //!< One of NV_DESKTOP_COLOR_DEPTH enum values.
        } data;
    } NV_COLOR_DATA_V5;

    typedef NV_COLOR_DATA_V5 NV_COLOR_DATA;

#define NV_COLOR_DATA_VER1 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V1, 1)

#define NV_COLOR_DATA_VER2 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V2, 2)

#define NV_COLOR_DATA_VER3 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V3, 3)

#define NV_COLOR_DATA_VER4 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V4, 4)

#define NV_COLOR_DATA_VER5 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V5, 5)

#define NV_COLOR_DATA_VER NV_COLOR_DATA_VER5


    NVAPI_INTERFACE NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData);

    //! @}

    typedef enum
    {
        NV_STATIC_METADATA_TYPE_1 = 0 //!< Tells the type of structure used to define the Static Metadata Descriptor block.
    } NV_STATIC_METADATA_DESCRIPTOR_ID;

    typedef struct _NV_HDR_CAPABILITIES_V1
    {
        NvU32 version; //!< Version of this structure

        NvU32 isST2084EotfSupported : 1;            //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported;
        NvU32 isTraditionalHdrGammaSupported : 1;   //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported;
        NvU32 isEdrSupported : 1;                   //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported;
        NvU32 driverExpandDefaultHdrParameters : 1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID.
                                                    //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters;
        NvU32 isTraditionalSdrGammaSupported : 1;   //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported;
        NvU32 reserved : 27;

        NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1)

        struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086
        {
            NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 desired_content_max_luminance;               //!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
            NvU16 desired_content_min_luminance;               //!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)
            NvU16 desired_content_max_frame_average_luminance; //!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
        } display_data;
    } NV_HDR_CAPABILITIES_V1;

    typedef struct _NV_HDR_CAPABILITIES_V2
    {
        NvU32 version; //!< Version of this structure

        NvU32 isST2084EotfSupported : 1;            //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported;
        NvU32 isTraditionalHdrGammaSupported : 1;   //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported;
        NvU32 isEdrSupported : 1;                   //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported;
        NvU32 driverExpandDefaultHdrParameters : 1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID.
                                                    //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters;
        NvU32 isTraditionalSdrGammaSupported : 1;   //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported;
        NvU32 isDolbyVisionSupported : 1;           //!< Dolby Vision Support. Boolean: 0 = not supported, 1 = supported;
        NvU32 reserved : 26;

        NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1)

        struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086
        {
            NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 desired_content_max_luminance;               //!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
            NvU16 desired_content_min_luminance;               //!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)
            NvU16 desired_content_max_frame_average_luminance; //!< Desired maximum Frame-Average Light Level (MaxFALL) of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
        } display_data;

        struct
        {
            NvU32 VSVDB_version : 3;               //!< Version of Vendor Data block,Version 0: 25 bytes  Version 1: 14 bytes
            NvU32 dm_version : 8;                  //!< Upper Nibble represents major version of Display Management(DM) while lower represents minor version of DM
            NvU32 supports_2160p60hz : 1;          //!< If set sink is capable of 4kx2k @ 60hz
            NvU32 supports_YUV422_12bit : 1;       //!< If set, sink is capable of YUV422-12 bit
            NvU32 supports_global_dimming : 1;     //!< Indicates if sink supports global dimming
            NvU32 colorimetry : 1;                 //!< If set indicates sink supports DCI P3 colorimetry, REc709 otherwise
            NvU32 supports_backlight_control : 2;  //!< This is set when sink is using lowlatency interface and can control its backlight.
            NvU32 backlt_min_luma : 2;             //!< It is the level for Backlt min luminance value.
            NvU32 interface_supported_by_sink : 2; //!< Indicates the interface (standard or low latency) supported by the sink.
            NvU32 supports_10b_12b_444 : 2;        //!< It is set when interface supported is low latency, it tells whether it supports 10 bit or 12 bit RGB 4:4:4 or YCbCr 4:4:4 or both.
            NvU32 reserved : 9;                    //!< Should be set to zero
                                                   //!< All values below are encoded use DolbyVisionHDMITransmissionSpecification document to decode
            NvU16 target_min_luminance;            //!< Represents min luminance level of Sink
            NvU16 target_max_luminance;            //!< Represents max luminance level of sink
            NvU16 cc_red_x;                        //!< Red primary chromaticity coordinate x
            NvU16 cc_red_y;                        //!< Red primary chromaticity coordinate y
            NvU16 cc_green_x;                      //!< Green primary chromaticity coordinate x
            NvU16 cc_green_y;                      //!< Green primary chromaticity coordinate Y
            NvU16 cc_blue_x;                       //!< Blue primary chromaticity coordinate x
            NvU16 cc_blue_y;                       //!< Blue primary chromaticity coordinate y
            NvU16 cc_white_x;                      //!< White primary chromaticity coordinate x
            NvU16 cc_white_y;                      //!< White primary chromaticity coordinate y
        } dv_static_metadata;

    } NV_HDR_CAPABILITIES_V2;

#define NV_HDR_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V1, 1)

#define NV_HDR_CAPABILITIES_VER2 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V2, 2)

#define NV_HDR_CAPABILITIES_VER NV_HDR_CAPABILITIES_VER2

    typedef NV_HDR_CAPABILITIES_V2 NV_HDR_CAPABILITIES;

    //! \ingroup dispcontrol
    //! @{
    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_Disp_GetHdrCapabilities
    //
    //! \fn NvAPI_Disp_GetHdrCapabilities(NvU32 displayId, NV_HDR_CAPABILITIES  *pHdrCapabilities)
    //! DESCRIPTION:    This API gets High Dynamic Range (HDR) capabilities of the display.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     displayId           Monitor Identifier
    //! \param [in,out] pHdrCapabilities    display's HDR capabilities
    //!
    //! \return    This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!            specific meaning for this API, they are listed below.
    //
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Disp_GetHdrCapabilities(__in NvU32 displayId, __inout NV_HDR_CAPABILITIES *pHdrCapabilities);

    //! @}

    typedef enum
    {
        NV_HDR_CMD_GET = 0, //!< Get current HDR output configuration
        NV_HDR_CMD_SET = 1  //!< Set HDR output configuration
    } NV_HDR_CMD;

    typedef enum
    {
        // Official production-ready HDR modes
        NV_HDR_MODE_OFF = 0,  //!< Turn off HDR
        NV_HDR_MODE_UHDA = 2, //!< Source: CCCS [a.k.a FP16 scRGB, linear, sRGB primaries, [-65504,0, 65504] range, RGB(1,1,1) = 80nits]  Output : UHDA HDR [a.k.a HDR10, RGB/YCC 10/12bpc ST2084(PQ) EOTF RGB(1,1,1) = 10000 nits, Rec2020 color primaries, ST2086 static HDR metadata]. This is the only supported production HDR mode.

        // Experimental
        NV_HDR_MODE_UHDA_PASSTHROUGH = 5, //!< Experimental mode only, not for production! Source: HDR10 RGB 10bpc Output: HDR10 RGB 10 bpc - signal UHDA HDR mode (PQ + Rec2020) to the sink but send source pixel values unmodified (no PQ or Rec2020 conversions) - assumes source is already in HDR10 format.
        NV_HDR_MODE_DOLBY_VISION = 7,     //!< Experimental mode only, not for production! Source: RGB8 Dolby Vision encoded (12 bpc YCbCr422 packed into RGB8) Output: Dolby Vision encoded : Application is to encoded frames in DV format and embed DV dynamic metadata as described in Dolby Vision specification.

        // Unsupported/obsolete HDR modes
        NV_HDR_MODE_EDR = 3,     //!< Do not use! Internal test mode only, to be removed. Source: CCCS (a.k.a FP16 scRGB) Output : EDR (Extended Dynamic Range) - HDR content is tonemapped and gamut mapped to output on regular SDR display set to max luminance ( ~300 nits ).
        NV_HDR_MODE_SDR = 4,     //!< Do not use! Internal test mode only, to be removed. Source: any Output: SDR (Standard Dynamic Range), we continuously send SDR EOTF InfoFrame signaling, HDMI compliance testing.
        NV_HDR_MODE_UHDA_NB = 6, //!< Do not use! Internal test mode only, to be removed. Source: CCCS (a.k.a FP16 scRGB) Output : notebook HDR
        NV_HDR_MODE_UHDBD = 2    //!< Do not use! Obsolete, to be removed. NV_HDR_MODE_UHDBD == NV_HDR_MODE_UHDA, reflects obsolete pre-UHDA naming convention.

    } NV_HDR_MODE;

    typedef struct _NV_HDR_COLOR_DATA_V1
    {
        NvU32 version;                                                  //!< Version of this structure
        NV_HDR_CMD cmd;                                                 //!< Command get/set
        NV_HDR_MODE hdrMode;                                            //!< HDR mode
        NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1)

        struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086
        {
            NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
            NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)

            NvU16 max_content_light_level;       //!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
            NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
        } mastering_display_data;
    } NV_HDR_COLOR_DATA_V1;

    typedef struct _NV_HDR_COLOR_DATA_V2
    {
        NvU32 version;                                                  //!< Version of this structure
        NV_HDR_CMD cmd;                                                 //!< Command get/set
        NV_HDR_MODE hdrMode;                                            //!< HDR mode
        NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1)

        struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086
        {
            NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
            NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])

            NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
            NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)

            NvU16 max_content_light_level;       //!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
            NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
        } mastering_display_data;

        NV_COLOR_FORMAT hdrColorFormat;   //!< Optional, One of NV_COLOR_FORMAT enum values, if set it will apply requested color format for HDR session
        NV_DYNAMIC_RANGE hdrDynamicRange; //!< Optional, One of NV_DYNAMIC_RANGE enum values, if set it will apply requested dynamic range for HDR session
        NV_BPC hdrBpc;                    //!< Optional, One of NV_BPC enum values, if set it will apply requested color depth
                                          //!< Dolby Vision mode: DV supports specific combinations of colorformat, dynamic range and bpc. Please refer Dolby Vision specification.
                                          //!<                    If invalid or no combination is passed driver will force default combination of RGB format + full range + 8bpc.
                                          //!< HDR mode: These fields are ignored in hdr mode
    } NV_HDR_COLOR_DATA_V2;

#define NV_HDR_COLOR_DATA_VER1 MAKE_NVAPI_VERSION(NV_HDR_COLOR_DATA_V1, 1)

#define NV_HDR_COLOR_DATA_VER2 MAKE_NVAPI_VERSION(NV_HDR_COLOR_DATA_V2, 2)


#ifndef NV_HDR_COLOR_DATA_VER
#define NV_HDR_COLOR_DATA_VER NV_HDR_COLOR_DATA_VER2

    typedef NV_HDR_COLOR_DATA_V2 NV_HDR_COLOR_DATA;
#endif

    //! \ingroup dispcontrol
    //! @{
    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_Disp_HdrColorControl
    //
    //! \fn NvAPI_Disp_HdrColorControl(NvU32 displayId, NV_HDR_COLOR_DATA *pHdrColorData)
    //! DESCRIPTION:    This API configures High Dynamic Range (HDR) and Extended Dynamic Range (EDR) output.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     displayId         Monitor Identifier
    //! \param [in,out] pHdrColorData     HDR configuration data
    //!
    //! \return    This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!            specific meaning for this API, they are listed below.
    //
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Disp_HdrColorControl(__in NvU32 displayId, __inout NV_HDR_COLOR_DATA *pHdrColorData);

    //! @}

    //! \ingroup dispcontrol
    //! Used in NvAPI_DISP_GetTiming().
    typedef struct
    {
        NvU32 isInterlaced : 4; //!< To retrieve interlaced/progressive timing
        NvU32 reserved0 : 12;
        union
        {
            NvU32 tvFormat : 8; //!< The actual analog HD/SDTV format. Used when the timing type is
                                //!  NV_TIMING_OVERRIDE_ANALOG_TV and width==height==rr==0.
            NvU32 ceaId : 8;    //!< The EIA/CEA 861B/D predefined short timing descriptor ID.
                                //!  Used when the timing type is NV_TIMING_OVERRIDE_EIA861
                                //!  and width==height==rr==0.
            NvU32 nvPsfId : 8;  //!< The NV predefined PsF format Id.
                                //!  Used when the timing type is NV_TIMING_OVERRIDE_NV_PREDEFINED.
        };
        NvU32 scaling : 8; //!< Define preferred scaling
    } NV_TIMING_FLAG;

    //! \ingroup dispcontrol
    //! Used in NvAPI_DISP_GetTiming().
    typedef struct _NV_TIMING_INPUT
    {
        NvU32 version; //!< (IN)     structure version

        NvU32 width;  //!< Visible horizontal size
        NvU32 height; //!< Visible vertical size
        float rr;     //!< Timing refresh rate

        NV_TIMING_FLAG flag; //!< Flag containing additional info for timing calculation.

        NV_TIMING_OVERRIDE type; //!< Timing type(formula) to use for calculating the timing
    } NV_TIMING_INPUT;

#define NV_TIMING_INPUT_VER MAKE_NVAPI_VERSION(NV_TIMING_INPUT, 1)


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_GetTiming
    //
    //! DESCRIPTION:  This function calculates the timing from the visible width/height/refresh-rate and timing type info.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //!
    //! \param [in]   displayId     Display ID of the display.
    //! \param [in]   timingInput   Inputs used for calculating the timing.
    //! \param [out]  pTiming       Pointer to the NV_TIMING structure.
    //!
    //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!                specific meaning for this API, they are listed below.
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_GetTiming(__in NvU32 displayId, __in NV_TIMING_INPUT *timingInput, __out NV_TIMING *pTiming);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_GetMonitorCapabilities
    //
    //! \fn NvAPI_DISP_GetMonitorCapabilities(NvU32 displayId, NV_MONITOR_CAPABILITIES *pMonitorCapabilities)
    //! DESCRIPTION:     This API returns the Monitor capabilities
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      displayId                Monitor Identifier
    //! \param [out]     pMonitorCapabilities     The monitor support info
    //!
    //! \return ::NVAPI_OK,
    //!         ::NVAPI_ERROR,
    //!         ::NVAPI_INVALID_ARGUMENT
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup dispcontrol
    //! @{

    //! HDMI-related and extended CAPs
    typedef enum
    {
        // hdmi related caps
        NV_MONITOR_CAPS_TYPE_HDMI_VSDB = 0x1000,
        NV_MONITOR_CAPS_TYPE_HDMI_VCDB = 0x1001,
    } NV_MONITOR_CAPS_TYPE;

    typedef struct _NV_MONITOR_CAPS_VCDB
    {
        NvU8 quantizationRangeYcc : 1;
        NvU8 quantizationRangeRgb : 1;
        NvU8 scanInfoPreferredVideoFormat : 2;
        NvU8 scanInfoITVideoFormats : 2;
        NvU8 scanInfoCEVideoFormats : 2;
    } NV_MONITOR_CAPS_VCDB;

    //! See NvAPI_DISP_GetMonitorCapabilities().
    typedef struct _NV_MONITOR_CAPS_VSDB
    {
        // byte 1
        NvU8 sourcePhysicalAddressB : 4; //!< Byte 1
        NvU8 sourcePhysicalAddressA : 4; //!< Byte 1
        // byte 2
        NvU8 sourcePhysicalAddressD : 4; //!< Byte 2
        NvU8 sourcePhysicalAddressC : 4; //!< Byte 2
        // byte 3
        NvU8 supportDualDviOperation : 1;  //!< Byte 3
        NvU8 reserved6 : 2;                //!< Byte 3
        NvU8 supportDeepColorYCbCr444 : 1; //!< Byte 3
        NvU8 supportDeepColor30bits : 1;   //!< Byte 3
        NvU8 supportDeepColor36bits : 1;   //!< Byte 3
        NvU8 supportDeepColor48bits : 1;   //!< Byte 3
        NvU8 supportAI : 1;                //!< Byte 3
        // byte 4
        NvU8 maxTmdsClock; //!< Bye 4
        // byte 5
        NvU8 cnc0SupportGraphicsTextContent : 1; //!< Byte 5
        NvU8 cnc1SupportPhotoContent : 1;        //!< Byte 5
        NvU8 cnc2SupportCinemaContent : 1;       //!< Byte 5
        NvU8 cnc3SupportGameContent : 1;         //!< Byte 5
        NvU8 reserved8 : 1;                      //!< Byte 5
        NvU8 hasVicEntries : 1;                  //!< Byte 5
        NvU8 hasInterlacedLatencyField : 1;      //!< Byte 5
        NvU8 hasLatencyField : 1;                //!< Byte 5
        // byte 6
        NvU8 videoLatency; //!< Byte 6
        // byte 7
        NvU8 audioLatency; //!< Byte 7
        // byte 8
        NvU8 interlacedVideoLatency; //!< Byte 8
        // byte 9
        NvU8 interlacedAudioLatency; //!< Byte 9
        // byte 10
        NvU8 reserved13 : 7;   //!< Byte 10
        NvU8 has3dEntries : 1; //!< Byte 10
        // byte 11
        NvU8 hdmi3dLength : 5;  //!< Byte 11
        NvU8 hdmiVicLength : 3; //!< Byte 11
        // Remaining bytes
        NvU8 hdmi_vic[7]; //!< Keeping maximum length for 3 bits
        NvU8 hdmi_3d[31]; //!< Keeping maximum length for 5 bits
    } NV_MONITOR_CAPS_VSDB;

    typedef struct _NV_MONITOR_CAPS_GENERIC
    {
        NvU8 supportVRR : 1;   //!< monitor supports variable refresh rate. Valid for NV_MONITOR_CAPS_TYPE_GENERIC only.
        NvU8 supportULMB : 1;  //!< monitor supports ULMB with variable refresh rate. Valid for NV_MONITOR_CAPS_TYPE_GENERIC only.
        NvU8 isTrueGsync : 1;  //!< whether the monitor is actually GSYNC or adaptive sync monitor : 0 for adaptive sync.
        NvU8 isRLACapable : 1; //!< whether monitor supports RLA
        NvU8 reserved : 4;
    } NV_MONITOR_CAPS_GENERIC;

    //! See NvAPI_DISP_GetMonitorCapabilities().
    typedef struct _NV_MONITOR_CAPABILITIES_V1
    {
        NvU32 version;
        NvU16 size;
        NvU32 infoType;
        NvU32 connectorType;   //!< Out: VGA, TV, DVI, HDMI, DP
        NvU8 bIsValidInfo : 1; //!< Boolean : Returns invalid if requested info is not present such as VCDB not present
        union
        {
            NV_MONITOR_CAPS_VSDB vsdb;
            NV_MONITOR_CAPS_VCDB vcdb;
            NV_MONITOR_CAPS_GENERIC caps;
        } data;
    } NV_MONITOR_CAPABILITIES_V1;

    typedef NV_MONITOR_CAPABILITIES_V1 NV_MONITOR_CAPABILITIES;

//! Macro for constructing the version field of ::NV_MONITOR_CAPABILITIES_V1
#define NV_MONITOR_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_MONITOR_CAPABILITIES_V1, 1)

#define NV_MONITOR_CAPABILITIES_VER NV_MONITOR_CAPABILITIES_VER1


    //! @}

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! \ingroup dispcontrol
    NVAPI_INTERFACE NvAPI_DISP_GetMonitorCapabilities(__in NvU32 displayId, __inout NV_MONITOR_CAPABILITIES *pMonitorCapabilities);

    //! \ingroup dispcontrol
    typedef struct _NV_MONITOR_COLOR_DATA
    {
        NvU32 version;
        // We are only supporting DP monitors for now. We need to extend this to HDMI panels as well
        NV_DP_COLOR_FORMAT colorFormat; //!< One of the supported color formats
        NV_DP_BPC backendBitDepths;     //!< One of the supported bit depths
    } NV_MONITOR_COLOR_CAPS_V1;

    typedef NV_MONITOR_COLOR_CAPS_V1 NV_MONITOR_COLOR_CAPS;

//! \ingroup dispcontrol
#define NV_MONITOR_COLOR_CAPS_VER1 MAKE_NVAPI_VERSION(NV_MONITOR_COLOR_CAPS_V1, 1)

#define NV_MONITOR_COLOR_CAPS_VER NV_MONITOR_COLOR_CAPS_VER1


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_GetMonitorColorCapabilities
    //
    //! DESCRIPTION:    This API returns all the color formats and bit depth values supported by a given DP monitor.
    //!
    //! USAGE:         Sequence of calls which caller should make to get the information.
    //!                1. First call NvAPI_DISP_GetMonitorColorCapabilities() with pMonitorColorCapabilities as NULL to get the count.
    //!                2. Allocate memory for color caps(NV_MONITOR_COLOR_CAPS) array.
    //!                3. Call NvAPI_DISP_GetMonitorColorCapabilities() again with the pointer to the memory allocated to get all the
    //!                   color capabilities.
    //!
    //!                Note :
    //!                1. pColorCapsCount should never be NULL, else the API will fail with NVAPI_INVALID_ARGUMENT.
    //!                2. *pColorCapsCount returned from the API will always be the actual count in any/every call.
    //!                3. Memory size to be allocated should be (*pColorCapsCount * sizeof(NV_MONITOR_COLOR_CAPS)).
    //!                4. If the memory allocated is less than what is required to return all the timings, this API will return the
    //!                   amount of information which can fit in user provided buffer and API will return NVAPI_INSUFFICIENT_BUFFER.
    //!                5. If the caller specifies a greater value for *pColorCapsCount in second call to NvAPI_DISP_GetMonitorColorCapabilities()
    //!                   than what was returned from first call, the API will return only the actual number of elements in the color
    //!                   capabilities array and the extra buffer will remain unused.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      displayId                  Monitor Identifier
    //! \param [in, out] pMonitorColorCapabilities  The monitor color capabilities information
    //! \param [in, out] pColorCapsCount            - During input, the number of elements allocated for the pMonitorColorCapabilities pointer
    //!                                             - During output, the actual number of color data elements the monitor supports
    //!
    //! \return    This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!            specific meaning for this API, they are listed below.
    //!
    //! \retval         NVAPI_INSUFFICIENT_BUFFER   The input buffer size is not sufficient to hold the total contents. In this case
    //!                                             *pColorCapsCount will hold the required amount of elements.
    //! \retval         NVAPI_INVALID_DISPLAY_ID    The input monitor is either not connected or is not a DP panel.
    //!
    //! \ingroup dispcontrol
    //!
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_GetMonitorColorCapabilities(__in NvU32 displayId, __inout_ecount_part_opt(*pColorCapsCount, *pColorCapsCount) NV_MONITOR_COLOR_CAPS *pMonitorColorCapabilities, __inout NvU32 *pColorCapsCount);

    //! \ingroup dispcontrol
    //! Used in NvAPI_DISP_EnumCustomDisplay() and NvAPI_DISP_TryCustomDisplay().
    typedef struct
    {
        NvU32 version;

        // the source mode information
        NvU32 width;           //!< Source surface(source mode) width
        NvU32 height;          //!< Source surface(source mode) height
        NvU32 depth;           //!< Source surface color depth."0" means all 8/16/32bpp
        NV_FORMAT colorFormat; //!< Color format (optional)

        NV_VIEWPORTF srcPartition; //!< For multimon support, should be set to (0,0,1.0,1.0) for now.

        float xRatio; //!< Horizontal scaling ratio
        float yRatio; //!< Vertical scaling ratio

        NV_TIMING timing;        //!< Timing used to program TMDS/DAC/LVDS/HDMI/TVEncoder, etc.
        NvU32 hwModeSetOnly : 1; //!< If set, it means a hardware modeset without OS update

    } NV_CUSTOM_DISPLAY;

//! \ingroup dispcontrol
//! Used in NV_CUSTOM_DISPLAY.
#define NV_CUSTOM_DISPLAY_VER MAKE_NVAPI_VERSION(NV_CUSTOM_DISPLAY, 1)


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_EnumCustomDisplay
    //
    //! DESCRIPTION:    This API enumerates the custom timing specified by the enum index.
    //!                 The client should keep enumerating until it returns NVAPI_END_ENUMERATION.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [in]     displayId   Dispaly ID of the display.
    //! \param [in]     index       Enum index
    //! \param [inout]  pCustDisp   Pointer to the NV_CUSTOM_DISPLAY structure
    //!
    //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!                specific meaning for this API, they are listed below.
    //! \retval        NVAPI_INVALID_DISPLAY_ID:   Custom Timing is not supported on the Display, whose display id is passed
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_EnumCustomDisplay(__in NvU32 displayId, __in NvU32 index, __inout NV_CUSTOM_DISPLAY *pCustDisp);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_TryCustomDisplay
    //
    //! DESCRIPTION:    This API is used to set up a custom display without saving the configuration on multiple displays.
    //!
    //! \note
    //!  All the members of srcPartition, present in NV_CUSTOM_DISPLAY structure, should have their range in (0.0,1.0).
    //!  In clone mode the timings can applied to both the target monitors but only one target at a time. \n
    //!  For the secondary target the applied timings works under the following conditions:
    //!  - If the secondary monitor EDID supports the selected timing, OR
    //!  - If the selected custom timings can be scaled by the secondary monitor for the selected source resolution on the primary, OR
    //!  - If the selected custom timings matches the existing source resolution on the primary.
    //!  Setting up a custom display on non-active but connected monitors is supported only for Win7 and above.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //!
    //! \param [in]    pDisplayIds    Array of the target display Dispaly IDs - See \ref handles.
    //! \param [in]    count          Total number of the incoming Display IDs and corresponding NV_CUSTOM_DISPLAY structure. This is for the multi-head support.
    //! \param [in]    pCustDisp      Pointer to the NV_CUSTOM_DISPLAY structure array.
    //!
    //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!                specific meaning for this API, they are listed below.
    //! \retval        NVAPI_INVALID_DISPLAY_ID:   Custom Timing is not supported on the Display, whose display id is passed
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_TryCustomDisplay(__in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in_ecount(count) NV_CUSTOM_DISPLAY *pCustDisp);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_DeleteCustomDisplay
    //
    //! DESCRIPTION:    This function deletes the custom display configuration, specified from the registry for  all the displays whose display IDs are passed.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //!
    //! \param [in]     pDisplayIds     Array of Dispaly IDs on which custom display configuration is to be saved.
    //! \param [in]     count           Total number of the incoming Dispaly IDs. This is for the multi-head support.
    //! \param [in]     pCustDisp       Pointer to the NV_CUSTOM_DISPLAY structure
    //!
    //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!                specific meaning for this API, they are listed below.
    //! \retval        NVAPI_INVALID_DISPLAY_ID:   Custom Timing is not supported on the Display, whose display id is passed
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_DeleteCustomDisplay(__in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NV_CUSTOM_DISPLAY *pCustDisp);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_SaveCustomDisplay
    //
    //! DESCRIPTION:    This function saves the current hardware display configuration on the specified Display IDs as a custom display configuration.
    //!                 This function should be called right after NvAPI_DISP_TryCustomDisplay() to save the custom display from the current
    //!                 hardware context. This function will not do anything if the custom display configuration is not tested on the hardware.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //!
    //! \param [in]     pDisplayIds         Array of Dispaly IDs on which custom display configuration is to be saved.
    //! \param [in]     count               Total number of the incoming Dispaly IDs. This is for the multi-head support.
    //! \param [in]     isThisOutputIdOnly  If set, the saved custom display will only be applied on the monitor with the same outputId (see \ref handles).
    //! \param [in]     isThisMonitorIdOnly If set, the saved custom display will only be applied on the monitor with the same EDID ID or
    //!                                     the same TV connector in case of analog TV.
    //!
    //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!                specific meaning for this API, they are listed below.
    //! \retval        NVAPI_INVALID_DISPLAY_ID:   Custom Timing is not supported on the Display, whose display id is passed
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_SaveCustomDisplay(__in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NvU32 isThisOutputIdOnly, __in NvU32 isThisMonitorIdOnly);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_RevertCustomDisplayTrial
    //
    //! DESCRIPTION:    This API is used to restore the display configuration, that was changed by calling NvAPI_DISP_TryCustomDisplay(). This function
    //!                 must be called only after a custom display configuration is tested on the hardware, using NvAPI_DISP_TryCustomDisplay(),
    //!                 otherwise no action is taken. On Vista, NvAPI_DISP_RevertCustomDisplayTrial should be called with an active display that
    //!                 was affected during the NvAPI_DISP_TryCustomDisplay() call, per GPU.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //!
    //! \param [in]    pDisplayIds   Pointer to display Id, of an active display.
    //! \param [in]    count         Total number of incoming Display IDs. For future use only. Currently it is expected to be passed as 1.
    //!
    //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!                specific meaning for this API, they are listed below.
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_RevertCustomDisplayTrial(__in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_GetView
    //
    //! This API lets caller retrieve the target display arrangement for selected source display handle.
    //! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW.
    //!       Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 85
    //!
    //!  \param [in]     hNvDisplay             NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from
    //!                                         NvAPI_EnumNVidiaDisplayHandle().
    //!  \param [out]    pTargets               User allocated storage to retrieve an array of  NV_VIEW_TARGET_INFO. Can be NULL to retrieve
    //!                                         the targetCount.
    //!  \param [in,out] targetMaskCount        Count of target device mask specified in pTargetMask.
    //!  \param [out]    targetView             Target view selected from NV_TARGET_VIEW_MODE.
    //!
    //!  \retval         NVAPI_OK               Completed request
    //!  \retval         NVAPI_ERROR            Miscellaneous error occurred
    //!  \retval         NVAPI_INVALID_ARGUMENT Invalid input parameter.
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.")
        NVAPI_INTERFACE NvAPI_GetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargets, NvU32 *pTargetMaskCount, NV_TARGET_VIEW_MODE *pTargetView);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_GetViewEx
    //
    //! DESCRIPTION:    This API lets caller retrieve the target display arrangement for selected source display handle.
    //!                 \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW.
    //!                       Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 165
    //!
    //! \param [in]     hNvDisplay       NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with
    //!                                  NvAPI_EnumNVidiaDisplayHandle().
    //! \param [in,out] pPathInfo        Count field should be set to NVAPI_MAX_DISPLAY_PATH. Can be NULL to retrieve just the pathCount.
    //! \param [in,out] pPathCount       Number of elements in array pPathInfo->path.
    //! \param [out]    pTargetViewMode  Display view selected from NV_TARGET_VIEW_MODE.
    //!
    //! \retval         NVAPI_OK                      Completed request
    //! \retval         NVAPI_API_NOT_INTIALIZED      NVAPI not initialized
    //! \retval         NVAPI_ERROR                   Miscellaneous error occurred
    //! \retval         NVAPI_INVALID_ARGUMENT        Invalid input parameter.
    //! \retval         NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle.
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.")
        NVAPI_INTERFACE NvAPI_GetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NvU32 *pPathCount, NV_TARGET_VIEW_MODE *pTargetViewMode);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_GetSupportedViews
    //
    //!  This API lets caller enumerate all the supported NVIDIA display views - nView and Dualview modes.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 85
    //!
    //!  \param [in]     hNvDisplay             NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from
    //!                                         NvAPI_EnumNVidiaDisplayHandle().
    //!  \param [out]    pTargetViews           Array of supported views. Can be NULL to retrieve the pViewCount first.
    //!  \param [in,out] pViewCount             Count of supported views.
    //!
    //!  \retval         NVAPI_OK               Completed request
    //!  \retval         NVAPI_ERROR            Miscellaneous error occurred
    //!  \retval         NVAPI_INVALID_ARGUMENT Invalid input parameter.
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetSupportedViews(NvDisplayHandle hNvDisplay, NV_TARGET_VIEW_MODE *pTargetViews, NvU32 *pViewCount);

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_DISP_GetDisplayIdByDisplayName
    //
    //! DESCRIPTION:     This API retrieves the Display Id of a given display by
    //!                  display name. The display must be active to retrieve the
    //!                  displayId. In the case of clone mode or Surround gaming,
    //!                  the primary or top-left display will be returned.
    //!
    //! \param [in]     displayName  Name of display (Eg: "\\DISPLAY1" to
    //!                              retrieve the displayId for.
    //! \param [out]    displayId    Display ID of the requested display.
    //!
    //! retval ::NVAPI_OK:                          Capabilties have been returned.
    //! retval ::NVAPI_INVALID_ARGUMENT:            One or more args passed in are invalid.
    //! retval ::NVAPI_API_NOT_INTIALIZED:          The NvAPI API needs to be initialized first
    //! retval ::NVAPI_NO_IMPLEMENTATION:           This entrypoint not available
    //! retval ::NVAPI_ERROR:                       Miscellaneous error occurred
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_GetDisplayIdByDisplayName(const char *displayName, NvU32 *displayId);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_GetDisplayConfig
    //
    //! DESCRIPTION:     This API lets caller retrieve the current global display
    //!                  configuration.
    //!       USAGE:     The caller might have to call this three times to fetch all the required configuration details as follows:
    //!                  First  Pass: Caller should Call NvAPI_DISP_GetDisplayConfig() with pathInfo set to NULL to fetch pathInfoCount.
    //!                  Second Pass: Allocate memory for pathInfo with respect to the number of pathInfoCount(from First Pass) to fetch
    //!                               targetInfoCount. If sourceModeInfo is needed allocate memory or it can be initialized to NULL.
    //!             Third  Pass(Optional, only required if target information is required): Allocate memory for targetInfo with respect
    //!                               to number of targetInfoCount(from Second Pass).
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in,out]  pathInfoCount    Number of elements in pathInfo array, returns number of valid topologies, this cannot be null.
    //! \param [in,out]  pathInfo         Array of path information
    //!
    //! \return    This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
    //!            specific meaning for this API, they are listed below.
    //!
    //! \retval    NVAPI_INVALID_ARGUMENT  -   Invalid input parameter. Following can be the reason for this return value:
    //!                                        -# pathInfoCount is NULL.
    //!                                        -# *pathInfoCount is 0 and pathInfo is not NULL.
    //!                                        -# *pathInfoCount is not 0 and pathInfo is NULL.
    //! \retval    NVAPI_DEVICE_BUSY       -   ModeSet has not yet completed. Please wait and call it again.
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_GetDisplayConfig(__inout NvU32 *pathInfoCount, __out_ecount_full_opt(*pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO *pathInfo);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_SetDisplayConfig
    //
    //
    //! DESCRIPTION:     This API lets caller apply a global display configuration
    //!                  across multiple GPUs.
    //!
    //!                  If all sourceIds are zero, then NvAPI will pick up sourceId's based on the following criteria :
    //!                  - If user provides sourceModeInfo then we are trying to assign 0th sourceId always to GDIPrimary.
    //!                     This is needed since active windows always moves along with 0th sourceId.
    //!                  - For rest of the paths, we are incrementally assigning the sourceId per adapter basis.
    //!                  - If user doesn't provide sourceModeInfo then NVAPI just picks up some default sourceId's in incremental order.
    //!                  Note : NVAPI will not intelligently choose the sourceIDs for any configs that does not need a modeset.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      pathInfoCount   Number of supplied elements in pathInfo
    //! \param [in]      pathInfo        Array of path information
    //! \param [in]      flags           Flags for applying settings
    //!
    //! \retval ::NVAPI_OK - completed request
    //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
    //! \retval ::NVAPI_ERROR - miscellaneous error occurred
    //! \retval ::NVAPI_INVALID_ARGUMENT - Invalid input parameter.
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_SetDisplayConfig(__in NvU32 pathInfoCount, __in_ecount(pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO *pathInfo, __in NvU32 flags);

    typedef struct _NV_GET_ADAPTIVE_SYNC_DATA_V1
    {
        NvU32 version;                    //!< [in]    structure version
        NvU32 maxFrameInterval;           //!< [out]   maximum frame interval in micro seconds as set previously using NvAPI_DISP_SetAdaptiveSyncData function.
                                          //!<         If default values from EDID are used, this parameter returns 0.
        NvU32 bDisableAdaptiveSync : 1;   //!< [out]   Indicates if adaptive sync is disabled on the display.
        NvU32 bDisableFrameSplitting : 1; //!< [out]   Indicates if frame splitting is disabled on the display.
        NvU32 reserved : 30;              //!< reserved for future use.
        NvU32 lastFlipRefreshCount;       //!< [out]   Number of times the last flip was shown on the screen
        NvU64 lastFlipTimeStamp;          //!< [out]   Timestamp for the lastest flip on the screen
        NvU32 reservedEx[4];              //!< reserved for future use.
    } NV_GET_ADAPTIVE_SYNC_DATA_V1;

#define NV_GET_ADAPTIVE_SYNC_DATA_VER1 MAKE_NVAPI_VERSION(NV_GET_ADAPTIVE_SYNC_DATA_V1, 1)

#define NV_GET_ADAPTIVE_SYNC_DATA_VER NV_GET_ADAPTIVE_SYNC_DATA_VER1


    typedef NV_GET_ADAPTIVE_SYNC_DATA_V1 NV_GET_ADAPTIVE_SYNC_DATA;

    ///////////////////////////////////////////////////////////////////////////////
    //
    //! \fn NvAPI_DISP_GetAdaptiveSyncData(__in NvU32 displayId, __inout NV_GET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData)
    //! \code
    //! DESCRIPTION:    This function is used to get data for the Adaptive Sync Display.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //! \since Release: 415
    //!
    //! \param [in]       displayId            - display id of the display
    //! \param [inout]    pAdaptiveSyncData    - A pointer to NV_GET_ADAPTIVE_SYNC_DATA, containing the information about the values of parameters that are to be retrieved on given display.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status. If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    ///////////////////////////////////////////////////////////////////////////////
    //! \ingroup dispcontrol
    NVAPI_INTERFACE NvAPI_DISP_GetAdaptiveSyncData(__in NvU32 displayId, __inout NV_GET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData);

    typedef struct _NV_SET_ADAPTIVE_SYNC_DATA_V1
    {
        NvU32 version;                    //!< [in]    structure version
        NvU32 maxFrameInterval;           //!< [in]    maximum frame interval in micro seconds.
                                          //!<         If maxFrameInterval is send as 0, default values from EDID will be used.
        NvU32 bDisableAdaptiveSync : 1;   //!< [in]    Indicates if adaptive sync is disabled on the display.
        NvU32 bDisableFrameSplitting : 1; //!< [in]    Indicates if Frame Splitting should be disabled.
        NvU32 reserved : 30;              //!< reserved for future use.
        NvU32 reservedEx[7];              //!< reserved for future use.
    } NV_SET_ADAPTIVE_SYNC_DATA_V1;

#define NV_SET_ADAPTIVE_SYNC_DATA_VER1 MAKE_NVAPI_VERSION(NV_SET_ADAPTIVE_SYNC_DATA_V1, 1)

#define NV_SET_ADAPTIVE_SYNC_DATA_VER NV_SET_ADAPTIVE_SYNC_DATA_VER1


    typedef NV_SET_ADAPTIVE_SYNC_DATA_V1 NV_SET_ADAPTIVE_SYNC_DATA;

    ///////////////////////////////////////////////////////////////////////////////
    //
    //! \fn NvAPI_DISP_SetAdaptiveSyncData(__in NvU32 displayId, __in NV_SET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData)
    //! \code
    //! DESCRIPTION:    This function is used to set data for Adaptive Sync Display.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //! \since Release: 415
    //!
    //! \param [in]       displayId            - display id of the display
    //! \param [in]       pAdaptiveSyncData    - A pointer to NV_SET_ADAPTIVE_SYNC_DATA, containing the information about the values of parameters that are to be set on given display.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status. If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    ///////////////////////////////////////////////////////////////////////////////
    //! \ingroup dispcontrol
    NVAPI_INTERFACE NvAPI_DISP_SetAdaptiveSyncData(__in NvU32 displayId, __in NV_SET_ADAPTIVE_SYNC_DATA *pAdaptiveSyncData);

    typedef struct _NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1
    {
        NvU32 version;         //!< [in]    structure version
        NvU32 frameIntervalUs; //!< [out]   frame interval in micro seconds if Virtual RR is currently applied
        NvU32 reservedEx[8];   //!< reserved for future use.
    } NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1;

#define NV_GET_VIRTUAL_REFRESH_RATE_DATA_VER1 MAKE_NVAPI_VERSION(_NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1, 1)

#define NV_GET_VIRTUAL_REFRESH_RATE_DATA_VER NV_GET_VIRTUAL_REFRESH_RATE_DATA_VER1


    typedef NV_GET_VIRTUAL_REFRESH_RATE_DATA_V1 NV_GET_VIRTUAL_REFRESH_RATE_DATA;

    ///////////////////////////////////////////////////////////////////////////////
    //
    //! \fn NvAPI_DISP_GetVirtualRefreshRateData(__in NvU32 displayId, __inout NV_GET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData)
    //! \code
    //! DESCRIPTION:    This function is used to get Virtual Refresh Rate data for a VRR Capable Display.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //! \since Release: 510
    //!
    //! \param [in]       displayId                  - display id of the display
    //! \param [inout]    pVirtualRefreshRateData    - A pointer to NV_GET_VIRTUAL_REFRESH_RATE_DATA, containing the information about the values of parameters that are to be retrieved on given display.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status. If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    ///////////////////////////////////////////////////////////////////////////////
    //! \ingroup dispcontrol
    NVAPI_INTERFACE NvAPI_DISP_GetVirtualRefreshRateData(__in NvU32 displayId, __inout NV_GET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData);

    typedef struct _NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1
    {
        NvU32 version;         //!< [in]   structure version
        NvU32 frameIntervalUs; //!< [in]   frame interval in micro seconds if Virtual RR is currently applied
        NvU32 reservedEx[8];   //!< reserved for future use.
    } NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1;

#define NV_SET_VIRTUAL_REFRESH_RATE_DATA_VER1 MAKE_NVAPI_VERSION(_NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1, 1)

#define NV_SET_VIRTUAL_REFRESH_RATE_DATA_VER NV_SET_VIRTUAL_REFRESH_RATE_DATA_VER1


    typedef NV_SET_VIRTUAL_REFRESH_RATE_DATA_V1 NV_SET_VIRTUAL_REFRESH_RATE_DATA;

    ///////////////////////////////////////////////////////////////////////////////
    //
    //! \fn NvAPI_DISP_SetVirtualRefreshRateData(__in NvU32 displayId, __in NV_SET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData)
    //! \code
    //! DESCRIPTION:    This function is used to set Virtual Refresh Rate data for a VRR Capable Display.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //! \since Release: 510
    //!
    //! \param [in]       displayId                  - display id of the display
    //! \param [inout]    pVirtualRefreshRateData    - A pointer to NV_SET_VIRTUAL_REFRESH_RATE_DATA, containing the information about the values of parameters that are to be retrieved on given display.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status. If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    ///////////////////////////////////////////////////////////////////////////////
    //! \ingroup dispcontrol
    NVAPI_INTERFACE NvAPI_DISP_SetVirtualRefreshRateData(__in NvU32 displayId, __in NV_SET_VIRTUAL_REFRESH_RATE_DATA *pVirtualRefreshRateData);

    //! \ingroup dispcontrol
    typedef struct
    {
        NvU32 version;   //!< [in] Structure version
        NvU32 displayId; //!< [in] Monitor Identifier to be set
        NvU32 reserved;  //!< Reserved for future use without adding versioning
    } NV_SET_PREFERRED_STEREO_DISPLAY_V1;

    //! \ingroup dispcontrol
    typedef NV_SET_PREFERRED_STEREO_DISPLAY_V1 NV_SET_PREFERRED_STEREO_DISPLAY;

//! \ingroup dispcontrol
#define NV_SET_PREFERRED_STEREO_DISPLAY_VER1 MAKE_NVAPI_VERSION(NV_SET_PREFERRED_STEREO_DISPLAY_V1, 1)


//! \ingroup dispcontrol
#define NV_SET_PREFERRED_STEREO_DISPLAY_VER NV_SET_PREFERRED_STEREO_DISPLAY_VER1


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_SetPreferredStereoDisplay
    //
    //! DESCRIPTION: Specifies a display output that drives the 3pin DIN output signal
    //!              in a workstation stereo system environment.
    //!              If display output is specified as a displayId of 0, the preferred
    //!              stereo display target is reset to the driver default selection.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //! \since Release: 470
    //!
    //! \param [in]      pPreferredStereoDisplay        Pointer to a NV_SET_PREFERRED_STEREO_DISPLAY structure
    //!
    //! \retval ::NVAPI_OK  completed request
    //! \retval ::NVAPI_ERROR  miscellaneous error occurred
    //! \retval ::NVAPI_INVALID_ARGUMENT  Invalid input parameter.
    //! \retval ::NVAPI_INVALID_USER_PRIVILEGE       - The application will require Administrator privileges to access this API.
    //!                                                The application can be elevated to a higher permission level by selecting "Run as Administrator".
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_SetPreferredStereoDisplay(__in NV_SET_PREFERRED_STEREO_DISPLAY *pPreferredStereoDisplay);

    //! \ingroup dispcontrol
    typedef struct
    {
        NvU32 version;   //!< [in] Structure version
        NvU32 displayId; //!< [out] The queried stereo display
        NvU32 reserved;  //!< Reserved for future use without adding versioning
    } NV_GET_PREFERRED_STEREO_DISPLAY_V1;

    //! \ingroup dispcontrol
    typedef NV_GET_PREFERRED_STEREO_DISPLAY_V1 NV_GET_PREFERRED_STEREO_DISPLAY;

//! \ingroup dispcontrol
#define NV_GET_PREFERRED_STEREO_DISPLAY_VER1 MAKE_NVAPI_VERSION(NV_GET_PREFERRED_STEREO_DISPLAY_V1, 1)


//! \ingroup dispcontrol
#define NV_GET_PREFERRED_STEREO_DISPLAY_VER NV_GET_PREFERRED_STEREO_DISPLAY_VER1


    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_DISP_GetPreferredStereoDisplay
    //
    //! DESCRIPTION: Queries the displayId of the display output driving the 3pin
    //!              DIN stereo signal, if any.
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //! \since Release: 470
    //!
    //! \param [inout]     pPreferredStereoDisplay        Pointer to a NV_GET_PREFERRED_STEREO_DISPLAY structure
    //!
    //! \retval ::NVAPI_OK  completed request
    //! \retval ::NVAPI_ERROR  miscellaneous error occurred
    //! \retval ::NVAPI_INVALID_ARGUMENT  Invalid input parameter.
    //! \retval ::NVAPI_INVALID_POINTER   An invalid pointer was passed as an argument (probably NULL).
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_GetPreferredStereoDisplay(__inout NV_GET_PREFERRED_STEREO_DISPLAY *pPreferredStereoDisplay);

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus)

    typedef struct _NV_MANAGED_DEDICATED_DISPLAY_INFO
    {
        NvU32 version;        //!< [in]  Version of this structure.
        NvU32 displayId;      //!< [out] DisplayId.
        NvU32 isAcquired : 1; //!< [out] If bit is set, this display has been acquired by another process through NvAPI_DISP_AcquireDedicatedDisplay().
        NvU32 isMosaic : 1;   //!< [out] If bit is set, this display represents a Mosaic grid.
        NvU32 reserved : 30;  //!< [out] Reserved for future use without adding versioning.
    } NV_MANAGED_DEDICATED_DISPLAY_INFO_V1;

#define NV_MANAGED_DEDICATED_DISPLAY_INFO_VER1 MAKE_NVAPI_VERSION(NV_MANAGED_DEDICATED_DISPLAY_INFO_V1, 1)

#define NV_MANAGED_DEDICATED_DISPLAY_INFO_VER NV_MANAGED_DEDICATED_DISPLAY_INFO_VER1


    typedef NV_MANAGED_DEDICATED_DISPLAY_INFO_V1 NV_MANAGED_DEDICATED_DISPLAY_INFO;

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DISP_GetNvManagedDedicatedDisplays
    //
    //!   DESCRIPTION: This API returns the count of dedicated displays managed by
    //!                the Nvidia driver, and specific driver info of each display.
    //!                This API does not return VR displays.
    //!
    //! HOW TO USE: 1) First make a call NvAPI_DISP_GetNvManagedDedicatedDisplays to get the number of dedicated displays managed by the Nvidia driver
    //!                by passing pDedicatedDisplays as NULL.
    //!                On call success:
    //!             2) Allocate memory based on pDisplayCount, then call NvAPI_DISP_GetNvManagedDedicatedDisplays to populate pDedicatedDisplays.
    //!
    //! \since Release: 495
    //!
    //! \param [in/out]   pDedicatedDisplayCount    The count of dedicated displays managed by the Nvidia driver.
    //! \param [in/out]   pDedicatedDisplays        Pointer to an array of NV_MANAGED_DEDICATED_DISPLAY_INFO data structure.
    //!
    //! \retval ::NVAPI_OK                    The call succeeded.
    //! \retval ::NVAPI_ERROR                 The call failed.
    //! \retval ::NVAPI_NO_IMPLEMENTATION     The API is not implemented in current driver.
    //! \retval ::NVAPI_OUT_OF_MEMORY         Could not allocate sufficient memory to complete the call.
    //! \retval ::NVAPI_INVALID_POINTER       An invalid pointer was passed as an argument.
    //! \retval ::NVAPI_API_NOT_INITIALIZED   NvAPI was not initialized.
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of NV_MANAGED_DEDICATED_DISPLAY_INFO structure is invalid.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_GetNvManagedDedicatedDisplays(__inout NvU32 *pDedicatedDisplayCount, __inout NV_MANAGED_DEDICATED_DISPLAY_INFO *pDedicatedDisplays);
#endif // defined(__cplusplus)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DISP_AcquireDedicatedDisplay
    //
    //!   DESCRIPTION: This API requests exclusive access to the specified dedicated
    //!                display managed by the Nvidia driver. If the call succeeds, a handle
    //!                is returned which could be opened as a DisplaySource.
    //!                The call fails if the display is not managed by the Nvidia driver.
    //!                The call fails if the display has already been acquired by another process.
    //!
    //! \since Release: 495
    //!
    //! \param [in]       displayId             Display ID of the dedicated display to be acquired.
    //! \param [in/out]   pDisplaySourceHandle  Pointer to memory that receives the shared handle to a DisplaySource.
    //!
    //! \retval ::NVAPI_OK                    The call succeeded.
    //! \retval ::NVAPI_ERROR                 The call failed.
    //! \retval ::NVAPI_NO_IMPLEMENTATION     The API not implemented.
    //! \retval ::NVAPI_INVALID_POINTER       An invalid pointer was passed as an argument.
    //! \retval ::NVAPI_API_NOT_INITIALIZED   NvAPI not initialized.
    //! \retval ::NVAPI_INVALID_DISPLAY_ID    An invalid displayId was passed as an argument.
    //! \retval ::NVAPI_UNREGISTERED_RESOURCE The display is not managed by the Nvidia driver.
    //! \retval ::NVAPI_RESOURCE_IN_USE       The display has already been acquired by another process.
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_AcquireDedicatedDisplay(__in NvU32 displayId, __inout NvU64 *pDisplaySourceHandle);
#endif // defined(__cplusplus)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DISP_ReleaseDedicatedDisplay
    //
    //!   DESCRIPTION: This API releases the exclusive ownership of a specific dedicated
    //!                display previously acquired by the process.
    //!
    //! \since Release: 495
    //!
    //! \param [in]   displayId               Display ID of the dedicated display to be released.
    //!
    //! \retval ::NVAPI_OK                    The call succeeded.
    //! \retval ::NVAPI_ERROR                 The call failed.
    //! \retval ::NVAPI_NO_IMPLEMENTATION     The API not implemented.
    //! \retval ::NVAPI_API_NOT_INITIALIZED   NvAPI not initialized.
    //! \retval ::NVAPI_UNREGISTERED_RESOURCE The display is not managed by the Nvidia driver.
    //! \retval ::NVAPI_DDISPLAY_NOT_ACQUIRED The display is not acquired by the process.
    //!
    //! \ingroup dispcontrol
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DISP_ReleaseDedicatedDisplay(__in NvU32 displayId);
#endif // defined(__cplusplus)

    ////////////////////////////////////////////////////////////////////////////////////////
    //
    // MOSAIC allows a multi display target output scanout on a single source.
    //
    // SAMPLE of MOSAIC 1x4 topo with 8 pixel horizontal overlap
    //
    //+-------------------------++-------------------------++-------------------------++-------------------------+
    //|                         ||                         ||                         ||                         |
    //|                         ||                         ||                         ||                         |
    //|                         ||                         ||                         ||                         |
    //|        DVI1             ||           DVI2          ||         DVI3            ||          DVI4           |
    //|                         ||                         ||                         ||                         |
    //|                         ||                         ||                         ||                         |
    //|                         ||                         ||                         ||                         |
    //|                         ||                         ||                         ||                         |
    //+-------------------------++-------------------------++-------------------------++-------------------------+

    //! \addtogroup mosaicapi
    //! @{

#define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8

#define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8

//
// These bits are used to describe the validity of a topo.
//
#define NV_MOSAIC_TOPO_VALIDITY_VALID 0x00000000               //!< The topology is valid

#define NV_MOSAIC_TOPO_VALIDITY_MISSING_GPU 0x00000001         //!< Not enough SLI GPUs were found to fill the entire

                                                               //! topology. hPhysicalGPU will be 0 for these.
#define NV_MOSAIC_TOPO_VALIDITY_MISSING_DISPLAY 0x00000002     //!< Not enough displays were found to fill the entire

                                                               //! topology. displayOutputId will be 0 for these.
#define NV_MOSAIC_TOPO_VALIDITY_MIXED_DISPLAY_TYPES 0x00000004 //!< The topoogy is only possible with displays of the same

                                                               //! NV_GPU_OUTPUT_TYPE. Check displayOutputIds to make
                                                               //! sure they are all CRTs, or all DFPs.

    //
    //! This structure defines the topology details.
    typedef struct
    {
        NvU32 version;                  //!< Version of this structure
        NvLogicalGpuHandle hLogicalGPU; //!< Logical GPU for this topology
        NvU32 validityMask;             //!< 0 means topology is valid with the current hardware.
                                        //! If not 0, inspect bits against NV_MOSAIC_TOPO_VALIDITY_*.
        NvU32 rowCount;                 //!< Number of displays in a row
        NvU32 colCount;                 //!< Number of displays in a column

        struct
        {
            NvPhysicalGpuHandle hPhysicalGPU; //!< Physical GPU to be used in the topology (0 if GPU missing)
            NvU32 displayOutputId;            //!< Connected display target (0 if no display connected)
            NvS32 overlapX;                   //!< Pixels of overlap on left of target: (+overlap, -gap)
            NvS32 overlapY;                   //!< Pixels of overlap on top of target: (+overlap, -gap)

        } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS];

    } NV_MOSAIC_TOPO_DETAILS;

//! Macro for constructing te vesion field of NV_MOSAIC_TOPO_DETAILS
#define NVAPI_MOSAIC_TOPO_DETAILS_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_DETAILS, 1)


    //
    //! These values refer to the different types of Mosaic topologies that are possible.  When
    //! getting the supported Mosaic topologies, you can specify one of these types to narrow down
    //! the returned list to only those that match the given type.
    typedef enum
    {
        NV_MOSAIC_TOPO_TYPE_ALL,                         //!< All mosaic topologies
        NV_MOSAIC_TOPO_TYPE_BASIC,                       //!< Basic Mosaic topologies
        NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO,              //!< Passive Stereo topologies
        NV_MOSAIC_TOPO_TYPE_SCALED_CLONE,                //!< Not supported at this time
        NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO_SCALED_CLONE, //!< Not supported at this time
        NV_MOSAIC_TOPO_TYPE_MAX,                         //!< Always leave this at end of the enum
    } NV_MOSAIC_TOPO_TYPE;

    //
    //! This is a complete list of supported Mosaic topologies.
    //!
    //! Using a "Basic" topology combines multiple monitors to create a single desktop.
    //!
    //! Using a "Passive" topology combines multiples monitors to create a passive stereo desktop.
    //! In passive stereo, two identical topologies combine - one topology is used for the right eye and the other identical //! topology (targeting different displays) is used for the left eye.  \n
    //! NOTE: common\inc\nvEscDef.h shadows a couple PASSIVE_STEREO enums.  If this
    //!       enum list changes and effects the value of NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO
    //!       please update the corresponding value in nvEscDef.h
    typedef enum
    {
        NV_MOSAIC_TOPO_NONE,

        // 'BASIC' topos start here
        //
        // The result of using one of these Mosaic topos is that multiple monitors
        // will combine to create a single desktop.
        //
        NV_MOSAIC_TOPO_BEGIN_BASIC,
        NV_MOSAIC_TOPO_1x2_BASIC = NV_MOSAIC_TOPO_BEGIN_BASIC,
        NV_MOSAIC_TOPO_2x1_BASIC,
        NV_MOSAIC_TOPO_1x3_BASIC,
        NV_MOSAIC_TOPO_3x1_BASIC,
        NV_MOSAIC_TOPO_1x4_BASIC,
        NV_MOSAIC_TOPO_4x1_BASIC,
        NV_MOSAIC_TOPO_2x2_BASIC,
        NV_MOSAIC_TOPO_2x3_BASIC,
        NV_MOSAIC_TOPO_2x4_BASIC,
        NV_MOSAIC_TOPO_3x2_BASIC,
        NV_MOSAIC_TOPO_4x2_BASIC,
        NV_MOSAIC_TOPO_1x5_BASIC,
        NV_MOSAIC_TOPO_1x6_BASIC,
        NV_MOSAIC_TOPO_7x1_BASIC,

        // Add padding for 10 more entries. 6 will be enough room to specify every
        // possible topology with 8 or fewer displays, so this gives us a little
        // extra should we need it.
        NV_MOSAIC_TOPO_END_BASIC = NV_MOSAIC_TOPO_7x1_BASIC + 9,

        // 'PASSIVE_STEREO' topos start here
        //
        // The result of using one of these Mosaic topos is that multiple monitors
        // will combine to create a single PASSIVE STEREO desktop.  What this means is
        // that there will be two topos that combine to create the overall desktop.
        // One topo will be used for the left eye, and the other topo (of the
        // same rows x cols), will be used for the right eye.  The difference between
        // the two topos is that different GPUs and displays will be used.
        //
        NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO, // value shadowed in nvEscDef.h
        NV_MOSAIC_TOPO_1x2_PASSIVE_STEREO = NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO,
        NV_MOSAIC_TOPO_2x1_PASSIVE_STEREO,
        NV_MOSAIC_TOPO_1x3_PASSIVE_STEREO,
        NV_MOSAIC_TOPO_3x1_PASSIVE_STEREO,
        NV_MOSAIC_TOPO_1x4_PASSIVE_STEREO,
        NV_MOSAIC_TOPO_4x1_PASSIVE_STEREO,
        NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO,
        NV_MOSAIC_TOPO_END_PASSIVE_STEREO = NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO + 4,

        //
        // Total number of topos.  Always leave this at the end of the enumeration.
        //
        NV_MOSAIC_TOPO_MAX //! Total number of topologies.

    } NV_MOSAIC_TOPO;

    //
    //! This is a "topology brief" structure.  It tells you what you need to know about
    //! a topology at a high level. A list of these is returned when you query for the
    //! supported Mosaic information.
    //!
    //! If you need more detailed information about the topology, call
    //! NvAPI_Mosaic_GetTopoGroup() with the topology value from this structure.
    typedef struct
    {
        NvU32 version;       //!< Version of this structure
        NV_MOSAIC_TOPO topo; //!< The topology
        NvU32 enabled;       //!< 1 if topo is enabled, else 0
        NvU32 isPossible;    //!< 1 if topo *can* be enabled, else 0

    } NV_MOSAIC_TOPO_BRIEF;

//! Macro for constructing the version field of NV_MOSAIC_TOPO_BRIEF
#define NVAPI_MOSAIC_TOPO_BRIEF_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_BRIEF, 1)


    //
    //! Basic per-display settings that are used in setting/getting the Mosaic mode
    typedef struct _NV_MOSAIC_DISPLAY_SETTING_V1
    {
        NvU32 version; //!< Version of this structure
        NvU32 width;   //!< Per-display width
        NvU32 height;  //!< Per-display height
        NvU32 bpp;     //!< Bits per pixel
        NvU32 freq;    //!< Display frequency
    } NV_MOSAIC_DISPLAY_SETTING_V1;

    typedef struct NV_MOSAIC_DISPLAY_SETTING_V2
    {
        NvU32 version; //!< Version of this structure
        NvU32 width;   //!< Per-display width
        NvU32 height;  //!< Per-display height
        NvU32 bpp;     //!< Bits per pixel
        NvU32 freq;    //!< Display frequency
        NvU32 rrx1k;   //!< Display frequency in x1k
    } NV_MOSAIC_DISPLAY_SETTING_V2;

    typedef NV_MOSAIC_DISPLAY_SETTING_V2 NV_MOSAIC_DISPLAY_SETTING;

//! Macro for constructing the version field of NV_MOSAIC_DISPLAY_SETTING
#define NVAPI_MOSAIC_DISPLAY_SETTING_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING_V1, 1)

#define NVAPI_MOSAIC_DISPLAY_SETTING_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING_V2, 2)

#define NVAPI_MOSAIC_DISPLAY_SETTING_VER NVAPI_MOSAIC_DISPLAY_SETTING_VER2


//
// Set a reasonable max number of display settings to support
// so arrays are bound.
//
#define NV_MOSAIC_DISPLAY_SETTINGS_MAX 40 //!< Set a reasonable maximum number of display settings to support

                                          //! so arrays are bound.

    //
    //! This structure is used to contain a list of supported Mosaic topologies
    //! along with the display settings that can be used.
    typedef struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V1
    {
        NvU32 version;                                                                //!< Version of this structure
        NvU32 topoBriefsCount;                                                        //!< Number of topologies in below array
        NV_MOSAIC_TOPO_BRIEF topoBriefs[NV_MOSAIC_TOPO_MAX];                          //!< List of supported topologies with only brief details
        NvU32 displaySettingsCount;                                                   //!< Number of display settings in below array
        NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; //!< List of per display settings possible

    } NV_MOSAIC_SUPPORTED_TOPO_INFO_V1;

    typedef struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V2
    {
        NvU32 version;                                                                //!< Version of this structure
        NvU32 topoBriefsCount;                                                        //!< Number of topologies in below array
        NV_MOSAIC_TOPO_BRIEF topoBriefs[NV_MOSAIC_TOPO_MAX];                          //!< List of supported topologies with only brief details
        NvU32 displaySettingsCount;                                                   //!< Number of display settings in below array
        NV_MOSAIC_DISPLAY_SETTING_V2 displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; //!< List of per display settings possible

    } NV_MOSAIC_SUPPORTED_TOPO_INFO_V2;

    typedef NV_MOSAIC_SUPPORTED_TOPO_INFO_V2 NV_MOSAIC_SUPPORTED_TOPO_INFO;

//! Macro forconstructing  the version field of NV_MOSAIC_SUPPORTED_TOPO_INFO
#define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO_V1, 1)

#define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO_V2, 2)

#define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER2


//
// Indices to use to access the topos array within the mosaic topology
#define NV_MOSAIC_TOPO_IDX_DEFAULT 0


#define NV_MOSAIC_TOPO_IDX_LEFT_EYE 0

#define NV_MOSAIC_TOPO_IDX_RIGHT_EYE 1

#define NV_MOSAIC_TOPO_NUM_EYES 2


//
//! This defines the maximum number of topos that can be in a topo group.
//! At this time, it is set to 2 because our largest topo group (passive
//! stereo) only needs 2 topos (left eye and right eye).
//!
//! If a new topo group with more than 2 topos is added above, then this
//! number will also have to be incremented.
#define NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP 2


    //
    //! This structure defines a group of topologies that work together to create one
    //! overall layout.  All of the supported topologies are represented with this
    //! structure.
    //!
    //! For example, a 'Passive Stereo' topology would be represented with this
    //! structure, and would have separate topology details for the left and right eyes.
    //! The count would be 2.  A 'Basic' topology is also represented by this structure,
    //! with a count of 1.
    //!
    //! The structure is primarily used internally, but is exposed to applications in a
    //! read-only fashion because there are some details in it that might be useful
    //! (like the number of rows/cols, or connected display information).  A user can
    //! get the filled-in structure by calling NvAPI_Mosaic_GetTopoGroup().
    //!
    //! You can then look at the detailed values within the structure.  There are no
    //! entrypoints which take this structure as input (effectively making it read-only).
    typedef struct
    {
        NvU32 version;              //!< Version of this structure
        NV_MOSAIC_TOPO_BRIEF brief; //!< The brief details of this topo
        NvU32 count;                //!< Number of topos in array below
        NV_MOSAIC_TOPO_DETAILS topos[NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP];

    } NV_MOSAIC_TOPO_GROUP;

//! Macro for constructing the version field of NV_MOSAIC_TOPO_GROUP
#define NVAPI_MOSAIC_TOPO_GROUP_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_GROUP, 1)


    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_GetSupportedTopoInfo
    //
    //! DESCRIPTION:     This API returns information on the topologies and display resolutions
    //!                  supported by Mosaic mode.
    //!
    //!                  NOTE: Not all topologies returned can be set immediately.
    //!                        See 'OUT' Notes below.
    //!
    //!                  Once you get the list of supported topologies, you can call
    //!                  NvAPI_Mosaic_GetTopoGroup() with one of the Mosaic topologies if you need
    //!                  more information about it.
    //!
    //!     <b>'IN' Notes:</b>  pSupportedTopoInfo->version must be set before calling this function.
    //!                  If the specified version is not supported by this implementation,
    //!                  an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION).
    //!
    //!     <b>'OUT' Notes:</b> Some of the topologies returned might not be valid for one reason or
    //!                  another.  It could be due to mismatched or missing displays.  It
    //!                  could also be because the required number of GPUs is not found.
    //!                  At a high level, you can see if the topology is valid and can be enabled
    //!                  by looking at the pSupportedTopoInfo->topoBriefs[xxx].isPossible flag.
    //!                  If this is true, the topology can be enabled. If it
    //!                  is false, you can find out why it cannot be enabled by getting the
    //!                  details of the topology via NvAPI_Mosaic_GetTopoGroup().  From there,
    //!                  look at the validityMask of the individual topologies.  The bits can
    //!                  be tested against the NV_MOSAIC_TOPO_VALIDITY_* bits.
    //!
    //!                  It is possible for this function to return NVAPI_OK with no topologies
    //!                  listed in the return structure.  If this is the case, it means that
    //!                  the current hardware DOES support Mosaic, but with the given configuration
    //!                  no valid topologies were found.  This most likely means that SLI was not
    //!                  enabled for the hardware. Once enabled, you should see valid topologies
    //!                  returned from this function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 185
    //!
    //!
    //! \param [in,out]  pSupportedTopoInfo  Information about what topologies and display resolutions
    //!                                      are supported for Mosaic.
    //! \param [in]      type                The type of topologies the caller is interested in
    //!                                      getting. See NV_MOSAIC_TOPO_TYPE for possible values.
    //!
    //! \retval ::NVAPI_OK                          No errors in returning supported topologies.
    //! \retval ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
    //! \retval ::NVAPI_INVALID_ARGUMENT            One or more arguments passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
    //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available.
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
    //                                              compatible with this entry point.
    //! \retval ::NVAPI_ERROR:                      Miscellaneous error occurred.
    //!
    //! \ingroup mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_GetSupportedTopoInfo(NV_MOSAIC_SUPPORTED_TOPO_INFO *pSupportedTopoInfo, NV_MOSAIC_TOPO_TYPE type);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_GetTopoGroup
    //
    //! DESCRIPTION:     This API returns a structure filled with the details
    //!                  of the specified Mosaic topology.
    //!
    //!                  If the pTopoBrief passed in matches the current topology,
    //!                  then information in the brief and group structures
    //!                  will reflect what is current. Thus the brief would have
    //!                  the current 'enable' status, and the group would have the
    //!                  current overlap values. If there is no match, then the
    //!                  returned brief has an 'enable' status of FALSE (since it
    //!                  is obviously not enabled), and the overlap values will be 0.
    //!
    //!     <b>'IN' Notes:</b>  pTopoGroup->version must be set before calling this function.
    //!                  If the specified version is not supported by this implementation,
    //!                  an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION).
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 185
    //!
    //! \param [in]     pTopoBrief        The topology for getting the details
    //!                                   This must be one of the topology briefs
    //!                                   returned from NvAPI_Mosaic_GetSupportedTopoInfo().
    //! \param [in,out] pTopoGroup        The topology details matching the brief
    //!
    //! \retval ::NVAPI_OK                          Details were retrieved successfully.
    //! \retval ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
    //! \retval ::NVAPI_INVALID_ARGUMENT            One or more argumentss passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
    //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available.
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
    //                                              compatible with this entry point.
    //! \retval ::NVAPI_ERROR:                      Miscellaneous error occurred.
    //!
    //! \ingroup mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_GetTopoGroup(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_TOPO_GROUP *pTopoGroup);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_GetOverlapLimits
    //
    //! DESCRIPTION:     This API returns the X and Y overlap limits required if
    //!                  the given Mosaic topology and display settings are to be used.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 185
    //!
    //! \param [in]   pTopoBrief          The topology for getting limits
    //!                                   This must be one of the topo briefs
    //!                                   returned from NvAPI_Mosaic_GetSupportedTopoInfo().
    //! \param [in]   pDisplaySetting     The display settings for getting the limits.
    //!                                   This must be one of the settings
    //!                                   returned from NvAPI_Mosaic_GetSupportedTopoInfo().
    //! \param [out]  pMinOverlapX        X overlap minimum
    //! \param [out]  pMaxOverlapX        X overlap maximum
    //! \param [out]  pMinOverlapY        Y overlap minimum
    //! \param [out]  pMaxOverlapY        Y overlap maximum
    //!
    //! \retval ::NVAPI_OK                          Details were retrieved successfully.
    //! \retval ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
    //! \retval ::NVAPI_INVALID_ARGUMENT            One or more argumentss passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
    //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available.
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
    //!                                             compatible with this entry point.
    //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred.
    //!
    //! \ingroup mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_GetOverlapLimits(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pMinOverlapX, NvS32 *pMaxOverlapX, NvS32 *pMinOverlapY, NvS32 *pMaxOverlapY);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_SetCurrentTopo
    //
    //! DESCRIPTION:     This API sets the Mosaic topology and performs a mode switch
    //!                  using the given display settings.
    //!
    //!                  If NVAPI_OK is returned, the current Mosaic topology was set
    //!                  correctly.  Any other status returned means the
    //!                  topology was not set, and remains what it was before this
    //!                  function was called.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 185
    //!
    //! \param [in]     pTopoBrief        The topology to set. This must be one of the topologies returned from
    //!                                   NvAPI_Mosaic_GetSupportedTopoInfo(), and it must have an isPossible value of 1.
    //! \param [in]     pDisplaySetting   The per display settings to be used in the Mosaic mode. This must be one of the
    //!                                   settings returned from NvAPI_Mosaic_GetSupportedTopoInfo().
    //! \param [in]     overlapX          The pixel overlap to use between horizontal displays (use positive a number for
    //!                                   overlap, or a negative number to create a gap.) If the overlap is out of bounds
    //!                                   for what is possible given the topo and display setting, the overlap will be clamped.
    //! \param [in]     overlapY          The pixel overlap to use between vertical displays (use positive a number for
    //!                                   overlap, or a negative number to create a gap.) If the overlap is out of bounds for
    //!                                   what is possible given the topo and display setting, the overlap will be clamped.
    //! \param [in]     enable            If 1, the topology being set will also be enabled, meaning that the mode set will
    //!                                   occur.  \n
    //!                                   If 0, you don't want to be in Mosaic mode right now, but want to set the current
    //!                                   Mosaic topology so you can enable it later with NvAPI_Mosaic_EnableCurrentTopo().
    //!
    //! \retval  ::NVAPI_OK                          The Mosaic topology was set.
    //! \retval  ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
    //! \retval  ::NVAPI_INVALID_ARGUMENT            One or more argumentss passed in are invalid.
    //! \retval  ::NVAPI_TOPO_NOT_POSSIBLE           The topology passed in is not currently possible.
    //! \retval  ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
    //! \retval  ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available.
    //! \retval  ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
    //!                                              compatible with this entrypoint.
    //! \retval  ::NVAPI_MODE_CHANGE_FAILED          There was an error changing the display mode.
    //! \retval  ::NVAPI_ERROR                       Miscellaneous error occurred.
    //!
    //! \ingroup mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_SetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 overlapX, NvS32 overlapY, NvU32 enable);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_GetCurrentTopo
    //
    //! DESCRIPTION:     This API returns information for the current Mosaic topology.
    //!                  This includes topology, display settings, and overlap values.
    //!
    //!                  You can call NvAPI_Mosaic_GetTopoGroup() with the topology
    //!                  if you require more information.
    //!
    //!                  If there isn't a current topology, then pTopoBrief->topo will
    //!                  be NV_MOSAIC_TOPO_NONE.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 185
    //!
    //! \param [out]     pTopoBrief       The current Mosaic topology
    //! \param [out]     pDisplaySetting  The current per-display settings
    //! \param [out]     pOverlapX        The pixel overlap between horizontal displays
    //! \param [out]     pOverlapY        The pixel overlap between vertical displays
    //!
    //! \retval ::NVAPI_OK                          Success getting current info.
    //! \retval ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
    //! \retval ::NVAPI_INVALID_ARGUMENT            One or more argumentss passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
    //! \retval ::NVAPI_NO_IMPLEMENTATION           This entry point not available.
    //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred.
    //!
    //! \ingroup mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_GetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pOverlapX, NvS32 *pOverlapY);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_EnableCurrentTopo
    //
    //! DESCRIPTION:     This API enables or disables the current Mosaic topology
    //!                  based on the setting of the incoming 'enable' parameter.
    //!
    //!                  An "enable" setting enables the current (previously set) Mosaic topology.
    //!                  Note that when the current Mosaic topology is retrieved, it must have an isPossible value of 1 or
    //!                  an error will occur.
    //!
    //!                  A "disable" setting disables the current Mosaic topology.
    //!                  The topology information will persist, even across reboots.
    //!                  To re-enable the Mosaic topology, call this function
    //!                  again with the enable parameter set to 1.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 185
    //!
    //! \param [in]   enable               1 to enable the current Mosaic topo, 0 to disable it.
    //!
    //! \retval ::NVAPI_OK                 The Mosaic topo was enabled/disabled.
    //! \retval ::NVAPI_NOT_SUPPORTED      Mosaic is not supported with the existing hardware.
    //! \retval ::NVAPI_INVALID_ARGUMENT   One or more arguments passed in are invalid.
    //! \retval ::NVAPI_TOPO_NOT_POSSIBLE  The current topology is not currently possible.
    //! \retval ::NVAPI_MODE_CHANGE_FAILED There was an error changing the display mode.
    //! \retval ::NVAPI_ERROR:             Miscellaneous error occurred.
    //!
    //! \ingroup mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_EnableCurrentTopo(NvU32 enable);

    //! \ingroup mosaicapi
    //! @{
    typedef struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V1
    {
        NvU32 displayId;    //!< DisplayID of the display
        NvS32 overlapX;     //!< (+overlap, -gap)
        NvS32 overlapY;     //!< (+overlap, -gap)
        NV_ROTATE rotation; //!< Rotation of display
        NvU32 cloneGroup;   //!< Reserved, must be 0
    } NV_MOSAIC_GRID_TOPO_DISPLAY_V1;

    typedef enum _NV_PIXEL_SHIFT_TYPE
    {
        NV_PIXEL_SHIFT_TYPE_NO_PIXEL_SHIFT = 0,          //!< No pixel shift will be applied to this display.
        NV_PIXEL_SHIFT_TYPE_2x2_TOP_LEFT_PIXELS = 1,     //!< This display will be used to scanout top left pixels in 2x2 PixelShift configuration
        NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_RIGHT_PIXELS = 2, //!< This display will be used to scanout bottom right pixels in 2x2 PixelShift configuration
        NV_PIXEL_SHIFT_TYPE_2x2_TOP_RIGHT_PIXELS = 4,    //!< This display will be used to scanout top right pixels in 2x2 PixelShift configuration
        NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_LEFT_PIXELS = 8,  //!< This display will be used to scanout bottom left pixels in 2x2 PixelShift configuration
    } NV_PIXEL_SHIFT_TYPE;

    typedef struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V2
    {
        NvU32 version; //!< Version of this structure

        NvU32 displayId;                    //!< DisplayID of the display
        NvS32 overlapX;                     //!< (+overlap, -gap)
        NvS32 overlapY;                     //!< (+overlap, -gap)
        NV_ROTATE rotation;                 //!< Rotation of display
        NvU32 cloneGroup;                   //!< Reserved, must be 0
        NV_PIXEL_SHIFT_TYPE pixelShiftType; //!< Type of the pixel shift enabled display
    } NV_MOSAIC_GRID_TOPO_DISPLAY_V2;

#ifndef NV_MOSAIC_GRID_TOPO_DISPLAY_VER

    typedef NV_MOSAIC_GRID_TOPO_DISPLAY_V1 NV_MOSAIC_GRID_TOPO_DISPLAY;

#endif

    typedef struct _NV_MOSAIC_GRID_TOPO_V1
    {
        NvU32 version;                                                   //!< Version of this structure
        NvU32 rows;                                                      //!< Number of rows
        NvU32 columns;                                                   //!< Number of columns
        NvU32 displayCount;                                              //!< Number of display details
        NvU32 applyWithBezelCorrect : 1;                                 //!< When enabling and doing the modeset, do we switch to the bezel-corrected resolution
        NvU32 immersiveGaming : 1;                                       //!< Enable as immersive gaming instead of Mosaic SLI (for Quadro-boards only)
        NvU32 baseMosaic : 1;                                            //!< Enable as Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards only)
        NvU32 driverReloadAllowed : 1;                                   //!< If necessary, reloading the driver is permitted (for Vista and above only). Will not be persisted. Value undefined on get.
        NvU32 acceleratePrimaryDisplay : 1;                              //!< Enable SLI acceleration on the primary display while in single-wide mode (For Immersive Gaming only). Will not be persisted. Value undefined on get.
        NvU32 reserved : 27;                                             //!< Reserved, must be 0
        NV_MOSAIC_GRID_TOPO_DISPLAY_V1 displays[NV_MOSAIC_MAX_DISPLAYS]; //!< Displays are done as [(row * columns) + column]
        NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings;                    //!< Display settings
    } NV_MOSAIC_GRID_TOPO_V1;

    typedef struct _NV_MOSAIC_GRID_TOPO_V2
    {
        NvU32 version;                                                   //!< Version of this structure
        NvU32 rows;                                                      //!< Number of rows
        NvU32 columns;                                                   //!< Number of columns
        NvU32 displayCount;                                              //!< Number of display details
        NvU32 applyWithBezelCorrect : 1;                                 //!< When enabling and doing the modeset, do we switch to the bezel-corrected resolution
        NvU32 immersiveGaming : 1;                                       //!< Enable as immersive gaming instead of Mosaic SLI (for Quadro-boards only)
        NvU32 baseMosaic : 1;                                            //!< Enable as Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards only)
        NvU32 driverReloadAllowed : 1;                                   //!< If necessary, reloading the driver is permitted (for Vista and above only). Will not be persisted. Value undefined on get.
        NvU32 acceleratePrimaryDisplay : 1;                              //!< Enable SLI acceleration on the primary display while in single-wide mode (For Immersive Gaming only). Will not be persisted. Value undefined on get.
        NvU32 pixelShift : 1;                                            //!< Enable Pixel shift
        NvU32 reserved : 26;                                             //!< Reserved, must be 0
        NV_MOSAIC_GRID_TOPO_DISPLAY_V2 displays[NV_MOSAIC_MAX_DISPLAYS]; //!< Displays are done as [(row * columns) + column]
        NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings;                    //!< Display settings
    } NV_MOSAIC_GRID_TOPO_V2;

//! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO
#define NV_MOSAIC_GRID_TOPO_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_GRID_TOPO_V1, 1)

#define NV_MOSAIC_GRID_TOPO_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_GRID_TOPO_V2, 2)

#ifndef NV_MOSAIC_GRID_TOPO_VER

    typedef NV_MOSAIC_GRID_TOPO_V2 NV_MOSAIC_GRID_TOPO;

//! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO
#define NV_MOSAIC_GRID_TOPO_VER NV_MOSAIC_GRID_TOPO_VER2


#endif

    //! @}

    //! since Release R290

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_DISPLAY_ON_INVALID_GPU NV_BIT(0)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_DISPLAY_ON_WRONG_CONNECTOR NV_BIT(1)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_COMMON_TIMINGS NV_BIT(2)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_EDID_AVAILABLE NV_BIT(3)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_MISMATCHED_OUTPUT_TYPE NV_BIT(4)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_DISPLAY_CONNECTED NV_BIT(5)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_GPU_TOPOLOGY NV_BIT(6)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NOT_SUPPORTED NV_BIT(7)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_SLI_BRIDGE NV_BIT(8)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_ECC_ENABLED NV_BIT(9)

#define NV_MOSAIC_DISPLAYCAPS_PROBLEM_GPU_TOPOLOGY_NOT_SUPPORTED NV_BIT(10)


//! Do not change the current GPU topology. If the NO_DRIVER_RELOAD bit is not
//! specified, then it may still require a driver reload.
#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_CURRENT_GPU_TOPOLOGY NV_BIT(0)


//! Do not allow a driver reload. That is, stick with the same master GPU as well as the
//! same SLI configuration.
#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_NO_DRIVER_RELOAD NV_BIT(1)


//! When choosing a GPU topology, choose the topology with the best performance.
//! Without this flag, it will choose the topology that uses the smallest number
//! of GPU's.
#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_MAXIMIZE_PERFORMANCE NV_BIT(2)


//! Do not return an error if no configuration will work with all of the grids.
#define NV_MOSAIC_SETDISPLAYTOPO_FLAG_ALLOW_INVALID NV_BIT(3)


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_SetDisplayGrids
    //
    //! DESCRIPTION:     Sets a new display topology, replacing any existing topologies
    //!                  that use the same displays.
    //!
    //!                  This function will look for an SLI configuration that will
    //!                  allow the display topology to work.
    //!
    //!                  To revert to a single display, specify that display as a 1x1
    //!                  grid.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      pGridTopologies    The topology details to set.
    //! \param [in]      gridCount          The number of elements in the pGridTopologies array.
    //! \param [in]      setTopoFlags       Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_*
    //!                                     flags.
    //!
    //!
    //! \retval ::NVAPI_OK                          Capabilities have been returned.
    //! \retval ::NVAPI_INVALID_ARGUMENT            One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first
    //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available
    //! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY      No matching GPU topologies could be found.
    //! \retval ::NVAPI_TOPO_NOT_POSSIBLE           One or more of the display grids are not valid.
    //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred
    //! \ingroup mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_SetDisplayGrids(__in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies, __in NvU32 gridCount, __in NvU32 setTopoFlags);

//! \ingroup mosaicapi
//! Indicates that a display's position in the grid is sub-optimal.
#define NV_MOSAIC_DISPLAYTOPO_WARNING_DISPLAY_POSITION NV_BIT(0)


//! \ingroup mosaicapi
//! Indicates that SetDisplaySettings would need to perform a driver reload.
#define NV_MOSAIC_DISPLAYTOPO_WARNING_DRIVER_RELOAD_REQUIRED NV_BIT(1)


    //! \ingroup mosaicapi
    typedef struct
    {
        NvU32 version;
        NvU32 errorFlags;   //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_ERROR_* flags.
        NvU32 warningFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags.

        NvU32 displayCount; //!< (OUT) The number of valid entries in the displays array.
        struct
        {
            NvU32 displayId;    //!< (OUT) The DisplayID of this display.
            NvU32 errorFlags;   //!< (OUT) Any of the NV_MOSAIC_DISPLAYCAPS_PROBLEM_* flags.
            NvU32 warningFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags.

            NvU32 supportsRotation : 1; //!< (OUT) This display can be rotated
            NvU32 reserved : 31;        //!< (OUT) reserved
        } displays[NVAPI_MAX_DISPLAYS];
    } NV_MOSAIC_DISPLAY_TOPO_STATUS;

//! \ingroup mosaicapi
#define NV_MOSAIC_DISPLAY_TOPO_STATUS_VER MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_TOPO_STATUS, 1)


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_ValidateDisplayGrids
    //
    //! DESCRIPTION:     Determines if a list of grid topologies is valid. It will choose an SLI
    //!                  configuration in the same way that NvAPI_Mosaic_SetDisplayGrids() does.
    //!
    //!                  On return, each element in the pTopoStatus array will contain any errors or
    //!                  warnings about each grid topology. If any error flags are set, then the topology
    //!                  is not valid. If any warning flags are set, then the topology is valid, but
    //!                  sub-optimal.
    //!
    //!                  If the ALLOW_INVALID flag is set, then it will continue to validate the grids
    //!                  even if no SLI configuration will allow all of the grids. In this case, a grid
    //!                  grid with no matching GPU topology will have the error
    //!                  flags NO_GPU_TOPOLOGY or NOT_SUPPORTED set.
    //!
    //!                  If the ALLOW_INVALID flag is not set and no matching SLI configuration is
    //!                  found, then it will skip the rest of the validation and return
    //!                  NVAPI_NO_ACTIVE_SLI_TOPOLOGY.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      setTopoFlags       Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_*
    //!                                     flags.
    //! \param [in]      pGridTopologies    The array of grid topologies to verify.
    //! \param [in,out]  pTopoStatus        The array of problems and warnings with each grid topology.
    //! \param [in]      gridCount          The number of elements in the pGridTopologies and
    //!                                     pTopoStatus arrays.
    //!
    //!
    //! \retval ::NVAPI_OK:                          Capabilities have been returned.
    //! \retval ::NVAPI_INVALID_ARGUMENT:            One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INTIALIZED:          The NvAPI API needs to be initialized first
    //! \retval ::NVAPI_NO_IMPLEMENTATION:           This entrypoint not available
    //! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY:      No matching GPU topologies could be found.
    //! \retval ::NVAPI_ERROR:                       Miscellaneous error occurred
    //!
    //! \ingroup mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_ValidateDisplayGrids(__in NvU32 setTopoFlags,
                                                      __in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies,
                                                      __inout_ecount_full(gridCount) NV_MOSAIC_DISPLAY_TOPO_STATUS *pTopoStatus,
                                                      __in NvU32 gridCount);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_EnumDisplayModes
    //
    //! DESCRIPTION:     Determines the set of available display modes for a given grid topology.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      pGridTopology         The grid topology to use.
    //! \param [in,out]  pDisplaySettings      A pointer to an array of display settings to populate,
    //!                                        or NULL to find out the total number of available modes.
    //! \param [in,out]  pDisplayCount         If pDisplaySettings is not NULL, then pDisplayCount
    //!                                        should point to the number of elements in the
    //!                                        pDisplaySettings array. On return, it will contain the
    //!                                        number of modes that were actually returned. If
    //!                                        pDisplaySettings is NULL, then pDisplayCount will receive
    //!                                        the total number of modes that are available.
    //!
    //!
    //! \retval ::NVAPI_OK                          Capabilities have been returned.
    //! \retval ::NVAPI_INVALID_ARGUMENT            One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first
    //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available
    //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred
    //!
    //! \ingroup mosaciapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayModes(__in NV_MOSAIC_GRID_TOPO *pGridTopology,
                                                  __inout_ecount_part_opt(*pDisplayCount, *pDisplayCount) NV_MOSAIC_DISPLAY_SETTING *pDisplaySettings,
                                                  __inout NvU32 *pDisplayCount);

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_Mosaic_EnumDisplayGrids
    //
    //! DESCRIPTION:     Enumerates the current active grid topologies. This includes Mosaic, IG, and
    //!                  Panoramic topologies, as well as single displays.
    //!
    //!                  If pGridTopologies is NULL, then pGridCount will be set to the number of active
    //!                  grid topologies.
    //!
    //!                  If pGridTopologies is not NULL, then pGridCount contains the maximum number of
    //!                  grid topologies to return. On return, pGridCount will be set to the number of
    //!                  grid topologies that were returned.
    //!
    //! \param [out]     pGridTopologies   The list of active grid topologies.
    //! \param [in,out]  pGridCount        A pointer to the number of grid topologies returned.
    //!
    //! \retval ::NVAPI_OK                          Capabilties have been returned.
    //! \retval ::NVAPI_END_ENUMERATION             There are no more topologies to return.
    //! \retval ::NVAPI_INVALID_ARGUMENT            One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first
    //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available
    //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred
    //!
    //! \ingroup mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayGrids(__inout_ecount_part_opt(*pGridCount, *pGridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies,
                                                  __inout NvU32 *pGridCount);

////////////////////////////////////////////////////////////////////////////////////////
//
// ###########################################################################
// DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
//
//   Below is the Phase 1 Mosaic stuff, the Phase 2 stuff above is what will remain
//   once Phase 2 is complete.  For a small amount of time, the two will co-exist.  As
//   soon as apps (nvapichk, NvAPITestMosaic, and CPL) are updated to use the Phase 2
//   entrypoints, the code below will be deleted.
//
// DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
// ###########################################################################
//
// Supported topos 1x4, 4x1 and 2x2 to start with.
//
// Selected scan out targets can be one per GPU or more than one on the same GPU.
//
// SAMPLE of MOSAIC 1x4 SCAN OUT TOPO with 8 pixel horizontal overlap
//
//+-------------------------++-------------------------++-------------------------++-------------------------+
//|                         ||                         ||                         ||                         |
//|                         ||                         ||                         ||                         |
//|                         ||                         ||                         ||                         |
//|        DVI1             ||           DVI2          ||         DVI3            ||          DVI4           |
//|                         ||                         ||                         ||                         |
//|                         ||                         ||                         ||                         |
//|                         ||                         ||                         ||                         |
//|                         ||                         ||                         ||                         |
//+-------------------------++-------------------------++-------------------------++-------------------------+

//! \addtogroup mosaicapi
//! @{

//! Used in NV_MOSAIC_TOPOLOGY.
#define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8


//! Used in NV_MOSAIC_TOPOLOGY.
#define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8


//! Used in NV_MOSAIC_TOPOLOGY.
#define NVAPI_MAX_MOSAIC_TOPOS 16


    //! Used in NvAPI_GetCurrentMosaicTopology() and NvAPI_SetCurrentMosaicTopology().
    typedef struct
    {
        NvU32 version;  //!< Version number of the mosaic topology
        NvU32 rowCount; //!< Horizontal display count
        NvU32 colCount; //!< Vertical display count

        struct
        {
            NvPhysicalGpuHandle hPhysicalGPU; //!< Physical GPU to be used in the topology
            NvU32 displayOutputId;            //!< Connected display target
            NvS32 overlapX;                   //!< Pixels of overlap on the left of target: (+overlap, -gap)
            NvS32 overlapY;                   //!< Pixels of overlap on the top of target: (+overlap, -gap)

        } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS];

    } NV_MOSAIC_TOPOLOGY;

//! Used in NV_MOSAIC_TOPOLOGY.
#define NVAPI_MOSAIC_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPOLOGY, 1)


    //! Used in NvAPI_GetSupportedMosaicTopologies().
    typedef struct
    {
        NvU32 version;
        NvU32 totalCount;                                 //!< Count of valid topologies
        NV_MOSAIC_TOPOLOGY topos[NVAPI_MAX_MOSAIC_TOPOS]; //!< Maximum number of topologies

    } NV_MOSAIC_SUPPORTED_TOPOLOGIES;

//! Used in NV_MOSAIC_SUPPORTED_TOPOLOGIES.
#define NVAPI_MOSAIC_SUPPORTED_TOPOLOGIES_VER MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPOLOGIES, 1)


    //!@}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GetSupportedMosaicTopologies
    //
    //! DESCRIPTION:     This API returns all valid Mosaic topologies.
    //!
    //! SUPPORTED OS:  Windows XP
    //!
    //!
    //! \since Release: 177
    //!
    //! \param [out] pMosaicTopos                   An array of valid Mosaic topologies.
    //!
    //! \retval      NVAPI_OK                       Call succeeded; 1 or more topologies were returned
    //! \retval      NVAPI_INVALID_ARGUMENT         One or more arguments are invalid
    //! \retval      NVAPI_MIXED_TARGET_TYPES       Mosaic topology is only possible with all targets of the same NV_GPU_OUTPUT_TYPE.
    //! \retval      NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \retval      NVAPI_NOT_SUPPORTED            Mosaic is not supported with GPUs on this system.
    //! \retval      NVAPI_NO_ACTIVE_SLI_TOPOLOGY   SLI is not enabled, yet needs to be, in order for this function to succeed.
    //!
    //! \ingroup     mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetSupportedMosaicTopologies(NV_MOSAIC_SUPPORTED_TOPOLOGIES *pMosaicTopos);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_GetCurrentMosaicTopology
    //
    //! DESCRIPTION:     This API gets the current Mosaic topology.
    //!
    //! SUPPORTED OS:  Windows XP
    //!
    //!
    //! \since Release: 177
    //!
    //! \param [out] pMosaicTopo                    The current Mosaic topology
    //! \param [out] pEnabled                       TRUE if returned topology is currently enabled, else FALSE
    //!
    //! \retval      NVAPI_OK                       Call succeeded
    //! \retval      NVAPI_INVALID_ARGUMENT         One or more arguments are invalid
    //! \retval      NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \retval      NVAPI_NOT_SUPPORTED            Mosaic is not supported with GPUs on this system.
    //! \retval      NVAPI_NO_ACTIVE_SLI_TOPOLOGY   SLI is not enabled, yet needs to be, in order for this function to succeed.
    //!
    //! \ingroup     mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo, NvU32 *pEnabled);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_SetCurrentMosaicTopology
    //
    //! DESCRIPTION:     This API sets the Mosaic topology, and enables it so that the
    //!                  Mosaic display settings are enumerated upon request.
    //!
    //! SUPPORTED OS:  Windows XP
    //!
    //!
    //! \since Release: 177
    //!
    //! \param [in]  pMosaicTopo                    A valid Mosaic topology
    //!
    //! \retval      NVAPI_OK                       Call succeeded
    //! \retval      NVAPI_INVALID_ARGUMENT         One or more arguments are invalid
    //! \retval      NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \retval      NVAPI_NOT_SUPPORTED            Mosaic is not supported with GPUs on this system.
    //! \retval      NVAPI_NO_ACTIVE_SLI_TOPOLOGY   SLI is not enabled, yet needs to be, in order for this function to succeed.
    //!
    //! \ingroup     mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_SetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_EnableCurrentMosaicTopology
    //
    //! DESCRIPTION:    This API enables or disables the current Mosaic topology.
    //!                 When enabling, the last Mosaic topology will be set.
    //!
    //!                  - If enabled, enumeration of display settings will include valid Mosaic resolutions.
    //!                  - If disabled, enumeration of display settings will not include Mosaic resolutions.
    //!
    //! SUPPORTED OS:  Windows XP
    //!
    //!
    //! \since Release: 177
    //!
    //! \param [in]  enable                         TRUE to enable the Mosaic Topology, FALSE to disable it.
    //!
    //! \retval      NVAPI_OK                       Call succeeded
    //! \retval      NVAPI_INVALID_ARGUMENT         One or more arguments are invalid
    //! \retval      NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
    //! \retval      NVAPI_NOT_SUPPORTED            Mosaic is not supported with GPUs on this system.
    //! \retval      NVAPI_NO_ACTIVE_SLI_TOPOLOGY   SLI is not enabled, yet needs to be, in order for this function to succeed.
    //!
    //! \ingroup     mosaicapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_EnableCurrentMosaicTopology(NvU32 enable);

#define NVAPI_MAX_GSYNC_DEVICES 4


    // Sync Display APIs

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GSync_EnumSyncDevices
    //
    //!   DESCRIPTION: This API returns an array of Sync device handles. A Sync device handle represents a
    //!                single Sync device on the system.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [out] nvGSyncHandles-  The caller provides an array of handles, which must contain at least
    //!                               NVAPI_MAX_GSYNC_DEVICES elements. The API will zero out the entire array and then fill in one
    //!                               or more handles. If an error occurs, the array is invalid.
    //! \param [out] *gsyncCount-     The caller provides the storage space. NvAPI_GSync_EnumSyncDevices
    //!                               sets *gsyncCount to indicate how many of the elements in the nvGSyncHandles[] array are valid.
    //!                               If an error occurs, *gsyncCount will be set to zero.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::NVAPI_INVALID_ARGUMENT         nvGSyncHandles or gsyncCount is NULL.
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND  The queried Graphics system does not have any Sync Device.
    //!
    //! \ingroup gsyncapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GSync_EnumSyncDevices(__out NvGSyncDeviceHandle nvGSyncHandles[NVAPI_MAX_GSYNC_DEVICES], __out NvU32 *gsyncCount);

// GSync boardId values
#define NVAPI_GSYNC_BOARD_ID_P358 856   //!< GSync board ID 0x358, see NV_GSYNC_CAPABILITIES

#define NVAPI_GSYNC_BOARD_ID_P2060 8288 //!< GSync board ID 0x2060, see NV_GSYNC_CAPABILITIES


//! \since Release: 375
#define NVAPI_GSYNC_BOARD_ID_P2061 8289 //!< GSync board ID 0x2061, see NV_GSYNC_CAPABILITIES


    //! Used in NvAPI_GSync_QueryCapabilities().
    typedef struct _NV_GSYNC_CAPABILITIES_V1
    {
        NvU32 version;  //!< Version of the structure
        NvU32 boardId;  //!< Board ID
        NvU32 revision; //!< FPGA Revision
        NvU32 capFlags; //!< Capabilities of the Sync board. Reserved for future use
    } NV_GSYNC_CAPABILITIES_V1;

    typedef struct _NV_GSYNC_CAPABILITIES_V2
    {
        NvU32 version;          //!< Version of the structure
        NvU32 boardId;          //!< Board ID
        NvU32 revision;         //!< FPGA major revision
        NvU32 capFlags;         //!< Capabilities of the Sync board. Reserved for future use
        NvU32 extendedRevision; //!< FPGA minor revision
    } NV_GSYNC_CAPABILITIES_V2;

    typedef NV_GSYNC_CAPABILITIES_V2 NV_GSYNC_CAPABILITIES;

//! \ingroup gsyncapi
//! Macro for constructing the version field of NV_GSYNC_CAPABILITIES.
#define NV_GSYNC_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V1, 1)

#define NV_GSYNC_CAPABILITIES_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V2, 2)

#define NV_GSYNC_CAPABILITIES_VER NV_GSYNC_CAPABILITIES_VER2


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GSync_QueryCapabilities
    //
    //!   DESCRIPTION: This API returns the capabilities of the Sync device.
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [in]    hNvGSyncDevice-        The handle for a Sync device for which the capabilities will be queried.
    //! \param [inout] *pNvGSyncCapabilities- The caller provides the storage space. NvAPI_GSync_QueryCapabilities() sets
    //!                                       *pNvGSyncCapabilities to the version and capabilities details of the Sync device
    //!                                       If an error occurs, *pNvGSyncCapabilities will be set to NULL.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::NVAPI_INVALID_ARGUMENT         hNvGSyncDevice is NULL.
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND  The queried Graphics system does not have any Sync Device.
    //!
    //! \ingroup gsyncapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GSync_QueryCapabilities(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CAPABILITIES *pNvGSyncCapabilities);

    //! Connector values for a GPU. Used in NV_GSYNC_GPU.
    typedef enum _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR
    {
        NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NONE = 0,
        NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_PRIMARY = 1,
        NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_SECONDARY = 2,
        NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_TERTIARY = 3,
        NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_QUARTERNARY = 4,
    } NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR;

    //! Display sync states. Used in NV_GSYNC_DISPLAY.
    typedef enum _NVAPI_GSYNC_DISPLAY_SYNC_STATE
    {
        NVAPI_GSYNC_DISPLAY_SYNC_STATE_UNSYNCED = 0,
        NVAPI_GSYNC_DISPLAY_SYNC_STATE_SLAVE = 1,
        NVAPI_GSYNC_DISPLAY_SYNC_STATE_MASTER = 2,
    } NVAPI_GSYNC_DISPLAY_SYNC_STATE;

    typedef struct _NV_GSYNC_GPU
    {
        NvU32 version;                                //!< Version of the structure
        NvPhysicalGpuHandle hPhysicalGpu;             //!< GPU handle
        NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR connector; //!< Indicates which connector on the device the GPU is connected to.
        NvPhysicalGpuHandle hProxyPhysicalGpu;        //!< GPU through which hPhysicalGpu is connected to the Sync device (if not directly connected)
                                                      //!<  - this is NULL otherwise
        NvU32 isSynced : 1;                           //!< Whether this GPU is sync'd or not.
        NvU32 reserved : 31;                          //!< Should be set to ZERO
    } NV_GSYNC_GPU;

    typedef struct _NV_GSYNC_DISPLAY
    {
        NvU32 version;                            //!< Version of the structure
        NvU32 displayId;                          //!< display identifier for displays.The GPU to which it is connected, can be retireved from NvAPI_SYS_GetPhysicalGpuFromDisplayId
        NvU32 isMasterable : 1;                   //!< Can this display be the master? (Read only)
        NvU32 reserved : 31;                      //!< Should be set to ZERO
        NVAPI_GSYNC_DISPLAY_SYNC_STATE syncState; //!< Is this display slave/master
                                                  //!< (Retrieved with topology or set by caller for enable/disable sync)
    } NV_GSYNC_DISPLAY;

#define NV_GSYNC_DISPLAY_VER MAKE_NVAPI_VERSION(NV_GSYNC_DISPLAY, 1)

#define NV_GSYNC_GPU_VER MAKE_NVAPI_VERSION(NV_GSYNC_GPU, 1)


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GSync_GetTopology
    //
    //!   DESCRIPTION: This API returns the topology for the specified Sync device.
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [in]       hNvGSyncDevice-     The caller provides the handle for a Sync device for which the topology will be queried.
    //! \param [in, out]  gsyncGpuCount-      It returns number of GPUs connected to Sync device
    //! \param [in, out]  gsyncGPUs-          It returns info about GPUs connected to Sync device
    //! \param [in, out]  gsyncDisplayCount-  It returns number of active displays that belongs to Sync device
    //! \param [in, out]  gsyncDisplays-      It returns info about all active displays that belongs to Sync device
    //!
    //! HOW TO USE: 1) make a call to get the number of GPUs connected OR displays synced through Sync device
    //!                by passing the gsyncGPUs OR gsyncDisplays as NULL respectively. Both gsyncGpuCount and gsyncDisplayCount can be retrieved in same call by passing
    //!                both gsyncGPUs and gsyncDisplays as NULL
    //!                On call success:
    //!             2) Allocate memory based on gsyncGpuCount(for gsyncGPUs) and/or gsyncDisplayCount(for gsyncDisplays) then make a call to populate gsyncGPUs and/or gsyncDisplays respectively.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::NVAPI_INVALID_ARGUMENT               hNvGSyncDevice is NULL.
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND        The queried Graphics system does not have any Sync Device.
    //! \retval ::NVAPI_INSUFFICIENT_BUFFER            When the actual number of GPUs/displays in the topology exceed the number of elements allocated for SyncGPUs/SyncDisplays respectively.
    //!
    //! \ingroup gsyncapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GSync_GetTopology(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout_opt NvU32 *gsyncGpuCount, __inout_ecount_part_opt(*gsyncGpuCount, *gsyncGpuCount) NV_GSYNC_GPU *gsyncGPUs,
                                            __inout_opt NvU32 *gsyncDisplayCount, __inout_ecount_part_opt(*gsyncDisplayCount, *gsyncDisplayCount) NV_GSYNC_DISPLAY *gsyncDisplays);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GSync_SetSyncStateSettings
    //
    //!   DESCRIPTION: Sets a new sync state for the displays in system.
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [in]  gsyncDisplayCount-			The number of displays in gsyncDisplays.
    //! \param [in]  pGsyncDisplays-			The caller provides the structure containing all displays that need to be synchronized in the system.
    //!											The displays that are not part of pGsyncDisplays, will be un-synchronized.
    //! \param [in]  flags-						Reserved for future use.
    //!
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \retval ::NVAPI_INVALID_ARGUMENT			If the display topology or count not valid.
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND		The queried Graphics system does not have any Sync Device.
    //! \retval ::NVAPI_INVALID_SYNC_TOPOLOGY       1.If any mosaic grid is partial.
    //!                                             2.If timing(HVisible/VVisible/refreshRate) applied of any display is different.
    //!                                             3.If There is a across GPU mosaic grid in system and that is not a part of pGsyncDisplays.
    //!
    //! \ingroup gsyncapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GSync_SetSyncStateSettings(__in NvU32 gsyncDisplayCount, __in_ecount(gsyncDisplayCount) NV_GSYNC_DISPLAY *pGsyncDisplays, __in NvU32 flags);

    //! \ingroup gsyncapi

    //! Source signal edge to be used for output pulse. See NV_GSYNC_CONTROL_PARAMS.
    typedef enum _NVAPI_GSYNC_POLARITY
    {
        NVAPI_GSYNC_POLARITY_RISING_EDGE = 0,
        NVAPI_GSYNC_POLARITY_FALLING_EDGE = 1,
        NVAPI_GSYNC_POLARITY_BOTH_EDGES = 2,
    } NVAPI_GSYNC_POLARITY;

    //! Used in NV_GSYNC_CONTROL_PARAMS.
    typedef enum _NVAPI_GSYNC_VIDEO_MODE
    {
        NVAPI_GSYNC_VIDEO_MODE_NONE = 0,
        NVAPI_GSYNC_VIDEO_MODE_TTL = 1,
        NVAPI_GSYNC_VIDEO_MODE_NTSCPALSECAM = 2,
        NVAPI_GSYNC_VIDEO_MODE_HDTV = 3,
        NVAPI_GSYNC_VIDEO_MODE_COMPOSITE = 4,
    } NVAPI_GSYNC_VIDEO_MODE;

    //! Used in NV_GSYNC_CONTROL_PARAMS.
    typedef enum _NVAPI_GSYNC_SYNC_SOURCE
    {
        NVAPI_GSYNC_SYNC_SOURCE_VSYNC = 0,
        NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC = 1,
    } NVAPI_GSYNC_SYNC_SOURCE;

    //! Used in NV_GSYNC_CONTROL_PARAMS.
    typedef struct _NV_GSYNC_DELAY
    {
        NvU32 version;   //!< Version of the structure
        NvU32 numLines;  //!< delay to be induced in number of horizontal lines.
        NvU32 numPixels; //!< delay to be induced in number of pixels.
        NvU32 maxLines;  //!< maximum number of lines supported at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only.
        NvU32 minPixels; //!< minimum number of pixels required at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only.
    } NV_GSYNC_DELAY;

#define NV_GSYNC_DELAY_VER MAKE_NVAPI_VERSION(NV_GSYNC_DELAY, 1)


    //! Used in NvAPI_GSync_GetControlParameters() and NvAPI_GSync_SetControlParameters().
    typedef struct _NV_GSYNC_CONTROL_PARAMS
    {
        NvU32 version;                  //!< Version of the structure
        NVAPI_GSYNC_POLARITY polarity;  //!< Leading edge / Falling edge / both
        NVAPI_GSYNC_VIDEO_MODE vmode;   //!< None, TTL, NTSCPALSECAM, HDTV
        NvU32 interval;                 //!< Number of pulses to wait between framelock signal generation
        NVAPI_GSYNC_SYNC_SOURCE source; //!< VSync/House sync
        NvU32 interlaceMode : 1;        //!< interlace mode for a Sync device
        NvU32 syncSourceIsOutput : 1;   //!< Set this to make house sync as an output; valid only when NV_GSYNC_CONTROL_PARAMS::source is NVAPI_GSYNC_SYNC_SOURCE_VSYNC on P2061 boards.
                                        //!< syncSourceIsOutput should always be NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC i.e. 0 on P2060 boards or when NV_GSYNC_CONTROL_PARAMS::source is set to NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC.
        NvU32 reserved : 30;            //!< should be set zero
        NV_GSYNC_DELAY syncSkew;        //!< The time delay between the frame sync signal and the GPUs signal.
        NV_GSYNC_DELAY startupDelay;    //!< Sync start delay for master.
    } NV_GSYNC_CONTROL_PARAMS;

#define NV_GSYNC_CONTROL_PARAMS_VER MAKE_NVAPI_VERSION(NV_GSYNC_CONTROL_PARAMS, 1)


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GSync_GetControlParameters
    //
    //!   DESCRIPTION: This API queries for sync control parameters as defined in NV_GSYNC_CONTROL_PARAMS.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [in]    hNvGSyncDevice-   The caller provides the handle of the Sync device for which to get parameters
    //! \param [inout] *pGsyncControls-  The caller provides the storage space. NvAPI_GSync_GetControlParameters() populates *pGsyncControls with values.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::NVAPI_INVALID_ARGUMENT          hNvGSyncDevice is NULL.
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND   The queried Graphics system does not have any Sync Device.
    //!
    //! \ingroup gsyncapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GSync_GetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls);

    //////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GSync_SetControlParameters
    //
    //!   DESCRIPTION: This API sets control parameters as defined in NV_SYNC_CONTROL_PARAMS.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [in]  hNvGSyncDevice-   The caller provides the handle of the Sync device for which to get parameters
    //! \param [inout]  *pGsyncControls-  The caller provides NV_GSYNC_CONTROL_PARAMS. skew and startDelay will be updated to the applied values.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::NVAPI_INVALID_ARGUMENT          hNvGSyncDevice is NULL.
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND   The queried Graphics system does not have any Sync Device.
    //! \retval ::NVAPI_SYNC_MASTER_NOT_FOUND     Control Parameters can only be set if there is a Sync Master enabled on the Gsync card.
    //!
    //! \ingroup gsyncapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GSync_SetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls);

    //! Used in NvAPI_GSync_AdjustSyncDelay()
    typedef enum _NVAPI_GSYNC_DELAY_TYPE
    {
        NVAPI_GSYNC_DELAY_TYPE_UNKNOWN = 0,
        NVAPI_GSYNC_DELAY_TYPE_SYNC_SKEW = 1,
        NVAPI_GSYNC_DELAY_TYPE_STARTUP = 2
    } NVAPI_GSYNC_DELAY_TYPE;

    //////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GSync_AdjustSyncDelay
    //
    //!   DESCRIPTION: This API adjusts the skew and startDelay to the closest possible values. Use this API before calling NvAPI_GSync_SetControlParameters for skew or startDelay.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 319
    //!
    //! \param [in]  hNvGSyncDevice-   	The caller provides the handle of the Sync device for which to get parameters
    //! \param [in]  delayType-   		Specifies whether the delay is syncSkew or startupDelay.
    //! \param [inout]  *pGsyncDelay-  	The caller provides NV_GSYNC_DELAY. skew and startDelay will be adjusted and updated to the closest values.
    //! \param [out]  *syncSteps-  		This parameter is optional. It returns the sync delay in unit steps. If 0, it means either the NV_GSYNC_DELAY::numPixels is less than NV_GSYNC_DELAY::minPixels or NV_GSYNC_DELAY::numOfLines exceeds the NV_GSYNC_DELAY::maxLines.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup gsyncapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GSync_AdjustSyncDelay(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NVAPI_GSYNC_DELAY_TYPE delayType, __inout NV_GSYNC_DELAY *pGsyncDelay, __out_opt NvU32 *syncSteps);

    //! Used in NvAPI_GSync_GetSyncStatus().
    typedef struct _NV_GSYNC_STATUS
    {
        NvU32 version;                //!< Version of the structure
        NvU32 bIsSynced;              //!< Is timing in sync?
        NvU32 bIsStereoSynced;        //!< Does the phase of the timing signal from the GPU = the phase of the master sync signal?
        NvU32 bIsSyncSignalAvailable; //!< Is the sync signal available?
    } NV_GSYNC_STATUS;

//! Macro for constructing the version field for NV_GSYNC_STATUS.
#define NV_GSYNC_STATUS_VER MAKE_NVAPI_VERSION(NV_GSYNC_STATUS, 1)


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GSync_GetSyncStatus
    //
    //!   DESCRIPTION: This API queries the sync status of a GPU - timing, stereosync and sync signal availability.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [in]  hNvGSyncDevice-     Handle of the Sync device
    //! \param [in]  hPhysicalGpu-       GPU to be queried for sync status.
    //! \param [out] *status-            The caller provides the storage space. NvAPI_GSync_GetSyncStatus() populates *status with
    //!                                  values - timing, stereosync and signal availability. On error, *status is set to NULL.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::NVAPI_INVALID_ARGUMENT          hNvGSyncDevice is NULL / SyncTarget is NULL.
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND   The queried Graphics system does not have any G-Sync Device.
    //!
    //! \ingroup gsyncapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GSync_GetSyncStatus(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GSYNC_STATUS *status);

    //! \ingroup gsyncapi

#define NVAPI_MAX_RJ45_PER_GSYNC 2


    //! Used in NV_GSYNC_STATUS_PARAMS.
    typedef enum _NVAPI_GSYNC_RJ45_IO
    {
        NVAPI_GSYNC_RJ45_OUTPUT = 0,
        NVAPI_GSYNC_RJ45_INPUT = 1,
        NVAPI_GSYNC_RJ45_UNUSED = 2 //!< This field is used to notify that the framelock is not actually present.

    } NVAPI_GSYNC_RJ45_IO;

    //! \ingroup gsyncapi
    //! Used in NvAPI_GSync_GetStatusParameters().
    typedef struct _NV_GSYNC_STATUS_PARAMS_V1
    {
        NvU32 version;
        NvU32 refreshRate;                                     //!< The refresh rate
        NVAPI_GSYNC_RJ45_IO RJ45_IO[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Configured as input / output
        NvU32 RJ45_Ethernet[NVAPI_MAX_RJ45_PER_GSYNC];         //!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!]
        NvU32 houseSyncIncoming;                               //!< Incoming house sync frequency in Hz
        NvU32 bHouseSync;                                      //!< Is house sync connected?
    } NV_GSYNC_STATUS_PARAMS_V1;

    typedef struct _NV_GSYNC_STATUS_PARAMS_V2
    {
        NvU32 version;
        NvU32 refreshRate;                                     //!< The refresh rate
        NVAPI_GSYNC_RJ45_IO RJ45_IO[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Configured as input / output
        NvU32 RJ45_Ethernet[NVAPI_MAX_RJ45_PER_GSYNC];         //!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!]
        NvU32 houseSyncIncoming;                               //!< Incoming house sync frequency in Hz
        NvU32 bHouseSync;                                      //!< Is house sync connected?
        NvU32 bInternalSlave : 1;                              //!< Valid only for P2061 board.
                                                               //!< If set to 1, it means that this P2061 board receives input from another P2061 board.
        NvU32 reserved : 31;                                   //!< Reserved for future use.
    } NV_GSYNC_STATUS_PARAMS_V2;

    typedef NV_GSYNC_STATUS_PARAMS_V2 NV_GSYNC_STATUS_PARAMS;

//! \ingroup gsyncapi
//! Macro for constructing the version field of NV_GSYNC_STATUS_PARAMS
#define NV_GSYNC_STATUS_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_STATUS_PARAMS_V1, 1)

#define NV_GSYNC_STATUS_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_STATUS_PARAMS_V2, 2)

#define NV_GSYNC_STATUS_PARAMS_VER NV_GSYNC_STATUS_PARAMS_VER2


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GSync_GetStatusParameters
    //
    //!   DESCRIPTION: This API queries for sync status parameters as defined in NV_GSYNC_STATUS_PARAMS.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [in]  hNvGSyncDevice   The caller provides the handle of the GSync device for which to get parameters
    //! \param [out] *pStatusParams   The caller provides the storage space. NvAPI_GSync_GetStatusParameters populates *pStatusParams with
    //!                               values.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::NVAPI_INVALID_ARGUMENT            hNvGSyncDevice is NULL / pStatusParams is NULL.
    //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND     The queried Graphics system does not have any GSync Device.
    //!
    //! \ingroup gsyncapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GSync_GetStatusParameters(NvGSyncDeviceHandle hNvGSyncDevice, NV_GSYNC_STATUS_PARAMS *pStatusParams);

    //! @}

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_D3D9_RegisterResource
    //
    //! DESCRIPTION:    This API binds a resource (surface/texture) so that it can be retrieved
    //!                 internally by NVAPI.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! \param [in]     pResource      surface/texture
    //!
    //! \return ::NVAPI_OK, ::NVAPI_ERROR
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_RegisterResource(IDirect3DResource9 *pResource);
#endif // defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_D3D9_UnregisterResource
    //
    //! DESCRIPTION:     This API unbinds a resource (surface/texture) after use.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     pResource    surface/texture
    //!
    //! \return ::NVAPI_OK, ::NVAPI_ERROR
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_UnregisterResource(IDirect3DResource9 *pResource);

#endif // defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_AliasSurfaceAsTexture
    //
    //! \fn NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev,
    //!                                              IDirect3DSurface9* pSurface,
    //!                                              IDirect3DTexture9 **ppTexture,
    //!                                              DWORD dwFlag);
    //!   DESCRIPTION: Create a texture that is an alias of a surface registered with NvAPI.  The
    //!                new texture can be bound with IDirect3DDevice9::SetTexture().  Note that the texture must
    //!                be unbound before drawing to the surface again.
    //!                Unless the USE_SUPER flag is passed, MSAA surfaces will be resolved before
    //!                being used as a texture.  MSAA depth buffers are resolved with a point filter,
    //!                and non-depth MSAA surfaces are resolved with a linear filter.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]    pDev         The D3D device that owns the objects
    //! \param [in]    pSurface     Pointer to a surface that has been registered with NvAPI
    //!                             to which a texture alias is to be provided
    //! \param [out]   ppTexture    Fill with the texture created
    //! \param [in]    dwFlag       NVAPI_ALIAS_SURFACE_FLAG to describe how to handle the texture
    //!
    //! \retval ::NVAPI_OK                  completed request
    //! \retval ::NVAPI_INVALID_POINTER     A null pointer was passed as an argument
    //! \retval ::NVAPI_INVALID_ARGUMENT    One of the arguments was invalid, probably dwFlag.
    //! \retval ::NVAPI_UNREGISTERED_RESOURCE pSurface has not been registered with NvAPI
    //! \retval ::NVAPI_ERROR               error occurred
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup dx
    //! See NvAPI_D3D9_AliasSurfaceAsTexture().
    typedef enum
    {
        NVAPI_ALIAS_SURFACE_FLAG_NONE = 0x00000000,
        NVAPI_ALIAS_SURFACE_FLAG_USE_SUPER = 0x00000001, //!< Use the surface's msaa buffer directly as a texture, rather than resolving. (This is much slower, but potentially has higher quality.)
        NVAPI_ALIAS_SURFACE_FLAG_MASK = 0x00000001
    } NVAPI_ALIAS_SURFACE_FLAG;

    //! \ingroup dx
    NVAPI_INTERFACE NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9 *pDev,
                                                     IDirect3DSurface9 *pSurface,
                                                     IDirect3DTexture9 **ppTexture,
                                                     DWORD dwFlag);
#endif // defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_D3D9_StretchRectEx
    //
    //! DESCRIPTION:     This API copies the contents of the source resource to the destination
    //!                  resource.  This function can convert
    //!                  between a wider range of surfaces than
    //!                  IDirect3DDevice9::StretchRect.  For example, it can copy
    //!                  from a depth/stencil surface to a texture.
    //!
    //!                  The source and destination resources *must* be registered
    //!                  with NvAPI before being used with NvAPI_D3D9_StretchRectEx().
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     pDevice             The D3D device that owns the objects.
    //! \param [in]     pSourceResource     Pointer to the source resource.
    //! \param [in]     pSrcRect            Defines the rectangle on the source to copy from.  If NULL, copy from the entire resource.
    //! \param [in]     pDestResource       Pointer to the destination resource.
    //! \param [in]     pDstRect            Defines the rectangle on the destination to copy to.  If NULL, copy to the entire resource.
    //! \param [in]     Filter              Choose a filtering method: D3DTEXF_NONE, D3DTEXF_POINT, D3DTEXF_LINEAR.
    //!
    //! \retval ::NVAPI_OK                       completed request
    //! \retval ::NVAPI_INVALID_POINTER          An invalid pointer was passed as an argument (probably NULL)
    //! \retval ::NVAPI_INVALID_ARGUMENT         One of the arguments was invalid
    //! \retval ::NVAPI_UNREGISTERED_RESOURCE    a resource was passed in without being registered
    //! \retval ::NVAPI_ERROR                    error occurred
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_StretchRectEx(IDirect3DDevice9 *pDevice,
                                             IDirect3DResource9 *pSourceResource,
                                             CONST RECT *pSourceRect,
                                             IDirect3DResource9 *pDestResource,
                                             CONST RECT *pDestRect,
                                             D3DTEXTUREFILTERTYPE Filter);

#endif // defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_D3D9_ClearRT
    //
    //! DESCRIPTION:     This API Clears the currently bound render target(s) with the
    //!                  given color
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     pDevice             The D3D device that owns the objects.
    //! \param [in]     dwNumRects          The no of rectangles to clear. If 0, clear the entire surface (clipped to viewport)
    //! \param [in]     pRects              Defines the rectangles to clear.  Should be NULL if dwNumRects == 0
    //! \param [in]     r                   red component of the clear color
    //! \param [in]     g                   green component of the clear color
    //! \param [in]     b                   blue component of the clear color
    //! \param [in]     a                   alpha component of the clear color
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_ClearRT(IDirect3DDevice9 *pDevice,
                                       NvU32 dwNumRects,
                                       CONST RECT *pRects,
                                       float r, float g, float b, float a);
#endif // if defined(_D3D9_H_)

#if defined(_D3D9_H_) && defined(__cplusplus)
    //! SUPPORTED OS:  Windows 7 and higher
    //!

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_GetSurfaceHandle
    //
    //!  This function gets the handle of a given surface. This handle uniquely
    //!  identifies the surface through all NvAPI entries.
    //!
    //!
    //! \since Release: 313
    //!
    //! \param [in]     pSurface  Surface to be identified
    //! \param [out]    pHandle    Will be filled by the return handle
    //!
    //! \return An int which could be an NvAPI status or DX HRESULT code
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_GetSurfaceHandle(IDirect3DSurface9 *pSurface,
                                                NVDX_ObjectHandle *pHandle);

#endif // defined(_D3D9_H_) && defined(__cplusplus)

#if defined(_D3D9_H_) && defined(__cplusplus)
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! \addtogroup dxvidcontrol
    //! @{

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION_NAME: NvAPI_D3D9_VideoSetStereoInfo
    //
    //! \fn NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev,
    //!                                            NV_DX_VIDEO_STEREO_INFO *pStereoInfo);
    //! \code
    //!   DESCRIPTION: This api specifies the stereo format of a surface, so that the
    //!                surface could be used for stereo video processing or compositing.
    //!                In particular, this api could be used to link the left and right
    //!                views of a decoded picture.
    //!
    //! \since Release: 313
    //!
    //!         INPUT: pDev        - The device on which the stereo surface will be used
    //!                pStereoInfo - The stereo format of the surface
    //!
    //! RETURN STATUS: an int which could be an NvAPI status or DX HRESULT code
    //! \endcode
    ///////////////////////////////////////////////////////////////////////////////

#ifndef NV_STEREO_VIDEO_FORMAT_DEFINE
#define NV_STEREO_VIDEO_FORMAT_DEFINE


    typedef enum _NV_STEREO_VIDEO_FORMAT
    {
        NV_STEREO_VIDEO_FORMAT_NOT_STEREO = 0,

        NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_LR = 1,
        NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_RL = 2,
        NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_LR = 3,
        NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_RL = 4,
        NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_LR = 5,
        NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_RL = 6,
        NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR = 7,
        NV_STEREO_VIDEO_FORMAT_MONO_PLUS_OFFSET = 8,

        NV_STEREO_VIDEO_FORMAT_LAST = 9,
    } NV_STEREO_VIDEO_FORMAT;

#endif // NV_STEREO_VIDEO_FORMAT_DEFINE

    typedef struct _NV_DX_VIDEO_STEREO_INFO
    {
        NvU32 dwVersion;                  //!< Must be NV_DX_VIDEO_STEREO_INFO_VER
        NVDX_ObjectHandle hSurface;       //!< The surface whose stereo format is to be set
        NVDX_ObjectHandle hLinkedSurface; //!< The linked surface (must be valid when eFormat==NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR)
        NV_STEREO_VIDEO_FORMAT eFormat;   //!< Stereo format of the surface
        NvS32 sViewOffset;                //!< Signed offset of each view (positive offset indicating left view is shifted left)
        BOOL bStereoEnable;               //!< Whether stereo rendering should be enabled (if FALSE, only left view will be used)
    } NV_DX_VIDEO_STEREO_INFO;

//! Macro for constructing the version field of ::NV_DX_VIDEO_STEREO_INFO
#define NV_DX_VIDEO_STEREO_INFO_VER MAKE_NVAPI_VERSION(NV_DX_VIDEO_STEREO_INFO, 1)


    NVAPI_INTERFACE NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev,
                                                  NV_DX_VIDEO_STEREO_INFO *pStereoInfo);

//! @}
#endif // defined(_D3D9_H_) && defined(__cplusplus)

#if defined(__cplusplus) && defined(__d3d10_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D10_SetDepthBoundsTest
    //
    //!   DESCRIPTION: This function enables/disables the depth bounds test.
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //!   \param [in]  pDev         The device to set the depth bounds test
    //!   \param [in]  bEnable      Enable(non-zero)/disable(zero) the depth bounds test
    //!   \param [in]  fMinDepth    The minimum depth for the depth bounds test
    //!   \param [in]  fMaxDepth    The maximum depth for the depth bounds test \n
    //!                             The valid values for fMinDepth and fMaxDepth
    //!                             are such that 0 <= fMinDepth <= fMaxDepth <= 1
    //!
    //!   \return NVAPI_OK if the depth bounds test was correctly enabled or disabled
    //!
    //!   \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D10_SetDepthBoundsTest(ID3D10Device *pDev,
                                                   NvU32 bEnable,
                                                   float fMinDepth,
                                                   float fMaxDepth);

#endif // defined(__cplusplus) && defined(__d3d10_h__)

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_IsNvShaderExtnOpCodeSupported
    //
    //!   DESCRIPTION: This function checks if a nv HLSL shader extension opcode is
    //!                supported on current hardware. List of opcodes is in nvShaderExtnEnums.h
    //!                To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
    //!                in the hlsl shader code. See nvHLSLExtns.h for more details on supported opcodes.
    //!
    //!                This function can be called from a different thread than the one calling immediate device setstate functions.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]        pDev         The device on which to query for support,
    //!                                 should be a ID3D11Device+ device
    //! \param [in]        opCode       the opcode to check
    //! \param [out]       pSupported   true if supported, false otherwise
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::         NVAPI_OK if the call succeeded
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_IsNvShaderExtnOpCodeSupported(__in IUnknown *pDev,
                                                              __in NvU32 opCode,
                                                              __out bool *pSupported);

#endif // defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_SetNvShaderExtnSlot
    //
    //!   DESCRIPTION: This function sets the fake UAV slot that is used by Nvidia HLSL
    //!                shader extensions globally. All createShader calls made to the driver after
    //!                setting this slot would treat writes/reads to this UAV in a
    //!                different way. Applications are expected to bind null UAV to this slot.
    //!                The same slot is used for all shader stages.
    //!                To disable shader extensions the app need to set this uav slot to 0xFFFFFFFF.
    //!                To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
    //!                in the hlsl shader code. See nvHLSLExtns.h for more details.
    //!
    //!                This function can be called from a different thread than the one calling immediate device setstate functions.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]        pDev         The device for which to set the extension slot
    //!                                 should be a ID3D11Device+ device
    //! \param [in]        uavSlot      the uav slot to use
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::         NVAPI_OK    : success, the uavSlot was set sucessfully
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_SetNvShaderExtnSlot(__in IUnknown *pDev,
                                                    __in NvU32 uavSlot);

#endif // defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

#if defined(__cplusplus) && defined(__d3d12_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_SetNvShaderExtnSlotSpace
    //
    //!   DESCRIPTION: This function is specifically created for ray tracing since we do not
    //!                currently support PSOs with DXR.
    //!                This function sets the device's fake UAV slot and space that is used by Nvidia HLSL
    //!                shader extensions globally. All state objects created by the driver after
    //!                setting this slot would treat writes/reads to this UAV in a
    //!                different way. Applications are expected to bind null UAV to this slot.
    //!                The same slot is used for all shader stages.
    //!                To disable shader extensions the app need to set this uav slot to 0xFFFFFFFF.
    //!                To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
    //!                in the hlsl shader code. See nvHLSLExtns.h for more details.
    //!
    //!                This function can be called from a different thread than the one calling immediate device setstate functions.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]        pDev         The device for which to set the extension slot
    //!                                 should be a ID3D12Device+ device
    //! \param [in]        uavSlot      The uav slot to use
    //! \param [in]        uavSpace     The uav space to use
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::         NVAPI_OK    : success, the uavSlot and uavSpace were set sucessfully
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_SetNvShaderExtnSlotSpace(__in IUnknown *pDev,
                                                         __in NvU32 uavSlot,
                                                         __in NvU32 uavSpace);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread
    //
    //!   DESCRIPTION: This function is specifically created for ray tracing shaders since we do not
    //!                currently support PSOs with DXR.
    //!                This function sets the device's fake UAV slot that is used by Nvidia HLSL
    //!                shader extensions on local thread. All state objects created by the driver
    //!                on the same thread that call this function after setting this slot would treat writes/reads
    //!                to this UAV in a different way.
    //!                Applications are expected to bind null UAV to this slot.
    //!                The same slot is used for all shader stages for the device.
    //!                To disable shader extensions the app may set this uav slot to 0xFFFFFFFF.
    //!                To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
    //!                in the hlsl shader code. See nvHLSLExtns.h for more details.
    //!
    //!                This function can be called from a different thread than the one calling immediate device setstate functions.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //!
    //! \since Release: 387
    //!
    //! \param [in]        pDev         The device for which to set the extension slot
    //!                                 should be a ID3D12Device+ device
    //! \param [in]        uavSlot      the uav slot to use
    //! \param [in]        uavSpace     the uav space to use
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::         NVAPI_OK    : success, the uavSlot and uavSpace were set sucessfully
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread(__in IUnknown *pDev,
                                                                    __in NvU32 uavSlot,
                                                                    __in NvU32 uavSpace);

#endif // defined (__cplusplus) && defined (__d3d12_h__)

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_SetNvShaderExtnSlotLocalThread
    //
    //!   DESCRIPTION: This function sets the fake UAV slot that is used by Nvidia HLSL
    //!                shader extensions on local thread. All createShader calls on the same thread
    //!                that calls this function after setting this slot would treat writes/reads
    //!                to this UAV in a different way.
    //!                Applications are expected to bind null UAV to this slot.
    //!                The same slot is used for all shader stages.
    //!                To disable shader extensions the app may set this uav slot to 0xFFFFFFFF.
    //!                To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
    //!                in the hlsl shader code. See nvHLSLExtns.h for more details.
    //!
    //!                This function can be called from a different thread than the one calling immediate device setstate functions.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 387
    //!
    //! \param [in]        pDev         The device for which to set the extension slot
    //!                                 should be a ID3D11Device+ device
    //! \param [in]        uavSlot      the uav slot to use
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::         NVAPI_OK    : success, the uavSlot was set sucessfully
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_SetNvShaderExtnSlotLocalThread(__in IUnknown *pDev,
                                                               __in NvU32 uavSlot);

#endif // defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_BeginUAVOverlapEx
    //
    //!   DESCRIPTION: Causes the driver to skip synchronization that is normally needed when accessing UAVs.
    //!                Applications must use this with caution otherwise this might cause data hazards when
    //!                multiple draw calls/compute shader launches are accessing same memory locations
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]        *pDeviceOrContext     pointer to D3D11 device, or D3D11 device context
    //! \param [in]        insertWFIFlags        bit fields to indicate which WFI would be inserted (gfx / compute / both).
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    typedef enum _NVAPI_D3D11_INSERTWFI_FLAG
    {
        NVAPI_D3D_BEGIN_UAV_OVERLAP_NO_WFI = 0x00000000,   //!< no WFI
        NVAPI_D3D_BEGIN_UAV_OVERLAP_GFX_WFI = 0x00000001,  //!< (bit 0) force graphics WFI
        NVAPI_D3D_BEGIN_UAV_OVERLAP_COMP_WFI = 0x00000002, //!< (bit 1) force compute WFI
    } NVAPI_D3D11_INSERTWFI_FLAG;

    NVAPI_INTERFACE NvAPI_D3D11_BeginUAVOverlapEx(__in IUnknown *pDeviceOrContext, __in NvU32 insertWFIFlags);

#endif // defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_BeginUAVOverlap
    //
    //!   DESCRIPTION: Causes the driver to skip synchronization that is normally needed when accessing UAVs.
    //!                Applications must use this with caution otherwise this might cause data hazards when
    //!                multiple draw calls/compute shader launches are accessing same memory locations
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]        *pDeviceOrContext     pointer to D3D11 device, or D3D11 device context
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_BeginUAVOverlap(__in IUnknown *pDeviceOrContext);

#endif // defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_EndUAVOverlap
    //
    //!   DESCRIPTION: Re-enables driver synchronization between calls that access same UAVs
    //!                See NvAPI_D3D_BeginUAVOverlap for more details.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]        *pDeviceOrContext     pointer to D3D11 device, or D3D11 device context
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_EndUAVOverlap(__in IUnknown *pDeviceOrContext);

#endif // defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

#if defined(__cplusplus) && defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_GetResourceHandle
    //
    //! \code
    //!   DESCRIPTION: This function retrieves a driver handle to a DX10 resource
    //!
    //!         INPUT:  pDev         The device on which the resource was created
    //!                 pResource    The resource for which we want to retrieve a
    //!                              driver handle.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //!        OUTPUT:  phObject     Pointer to an NvAPI handle to be populated
    //!                              on success
    //!
    //! RETURN STATUS: NVAPI_OK if and only if phObject was populated with a valid
    //!                driver handle
    //! \endcode
    //! \ingroup nsightapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_GetResourceHandle(ID3D11Device *pDev,
                                                  ID3D11Resource *pResource,
                                                  NVDX_ObjectHandle *phObject);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_SetFPSIndicatorState
    //
    //!   DESCRIPTION: Display an overlay that tracks the number of times the app presents per second, or,
    //!      the number of frames-per-second (FPS)
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in] bool    Whether or not to enable the fps indicator.
    //!
    //! \return ::NVAPI_OK,
    //!         ::NVAPI_ERROR
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_SetFPSIndicatorState(IUnknown *pDev, NvU8 doEnable);

#endif // if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_Present
    //
    //! DESCRIPTION: This API presents the contents of the next buffer in the sequence of back buffers
    //!              owned by a IDirect3DDevice9 device.
    //!              This Present operation supports using a SwapGroup and SwapBarrier on the SwapChain
    //!              that owns the back buffer to be presented.
    //!
    //!          NOTE: NvAPI_D3D9_Present is a wrapper of the method IDirect3DDevice9::Present which
    //!                additionally notifies the D3D driver of the SwapChain used by the runtime for
    //!                presentation, thus allowing the D3D driver to apply SwapGroup and SwapBarrier
    //!                functionality to that SwapChain.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]    pDevice     The IDirect3DDevice9 interface that is used to issue the Present,
    //!                using the following IDirect3DDevice9::Present input parameters
    //! \param [in]    pSwapChain   Optional pointer to a IDirect3DSwapChain9 interface. If provided, the presentation is executed
    //!                             using this interface (i.e. pSwapChain->Present()) for the given swapchain only.
    //!                             If NULL, the presentation is executed on the device for all swapchains as in pDevice->Present()
    //! \param [in]    pSourceRect  A pointer to a RECT structure containing the source rectangle.
    //!                             If NULL, the entire source surface is presented.
    //! \param [in]    pDestRect      A pointer to a RECT structure containing the destination rectangle, in window client coordinates.
    //!                   If NULL, the entire client area is filled.
    //! \param [in]    hDestWindowOverride  A pointer to a destination window whose client area is taken as the target for this presentation.
    //!                                     If this value is NULL, then the hWndDeviceWindow member of D3DPRESENT_PARAMTERS is taken.
    //! \param [in]    pDirtyRegion (IN)   A pointer to a region to be presented. It must be NULL unless the swap chain was reated with
    //!                                    D3DSWAPEFFECT_COPY. If this value is non-NULL, the contained region is expressed in back buffer coordinates.
    //!
    //! \retval ::NVAPI_OK                 the Present operation was successfully executed
    //! \retval ::NVAPI_D3D_DEVICE_LOST    D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET, the caller has to reset device
    //! \retval ::NVAPI_DEVICE_BUSY        the Present operation failed with an error other than D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET
    //! \retval ::NVAPI_ERROR              the communication with the D3D driver failed, SwapGroup/SwapBarrier may not be possible.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
    //!
    //!\ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_Present(IDirect3DDevice9 *pDevice,
                                       IDirect3DSwapChain9 *pSwapChain,
                                       const RECT *pSourceRect,
                                       const RECT *pDestRect,
                                       HWND hDestWindowOverride,
                                       const RGNDATA *pDirtyRegion);
#endif // if defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_QueryFrameCount
    //
    //!   DESCRIPTION: This API queries the universal framecounter of the Quadro-Sync master device.
    //!
    //! \param [in]   pDevice            The caller provides the DX9 device that has access to the Quadro-Sync device
    //! \param [out]  pFrameCount        The caller provides the storage space where the framecount is stored.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                  *pFrameCount populated with framecount value.
    //! \retval ::NVAPI_ERROR               The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT    One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_QueryFrameCount(IDirect3DDevice9 *pDevice,
                                               NvU32 *pFrameCount);
#endif // if defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_ResetFrameCount
    //
    //!   DESCRIPTION: This API resets the universal framecounter on the Quadro-Sync master device.
    //!
    //! \param [in]   pDevice            The caller provides the DX9 device that has access to the Quadro-Sync device
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                   framecounter has been reset
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED  NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_ResetFrameCount(IDirect3DDevice9 *pDevice);
#endif // if defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_QueryMaxSwapGroup
    //
    //!   DESCRIPTION: This API queries the number of supported SwapGroups and SwapBarriers in the graphics system.
    //!
    //! \param [in]   pDevice              The caller provides the DirectX 9 device that is used as a swapgroup client
    //! \param [out]  pMaxGroups           The caller provides the storage space where the number of available SwapGroups is stored.
    //! \param [out]  pMaxBarriers         The caller provides the storage space where the number of available SwapBarriers is stored.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                   the number of SwapGroups and SwapBarriers has been stored
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED  NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_QueryMaxSwapGroup(IDirect3DDevice9 *pDevice,
                                                 NvU32 *pMaxGroups,
                                                 NvU32 *pMaxBarriers);
#endif // if defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_QuerySwapGroup
    //
    //!   DESCRIPTION: This API queries the current SwapGroup and SwapBarrier that a SwapChain of a specific client device is bound to.
    //!
    //! \param [in]   pDevice            The caller provides the DirectX 9 device that is used as a swapgroup client
    //! \param [in]   pSwapChain         The caller provides the IDirect3DSwapChain9 interface as a handle to the SwapChain
    //!                                  that belongs to the swapgroup client device
    //! \param [out]  pSwapGroup         The caller provides the storage space where the current SwapGroup is stored.
    //! \param [out]  pSwapBarrier       The caller provides the storage space where the current SwapBarrier is stored.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                   the current SwapGroup and SwapBarrier has been stored
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED  NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_QuerySwapGroup(IDirect3DDevice9 *pDevice,
                                              IDirect3DSwapChain9 *pSwapChain,
                                              NvU32 *pSwapGroup,
                                              NvU32 *pSwapBarrier);
#endif // if defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_JoinSwapGroup
    //
    //!   DESCRIPTION: This API causes the SwapChain of a SwapGroup client to join or leave the specified SwapGroup.
    //!
    //! \param [in]    pDevice               The caller provides the DirectX 9 device that is used as a swapgroup client
    //! \param [in]    pSwapChain            The caller provides the IDirect3DSwapChain9 interface as a handle to the SwapChain
    //!                                      that belongs to the swapgroup client device
    //! \param [in]    group                 The caller specifies the SwapGroup which the SwapChain should join.
    //!                                      - If the value of group is zero, the SwapChain leaves the SwapGroup.
    //!                                      - The SwapChain joins a SwapGroup if the SwapGroup number is a positive integer less than or
    //!                                        equal to the maximum number of SwapGroups queried by NvAPI_SwapGroup_QueryMaxSwapGroup.
    //! \param [in]    blocking              The caller specifies that a presentation of this SwapChain should return immediately or block
    //!                                      until all members of the SwapGroup are ready and the presentation was actually executed.
    //!                                      A boolean value of false means the Present operation returns immediately and a value of true
    //!                                      means the Present operation is blocking.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                   the SwapChain joined/left the SwapGroup accordingly
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED  NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_JoinSwapGroup(IDirect3DDevice9 *pDevice,
                                             IDirect3DSwapChain9 *pSwapChain,
                                             NvU32 group,
                                             BOOL blocking);
#endif // if defined(_D3D9_H_)

#if defined(_D3D9_H_)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_BindSwapBarrier
    //
    //!   DESCRIPTION: This API causes a SwapGroup to be bound to or released from the specified SwapBarrier.
    //!
    //! \param [in]    pDevice    The caller provides the DirectX 9 device that is used as a swapgroup client
    //! \param [in]    group      The caller specifies the SwapGroup to be bound to the SwapBarrier.
    //! \param [in]    barrier    The caller specifies the SwapBarrier that the SwapGroup should be bound to.
    //!                              - If the value of barrier is zero, the SwapGroup will be released from the SwapBarrier.
    //!                              - The SwapGroup will be bound to the SwapBarrier if the value of barrier is a positive
    //!                                integer less than or equal to the maximum number of SwapBarriers queried by NvAPI_SwapGroup_QueryMaxSwapGroup.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                  the SwapGroup is bound to or released from the specified SwapBarrier
    //! \retval ::NVAPI_ERROR               The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT    One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_BindSwapBarrier(IDirect3DDevice9 *pDevice,
                                               NvU32 group,
                                               NvU32 barrier);
#endif // if defined(_D3D9_H_)

#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_Present
    //
    //! DESCRIPTION: Presents the contents of the next buffer in the sequence of back buffers
    //!              owned by a D3D device.
    //!              This Present operation supports using a SwapGroup and SwapBarrier on the SwapChain
    //!              that owns the back buffer to be presented.
    //!
    //!          NOTE: NvAPI_D3D1x_Present is a wrapper of the method IDXGISwapChain::Present which
    //!                additionally notifies the D3D driver of the SwapChain used by the runtime for
    //!                presentation, thus allowing the D3D driver to apply SwapGroup and SwapBarrier
    //!                functionality to that SwapChain.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     pDevice          The D3D device interface that is used to issue the Present operation,
    //!                                 using the following IDirect3DDevice9::Present input parameters.
    //!                                  pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
    //! \param [in]     pSwapChain       The IDXGISwapChain interface that is intended to present
    //! \param [in]     SyncInterval     An integer that specifies the how to synchronize presentation of a frame with the vertical blank.
    //!                                          Values are:
    //!                                          - 0:  The presentation occurs immediately, there is no synchronization.
    //!                                          - 1,2,3,4 : Synchronize presentation after the n'th vertical blank.
    //! \param [in]     Flags            An integer value that contains swap-chain presentation options as defined in DXGI_PRESENT.
    //!
    //! \retval ::NVAPI_OK                 the Present operation was successfully executed
    //! \retval ::NVAPI_DEVICE_BUSY        the Present operation failed with an error DXGI_ERROR_DEVICE_RESET or DXGI_ERROR_DEVICE_REMOVED,
    //                                     DXGI_STATUS_OCCLUDED, or D3DDDIERR_DEVICEREMOVED.
    //! \retval ::NVAPI_ERROR              the communication with the D3D driver failed, SwapGroup/SwapBarrier may not be possible.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D1x_Present(IUnknown *pDevice,
                                        IDXGISwapChain *pSwapChain,
                                        UINT SyncInterval,
                                        UINT Flags);
#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)

#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_QueryFrameCount
    //
    //!   DESCRIPTION: This API queries the universal framecounter of the Quadro-Sync master device.
    //!
    //! \param [in]    pDevice           The caller provides the D3D device that has access to the Quadro-Sync device,
    //!                                  pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
    //! \param [out]   pFrameCount       The caller provides the storage space where the framecount is stored.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                   *pFrameCount populated with framecount value.
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED  NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D1x_QueryFrameCount(IUnknown *pDevice,
                                                NvU32 *pFrameCount);
#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)

#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_ResetFrameCount
    //
    //!   DESCRIPTION: This API resets the universal framecounter on the Quadro-Sync master device.
    //!
    //! \param [in]    pDevice         The caller provides the D3D device that has access to the Quadro-Sync device,
    //!                                pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                   framecounter has been reset
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     pDevice arg passed in is invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED  NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D1x_ResetFrameCount(IUnknown *pDevice);
#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)

#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_QueryMaxSwapGroup
    //
    //!   DESCRIPTION: This API queries the number of supported SwapGroups and SwapBarriers in the graphics system.
    //!
    //! \param [in]    pDevice        The caller provides the D3D device that is intended to use SwapGroup functionality.
    //!                               pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
    //! \param [out]   pMaxGroups     The caller provides the storage space where the number of available SwapGroups is stored.
    //! \param [out]   pMaxBarriers   The caller provides the storage space where the number of available SwapBarriers is stored.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                  the number of SwapGroups and SwapBarriers has been stored
    //! \retval ::NVAPI_ERROR               The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT    One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D1x_QueryMaxSwapGroup(IUnknown *pDevice,
                                                  NvU32 *pMaxGroups,
                                                  NvU32 *pMaxBarriers);
#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)

#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_QuerySwapGroup
    //
    //!   DESCRIPTION: This API queries the current SwapGroup and SwapBarrier that a SwapChain of a specific client device is bound to.
    //!
    //! \param [in]    pDevice            The caller provides the D3D device that owns the SwapChain used as a SwapGroup client.
    //!                                   pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
    //! \param [in]    pSwapChain         The IDXGISwapChain interface that is used as the SwapGroup client.
    //!
    //! \param [out]   pSwapGroup         The caller provides the storage space where the current SwapGroup is stored.
    //! \param [out]   pSwapBarrier       The caller provides the storage space where the current SwapBarrier is stored.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                   the current SwapGroup and SwapBarrier has been stored
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED  NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D1x_QuerySwapGroup(IUnknown *pDevice,
                                               IDXGISwapChain *pSwapChain,
                                               NvU32 *pSwapGroup,
                                               NvU32 *pSwapBarrier);
#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)

#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_JoinSwapGroup
    //
    //!   DESCRIPTION: This API causes the SwapChain of a SwapGroup client to join or leave the specified SwapGroup.
    //!
    //! \param [in]   pDevice            The caller provides the D3D device that owns the SwapChain used as a SwapGroup client.
    //!                                  pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
    //! \param [in]   pSwapChain         The IDXGISwapChain interface that is used as the SwapGroup client.
    //! \param [in]   group              The caller specifies the SwapGroup which the SwapChain should join.
    //!                                      - If the value of group is zero, the SwapChain leaves the SwapGroup.
    //!                                      - The SwapChain joins a SwapGroup if the SwapGroup number is a positive integer less than or
    //!                                        equal to the maximum number of SwapGroups queried by NvAPI_SwapGroup_QueryMaxSwapGroup.
    //! \param [in]   blocking           The caller specifies that a presentation of this SwapChain should return immediately or block
    //!                                  until all members of the SwapGroup are ready and the presentation was actually executed.
    //!                                  A boolean value of false means the Present operation returns immediately and a value of true
    //!                                  means the Present operation is blocking.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                   the SwapChain joined/left the SwapGroup accordingly
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED  NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D1x_JoinSwapGroup(IUnknown *pDevice,
                                              IDXGISwapChain *pSwapChain,
                                              NvU32 group,
                                              BOOL blocking);
#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)

#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_BindSwapBarrier
    //
    //!   DESCRIPTION: This API causes a SwapGroup to be bound to or released from the specified SwapBarrier.
    //!
    //! \param [in]   pDevice            The caller provides the D3D device that owns the SwapChain used as a SwapGroup client.
    //!                                  pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
    //! \param [in]   group              The caller specifies the SwapGroup to be bound to the SwapBarrier.
    //! \param [in]   barrier            The caller specifies the SwapBarrier that the SwapGroup should be bound to.
    //!                                      - If the value of barrier is zero, the SwapGroup releases the SwapBarrier.
    //!                                      - The SwapGroup will be bound to the SwapBarrier if the value of barrier is a positive
    //!                                        integer less than or equal to the maximum number of SwapBarriers queried by NvAPI_D3D1x_QueryMaxSwapGroup.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \retval ::NVAPI_OK                  the SwapGroup is bound to the specified SwapBarrier
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     One or more args passed in are invalid.
    //! \retval ::NVAPI_API_NOT_INITIALIZED  NvAPI was not yet initialized.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D1x_BindSwapBarrier(IUnknown *pDevice,
                                                NvU32 group,
                                                NvU32 barrier);
#endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_QueryPresentBarrierSupport
    //
    //!   DESCRIPTION: This API returns if presentBarrier feature is supported on the specified device.
    //!
    //! \since Release: 470
    //!
    //! \param [in]     pDevice               The ID3D12Device device which owns the SwapChain as a PresentBarrier client.
    //! \param [out]    pSupported            Pointer to a boolean returning true if supported, false otherwise.
    //!
    //! \return ::NVAPI_OK                     the call succeeded
    //! \return ::NVAPI_ERROR                  the call failed
    //! \return ::NVAPI_NO_IMPLEMENTATION      the API is not implemented
    //! \return ::NVAPI_INVALID_POINTER        an invalid pointer was passed as an argument
    //! \retval ::NVAPI_API_NOT_INITIALIZED    NvAPI not initialized
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_QueryPresentBarrierSupport(__in ID3D12Device *pDevice, __out bool *pSupported);
#endif // defined(__cplusplus) && defined(__d3d12_h__)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreatePresentBarrierClient
    //
    //!   DESCRIPTION: This API returns an NvPresentBarrierClientHandle handle, which
    //!                owns the swapchain to be synchronized through PresentBarrier.
    //!                This handle is used in other PresentBarrier functions.
    //!
    //! \since Release: 470
    //!
    //! \param [in]   pDevice                  The ID3D12Device device which owns the SwapChain as a PresentBarrier client.
    //! \param [in]   pSwapChain               The IDXGISwapChain interface that presentBarrier is operated on.
    //! \param [OUT]  pPresentBarrierClient    Pointer to an NvPresentBarrierClientHandle handle created by the driver
    //!                                        on success.
    //!
    //! \return ::NVAPI_OK                     the call succeeded
    //! \return ::NVAPI_ERROR                  the call failed
    //! \return ::NVAPI_INVALID_POINTER        an invalid pointer was passed as an argument
    //! \return ::NVAPI_NO_IMPLEMENTATION      the API is not implemented
    //! \retval ::NVAPI_API_NOT_INITIALIZED    NvAPI not initialized
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_CreatePresentBarrierClient(__in ID3D12Device *pDevice,
                                                           __in IDXGISwapChain *pSwapChain,
                                                           __out NvPresentBarrierClientHandle *pPresentBarrierClient);
#endif // defined(__cplusplus) && defined(__d3d12_h__)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_RegisterPresentBarrierResources
    //
    //!   DESCRIPTION: This API registers scanout resources of a presentBarrier client
    //!                to the presentBarrier, and a fence object which is used for
    //!                presentBarrier synchronization. Once the registration has completed
    //!                successfully, it is not allowed to add additional resources, i.e. the
    //!                number of back buffers and fence object are not allowed to be
    //!                changed. However, application must call this function whenever the
    //!                back buffers are changed, e.g. ResizeBuffers() is called.
    //!
    //! \since Release: 470
    //!
    //! \param [in]   presentBarrierClient The NvPresentBarrierClientHandle client handle that owns the resources.
    //! \param [in]   pFence               An ID3D12Fence object created by the application and used for present
    //!                                    synchronization through presentBarrier. Application must wait on this
    //!                                    fence to ensure the scanout resources are ready for use in the next
    //!                                    rendering loop. The fence is only signaled by the driver and must not
    //!                                    be signaled through any other queue command. The fence value must be
    //!                                    monotonically increasing on every present call, and tracked by the
    //!                                    application.
    //! \param [in]   ppResources          An array of ID3D12Resource to be synchronized through presentBarrier, and
    //!                                    the size is specified by numResources.
    //! \param [in]   numResources         The number of ID3D12Resource elements in ppResources.
    //!
    //! \return ::NVAPI_OK                     the call succeeded
    //! \return ::NVAPI_ERROR                  the call failed
    //! \return ::NVAPI_NO_IMPLEMENTATION      the API is not implemented
    //! \return ::NVAPI_INVALID_POINTER        an invalid pointer was passed as an argument
    //! \return ::NVAPI_INVALID_HANDLE         an invalid NvPresentBarrierClientHandle was passed as an argument
    //! \return ::NVAPI_INVALID_ARGUMENT       an invalid number of resources was passed as an argument
    //! \retval ::NVAPI_API_NOT_INITIALIZED    NvAPI not initialized
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_RegisterPresentBarrierResources(__in NvPresentBarrierClientHandle presentBarrierClient,
                                                                __in ID3D12Fence *pFence,
                                                                __in ID3D12Resource **ppResources,
                                                                __in NvU32 numResources);
#endif // defined(__cplusplus) && defined(__d3d12_h__)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DestroyPresentBarrierClient
    //
    //!   DESCRIPTION: This API destroys a presentBarrier client, and must be called
    //!                after client leaves presentBarrier to avoid memory leak.
    //!
    //! \since Release: 470
    //!
    //! \param [in]   presentBarrierClient     An NvPresentBarrierClientHandle handle created by NvAPI_xxxx_CreatedPresentBarrierClient
    //!
    //! \return ::NVAPI_OK                     the call succeeded
    //! \return ::NVAPI_INVALID_HANDLE         an invalid NvPresentBarrierClientHandle was passed as an argument
    //! \return ::NVAPI_NO_IMPLEMENTATION      the API is not implemented
    //! \retval ::NVAPI_API_NOT_INITIALIZED    NvAPI not initialized
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DestroyPresentBarrierClient(__in NvPresentBarrierClientHandle presentBarrierClient);
#endif // defined(__cplusplus)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus)
    typedef struct _NV_JOIN_PRESENT_BARRIER_PARAMS
    {
        NvU32 dwVersion; //!< Must be NV_JOIN_PRESENT_BARRIER_PARAMS_VER1
    } NV_JOIN_PRESENT_BARRIER_PARAMS;

//! Macro for constructing the version field of ::NV_JOIN_PRESENT_BARRIER_PARAMS
#define NV_JOIN_PRESENT_BARRIER_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_JOIN_PRESENT_BARRIER_PARAMS, 1)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_JoinPresentBarrier
    //
    //!   DESCRIPTION: This API adds a registered PresentBarrier client to the presentBarrier.
    //!                If the call suceeds, image present of the registered scanout resources
    //!                from this client is under the synchronization of presentBarrier.
    //!
    //! \since Release: 470
    //!
    //! \param [in]  presentBarrierClient     An NvPresentBarrierClientHandle handle created by NvAPI_xxxx_CreatedPresentBarrierClient
    //! \param [in]  pParams                  Parameters to joining presentBarrier.
    //!
    //! \retval ::NVAPI_OK                    the call succeeded
    //! \retval ::NVAPI_ERROR                 the call failed
    //! \retval ::NVAPI_NO_IMPLEMENTATION     the interface is not implemented
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION the version of data structure is not correct
    //! \retval ::NVAPI_INVALID_HANDLE        an invalid NvPresentBarrierClientHandle was passed as an argument
    //! \retval ::NVAPI_INVALID_POINTER       an invalid pointer was passed as an argument (probably NULL)
    //! \retval ::NVAPI_API_NOT_INITIALIZED   NvAPI not initialized
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_JoinPresentBarrier(__in NvPresentBarrierClientHandle presentBarrierClient, __in NV_JOIN_PRESENT_BARRIER_PARAMS *pParams);
#endif // defined(__cplusplus)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_LeavePresentBarrier
    //
    //!   DESCRIPTION: This API removes a registered client from presentBarrier. If this
    //!                client does not join presentBarrier, this function does nothing.
    //!
    //! \since Release: 470
    //!
    //! \param [in]  presentBarrierClient     An NvPresentBarrierClientHandle handle created by NvAPI_xxxxx_CreatePresentBarrierClient.
    //!
    //! \retval ::NVAPI_OK                    the call succeeded
    //! \retval ::NVAPI_ERROR                 the call failed
    //! \retval ::NVAPI_NO_IMPLEMENTATION     the interface is not implemented
    //! \retval ::NVAPI_INVALID_HANDLE        an invalid NvPresentBarrierClientHandle was passed as an argument
    //! \retval ::NVAPI_API_NOT_INITIALIZED   NvAPI not initialized
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_LeavePresentBarrier(__in NvPresentBarrierClientHandle presentBarrierClient);
#endif // defined(__cplusplus)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus)

#define NV_PRESENT_BARRIER_FRAME_STATICS_VER1 MAKE_NVAPI_VERSION(NV_PRESENT_BARRIER_FRAME_STATISTICS, 1)


    typedef enum _NV_PRESENT_BARRIER_SYNC_MODE
    {
        PRESENT_BARRIER_NOT_JOINED = 0x00000000,   //!< The client hasn't joined presentBarrier
        PRESENT_BARRIER_SYNC_CLIENT = 0x00000001,  //!< The client joined the presentBarrier, but is not synchronized with
                                                   //!  any other presentBarrier clients. This happens if the back buffers
                                                   //!  of this client are composited instead of being flipped out to screen
        PRESENT_BARRIER_SYNC_SYSTEM = 0x00000002,  //!< The client joined the presentBarrier, and is synchronized with other
                                                   //!  presentBarrier clients within the system
        PRESENT_BARRIER_SYNC_CLUSTER = 0x00000003, //!< The client joined the presentBarrier, and is synchronized with other
                                                   //!  clients within the system and across systems through QSync devices
    } NV_PRESENT_BARRIER_SYNC_MODE;

    typedef struct _NV_PRESENT_BARRIER_FRAME_STATISTICS
    {
        NvU32 dwVersion;                       //!< Must be NV_PRESENT_BARRIER_FRAME_STATICS_VER1
        NV_PRESENT_BARRIER_SYNC_MODE SyncMode; //!< The presentBarrier mode of this client from last present call
        NvU32 PresentCount;                    //!< The total count of times that a frame has been presented from this
                                               //!  client after it joined presentBarrier successfully.
        NvU32 PresentInSyncCount;              //!< The total count of times that a frame has been presented from this
                                               //!  client and that has happened since the returned SyncMode is
                                               //!  PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER.
                                               //!  If the returned SyncMode is any other mode, this value is 0.
                                               //!  This count is set back to 0 in case the SyncMode switches away from
                                               //!  PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER.
        NvU32 FlipInSyncCount;                 //!< The total count of flips from this client since the returned SyncMode
                                               //!  is PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER.
                                               //!  If the returned SyncMode is any other mode, this value is 0.
                                               //!  This count is set back to 0 in case the SyncMode switches away from
                                               //!  PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER.
        NvU32 RefreshCount;                    //!< The total count of v-blanks since the returned SyncMode of this client
                                               //!  is PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER.
                                               //!  If the returned SyncMode is any other mode, this value is 0.
                                               //!  This count is set back to 0 in case the SyncMode switches away from
                                               //!  PRESENT_BARRIER_SYNC_SYSTEM or PRESENT_BARRIER_SYNC_CLUSTER.
    } NV_PRESENT_BARRIER_FRAME_STATISTICS;

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_QueryPresentBarrierFrameStatistics
    //
    //!   DESCRIPTION: This API returns the presentBarrier frame statistics of last
    //!                present call from this client. If the client did not join
    //!                presentBarrier, the SyncMode is returned as PRESENT_BARRIER_NOT_JOINED,
    //!                and all other fields are reset. Driver does not retain any
    //!                presentBarrier info of the client once it leaves presentBarrier.
    //!
    //! \since Release: 470
    //!
    //! \param [in]   presentBarrierClient    An NvPresentBarrierClientHandle handle created by NvAPI_xxxxx_CreatePresentBarrierClient.
    //! \param [out]  pFrameStats             Pointer to NV_PRESENT_BARRIER_FRAME_STATISTICS structure about presentBarrier statistics.
    //!
    //! \retval ::NVAPI_OK                    the call succeeded
    //! \retval ::NVAPI_ERROR                 the call failed
    //! \retval ::NVAPI_NO_IMPLEMENTATION     the interface is not implemented
    //! \retval ::NVAPI_INVALID_HANDLE        an invalid NvPresentBarrierClientHandle was passed as an argument
    //! \retval ::NVAPI_INVALID_POINTER       an invalid pointer was passed as an argument (probably NULL)
    //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION invalid version of frameStatistics params
    //! \retval ::NVAPI_API_NOT_INITIALIZED   NvAPI not initialized
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_QueryPresentBarrierFrameStatistics(__in NvPresentBarrierClientHandle presentBarrierClient,
                                                             __out NV_PRESENT_BARRIER_FRAME_STATISTICS *pFrameStats);
#endif // defined(__cplusplus)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreateDDisplayPresentBarrierClient
    //
    //!   DESCRIPTION: This API returns an NvPresentBarrierClientHandle handle.
    //!
    //! \since Release: 510
    //!
    //! \param [in]   pDevice                  The ID3D12Device device which executes the rendering commands of this PresentBarrier
    //!                                        client. It must be created on the same adapter as DisplayDevice.
    //! \param [in]   sourceId                 The adapter-relative identifier for the DisplaySource obtained from DisplaySource.SourceId().
    //! \param [OUT]  pPresentBarrierClient    Pointer to an NvPresentBarrierClientHandle handle created by the driver on success.
    //!
    //! \return ::NVAPI_OK                     the call succeeded
    //! \return ::NVAPI_ERROR                  the call failed
    //! \return ::NVAPI_INVALID_POINTER        an invalid pointer was passed as an argument
    //! \return ::NVAPI_INVALID_HANDLE         the input displaySource handle is not owned by the process
    //! \return ::NVAPI_NOT_SUPPORTED          PresentBarrier featue is not supported on this configuration
    //! \return ::NVAPI_NO_IMPLEMENTATION      the API is not implemented
    //! \retval ::NVAPI_API_NOT_INITIALIZED    NvAPI not initialized
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_CreateDDisplayPresentBarrierClient(__in ID3D12Device *pDevice, __in NvU32 sourceId, __out NvPresentBarrierClientHandle *pPresentBarrierClient);
#endif // defined(__cplusplus) && defined(__d3d12_h__)

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__))

    enum NVAPI_QUAD_FILLMODE
    {
        NVAPI_QUAD_FILLMODE_DISABLED = 0,
        NVAPI_QUAD_FILLMODE_BBOX = 1,
        NVAPI_QUAD_FILLMODE_FULL_VIEWPORT = 2,
    };

#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__))

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    typedef struct NvAPI_D3D11_RASTERIZER_DESC_EX
    {
        // D3D11_RASTERIZER_DESC member variables
        D3D11_FILL_MODE FillMode;
        D3D11_CULL_MODE CullMode;
        BOOL FrontCounterClockwise;
        INT DepthBias;
        FLOAT DepthBiasClamp;
        FLOAT SlopeScaledDepthBias;
        BOOL DepthClipEnable;
        BOOL ScissorEnable;
        BOOL MultisampleEnable;
        BOOL AntialiasedLineEnable;

        // NvAPI_D3D11_RASTERIZER_DESC_EX specific member variables
        NvU32 ForcedSampleCount;                //<! Added DX 11.1, part of _DESC1 version of this struct.
        bool ProgrammableSamplePositionsEnable; //<! enable Programmable Samples feature
        bool InterleavedSamplingEnable;         //<! when jitter is enabled, an app need to fill the whole arrays below, otherwise only as much entries as samples
        NvU8 SampleCount;                       //<! number of samples. In TIR N->1 it needs to match N, in non-TIR it needs to match RT sample count. Ignored if ForcePerSampleInterlock is set
        NvU8 SamplePositionsX[16];              //<! x positions in API sample order
        NvU8 SamplePositionsY[16];              //<! y positions in API sample order
        bool ConservativeRasterEnable;          //<! rasterize all pixels a primitive touches in any way instead of just those with the centroid covered.
        NVAPI_QUAD_FILLMODE QuadFillMode;       //<! Fill a triangle outside its bounds as a screen-aligned quad, matching the tri's bounding-box or filling the full viewport.
        bool PostZCoverageEnable;               //<! Enable pixel-shader input SV_COVERAGE to account for z-test in early-z mode.
        bool CoverageToColorEnable;             //<! Enable output of coverage to a color render-target.
        NvU8 CoverageToColorRTIndex;            //<! Index of RT for coverage-to-color.
        bool TargetIndepentRasterWithDepth;     //<! TargetIndepentRasterWithDepth = TRUE enables rasterezation mode where sample count of both raster and depth-stencil buffer are equal and do not match RT sample count.
        NvU8 reserved[63];                      //<! reserved for expansion, set to zero.
    } NvAPI_D3D11_RASTERIZER_DESC_EX;

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateRasterizerState
    //
    //! \code
    //!   DESCRIPTION: This function is an extension of ID3D11Device::CreateRasterizerState with additional raster states
    //!
    //!                If programmable sample positions is used, to decompress the surface using the currently bound
    //!                programmable sample positions, use function NvAPI_D3D11_DecompressView.
    //!
    //!                This function is  free-threaded create compatible i.e. it can be called from a different thread
    //!                than the one calling immediate device setstate functions.
    //!
    //!         \param [in]        pDevice             current d3d device
    //!         \param [in]        pRasterizerDesc     Rasterizer state description of type NVAPI_D3D11_RASTERIZER_DESC_EX
    //!         \param [out]       ppRasterizerState   ID3D11RasterizerState
    //!
    //!
    //! \return ::NVAPI_OK     if the call succeeds.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_CreateRasterizerState(__in ID3D11Device *pDevice,
                                                      __in const NvAPI_D3D11_RASTERIZER_DESC_EX *pRasterizerDesc,
                                                      __out ID3D11RasterizerState **ppRasterizerState);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_ConfigureAnsel
    //
    //! \code
    //!   DESCRIPTION: This function configure the setting of AnselShim, including hotkey.
    //!
    //!         \param [in]        pDevice             current d3d device (should be ID3D11Device, ID3D10Device, or ID3D12Device)
    //!         \param [in]        pAnselConfig        configuration of Ansel to be set, including hotkey setting
    //!
    //!
    //! \return ::NVAPI_OK     if the call succeeds.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    typedef enum _NVAPI_ANSEL_FEATURE
    {
        NVAPI_ANSEL_FEATURE_UNKNOWN = 0,
        NVAPI_ANSEL_FEATURE_BLACK_AND_WHITE = 1,
        NVAPI_ANSEL_FEATURE_HUDLESS = 2
    } NVAPI_ANSEL_FEATURE;

    typedef enum _NVAPI_ANSEL_FEATURE_STATE
    {
        NVAPI_ANSEL_FEATURE_STATE_UNKNOWN = 0,
        NVAPI_ANSEL_FEATURE_STATE_ENABLE = 1, //!< Toggle feature on
        NVAPI_ANSEL_FEATURE_STATE_DISABLE = 2 //!< Toggle feature off
    } NVAPI_ANSEL_FEATURE_STATE;

    typedef enum _NVAPI_ANSEL_HOTKEY_MODIFIER
    {
        NVAPI_ANSEL_HOTKEY_MODIFIER_UNKNOWN = 0,
        NVAPI_ANSEL_HOTKEY_MODIFIER_CTRL = 1,  //!< Use control in the hotkey combination
        NVAPI_ANSEL_HOTKEY_MODIFIER_SHIFT = 2, //!< Use shift in the hotkey combination
        NVAPI_ANSEL_HOTKEY_MODIFIER_ALT = 3    //!< Use alternate in the hotkey combination
    } NVAPI_ANSEL_HOTKEY_MODIFIER;

    typedef struct NVAPI_ANSEL_FEATURE_CONFIGURATION_STRUCT
    {
        NVAPI_ANSEL_FEATURE featureId;          //!< Id of the feature
        NVAPI_ANSEL_FEATURE_STATE featureState; //!< Whether the feature is enabled or not
        UINT hotkey;                            //!< An optional virtual key associated with this feature
    } NVAPI_ANSEL_FEATURE_CONFIGURATION_STRUCT;

    typedef struct NVAPI_ANSEL_CONFIGURATION_STRUCT_V1
    {
        NvU32 version;                                            //!< Structure version
        NVAPI_ANSEL_HOTKEY_MODIFIER hotkeyModifier;               //!< Modifier key to use in hotkey combination
        UINT keyEnable;                                           //!< VKEY to enable/disable Ansel
        UINT numAnselFeatures;                                    //!< Number of features in pAnselFeatures
        NVAPI_ANSEL_FEATURE_CONFIGURATION_STRUCT *pAnselFeatures; //!< Array of features configurations
    } NVAPI_ANSEL_CONFIGURATION_STRUCT_V1;

    typedef NVAPI_ANSEL_CONFIGURATION_STRUCT_V1 NVAPI_ANSEL_CONFIGURATION_STRUCT;

#define NVAPI_ANSEL_CONFIGURATION_STRUCT_VER1 MAKE_NVAPI_VERSION(NVAPI_ANSEL_CONFIGURATION_STRUCT_V1, 1)

#define NVAPI_ANSEL_CONFIGURATION_STRUCT_VER NVAPI_ANSEL_CONFIGURATION_STRUCT_VER1


    NVAPI_INTERFACE NvAPI_D3D_ConfigureAnsel(__in IUnknown *pDevice,
                                             __in NVAPI_ANSEL_CONFIGURATION_STRUCT *pNLSConfig);

#endif // defined (__cplusplus) && (defined(_D3D9_H_) || defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__))

    //! SUPPORTED OS:  Windows 8 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_2_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateTiledTexture2DArray
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: Tiled resource is supported for Texture2D Array, however, but only when mip packing is not triggered.
    //!                So any mip level cannot be smaller than a single tile size(64KB).
    //!                This set of API is an extension of D3D11 support for tiled resource to allow a tiled texture2D array with mip packing.
    //!                If any of API from this set is used, using all of them is highly recommended.
    //!                It includes NvAPI_D3D11_CreateTiledTexture2DArray, NvAPI_D3D11_TiledTexture2DArrayGetDesc,
    //!                NvAPI_D3D11_UpdateTileMappings, NvAPI_D3D11_CopyTileMappings, NvAPI_D3D11_TiledResourceBarrier.
    //!                Reminder: all API in this set other than NvAPI_D3D11_CreateTiledTexture2DArray won't has D3D Debug Layer information.
    //!
    //!                NvAPI_D3D11_CreateTiledTexture2DArray is an extension of ID3D11Device::CreateTexutre2D.
    //!                Use this function to create a tiled Texture2D array with mip packing.
    //!                Runtime doesn't know the created resource is actually a tiled resource.
    //!                Any other D3D11 API where runtime will check whether resource is tiled or not has a corresponding NVAPI version and they should be used.
    //!                Different from DX12 implementation, this API should only be called when creating a tiled texture2D array with mip packing.
    //!                Other normal tiled resource following D3D spec must use the standard ID3D11Device::CreateTexutre2D to create.
    //!
    //!         \param [in]        pDevice             current d3d device
    //!         \param [in]        pDesc               The Texture2D Array descriptor, ArraySize > 1 && (pDesc->MiscFlags&D3D11_RESOURCE_MISC_TILED)
    //!         \param [in]        pInitialData        A pointer to an array of D3D11_SUBRESOURCE_DATA structures that describe subresources for the 2D texture resource.
    //!         \param [out]       ppTexture2D         A pointer to a buffer that receives a pointer to a ID3D11Texture2D interface for the created texture.

    //!
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_CreateTiledTexture2DArray(__in ID3D11Device *pDevice,
                                                          __in const D3D11_TEXTURE2D_DESC *pDesc,
                                                          __in const D3D11_SUBRESOURCE_DATA *pInitialData,
                                                          __out ID3D11Texture2D **ppTexture2D);

#endif // defined(__cplusplus) && defined(__d3d11_2_h__)

    //! SUPPORTED OS:  Windows 10 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_h__)

    typedef enum _NV_D3D11_FEATURE
    {
        NV_D3D11_FEATURE_RASTERIZER,
    } NV_D3D11_FEATURE;

    typedef struct _NV_D3D11_FEATURE_DATA_RASTERIZER_SUPPORT
    {
        BOOL TargetIndependentRasterWithDepth;
        BOOL ProgrammableSamplePositions;
        BOOL InterleavedSampling;
        BOOL ConservativeRaster;
        BOOL PostZCoverage;
        BOOL CoverageToColor;
    } NV_D3D11_FEATURE_DATA_RASTERIZER_SUPPORT;

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CheckFeatureSupport
    //
    //!   DESCRIPTION: This function gets information about the features that are supported by the current graphics driver.
    //!
    //!
    //!
    //! \param [in]        pDevice                 The device on which to query for support.
    //! \param [in]        Feature                 A member of the NvAPI_D3D11_FEATURE enumerated type that describes which feature to query for suppor.
    //! \param [in]        pFeatureSupportData     Upon completion of the method, the passed structure is filled with data that describes the feature support.
    //! \param [out]       FeatureSupportDataSize  The size of the structure passed to the pFeatureSupportData parameter.
    //!
    //! \since Release: 410
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //! \retval ::         Returns NVAPI_OK if successful; returns NVAPI_INVALID_ARGUMENT if an unsupported data type is passed to the pFeatureSupportData parameter
    //!                    or a size mismatch is detected for the FeatureSupportDataSize parameter;
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_CheckFeatureSupport(__in ID3D11Device *pDevice,
                                                    __in NV_D3D11_FEATURE Feature,
                                                    __out void *pFeatureSupportData,
                                                    __in UINT FeatureSupportDataSize);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

    //! SUPPORTED OS:  Windows 10 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateImplicitMSAATexture2D
    //
    //! \since Release: 410
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D11_CreateImplicitMSAATexture2D is a simple wrapper of ID3D11Device::CreateTexture2D
    //!                which allows to create multisampled 2D texture that is exposed to DX runtime as non-multisampled texture.
    //!
    //!         \param [in]       pDevice      Current d3d device
    //!         \param [in]       pDesc        A pointer to a D3D11_TEXTURE2D_DESC structure that describes a 2D texture resource.
    //!                                        To create a typeless resource that can be interpreted at runtime into different,
    //!                                        compatible formats, specify a typeless format in the texture description.
    //!                                        To generatemipmap levels automatically, set the number of mipmap levels to 0.
    //!                                        SampleDesc.SampleCount specifies actual resource sample count, while D3D runtime object
    //!                                        sees resource as non-multisampled.
    //!
    //!         \param [out]      ppTexture2D  A pointer to a buffer that receives a pointer to a ID3D11Texture2D interface for the
    //!                                        created texture.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  See MSDN for the API specific error codes.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_CreateImplicitMSAATexture2D(__in ID3D11Device *pDevice,
                                                            __in const D3D11_TEXTURE2D_DESC *pDesc,
                                                            __out ID3D11Texture2D **ppTexture2D);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

    //! SUPPORTED OS:  Windows 10 and higher
    //!

#if defined(__cplusplus) && defined(__d3d12_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreateImplicitMSAATexture2D
    //
    //! \since Release: 410
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D is a simple wrapper of ID3D12Device::CreateCommittedResource
    //!                which allows to create multisampled 2D texture that is exposed to DX runtime as non-multisampled texture.
    //!
    //!         \param [in]       pDevice      Current d3d device
    //!         \param [in]       pDesc        A pointer to a D3D12_RESOURCE_DESC structure that describes a 2D texture resource.
    //!                                        To create a typeless resource that can be interpreted at runtime into different,
    //!                                        compatible formats, specify a typeless format in the texture description.
    //!                                        To generatemipmap levels automatically, set the number of mipmap levels to 0.
    //!                                        SampleDesc.SampleCount specifies actual resource sample count, while D3D runtime object
    //!                                        sees resource as non-multisampled.
    //!         \param [in]       pHeapProperties, HeapFlags, InitialResourceState, pOptimizedClearValue, riidResource  See D3D12 docs
    //!
    //!         \param [out]      ppResource   Same ID3D12Device::CreateCommittedResource
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  See MSDN for the API specific error codes.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D(
        __in ID3D12Device *pDevice,
        __in const D3D12_HEAP_PROPERTIES *pHeapProperties,
        D3D12_HEAP_FLAGS HeapFlags,
        __in const D3D12_RESOURCE_DESC *pDesc,
        D3D12_RESOURCE_STATES InitialResourceState,
        __in_opt const D3D12_CLEAR_VALUE *pOptimizedClearValue,
        REFIID riidResource,
        __out void **ppvResource);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

    //! SUPPORTED OS:  Windows 10 and higher
    //!

    //! \ingroup dx
    //! Valid modes for NvAPI_D3D11_ResolveSubresourceRegion() and NvAPI_D3D12_ResolveSubresourceRegion
    typedef enum _NV_RESOLVE_MODE
    {
        NV_RESOLVE_MODE_SAMPLE_0,
    } NV_RESOLVE_MODE;

#if defined(__cplusplus) && defined(__d3d11_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_ResolveSubresourceRegion
    //
    //! \since Release: 410
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D11_ResolveSubresourceRegion is D3D11 an analog of D3D12 ResolveSubresourceRegion.
    //!
    //!         \param [in]       pDstResource    Destination resource. Must be a created with the D3D11_USAGE_DEFAULT flag and be single-sampled.
    //!         \param [in]       DstSubresource  A zero-based index, that identifies the destination subresource. Use D3D11CalcSubresource to calculate the index.
    //!         \param [in]       DstX            The X coordinate of the left-most edge of the destination region.
    //!                                           The width of the destination region is the same as the width of the source rect.
    //!
    //!         \param [in]       DstY            The Y coordinate of the top-most edge of the destination region.
    //!                                           The height of the destination region is the same as the height of the source rect.
    //!
    //!         \param [in]       pSrcResource    Source resource. Must be multisampled.
    //!         \param [in]       SrcSubresource  The source subresource of the source resource.
    //!         \param [in]       pSrcRect        Specifies the rectangular region of the source resource to be resolved.
    //!                                           Passing NULL for pSrcRect specifies that the entire subresource is to be resolved.
    //!
    //!         \param [in]       Format          A DXGI_FORMAT that indicates how the multisampled resource will be resolved to a single-sampled resource.
    //!         \param [in]       ResolveMode     Specifies the operation used to resolve the source samples. NV_RESOLVE_MODE_SAMPLE_0 is the only supported mode.
    //!                                           NV_RESOLVE_MODE_SAMPLE_0 outputs sample 0 and discards all other samples.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  See MSDN for the API specific error codes.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_ResolveSubresourceRegion(
        __in ID3D11Device *pDevice,
        __in ID3D11Texture2D *pDstResource,
        __in UINT DstSubresource,
        __in UINT DstX,
        __in UINT DstY,
        __in ID3D11Texture2D *pSrcResource,
        __in UINT SrcSubresource,
        __in_opt const RECT *pSrcRect,
        __in DXGI_FORMAT Format,
        __in NV_RESOLVE_MODE ResolveMode);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

    //! SUPPORTED OS:  Windows 10 and higher
    //!

#if defined(__cplusplus) && defined(__d3d12_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_ResolveSubresourceRegion
    //
    //! \since Release: 410
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D12_ResolveSubresourceRegion is D3D11 an analog of D3D12 ResolveSubresourceRegion.
    //!
    //!         \param [in]       pDstResource    Destination resource. Must be a created with the D3D11_USAGE_DEFAULT flag and be single-sampled.
    //!         \param [in]       DstSubresource  A zero-based index, that identifies the destination subresource. Use D3D11CalcSubresource to calculate the index.
    //!         \param [in]       DstX            The X coordinate of the left-most edge of the destination region.
    //!                                           The width of the destination region is the same as the width of the source rect.
    //!
    //!         \param [in]       DstY            The Y coordinate of the top-most edge of the destination region.
    //!                                           The height of the destination region is the same as the height of the source rect.
    //!
    //!         \param [in]       pSrcResource    Source resource. Must be multisampled.
    //!         \param [in]       SrcSubresource  The source subresource of the source resource.
    //!         \param [in]       pSrcRect        Specifies the rectangular region of the source resource to be resolved.
    //!                                           Passing NULL for pSrcRect specifies that the entire subresource is to be resolved.
    //!
    //!         \param [in]       Format          A DXGI_FORMAT that indicates how the multisampled resource will be resolved to a single-sampled resource.
    //!         \param [in]       ResolveMode     Specifies the operation used to resolve the source samples. NV_RESOLVE_MODE_SAMPLE_0 is the only supported mode.
    //!                                           NV_RESOLVE_MODE_SAMPLE_0 outputs sample 0 and discards all other samples.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  See MSDN for the API specific error codes.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_ResolveSubresourceRegion(
        __in ID3D12GraphicsCommandList1 *pCommandList,
        __in ID3D12Resource *pDstResource,
        __in UINT DstSubresource,
        __in UINT DstX,
        __in UINT DstY,
        __in ID3D12Resource *pSrcResource,
        __in UINT SrcSubresource,
        __in_opt RECT *pSrcRect,
        __in DXGI_FORMAT Format,
        __in NV_RESOLVE_MODE ResolveMode);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

    //! SUPPORTED OS:  Windows 8 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_2_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_TiledTexture2DArrayGetDesc
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D11_TiledTexture2DArrayGetDesc is an simple wrapper of ID3D11Texture2D::GetDesc
    //!                when pTiledTexture2DArray is created with NvAPI_D3D11_CreateTiledTexture2DArray.
    //!                Runtime doesn't know the created resource is actually a tiled resource.
    //!                So calling ID3D11Texture2D::GetDesc will get a desc without D3D11_RESOURCE_MISC_TILED in MiscFlags.
    //!                This wrapper API just adds D3D11_RESOURCE_MISC_TILED back.
    //!
    //!         \param [in]        pTiledTexture2DArray  Pointer of tiled texture2D array to get resource desc from.
    //!         \param [out]       pDesc                 Pointer to a resource description.

    //!
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_TiledTexture2DArrayGetDesc(__in ID3D11Texture2D *pTiledTexture2DArray,
                                                           __out D3D11_TEXTURE2D_DESC *pDesc);

#endif // defined(__cplusplus) && defined(__d3d11_2_h__)

    //! SUPPORTED OS:  Windows 8 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_2_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_UpdateTileMappings
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D11_UpdateTileMappings is an extension of ID3D11DeviceContext2::UpdateTileMappings.
    //!                It allows pTiledResource to be a resource created with NvAPI_D3D11_CreateTiledTexture2DArray, and should be used only in such case.
    //!
    //!         \param [in]        pDeviceContext                       Must be Immediate DeviceContext.
    //!         \param [in]        pTiledResource                       A pointer to the tiled texture 2D array resource created by NvAPI_D3D11_CreateTiledTexture2DArray.
    //!         \param [in]        NumTiledResourceRegions              The number of tiled resource regions.
    //!         \param [in]        pTiledResourceRegionStartCoordinates An array of D3D11_TILED_RESOURCE_COORDINATE structures that describe the starting coordinates of the tiled resource regions. Cannot be NULL.
    //!         \param [in]        pTiledResourceRegionSizes            An array of D3D11_TILE_REGION_SIZE structures that describe the sizes of the tiled resource regions. Cannot be NULL.
    //!         \param [in]        pTilePool                            A pointer to the tile pool. This resource should be created by standard API.
    //!         \param [in]        NumRanges                            The number of tile-pool ranges.
    //!         \param [in]        pRangeFlags                          An array of D3D11_TILE_RANGE_FLAG values that describe each tile-pool range.
    //!         \param [in]        pTilePoolStartOffsets                An array of offsets into the tile pool. These are 0-based tile offsets, counting in tiles (not bytes).
    //!         \param [in]        pRangeTileCounts                     An array of values that specify the number of tiles in each tile-pool range.
    //!         \param [in]        Flags                                A combination of D3D11_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation.

    //!
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_UpdateTileMappings(
        __in ID3D11DeviceContext2 *pDeviceContext,
        __in ID3D11Resource *pTiledResource,
        __in UINT NumTiledResourceRegions,
        __in const D3D11_TILED_RESOURCE_COORDINATE *pTiledResourceRegionStartCoordinates,
        __in const D3D11_TILE_REGION_SIZE *pTiledResourceRegionSizes,
        __in ID3D11Buffer *pTilePool,
        __in UINT NumRanges,
        __in const UINT *pRangeFlags,
        __in const UINT *pTilePoolStartOffsets,
        __in const UINT *pRangeTileCounts,
        __in UINT Flags);

#endif // defined(__cplusplus) && defined(__d3d11_2_h__)

    //! SUPPORTED OS:  Windows 8 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_2_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CopyTileMappings
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D11_CopyTileMappings is an extension of ID3D11DeviceContext2::CopyTileMappings
    //!                It allows pDestTiledResource or pSourceTiledResource or both to be created with NvAPI_D3D11_CreateTiledTexture2DArray.
    //!                It should be used only in such case.
    //!
    //!         \param [in]        pDeviceContext                       Must be Immediate DeviceContext.
    //!         \param [in]        pDestTiledResource                   Tiled resource created by NvAPI_D3D11_CreateTiledTexture2DArray to copy tile mappings into.
    //!         \param [in]        pDestRegionStartCoordinate           A pointer to a D3D11_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the destination tiled resource.
    //!         \param [in]        pSourceTiledResource                 Tiled resource created by NvAPI_D3D11_CreateTiledTexture2DArray to copy tile mappings from.
    //!         \param [in]        pSourceRegionStartCoordinate         A pointer to a D3D11_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the source tiled resource.
    //!         \param [in]        pTileRegionSize                      A pointer to a D3D11_TILE_REGION_SIZE structure that describes the size of the tiled region.
    //!         \param [in]        Flags                                A combination of D3D11_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation.

    //!
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_CopyTileMappings(
        __in ID3D11DeviceContext *pDeviceContext,
        __in ID3D11Resource *pDestTiledResource,
        __in const D3D11_TILED_RESOURCE_COORDINATE *pDestRegionStartCoordinate,
        __in ID3D11Resource *pSourceTiledResource,
        __in const D3D11_TILED_RESOURCE_COORDINATE *pSourceRegionStartCoordinate,
        __in const D3D11_TILE_REGION_SIZE *pTileRegionSize,
        __in UINT Flags);

#endif // defined(__cplusplus) && defined(__d3d11_2_h__)

    //! SUPPORTED OS:  Windows 8 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_2_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_TiledResourceBarrier
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D11_TiledResourceBarrier is an extension of ID3D11DeviceContext2::TiledResourceBarrier, but only works on ID3D11Resource(no support for ID3D11View).
    //!                If pTiledResourceAccessBeforeBarrier or pTiledResourceAccessAfterBarrier or both are created by NvAPI_D3D11_CreateTiledTexture2DArray,
    //!                NvAPI_D3D11_TiledResourceBarrier must be used instead of ID3D11DeviceContext2::TiledResourceBarrier.
    //!
    //!         \param [in]        pDeviceContext                          Must be Immediate DeviceContext.
    //!         \param [in]        pTiledResourceAccessBeforeBarrier       Access operations on this resource must complete before the access operations on the object that pTiledResourceAccessAfterBarrier specifies.
    //!         \param [in]        pTiledResourceAccessAfterBarrier        Access operations on this resource must begin after the access operations on the object that pTiledResourceAccessBeforeBarrier specifies.

    //!
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_TiledResourceBarrier(
        __in ID3D11DeviceContext *pDeviceContext,
        __in ID3D11Resource *pTiledResourceAccessBeforeBarrier,
        __in ID3D11Resource *pTiledResourceAccessAfterBarrier);

#endif // defined(__cplusplus) && defined(__d3d11_2_h__)

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA
    //
    //! \code
    //!   DESCRIPTION: This function allows creating (aliasing) a non-MSAA Texture2D object using the same memory as the given multi-sampled
    //!                texture (pInputTex). The surface created would be bloated in width and height but it will have SampleCount = 1
    //!                For 2X MSAA: OutTex.Width = InputTex.Width * 2, outTex.Height = InputTex.Height
    //!                For 4X MSAA: OutTex.Width = InputTex.Width * 2, outTex.Height = InputTex.Height * 2
    //!                For 8X MSAA: OutTex.Width = InputTex.Width * 4, outTex.Height = InputTex.Height * 2
    //!                Only textures SampleQuality = 0 can be aliased as Non MSAA
    //!                The app should ensure that original texture is released only after the aliased copy is released.
    //!
    //!                This function is  free-threaded create compatible i.e. it can be called from a different thread
    //!                than the one calling immediate device setstate functions.
    //!
    //!         \param [in]        pDevice             current d3d device
    //!         \param [in]        pInputTex           The MultiSampled Texture2D resource that is being aliased
    //!         \param [out]       ppOutTex            The aliased non AA copy MultiSampled Texture2D resource
    //!
    //!
    //! \return :: NVAPI_OK                   if the call succeeds.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA(__in ID3D11Device *pDevice,
                                                            __in ID3D11Texture2D *pInputTex,
                                                            __out ID3D11Texture2D **ppOutTex);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))
    typedef UINT NvAPI_D3D11_SWIZZLE_MODE;

    typedef enum _NV_SWIZZLE_MODE
    {
        NV_SWIZZLE_POS_X = 0,
        NV_SWIZZLE_NEG_X = 1,
        NV_SWIZZLE_POS_Y = 2,
        NV_SWIZZLE_NEG_Y = 3,
        NV_SWIZZLE_POS_Z = 4,
        NV_SWIZZLE_NEG_Z = 5,
        NV_SWIZZLE_POS_W = 6,
        NV_SWIZZLE_NEG_W = 7
    } NV_SWIZZLE_MODE;

    typedef enum _NV_SWIZZLE_OFFSET
    {
        NV_SWIZZLE_OFFSET_X = 0,
        NV_SWIZZLE_OFFSET_Y = 4,
        NV_SWIZZLE_OFFSET_Z = 8,
        NV_SWIZZLE_OFFSET_W = 12
    } NV_SWIZZLE_OFFSET;

#endif // defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))
#define NV_CUSTOM_SEMANTIC_MAX_LIMIT 32


    typedef enum NV_CUSTOM_SEMANTIC_TYPE
    {
        NV_NONE_SEMANTIC = 0,
        NV_X_RIGHT_SEMANTIC = 1,
        NV_VIEWPORT_MASK_SEMANTIC = 2,
        NV_XYZW_RIGHT_SEMANTIC = 3,
        NV_VIEWPORT_MASK_2_SEMANTIC = 4,

        NV_POSITION_SEMANTIC = 5,
        NV_CLIP_DISTANCE_0_SEMANTIC = 6, // MultiView can accept upto two vec4 values. So the application should not use
        NV_CLIP_DISTANCE_1_SEMANTIC = 7, // more than 2 of the below Clip / Cull semantics in a single shader.
        NV_CULL_DISTANCE_0_SEMANTIC = 8,
        NV_CULL_DISTANCE_1_SEMANTIC = 9,
        NV_GENERIC_ATTRIBUTE_SEMANTIC = 10,

        NV_PACKED_EYE_INDEX_SEMANTIC = 17,
        NV_CUSTOM_SEMANTIC_MAX = NV_CUSTOM_SEMANTIC_MAX_LIMIT,
    } NV_CUSTOM_SEMANTIC_TYPE;

    typedef struct _NV_CUSTOM_SEMANTIC
    {
        UINT version; // NV_CUSTOM_SEMANTIC_VERSION

        NV_CUSTOM_SEMANTIC_TYPE NVCustomSemanticType; // type of custom semantic (NV_CUSTOM_SEMANTIC_TYPE)
        NvAPI_LongString NVCustomSemanticNameString;  // name of custom semantic e.g. "NV_X_RIGHT", "NV_VIEWPORT_MASK"
        BOOL RegisterSpecified;                       // (optional) set to TRUE to explicitly provide register number and mask as below
        NvU32 RegisterNum;                            // (optional) output register which has the custom semantic.
        NvU32 RegisterMask;                           // (optional) output register component mask which has the custom semantic (X:1, Y:2, Z:4)
        NvU32 Reserved;                               // reserved
    } NV_CUSTOM_SEMANTIC;

#define NV_CUSTOM_SEMANTIC_VERSION MAKE_NVAPI_VERSION(NV_CUSTOM_SEMANTIC, 1)


#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))

#if defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    typedef struct NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5
    {
        UINT version;

        BOOL UseViewportMask;
        BOOL OffsetRtIndexByVpIndex;
        BOOL ForceFastGS;
        BOOL DontUseViewportOrder;
        BOOL UseAttributeSkipMask;
        BOOL UseCoordinateSwizzle;
        NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
        BOOL ConvertToFastGS;                 // reserved
        BOOL UseSpecificShaderExt;            // TRUE if creating minimal specific shaders with nvapi shader extensions
    } NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5;

    typedef NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5 NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX;
#define NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VER_5 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5, 5)

#define NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VERSION NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VER_5


    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateGeometryShaderEx
    //
    //! \fn NvAPI_D3D11_CreateGeometryShaderEx
    //!
    //!   DESCRIPTION: This function allows us to extend the creation of geometry shaders with extra bits
    //!                of functionality.
    //!
    //!                The first parameters are identical to ID3D11Device::CreateGeometryShader()
    //!                so please refer to its documentation for their usage.
    //!
    //!                The new parameter is UseViewportMask which is to tell the driver to create a shader
    //!                that outputs a viewport mask instead when a viewport index is indicated.
    //!                Outputting a viewport mask allows a single primitive to land on many different viewports
    //!                as specified by the bits set in the mask, rather than to rely on a single number that tells it
    //!                which unique viewport it would be drawn on.
    //!                This can be used for example in conjunction with the setting of coordinates swizzling (see XXX_NVAPI function)
    //!                to generates multiple adjacent views of the same primitive in a more efficient fashion
    //!                (outputting the primitive only once).
    //!
    //!                This function is  free-threaded create compatible i.e. it can be called from a different
    //!                thread than the one calling immediate device setstate functions.
    //!
    //! \since Release:
    //!
    //!   \param [in]  pDevice               The device pointer
    //!   \param [in]  pShaderBytecode       A pointer to the compiled shader.
    //!   \param [in]  BytecodeLength        Size of the compiled geometry shader.
    //!   \param [in]  pClassLinkage         A pointer to a class linkage interface. Can be NULL.
    //!   \param [in]  UseViewportMask       Set to FALSE for custom semantic shaders. Tell the driver to create a shader that outputs the viewport mask in lieu of the viewport index. See above description.
    //!   \param [in]  OffsetRtIndexByVpIndex Set to FALSE for custom semantic shaders. The Rendertarget index is offset by the viewport index
    //!   \param [in]  ForceFastGS           If TRUE, GS must be written with maxvertexcount(1) and must pass-through input vertex 0 to the output without modification
    //!   \param [in]  DontUseViewportOrder  Default FALSE for Primitives batched per viewport to improve performance. Set TRUE for API order (slow).
    //!   \param [in]  UseAttributeSkipMask  reserved
    //!   \param [in]  UseCoordinateSwizzle  reserved
    //!   \param [in]  pCoordinateSwizzling  reserved
    //!   \param [in]  NumCustomSemantics    Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
    //!   \param [in]  pCustomSemantics      pointer to array of NV_CUSTOM_SEMANTIC
    //!   \param [in]  ConvertToFastGS       reserved
    //!   \param [in]  UseSpecificShaderExt  TRUE if creating minimal specific shaders with nvapi shader extensions
    //!   \param [out] ppGeometryShader      Address of a pointer to a ID3D11GeometryShader interface.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_CreateGeometryShaderEx_2(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
                                                         __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
                                                         __in const NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX *pCreateGeometryShaderExArgs,
                                                         __out ID3D11GeometryShader **ppGeometryShader);

#endif // defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1
    {
        UINT version;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
    } NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1;

    typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2
    {
        UINT version;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
        BOOL UseWithFastGS;                   // reserved
    } NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2;

    typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3
    {
        UINT version;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
        BOOL UseWithFastGS;                   // reserved
        BOOL UseSpecificShaderExt;            // TRUE if creating minimal specific shaders with nvapi shader extensions
    } NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3;

    typedef NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3 NvAPI_D3D11_CREATE_VERTEX_SHADER_EX;
#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1, 1)

#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2, 2)

#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_3 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2, 3)

#define NVAPI_D3D11_CREATEVERTEXSHADEREX_VERSION NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_3


    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateVertexShaderEx
    //
    //! \fn NvAPI_D3D11_CreateVertexShaderEx
    //!
    //!   DESCRIPTION: This function allows us to extend the creation of vertex shaders with extra bits
    //!                of functionality.
    //!
    //!                The first parameters are identical to ID3D11Device::CreateVertexShader()
    //!                so please refer to its documentation for their usage.
    //!
    //!                The new parameter are custom semantics which allow setting of custom semantic variables
    //!                in the shader
    //!
    //!                This function is  free-threaded create compatible i.e. it can be called from a different thread
    //!                than the one calling immediate device setstate functions.
    //!
    //! \since Release:
    //!
    //!   \param [in]  pDevice               The device pointer
    //!   \param [in]  pShaderBytecode       A pointer to the compiled shader.
    //!   \param [in]  BytecodeLength        Size of the compiled vertex shader.
    //!   \param [in]  pClassLinkage         A pointer to a class linkage interface. Can be NULL.
    //!   \param [in]  NumCustomSemantics    Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
    //!   \param [in]  pCustomSemantics      pointer to array of NV_CUSTOM_SEMANTIC
    //!   \param [in]  UseWithFastGS         reserved
    //!   \param [in]  UseSpecificShaderExt  TRUE if creating minimal specific shaders with nvapi shader extensions
    //!   \param [out] ppVertexShader        Address of a pointer to a ID3D11VertexShader interface.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_CreateVertexShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
                                                     __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
                                                     __in const NvAPI_D3D11_CREATE_VERTEX_SHADER_EX *pCreateVertexShaderExArgs,
                                                     __out ID3D11VertexShader **ppVertexShader);

#endif // defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    typedef struct NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1
    {
        UINT version;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
        BOOL UseWithFastGS;                   // reserved
    } NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1;

    typedef struct NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2
    {
        UINT version;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
        BOOL UseWithFastGS;                   // reserved
        BOOL UseSpecificShaderExt;            // TRUE if creating minimal specific shaders with nvapi shader extensions
    } NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2;

    typedef NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2 NvAPI_D3D11_CREATE_HULL_SHADER_EX;
#define NVAPI_D3D11_CREATEHULLSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1, 1)

#define NVAPI_D3D11_CREATEHULLSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1, 2)

#define NVAPI_D3D11_CREATEHULLSHADEREX_VERSION NVAPI_D3D11_CREATEHULLSHADEREX_VER_2


    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateHullShaderEx
    //
    //! \fn NvAPI_D3D11_CreateHullShaderEx
    //!
    //!   DESCRIPTION: This function allows us to extend the creation of hull shaders with extra bits
    //!                of functionality.
    //!
    //!                The first parameters are identical to ID3D11Device::CreateHullShader()
    //!                so please refer to its documentation for their usage.
    //!
    //!                The new parameter are custom semantics which allow setting of custom semantic variables
    //!                in the shader
    //!
    //!                This function is  free-threaded create compatible i.e. it can be called from a different thread
    //!                than the one calling immediate device setstate functions.
    //!
    //! \since Release:
    //!
    //!   \param [in]  pDevice               The device pointer
    //!   \param [in]  pShaderBytecode       A pointer to the compiled shader.
    //!   \param [in]  BytecodeLength        Size of the compiled hull shader.
    //!   \param [in]  pClassLinkage         A pointer to a class linkage interface. Can be NULL.
    //!   \param [in]  NumCustomSemantics    Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
    //!   \param [in]  pCustomSemantics      pointer to array of NV_CUSTOM_SEMANTIC
    //!   \param [in]  UseWithFastGS         reserved
    //!   \param [in]  UseSpecificShaderExt  TRUE if creating minimal specific shaders with nvapi shader extensions
    //!   \param [out] ppHullShader          Address of a pointer to a ID3D11HullShader interface.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_CreateHullShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
                                                   __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
                                                   __in const NvAPI_D3D11_CREATE_HULL_SHADER_EX *pCreateHullShaderExArgs,
                                                   __out ID3D11HullShader **ppHullShader);

#endif // defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1
    {
        UINT version;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
    } NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1;

    typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2
    {
        UINT version;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
        BOOL UseWithFastGS;                   // reserved
    } NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2;

    typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3
    {
        UINT version;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
        BOOL UseWithFastGS;                   // reserved
        BOOL UseSpecificShaderExt;            // TRUE if creating minimal specific shaders with nvapi shader extensions
    } NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3;

    typedef NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3 NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX;
#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1, 1)

#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2, 2)

#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_3 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3, 3)

#define NVAPI_D3D11_CREATEDOMAINSHADEREX_VERSION NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_3


    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateDomainShaderEx
    //
    //! \fn NvAPI_D3D11_CreateDomainShaderEx
    //!
    //!   DESCRIPTION: This function allows us to extend the creation of domain shaders with extra bits
    //!                of functionality.
    //!
    //!                The first parameters are identical to ID3D11Device::CreateDomainShader()
    //!                so please refer to its documentation for their usage.
    //!
    //!                The new parameter are custom semantics which allow setting of custom semantic variables
    //!                in the shader
    //!
    //!                This function is  free-threaded create compatible i.e. it can be called from a different thread
    //!                than the one calling immediate device setstate functions.
    //!
    //! \since Release:
    //!
    //!   \param [in]  pDevice               The device pointer
    //!   \param [in]  pShaderBytecode       A pointer to the compiled shader.
    //!   \param [in]  BytecodeLength        Size of the compiled domain shader.
    //!   \param [in]  pClassLinkage         A pointer to a class linkage interface. Can be NULL.
    //!   \param [in]  NumCustomSemantics    Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
    //!   \param [in]  pCustomSemantics      pointer to array of NV_CUSTOM_SEMANTIC
    //!   \param [in]  UseWithFastGS         reserved
    //!   \param [in]  UseSpecificShaderExt  TRUE if creating minimal specific shaders with nvapi shader extensions
    //!   \param [out] ppDomainShader        Address of a pointer to a ID3D11DomainShader interface.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_CreateDomainShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
                                                     __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
                                                     __in const NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX *pCreateDomainShaderExArgs,
                                                     __out ID3D11DomainShader **ppDomainShader);

#endif // defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    typedef struct NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1
    {
        UINT version;

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
    } NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1;

#define NVAPI_D3D11_CREATEPIXELSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1, 1)


    typedef struct NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2
    {
        UINT version; // Always use NVAPI_D3D11_CREATEPIXELSHADEREX_VERSION

        NvU32 NumCustomSemantics;                                     // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics;                         // pointer to array of NV_CUSTOM_SEMANTIC
        NvU32 bEnableSuperSamplingPredicationForVRS : 1;              // This enables sampling within a pixel for SuperSampling mode of Variable Rate Shading for relevant attributes tagged with "sample" modifier
        NvU32 bEnableSuperSamplingPredicationForVRSAllAttributes : 1; // This enables sampling within a pixel for SuperSampling mode of Variable Rate Shading for all relevant attributes
        NvU32 reserved : 30;                                          // Reserved for further use
    } NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2;

    typedef NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2 NvAPI_D3D11_CREATE_PIXEL_SHADER_EX;
#define NVAPI_D3D11_CREATEPIXELSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2, 2)

#define NVAPI_D3D11_CREATEPIXELSHADEREX_VERSION NVAPI_D3D11_CREATEPIXELSHADEREX_VER_2


    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreatePixelShaderEx_2
    //
    //! \fn NvAPI_D3D11_CreatePixelShaderEx_2
    //!
    //!   DESCRIPTION: This function allows us to extend the creation of pixel shaders with extra bits
    //!                of functionality.
    //!
    //!                The first parameters are identical to ID3D11Device::CreatePixelShader()
    //!                so please refer to its documentation for their usage.
    //!
    //!                The new parameter are custom semantics which allow setting of custom semantic variables
    //!                in the shader
    //!
    //!                This function is  free-threaded create compatible i.e. it can be called from a different thread
    //!                than the one calling immediate device setstate functions.
    //!
    //! \since Release: 410
    //!
    //!   \param [in]  pDevice               The device pointer
    //!   \param [in]  pShaderBytecode       A pointer to the compiled shader.
    //!   \param [in]  BytecodeLength        Size of the compiled domain shader.
    //!   \param [in]  pClassLinkage         A pointer to a class linkage interface. Can be NULL.
    //!   \param [in]  NumCustomSemantics    Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
    //!   \param [in]  pCustomSemantics      pointer to array of NV_CUSTOM_SEMANTIC
    //!   \param [out] ppPixelShader         Address of a pointer to a ID3D11PixelShader interface.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_CreatePixelShaderEx_2(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
                                                      __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
                                                      __in const NvAPI_D3D11_CREATE_PIXEL_SHADER_EX *pCreatePixelShaderExArgs,
                                                      __out ID3D11PixelShader **ppPixelShader);

#endif // defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))

    typedef enum _NV_FASTGS_FLAGS
    {
        NV_FASTGS_USE_VIEWPORT_MASK = 0x01,           // Causes SV_ViewportArrayIndex value to be interpreted as a bitmask of viewports to broadcast to.
        NV_FASTGS_OFFSET_RT_INDEX_BY_VP_INDEX = 0x02, // Causes SV_RenderTargetArrayIndex value to be offset by the viewport index when broadcasting.
        NV_FASTGS_STRICT_API_ORDER = 0x04,            // Causes broadcast primitives to be rendered strictly in API order (slow).
                                                      // By default, primitives may be batched per viewport to improve performance.
    } NV_FASTGS_FLAGS;

#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))

#if defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    struct NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1
    {
        NvU32 version;                                  // ALWAYS == NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER
        NvU32 flags;                                    // A combination of flags from NV_FASTGS_FLAGS
        NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; // [optional] Array of 16 coordinate swizzle modes, one per viewport. NULL if not used.
                                                        // The output x, y, z, and w coordinates of all vertices can be set to any of the coordinates or their
                                                        // negated versions i.e. {x, y, z, w, -x, -y, -z, -w}. Coordinates are swizzled before any viewport
                                                        // operation occurs i.e. before frustum clipping, scaling, and viewport clipping. And after
                                                        // last of vertex/tesselation/geometry shader stage, stream-out and viewport broadcast expansion (see NV_FASTGS_USE_VIEWPORT_MASK)
                                                        // pCoordinateSwizzling[i] sets the swizzle-mode of each component for viewport i.
                                                        // See NV_SWIZZLE_MODE for values of allowed swizzle modes.
                                                        // See NV_SWIZZLE_OFFSET for bit offset from where NV_SWIZZLE_MODE to be set for each component.
                                                        // For example :
                                                        // 1. To set swizzle for viewport 0 such that -  w and z are unchanged and values of x and y are swapped :
                                                        // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) |
                                                        //                           (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) |
                                                        //                           (NV_SWIZZLE_POS_X << NV_SWIZZLE_OFFSET_Y) |
                                                        //                           (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_X);
                                                        // 2. To set swizzle for viewport 0 such that -  w, z and y are unchanged and value of x is negated :
                                                        // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) |
                                                        //                           (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) |
                                                        //                           (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_Y) |
                                                        //                           (NV_SWIZZLE_NEG_X << NV_SWIZZLE_OFFSET_X);
                                                        // Need to set some valid combination of swizzle-modes for all viewports, irrespective of whether that viewport is set.
                                                        // Invalid swizzle-mode for any viewport (even if that viewport is not set) may result in removal of device.
    };

#define NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1, 1)

#define NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER1


    typedef NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1 NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC;

    ////////////////////////////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateFastGeometryShaderExplicit
    //
    //! \fn NvAPI_D3D11_CreateFastGeometryShaderExplicit
    //!
    //!   DESCRIPTION: This function will create a fast geometry shader written using an "explicit"
    //!                coding style, rather than converting a standard GS. For the explicit coding
    //!                style, the GS must be written with maxvertexcount(1), and must pass-through
    //!                input vertex 0 to the output without modification.
    //!
    //!                Additional per-primitive outputs may also be computed and written to the single
    //!                output vertex. If these outputs are read by the pixel shader, they must be
    //!                declared with the "nointerpolation" attribute in the PS input signature;
    //!                otherwise, visual corruption may occur. Also, unlike D3D API, there is no guarantee
    //!                that pixel shader will get the default value of an attribute if that attribute is not written
    //!                by the earlier shader stage in the pipeline.
    //!
    //!                The first four parameters are identical to ID3D11Device::CreateGeometryShader(),
    //!                so please refer to its documentation for their usage.
    //!
    //!                This function is  free-threaded create compatible i.e. it can be called from a different thread
    //!                than the one calling immediate device setstate functions.
    //!
    //! \since Release:
    //!
    //!   \param [in]  pDevice               The device pointer
    //!   \param [in]  pShaderBytecode       A pointer to the compiled shader.
    //!   \param [in]  BytecodeLength        Size of the compiled geometry shader.
    //!   \param [in]  pClassLinkage         A pointer to a class linkage interface. Can be NULL.
    //!   \param [in]  pCreateFastGSArgs     A pointer to a NvAPI_D3D11_CREATE_FASTGS_EXPLICIT struct.
    //!   \param [out] ppGeometryShader      Address of a pointer to a ID3D11GeometryShader interface.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //
    ////////////////////////////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_CreateFastGeometryShaderExplicit(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
                                                                 __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
                                                                 __in const NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC *pCreateFastGSArgs,
                                                                 __out ID3D11GeometryShader **ppGeometryShader);

#endif // defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
    ////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateFastGeometryShader
    //
    //! \fn NvAPI_D3D11_CreateFastGeometryShader
    //!
    //!   DESCRIPTION: This function will convert a regular geometry shader into a fast GS variant if possible.
    //!                It will not do any validation regarding the compatibility of the resulting fast GS with any
    //!                Pixel shader. The validation has to be done by the application manually.
    //!
    //!                The parameters are identical to ID3D11Device::CreateGeometryShader()
    //!                so please refer to its documentation for their usage.
    //!
    //!                If the shader is too complex or is not in adequate form to be converted to fast GS
    //!                this function will simply fail. You should then call ID3D11Device::CreateGeometryShader()
    //!                to create the regular geometry shader.
    //!
    //!                This function is  free-threaded create compatible i.e. it can be called from a different thread
    //!                than the one calling immediate device setstate functions.
    //!
    //! \since Release:
    //!
    //!   \param [in]  pDevice               The device pointer
    //!   \param [in]  pShaderBytecode       A pointer to the compiled shader.
    //!   \param [in]  BytecodeLength        Size of the compiled geometry shader.
    //!   \param [in]  pClassLinkage         A pointer to a class linkage interface. Can be NULL.
    //!   \param [out] ppGeometryShader      Address of a pointer to a ID3D11GeometryShader interface.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_CreateFastGeometryShader(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
                                                         __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
                                                         __out ID3D11GeometryShader **ppGeometryShader);

#endif // defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && defined(__d3d11_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_DecompressView
    //
    //! \code
    //!   DESCRIPTION: This function is used to decompress a surface using the currently bound programmable sample positions.
    //!
    //!                This is needed:
    //!                  - When writing to a surface in a region previously rendered by different sample positions and no clear was done.
    //!                  - When reading a surface in a shader that was rendered using non-standard sample positions.
    //!                  - When copying from a surface that was rendered using non-standard sample positions.
    //!
    //!         \param [in]        pDevice             Current d3d11 device
    //!         \param [in]        pDeviceContext      Current d3d11 device context
    //!         \param [in]        pView               Current view to decompress
    //!
    //!
    //! \return ::NVAPI_OK     if the call succeeds.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_DecompressView(__in ID3D11Device *pDevice, __in ID3D11DeviceContext *pDeviceContext, __in ID3D11View *pView);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)

    //! Enum for CreatePSO extensions.
    //! \ingroup dx
    //! constant 5 is assigned to two members of this enum becuase the first member name contains a typo: EXTNENSION. Please use the correctly-spelled enumerator.
    typedef enum _NV_PSO_EXTENSION
    {
        NV_PSO_RASTER_EXTENSION = 0,
        NV_PSO_REQUEST_FASTGS_EXTENSION = 1,
        NV_PSO_GEOMETRY_SHADER_EXTENSION = 2,
        NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION = 3,
        NV_PSO_EXPLICIT_FASTGS_EXTENSION = 4,
        NV_PSO_SET_SHADER_EXTNENSION_SLOT_AND_SPACE = 5,
        NV_PSO_SET_SHADER_EXTENSION_SLOT_AND_SPACE = 5,
        NV_PSO_VERTEX_SHADER_EXTENSION = 6,
        NV_PSO_DOMAIN_SHADER_EXTENSION = 7,
        NV_PSO_HULL_SHADER_EXTENSION = 9,
    } NV_PSO_EXTENSION;

    struct NVAPI_D3D12_PSO_EXTENSION_DESC_V1
    {
        NvU32 baseVersion; //<! Always use NV_PSO_EXTENSION_DESC_VER
        NV_PSO_EXTENSION psoExtension;
    };

#define NV_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_EXTENSION_DESC_V1, 1)

#define NV_PSO_EXTENSION_DESC_VER NV_PSO_EXTENSION_DESC_VER_1


    typedef NVAPI_D3D12_PSO_EXTENSION_DESC_V1 NVAPI_D3D12_PSO_EXTENSION_DESC;

    struct NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
    {
        NvU32 version; //<! Always use NV_RASTERIZER_PSO_EXTENSION_DESC_VER
        // These are additional parameters on the top of D3D12_RASTERIZER_DESC
        bool ProgrammableSamplePositionsEnable; //<! enable Programmable Samples feature
        bool InterleavedSamplingEnable;         //<! when jitter is enabled, an app need to fill the whole arrays below, otherwise only as much entries as samples
        NvU8 SampleCount;                       //<! number of samples. In TIR N->1 it needs to match N, in non-TIR it needs to match RT sample count. Ignored if ForcePerSampleInterlock is set
        NvU8 SamplePositionsX[16];              //<! x positions in API sample order
        NvU8 SamplePositionsY[16];              //<! y positions in API sample order
        NVAPI_QUAD_FILLMODE QuadFillMode;       //<! Fill a triangle outside its bounds as a screen-aligned quad, matching the tri's bounding-box or filling the full viewport.
        bool PostZCoverageEnable;               //<! Enable pixel-shader input SV_COVERAGE to account for z-test in early-z mode.
        bool CoverageToColorEnable;             //<! Enable output of coverage to a color render-target.
        NvU8 CoverageToColorRTIndex;            //<! Index of RT for coverage-to-color.

        // Added with NV_RASTERIZER_PSO_EXTENSION_DESC_VER_2
        bool TargetIndepentRasterWithDepth; //<! TargetIndepentRasterWithDepth = TRUE enables rasterezation mode where sample count of both raster and depth-stencil buffer are equal and do not match RT sample count.
        NvU8 ForcedSampleCount;             //<! Must be set when TargetIndepentRasterWithDepth is true - refers to SampleDesc.Count for the DSV

        // Reserved
        NvU8 reserved[62]; //<! reserved for expansion, set to zero.
    };

#define NV_RASTERIZER_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC_V1, 1)

#define NV_RASTERIZER_PSO_EXTENSION_DESC_VER_2 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC_V1, 2)

#define NV_RASTERIZER_PSO_EXTENSION_DESC_VER NV_RASTERIZER_PSO_EXTENSION_DESC_VER_2


    typedef NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC_V1 NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC;

    struct NVAPI_D3D12_PSO_CREATE_FASTGS_EXPLICIT_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
    {
        NvU32 version;                                  // ALWAYS == NV_FASTGS_EXPLICIT_PSO_EXTENSION_VER
        NvU32 flags;                                    // A combination of flags from NV_FASTGS_FLAGS
        NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; // [optional] Array of 16 coordinate swizzle modes, one per viewport. NULL if not used.
                                                        // The output x, y, z, and w coordinates of all vertices can be set to any of the coordinates or their
                                                        // negated versions i.e. {x, y, z, w, -x, -y, -z, -w}. Coordinates are swizzled before any viewport
                                                        // operation occurs i.e. before frustum clipping, scaling, and viewport clipping. And after
                                                        // last of vertex/tesselation/geometry shader stage, stream-out and viewport broadcast expansion (see NV_FASTGS_USE_VIEWPORT_MASK)
                                                        // pCoordinateSwizzling[i] sets the swizzle-mode of each component for viewport i.
                                                        // See NV_SWIZZLE_MODE for values of allowed swizzle modes.
                                                        // See NV_SWIZZLE_OFFSET for bit offset from where NV_SWIZZLE_MODE to be set for each component.
                                                        // For example :
                                                        // 1. To set swizzle for viewport 0 such that -  w and z are unchanged and values of x and y are swapped :
                                                        // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) |
                                                        //                           (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) |
                                                        //                           (NV_SWIZZLE_POS_X << NV_SWIZZLE_OFFSET_Y) |
                                                        //                           (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_X);
                                                        // 2. To set swizzle for viewport 0 such that -  w, z and y are unchanged and value of x is negated :
                                                        // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) |
                                                        //                           (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) |
                                                        //                           (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_Y) |
                                                        //                           (NV_SWIZZLE_NEG_X << NV_SWIZZLE_OFFSET_X);
                                                        // Need to set some valid combination of swizzle-modes for all viewports, irrespective of whether that viewport is set.
                                                        // Invalid swizzle-mode for any viewport (even if that viewport is not set) may result in removal of device.
    };

#define NV_FASTGS_EXPLICIT_PSO_EXTENSION_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_CREATE_FASTGS_EXPLICIT_DESC_V1, 1)

#define NV_FASTGS_EXPLICIT_PSO_EXTENSION_VER NV_FASTGS_EXPLICIT_PSO_EXTENSION_VER_1


    typedef NVAPI_D3D12_PSO_CREATE_FASTGS_EXPLICIT_DESC_V1 NVAPI_D3D12_PSO_CREATE_FASTGS_EXPLICIT_DESC;

    struct NVAPI_D3D12_PSO_REQUEST_FAST_GEOMETRY_SHADER_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
    {
        NvU32 version; //<! Always use NV_FAST_GEOMETRY_SHADER_PSO_EXTENSION_VER
    };

#define NV_FAST_GEOMETRY_SHADER_PSO_EXTENSION_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_REQUEST_FAST_GEOMETRY_SHADER_DESC_V1, 1)

#define NV_FAST_GEOMETRY_SHADER_PSO_EXTENSION_VER NV_FAST_GEOMETRY_SHADER_PSO_EXTENSION_VER_1


    typedef NVAPI_D3D12_PSO_REQUEST_FAST_GEOMETRY_SHADER_DESC_V1 NVAPI_D3D12_PSO_REQUEST_FAST_GEOMETRY_SHADER_DESC;

    struct NVAPI_D3D12_PSO_GEOMETRY_SHADER_DESC_V5 : public NVAPI_D3D12_PSO_EXTENSION_DESC
    {
        NvU32 version; //<! Always use NV_GEOMETRY_SHADER_PSO_EXTENSION_DESC_VER

        BOOL UseViewportMask;                           // Set to FALSE for custom semantic shaders. Tell the driver to create a shader that outputs the viewport mask in lieu of the viewport index. See above description.
        BOOL OffsetRtIndexByVpIndex;                    // Set to FALSE for custom semantic shaders. The Rendertarget index is offset by the viewport index
        BOOL ForceFastGS;                               // If TRUE, GS must be written with maxvertexcount(1) and must pass-through input vertex 0 to the output without modification
        BOOL DontUseViewportOrder;                      // Default FALSE for Primitives batched per viewport to improve performance. Set TRUE for API order (slow).
        BOOL UseAttributeSkipMask;                      // Reserved
        BOOL UseCoordinateSwizzle;                      // Reserved
        NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; // Reserved

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC

        BOOL ConvertToFastGS; // Tell the driver to attempt to create a fast geometry shader

        BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions
    };

#define NV_GEOMETRY_SHADER_PSO_EXTENSION_DESC_VER_5 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_GEOMETRY_SHADER_DESC_V5, 5)

#define NV_GEOMETRY_SHADER_PSO_EXTENSION_DESC_VER NV_GEOMETRY_SHADER_PSO_EXTENSION_DESC_VER_5


    typedef NVAPI_D3D12_PSO_GEOMETRY_SHADER_DESC_V5 NVAPI_D3D12_PSO_GEOMETRY_SHADER_DESC;

    struct NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
    {
        NvU32 version; //<! Always use NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // Pointer to array of NV_CUSTOM_SEMANTIC
    };

    struct NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V2 : public NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V1
    {
        BOOL UseWithFastGS; // Reserved
    };

    struct NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V3 : public NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V2
    {
        BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with NvAPI shader extensions
    };

#define NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V1, 1)

#define NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER_2 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V2, 2)

#define NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER_3 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V3, 3)

#define NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER_3


    typedef NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V3 NVAPI_D3D12_PSO_VERTEX_SHADER_DESC;

    struct NVAPI_D3D12_PSO_HULL_SHADER_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
    {
        NvU32 version; //<! Always use NV_HULL_SHADER_PSO_EXTENSION_DESC_VER

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // Pointer to array of NV_CUSTOM_SEMANTIC
        BOOL UseWithFastGS;                   // Reserved
    };

    struct NVAPI_D3D12_PSO_HULL_SHADER_DESC_V2 : public NVAPI_D3D12_PSO_HULL_SHADER_DESC_V1
    {
        BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions
    };

#define NV_HULL_SHADER_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_HULL_SHADER_DESC_V1, 1)

#define NV_HULL_SHADER_PSO_EXTENSION_DESC_VER_2 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_HULL_SHADER_DESC_V2, 2)

#define NV_HULL_SHADER_PSO_EXTENSION_DESC_VER NV_HULL_SHADER_PSO_EXTENSION_DESC_VER_2


    typedef NVAPI_D3D12_PSO_HULL_SHADER_DESC_V2 NVAPI_D3D12_PSO_HULL_SHADER_DESC;

    struct NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
    {
        NvU32 version; //<! Always use NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER

        NvU32 NumCustomSemantics;             // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
        NV_CUSTOM_SEMANTIC *pCustomSemantics; // Pointer to array of NV_CUSTOM_SEMANTIC
    };

    struct NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V2 : public NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V1
    {
        BOOL UseWithFastGS; // Reserved
    };

    struct NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V3 : public NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V2
    {
        BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with NvAPI shader extensions
    };

#define NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V1, 1)

#define NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER_2 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V2, 2)

#define NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER_3 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V3, 3)

#define NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER_3


    typedef NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V3 NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC;

    struct NVAPI_D3D12_PSO_ENABLE_DEPTH_BOUND_TEST_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
    {
        NvU32 version; //<! Always use NV_ENABLE_DEPTH_BOUND_TEST_PSO_EXTENSION_DESC_VER
        bool EnableDBT;
    };

#define NV_ENABLE_DEPTH_BOUND_TEST_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_ENABLE_DEPTH_BOUND_TEST_DESC_V1, 1)

#define NV_ENABLE_DEPTH_BOUND_TEST_PSO_EXTENSION_DESC_VER NV_ENABLE_DEPTH_BOUND_TEST_PSO_EXTENSION_DESC_VER_1


    typedef NVAPI_D3D12_PSO_ENABLE_DEPTH_BOUND_TEST_DESC_V1 NVAPI_D3D12_PSO_ENABLE_DEPTH_BOUND_TEST_DESC;

    struct NVAPI_D3D12_PSO_SET_SHADER_EXTENSION_SLOT_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
    {
        NvU32 version; //<! Always use NV_SET_SHADER_EXTENSION_SLOT_DESC_VER
        NvU32 uavSlot;
        NvU32 registerSpace;
    };

#define NV_SET_SHADER_EXTENSION_SLOT_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_SET_SHADER_EXTENSION_SLOT_DESC_V1, 1)

#define NV_SET_SHADER_EXTENSION_SLOT_DESC_VER NV_SET_SHADER_EXTENSION_SLOT_DESC_VER_1


    typedef NVAPI_D3D12_PSO_SET_SHADER_EXTENSION_SLOT_DESC_V1 NVAPI_D3D12_PSO_SET_SHADER_EXTENSION_SLOT_DESC;

    //! \ingroup dx
    //! Enum for compute shader derivative modes
    typedef enum _NV_COMPUTE_SHADER_DERIVATIVES
    {
        NV_COMPUTE_SHADER_DERIVATIVE_NONE = 0, // No support for compute derivatives

        NV_COMPUTE_SHADER_DERIVATIVE_GROUP_LINEAR = 1, // Compute derivatives supported. Quads are defined as groups of four threads with linear thread IDs of the form 4N..4N + 3

        NV_COMPUTE_SHADER_DERIVATIVE_GROUP_QUADS = 2, // Compute derivatives supported. Quads are defined as group of 2x2 thread IDs in a 2D (or 3D) CTA. In this mode
                                                      // the app must ensure that width and height of the CTA dimension are both multiples of 2
    } NV_COMPUTE_SHADER_DERIVATIVES;

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreateGraphicsPipelineState
    //
    //! \code
    //!   DESCRIPTION: This function will create PSO with provided extensions
    //!
    //! \note   Note that "Cached PSO" functionality is not supported with the Pipeline State Object created using
    //!         this NvAPI. GetCachedBlob() should not be called with such a PSO.
    //!
    //!         \param [in]        pDevice              Current d3d device
    //!         \param [in]        pPSODesc             PSO description of type D3D12_GRAPHICS_PIPELINE_STATE_DESC
    //!         \param [in]        numExtensions        Number of extensions
    //!         \param [in]        ppExtensions         Array of PSO extensions (see NV_PSO_EXTENSION  for possible extensions)
    //!         \param [out]       ppPSO                Output PSO object of type ID3D12PipelineState
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return ::NVAPI_OK     if the call succeeds.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_CreateGraphicsPipelineState(__in ID3D12Device *pDevice,
                                                            __in const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pPSODesc,
                                                            NvU32 numExtensions,
                                                            __in const NVAPI_D3D12_PSO_EXTENSION_DESC **ppExtensions,
                                                            __out ID3D12PipelineState **ppPSO);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreateComputePipelineState
    //
    //! \code
    //!   DESCRIPTION: This function will create PSO with provided extensions
    //!
    //!         \param [in]        pDevice              Current d3d device
    //!         \param [in]        pPSODesc             PSO description of type D3D12_COMPUTE_PIPELINE_STATE_DESC
    //!         \param [in]        numExtensions        Number of extensions
    //!         \param [in]        ppExtensions         Array of PSO extensions (see NV_PSO_EXTENSION  for possible extensions)
    //!         \param [out]       ppPSO                Output PSO object of type ID3D12PipelineState
    //!
    //! \since Release: 364
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return ::NVAPI_OK     if the call succeeds.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_CreateComputePipelineState(__in ID3D12Device *pDevice,
                                                           __in const D3D12_COMPUTE_PIPELINE_STATE_DESC *pPSODesc,
                                                           NvU32 numExtensions,
                                                           __in const NVAPI_D3D12_PSO_EXTENSION_DESC **ppExtensions,
                                                           __out ID3D12PipelineState **ppPSO);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_SetDepthBoundsTestValues
    //
    //! \code
    //!   DESCRIPTION: This function will set the minDepth and maxDepth values for depth bounds test
    //!                To enable/ disable depth bounds test use PSO extension NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION
    //!                in the nvapi NvAPI_D3D12_CreateGraphicsPipelineState
    //!
    //!         \param [in]        pCommandList         Command List to set depth bounds test
    //!         \param [in]        minDepth             min value for depth bound test
    //!         \param [in]        maxDepth             max value for depth bound test
    //!
    //! The valid values for minDepth and maxDepth are such that 0 <= minDepth <= maxDepth <= 1
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return ::NVAPI_OK     if the call succeeds.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_SetDepthBoundsTestValues(__in ID3D12GraphicsCommandList *pCommandList,
                                                         __in const float minDepth,
                                                         __in const float maxDepth);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreateReservedResource
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: Tiled resource is supported for Texture2D Array, however, but only when mip packing is not triggered.
    //!                So any mip level cannot be smaller than a single tile size(64KB).
    //!                This set of API is an extension of D3D12 support for tiled resource to allow a tiled texture2D array with mip packing.
    //!                If any of API from this set is used, using all of them is highly recommended.
    //!                It includes NvAPI_D3D12_CreateReservedResource, NvAPI_D3D12_CreateHeap, NvAPI_D3D12_ReservedResourceGetDesc,
    //!                NvAPI_D3D12_UpdateTileMappings, NvAPI_D3D12_CopyTileMappings, NvAPI_D3D12_ResourceAliasingBarrier.
    //!                Reminder: all API in this set other than NvAPI_D3D12_CreateReservedResource won't has D3D Debug Layer information.
    //!
    //!                NvAPI_D3D12_CreateReservedResource is an extension of ID3D12Device::CreateReservedResource.
    //!                Use this function to create a tiled Texture2D array with mip packing.
    //!                Runtime doesn't know the created resource is actually a tiled resource.
    //!                Any other D3D12 API where runtime will check whether resource is tiled or not, has a corresponding NVAPI version and they should be used.
    //!                Different from DX11 implementation, we highly recommend replace all ID3D12Device::CreateReservedResource with NvAPI_D3D12_CreateReservedResource,
    //!                and use bTexture2DArrayMipPack to control which creation to use.
    //!                Otherwise, NvAPI_D3D12_ResourceAliasingBarrier will fail if any resource is not created by NvAPI_D3D12_CreateReservedResource.
    //!                DX11 implementation doesn't have this restriction and resource created by NVAPI and D3D API can be used together.
    //!                pHeap is necessary when bTexture2DArrayMipPack is true. pHeap can be any heap and this API doens't change anything to it.
    //!
    //!         \param [in]        pDevice                A pointer to D3D12 device.
    //!         \param [in]        pDesc                  A pointer to a D3D12_RESOURCE_DESC structure that describes the resource.
    //!         \param [in]        InitialState           The initial state of the resource, as a bitwise-OR'd combination of D3D12_RESOURCE_STATES enumeration constants.
    //!         \param [in]        pOptimizedClearValue   Specifies a D3D12_CLEAR_VALUE that describes the default value for a clear color.
    //!         \param [in]        riid                   The globally unique identifier (GUID) for the resource interface.
    //!         \param [out]       ppvResource            A pointer to a memory block that receives a pointer to the resource. Cannot be NULL.
    //!         \param [in]        bTexture2DArrayMipPack Whether pDesc indicates it's a texture2D array resource with mip packing.
    //!                                                   TRUE:  Use NVAPI to create. Will check pHeap to be not NULL.
    //!                                                   FALSE: Standard D3D12 API will be used, use DebugDevice to check any runtime ERROR. Won't check pHeap
    //!         \param [in]        pHeap                  A pointer to ID3D12Heap. Cannot be NULL when bTexture2DArrayMipPack is true.
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_CreateReservedResource(__in ID3D12Device *pDevice,
                                                       __in const D3D12_RESOURCE_DESC *pDesc,
                                                       __in D3D12_RESOURCE_STATES InitialState,
                                                       __in const D3D12_CLEAR_VALUE *pOptimizedClearValue,
                                                       __in REFIID riid,
                                                       __out void **ppvResource,
                                                       __in bool bTexture2DArrayMipPack,
                                                       __in ID3D12Heap *pHeap);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreateHeap
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D12_CreateHeap is a safe replacement of ID3D12Device::CreateHeap with no functionality change and overhead.
    //!                In NvAPI_D3D12_UpdateTileMappings, pTilePool must be created with NvAPI_D3D12_CreateHeap and otherwise NvAPI_D3D12_UpdateTileMappings will fail.
    //!                In other word, any tile pool used in NvAPI_D3D12_UpdateTileMappings must be created by NvAPI_D3D12_CreateHeap.
    //!
    //!         \param [in]        pDevice                A pointer to D3D12 device.
    //!         \param [in]        pDesc                  A pointer to a D3D12_HEAP_DESC structure that describes the heap.
    //!         \param [in]        riid                   The globally unique identifier (GUID) for the resource interface.
    //!         \param [out]       ppvHeap                A pointer to a memory block that receives a pointer to the heap. Cannot be NULL.
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_CreateHeap(__in ID3D12Device *pDevice,
                                           __in const D3D12_HEAP_DESC *pDesc,
                                           __in REFIID riid,
                                           __out void **ppvHeap);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreateHeap2
    //
    //! \since Release: 465
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D12_CreateHeap2 is a wrapper of ID3D12Device::CreateHeap
    //!                NV_D3D12_HEAP_FLAG_CPUVISIBLE_VIDMEM gives driver hint to create the heap on vidmem
    //!                only upload heaps use this flag currently, others behave exactly as ID3D12Device::CreateHeap
    //!                Best practice: Query available space in cpu visible vidmem using NvAPI_D3D12_QueryCpuVisibleVidmem
    //!                before using this flag
    //!
    //!         \param [in]        pDevice                A pointer to D3D12 device.
    //!         \param [in]        pDesc                  A pointer to a D3D12_HEAP_DESC structure that describes the heap
    //!         \param [in]        pNVHeapParams          A pointer to a NV_HEAP_PARAMS structure that gives additional NV specific resource creation information(NV_D3D12_HEAP_FLAGS below for more info)
    //!         \param [in]        riid                   The globally unique identifier (GUID) for the resource interface.
    //!         \param [out]       ppvHeap                A pointer to a memory block that receives a pointer to the heap. Cannot be NULL.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    typedef enum
    {
        NV_D3D12_HEAP_FLAG_NONE = 0,
        NV_D3D12_HEAP_FLAG_CPUVISIBLE_VIDMEM = 1, //!< Hint to create heap in cpuvisible vidmem
    } NV_D3D12_HEAP_FLAGS;

    typedef struct _NV_HEAP_PARAMS_V1
    {
        NvU32 version;                   //!< Version of structure. Must always be first member
        NV_D3D12_HEAP_FLAGS NVHeapFlags; //!< Additional NV specific flags
    } NV_HEAP_PARAMS_V1;

#define NV_HEAP_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_HEAP_PARAMS_V1, 1)


#define NV_HEAP_PARAMS_VER NV_HEAP_PARAMS_VER_1

    typedef NV_HEAP_PARAMS_V1 NV_HEAP_PARAMS;

    NVAPI_INTERFACE NvAPI_D3D12_CreateHeap2(__in ID3D12Device *pDevice,
                                            __in const D3D12_HEAP_DESC *pDesc,
                                            __in const NV_HEAP_PARAMS *pNVHeapParams,
                                            __in REFIID riid,
                                            __out void **ppvHeap);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_QueryCpuVisibleVidmem
    //
    //! \since Release: 465
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D12_QueryCpuVisibleVidmem queries total bytes and unused bytes in
    //!                cpu visible vdmem
    //!
    //!         \param [in]        pDevice                A pointer to D3D12 device.
    //!         \param [out]       pTotalBytes            Total bytes in cpu visible vidmem
    //!         \param [out]       pFreeBytes             Unused bytes in cpu visible vidmem
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_QueryCpuVisibleVidmem(__in ID3D12Device *pDevice,
                                                      __out NvU64 *pTotalBytes,
                                                      __out NvU64 *pFreeBytes);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_ReservedResourceGetDesc
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D12_ReservedResourceGetDesc is an simple wrapper of ID3D12Resource::GetDesc when pReservedResource is created by NvAPI_D3D12_CreateReservedResource.
    //!                Runtime doesn't know the created resource is actually a tiled resource if bTexture2DArrayMipPack = true in NvAPI_D3D12_CreateReservedResource.
    //!                So calling ID3D12Resource::GetDesc on such resource will get a desc with D3D12_TEXTURE_LAYOUT_UNKNOWN in Layout instead of D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE.
    //!                This wrapper API just set Layout to D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE if Layout is D3D12_TEXTURE_LAYOUT_UNKNOWN.
    //!
    //!         \param [in]        pReservedResource  Pointer of reserved resource to get resource desc from.
    //!         \param [out]       pDesc              Pointer to a resource description.
    //! SUPPORTED OS:  Windows 10
    //!
    //!
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_ReservedResourceGetDesc(__in ID3D12Resource *pReservedResource,
                                                        __out D3D12_RESOURCE_DESC *pDesc);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_UpdateTileMappings
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D12_UpdateTileMappings is an extension of ID3D12CommandQueue::UpdateTileMappings.
    //!                pTiledResource must be created by NvAPI_D3D12_CreateReservedResource.
    //!                pTilePool must be created by NvAPI_D3D12_CreateHeap.
    //!
    //!         \param [in]        pCommandQueue                        A pointer to ID3D12CommandQueue.
    //!         \param [in]        pTiledResource                       A pointer to the tiled resource created by NvAPI_D3D12_CreateReservedResource.
    //!         \param [in]        NumTiledResourceRegions              The number of tiled resource regions.
    //!         \param [in]        pTiledResourceRegionStartCoordinates An array of D3D12_TILED_RESOURCE_COORDINATE structures that describe the starting coordinates of the tiled resource regions. Cannot be NULL.
    //!         \param [in]        pTiledResourceRegionSizes            An array of D3D12_TILE_REGION_SIZE structures that describe the sizes of the tiled resource regions. Cannot be NULL.
    //!         \param [in]        pTilePool                            A pointer to the resource heap created by NvAPI_D3D12_CreateHeap.
    //!         \param [in]        NumRanges                            The number of tile-pool ranges.
    //!         \param [in]        pRangeFlags                          A pointer to an array of D3D12_TILE_RANGE_FLAGS values that describes each tile range.
    //!         \param [in]        pTilePoolStartOffsets                An array of offsets into the tile pool. These are 0-based tile offsets, counting in tiles (not bytes).
    //!         \param [in]        pRangeTileCounts                     An array of values that specify the number of tiles in each tile-pool range.
    //!         \param [in]        Flags                                A combination of D3D12_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation.
    //! SUPPORTED OS:  Windows 10
    //!
    //!
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_UpdateTileMappings(
        __in ID3D12CommandQueue *pCommandQueue,
        __in ID3D12Resource *pResource,
        __in UINT NumResourceRegions,
        __in const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates,
        __in const D3D12_TILE_REGION_SIZE *pResourceRegionSizes,
        __in ID3D12Heap *pHeap,
        __in UINT NumRanges,
        __in const D3D12_TILE_RANGE_FLAGS *pRangeFlags,
        __in const UINT *pHeapRangeStartOffsets,
        __in const UINT *pRangeTileCounts,
        __in D3D12_TILE_MAPPING_FLAGS Flags);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CopyTileMappings
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D12_CopyTileMappings is an extension of ID3D12CommandQueue::CopyTileMappings
    //!                pDstResource and pSrcResource must be created by NvAPI_D3D12_CreateReservedResource.
    //!
    //!         \param [in]        pCommandQueue                        A pointer to ID3D12CommandQueue.
    //!         \param [in]        pDstResource                         Tiled resource created by NvAPI_D3D12_CreateReservedResource to copy tile mappings into.
    //!         \param [in]        pDstRegionStartCoordinate            A pointer to a D3D12_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the destination reserved resource.
    //!         \param [in]        pSrcResource                         Tiled resource created by NvAPI_D3D12_CreateReservedResource to copy tile mappings from.
    //!         \param [in]        pSourceRegionStartCoordinate         A pointer to a D3D12_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the source reserved resource.
    //!         \param [in]        pTileRegionSize                      A pointer to a D3D12_TILE_REGION_SIZE structure that describes the size of the reserved region.
    //!         \param [in]        Flags                                One member of D3D12_TILE_MAPPING_FLAGS.
    //! SUPPORTED OS:  Windows 10
    //!
    //!
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_CopyTileMappings(
        __in ID3D12CommandQueue *pCommandQueue,
        __in ID3D12Resource *pDstResource,
        __in const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate,
        __in ID3D12Resource *pSrcResource,
        __in const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate,
        __in const D3D12_TILE_REGION_SIZE *pRegionSize,
        __in D3D12_TILE_MAPPING_FLAGS Flags);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_ResourceAliasingBarrier
    //
    //! \since Release: 375
    //
    //! \code
    //!   DESCRIPTION: NvAPI_D3D12_ResourceAliasingBarrier is an extension of ID3D12GraphicsCommandList::ResourceBarrier, but only for D3D12_RESOURCE_ALIASING_BARRIER.
    //!                Both resource in pBarriers must be created by NvAPI_D3D12_CreateReservedTexture2DArray.
    //!
    //!         \param [in]        pCommandList                            A pointer to ID3D12GraphicsCommandList.
    //!         \param [in]        NumBarriers                             The number of submitted barrier descriptions.
    //!         \param [in]        pBarriers                               Pointer to an array of barrier descriptions with D3D12_RESOURCE_ALIASING_BARRIER type only.
    //! SUPPORTED OS:  Windows 10
    //!
    //!
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_ResourceAliasingBarrier(
        __in ID3D12GraphicsCommandList *pCommandList,
        __in UINT NumBarriers,
        __in const D3D12_RESOURCE_BARRIER *pBarriers);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    // Experimental API for internal use. DO NOT USE!

    typedef struct
    {
        NvU32 version;       //!< Structure version
        NvU32 surfaceHandle; //!< [OUT] driver handle for a UAV (that can be used as a cudaSurfaceObject_t)
        NvU64 gpuVAStart;    //!< [OUT] gpu virtual address where resource starts
        NvU64 gpuVASize;     //!< [OUT] virtual memory size
    } NVAPI_UAV_INFO_V1;

    typedef struct
    {
        NvU32 version;       //!< Structure version
        NvU32 surfaceHandle; //!< [OUT] driver handle for a UAV (that can be used as a cudaSurfaceObject_t)
        NvU64 gpuVAStart;    //!< [OUT] gpu virtual address where resource starts
        NvU64 gpuVASize;     //!< [OUT] virtual memory size
        NvU64 outFlags;
    } NVAPI_UAV_INFO_V2;

#define NVAPI_UAV_INFO_VER1 1

#define NVAPI_UAV_INFO_VER2 MAKE_NVAPI_VERSION(NVAPI_UAV_INFO_V2, 2)


#define NVAPI_UAV_INFO_VER NVAPI_UAV_INFO_VER2

    typedef NVAPI_UAV_INFO_V2 NVAPI_UAV_INFO;

    NVAPI_INTERFACE NvAPI_D3D12_CaptureUAVInfo(__in ID3D12Device *pDevice,
                                               __out NVAPI_UAV_INFO *pUAVInfo);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d11_h__)
    typedef struct
    {
        NvU32 version;               //!< [IN]
        NVDX_ObjectHandle hResource; //!< [IN]
        NvU64 gpuVAStart;            //!< [OUT] gpu virtual address where resource starts
        NvU64 gpuVASize;             //!< [OUT] virtual memory size
    } NV_GET_GPU_VIRTUAL_ADDRESS_V1;

#define NV_GET_GPU_VIRTUAL_ADDRESS_VER1 MAKE_NVAPI_VERSION(NV_GET_GPU_VIRTUAL_ADDRESS_V1, 1)

#define NV_GET_GPU_VIRTUAL_ADDRESS_VER NV_GET_GPU_VIRTUAL_ADDRESS_VER1

#define NV_GET_GPU_VIRTUAL_ADDRESS NV_GET_GPU_VIRTUAL_ADDRESS_V1


    //! SUPPORTED OS:  Windows 10
    //!
    // Experimental API for internal use. DO NOT USE!
    NVAPI_INTERFACE NvAPI_D3D11_GetResourceGPUVirtualAddressEx(__in ID3D11Device *pDevice,
                                                               __inout NV_GET_GPU_VIRTUAL_ADDRESS *pParams);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
///////////////////////////////////////////////////////////////////////////////
//
// MetaCommands common defines
//
//! \since Release: 400
//
///////////////////////////////////////////////////////////////////////////////
#pragma pack(push, 4)

    enum NV_D3D_GRAPHICS_STATES
    {
        NV_D3D_GRAPHICS_STATE_NONE = 0,
        NV_D3D_GRAPHICS_STATE_IA_VERTEX_BUFFERS = (1 << 0),
        NV_D3D_GRAPHICS_STATE_IA_INDEX_BUFFER = (1 << 1),
        NV_D3D_GRAPHICS_STATE_IA_PRIMITIVE_TOPOLOGY = (1 << 2),
        NV_D3D_GRAPHICS_STATE_DESCRIPTOR_HEAP = (1 << 3),
        NV_D3D_GRAPHICS_STATE_GRAPHICS_ROOT_SIGNATURE = (1 << 4),
        NV_D3D_GRAPHICS_STATE_COMPUTE_ROOT_SIGNATURE = (1 << 5),
        NV_D3D_GRAPHICS_STATE_RS_VIEWPORTS = (1 << 6),
        NV_D3D_GRAPHICS_STATE_RS_SCISSOR_RECTS = (1 << 7),
        NV_D3D_GRAPHICS_STATE_PREDICATION = (1 << 8),
        NV_D3D_GRAPHICS_STATE_OM_RENDER_TARGETS = (1 << 9),
        NV_D3D_GRAPHICS_STATE_OM_STENCIL_REF = (1 << 10),
        NV_D3D_GRAPHICS_STATE_OM_BLEND_FACTOR = (1 << 11),
        NV_D3D_GRAPHICS_STATE_PIPELINE_STATE = (1 << 12),
        NV_D3D_GRAPHICS_STATE_SO_TARGETS = (1 << 13),
        NV_D3D_GRAPHICS_STATE_OM_DEPTH_BOUNDS = (1 << 14),
        NV_D3D_GRAPHICS_STATE_SAMPLE_POSITIONS = (1 << 15),
        NV_D3D_GRAPHICS_STATE_VIEW_INSTANCE_MASK = (1 << 16),
    };

    struct NVAPI_META_COMMAND_DESC
    {
        GUID Id;
        LPCWSTR Name;

        // states that the initialization and execution of the metacommand will dirty
        NV_D3D_GRAPHICS_STATES InitializationDirtyState;
        NV_D3D_GRAPHICS_STATES ExecutionDirtyState;
    };

    typedef NvU64 NV_META_COMMAND_BOOL;

#define NV_META_COMMAND_MAX_TENSOR_DIM 5

    // dimensions (Size and Stride) are always indexed this way, irrespective of NV_META_COMMAND_LAYOUT
    // For DimensionCount = 5: N, C, D, H, W
    // For DimensionCount = 4: N, C, H, W

#define NV_META_COMMAND_ACTIVATION_MAX_PARAMS 2


#if __cplusplus >= 201103L

#define compile_time_assert(b) static_assert((b), "Compile time assertion failed: " #b)


    enum NV_META_COMMAND_TENSOR_DATA_TYPE : NvU64
    {
        NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT32,
        NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT16,
        NV_META_COMMAND_TENSOR_DATA_TYPE_UINT32,

        NV_META_COMMAND_TENSOR_DATA_TYPE_COUNT,
    };

    enum NV_META_COMMAND_TENSOR_LAYOUT : NvU64
    {
        NV_META_COMMAND_TENSOR_LAYOUT_UNKNOWN,  // opaque HW-native layout
        NV_META_COMMAND_TENSOR_LAYOUT_STANDARD, // NCDHW - planar / row major layout (width is inner-most dimension, batch-size N is the outermost)
        NV_META_COMMAND_TENSOR_LAYOUT_COUNT,
    };

    enum NV_META_COMMAND_TENSOR_FLAGS : NvU64
    {
        NV_META_COMMAND_TENSOR_FLAG_NONE = 0,
        NV_META_COMMAND_TENSOR_FLAG_DATA_STATIC = 0x1, // data pointed by the tensor is static (i.e, won't be modified after command list recording)
    };

    enum NV_META_COMMAND_PRECISION : NvU64
    {
        NV_META_COMMAND_PRECISION_FLOAT32,
        NV_META_COMMAND_PRECISION_FLOAT16,
        NV_META_COMMAND_PRECISION_MUL_FLOAT16_ADD_FLOAT32,

        NV_META_COMMAND_PRECISION_COUNT,
    };

    struct NV_META_COMMAND_TENSOR_DESC
    {
        NV_META_COMMAND_TENSOR_DATA_TYPE DataType;
        NV_META_COMMAND_TENSOR_LAYOUT Layout;
        NV_META_COMMAND_TENSOR_FLAGS Flags;
        NvU64 DimensionCount; // 4 or 5
        NvU64 Size[NV_META_COMMAND_MAX_TENSOR_DIM];
        NvU64 Stride[NV_META_COMMAND_MAX_TENSOR_DIM]; // only used with NV_META_COMMAND_TENSOR_LAYOUT_STANDARD
    };

    enum NV_META_COMMAND_ACTIVATION_FUNCTION : NvU64
    {
        NV_META_COMMAND_ACTIVATION_FUNCTION_ELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_HARDMAX,
        NV_META_COMMAND_ACTIVATION_FUNCTION_HARD_SIGMOID,
        NV_META_COMMAND_ACTIVATION_FUNCTION_IDENTITY,
        NV_META_COMMAND_ACTIVATION_FUNCTION_LEAKY_RELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_LINEAR,
        NV_META_COMMAND_ACTIVATION_FUNCTION_LOG_SOFTMAX,
        NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETERIZED_RELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETRIC_SOFTPLUS,
        NV_META_COMMAND_ACTIVATION_FUNCTION_RELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_ELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_TANH,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SIGMOID,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTMAX,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTPLUS,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTSIGN,
        NV_META_COMMAND_ACTIVATION_FUNCTION_TANH,
        NV_META_COMMAND_ACTIVATION_FUNCTION_THRESHOLDED_RELU,

        NV_META_COMMAND_ACTIVATION_FUNCTION_COUNT,
    };

    struct NV_META_COMMAND_ACTIVATION_DESC
    {
        NV_META_COMMAND_ACTIVATION_FUNCTION Function;
        float Params[NV_META_COMMAND_ACTIVATION_MAX_PARAMS];
    };

#else

#define compile_time_assert(b) typedef char compile_time_assertion_failed_in_line_##__LINE__[(b) ? 1 : -1]

    enum NV_META_COMMAND_TENSOR_DATA_TYPE
    {
        NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT32,
        NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT16,
        NV_META_COMMAND_TENSOR_DATA_TYPE_UINT32,

        NV_META_COMMAND_TENSOR_DATA_TYPE_COUNT,
    };


    enum NV_META_COMMAND_TENSOR_LAYOUT
    {
        NV_META_COMMAND_TENSOR_LAYOUT_UNKNOWN,  // opaque HW-native layout
        NV_META_COMMAND_TENSOR_LAYOUT_STANDARD, // NCDHW - planar / row major layout (width is inner-most dimension, batch-size N is the outermost)
        NV_META_COMMAND_TENSOR_LAYOUT_COUNT,
    };

    enum NV_META_COMMAND_TENSOR_FLAGS
    {
        NV_META_COMMAND_TENSOR_FLAG_NONE = 0,
        NV_META_COMMAND_TENSOR_FLAG_DATA_STATIC = 0x1, // data pointed by the tensor is static (i.e, won't be modified after command list recording)
    };

    enum NV_META_COMMAND_PRECISION
    {
        NV_META_COMMAND_PRECISION_FLOAT32,
        NV_META_COMMAND_PRECISION_FLOAT16,
        NV_META_COMMAND_PRECISION_MUL_FLOAT16_ADD_FLOAT32,

        NV_META_COMMAND_PRECISION_COUNT,
    };

    struct NV_META_COMMAND_TENSOR_DESC
    {
        NvU64 DataType;       // NV_META_COMMAND_TENSOR_DATA_TYPE
        NvU64 Layout;         // NV_META_COMMAND_TENSOR_LAYOUT
        NvU64 Flags;          // NV_META_COMMAND_TENSOR_FLAGS
        NvU64 DimensionCount; // 4 or 5
        NvU64 Size[NV_META_COMMAND_MAX_TENSOR_DIM];
        NvU64 Stride[NV_META_COMMAND_MAX_TENSOR_DIM]; // only used with NV_META_COMMAND_TENSOR_LAYOUT_STANDARD
    };

    enum NV_META_COMMAND_ACTIVATION_FUNCTION
    {
        NV_META_COMMAND_ACTIVATION_FUNCTION_ELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_HARDMAX,
        NV_META_COMMAND_ACTIVATION_FUNCTION_HARD_SIGMOID,
        NV_META_COMMAND_ACTIVATION_FUNCTION_IDENTITY,
        NV_META_COMMAND_ACTIVATION_FUNCTION_LEAKY_RELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_LINEAR,
        NV_META_COMMAND_ACTIVATION_FUNCTION_LOG_SOFTMAX,
        NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETERIZED_RELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETRIC_SOFTPLUS,
        NV_META_COMMAND_ACTIVATION_FUNCTION_RELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_ELU,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_TANH,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SIGMOID,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTMAX,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTPLUS,
        NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTSIGN,
        NV_META_COMMAND_ACTIVATION_FUNCTION_TANH,
        NV_META_COMMAND_ACTIVATION_FUNCTION_THRESHOLDED_RELU,

        NV_META_COMMAND_ACTIVATION_FUNCTION_COUNT,
    };

    struct NV_META_COMMAND_ACTIVATION_DESC
    {
        NvU64 Function; // NV_META_COMMAND_ACTIVATION_FUNCTION
        float Params[NV_META_COMMAND_ACTIVATION_MAX_PARAMS];
    };

#endif

    struct NV_META_COMMAND_OPTIONAL_TENSOR_DESC : NV_META_COMMAND_TENSOR_DESC
    {
        // true when the tensor isn't needed (e.g, bias is optional)
        NV_META_COMMAND_BOOL IsNull;
    };

    struct NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC : NV_META_COMMAND_ACTIVATION_DESC
    {
        // true when activation isn't needed
        NV_META_COMMAND_BOOL IsNull;
    };

    enum NV_META_COMMAND_PADDING_MODE
    {
        NV_META_COMMAND_PADDING_ZEROS,
        NV_META_COMMAND_PADDING_MIRROR,
        NV_META_COMMAND_PADDING_CLAMP,
        NV_META_COMMAND_PADDING_CONSTANT,

        NV_META_COMMAND_PADDING_COUNT,
    };

    struct NV_META_COMMAND_PADDING_DESC
    {
        NV_META_COMMAND_PADDING_MODE Mode;

        // used with NV_META_COMMAND_PADDING_CONSTANT
        float ConstantPadVal;
    };

    // use this enum to query resource sizes using GetRequiredParameterResourceSize() call
    enum NV_META_COMMAND_RESOURCE_TYPE
    {
        NV_META_COMMAND_RESOURCE_TYPE_INPUT = 0,
        NV_META_COMMAND_RESOURCE_TYPE_OUTPUT = 1,

        NV_META_COMMAND_RESOURCE_TYPE_FILTER = 2,
        NV_META_COMMAND_RESOURCE_TYPE_WEIGHT = 2,
        NV_META_COMMAND_RESOURCE_TYPE_BIAS = 3,

        NV_META_COMMAND_RESOURCE_TYPE_MATRIX_A = 0,
        NV_META_COMMAND_RESOURCE_TYPE_MATRIX_B = 2,
        NV_META_COMMAND_RESOURCE_TYPE_MATRIX_C = 3,

        NV_META_COMMAND_RESOURCE_TYPE_PERSISTENT = 4,
        NV_META_COMMAND_RESOURCE_TYPE_TEMPORARY = 5,
    };

    // Extended version of convolution operation that performs:
    //
    // y = act ( alpha1 * conv(x) + alpha2 * z + bias )
    //
    // alpha1 and alpha2 are either scalars or if PerChannelScaling is TRUE, they are vectors of
    // same dimension as the bias tensor (vector of size equal to number of output channels)
    //
    // z (SkipConnectionResource) has same dimension as output tensor y (OutputResource).

    static const GUID MetaCommand_ConvolutionEx =
        {0xa7666f1e, 0x9c55, 0x47ee, {0x9e, 0xb3, 0xe1, 0x62, 0x0, 0x92, 0xd1, 0xe9}};

#define NV_META_COMMAND_NUM_SPATIAL_DIM 3

    // D, H, W when DimensionCount is 3
    // H, W when DimensionCount is 2

#if __cplusplus >= 201103L
    enum NV_META_COMMAND_CONVOLUTION_DIRECTION : NvU64
    {
        NV_META_COMMAND_CONVOLUTION_DIRECTION_FORWARD,  // Corresponds to regular Convolution
        NV_META_COMMAND_CONVOLUTION_DIRECTION_BACKWARD, // Corresponds to ConvolutionTranspose

        NV_META_COMMAND_CONVOLUTION_DIRECTION_COUNT,
    };

    enum NV_META_COMMAND_CONVOLUTION_MODE : NvU64
    {
        NV_META_COMMAND_CONVOLUTION_MODE_CONVOLUTION,
        NV_META_COMMAND_CONVOLUTION_MODE_CROSS_CORRELATION,

        NV_META_COMMAND_CONVOLUTION_MODE_COUNT,
    };

    struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC
    {
        // Descriptor of the input tensor
        NV_META_COMMAND_TENSOR_DESC DescIn;

        // Descriptor of the tensor acting as the filter kernel
        NV_META_COMMAND_TENSOR_DESC DescFilter;

        // Descriptor of the optional bias tensor
        NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescBias;

        // Descriptor of the output tensor
        NV_META_COMMAND_TENSOR_DESC DescOut;

        // Convolution mode (CROSS_CORRELATION or CONVOLUTION)
        NV_META_COMMAND_CONVOLUTION_MODE Mode;

        // Convolution direction (FORWARD or BACKWARD)
        NV_META_COMMAND_CONVOLUTION_DIRECTION Direction;

        // Precision at which convolution is done
        NV_META_COMMAND_PRECISION Precision;

        // Optional activation function
        NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation;

        // Padding mode (only used when output tensor dimensions are different from input tensor dimensions)
        NV_META_COMMAND_PADDING_DESC Padding;

        // enables per channel scaling i.e, use Alpha1Resource and Alpha2Resource
        // instead of Alpha1 and Alpha2 below
        NV_META_COMMAND_BOOL PerChannelScaling;

        // scaling factors used when PerChannelScaling is FALSE
        // set Alpha1 = 1.0f, Alpha2 = 0.0f for simple convolutions
        // that don't need scaling or skip connection
        float Alpha1;
        float Alpha2;

        // Strides for the filter kernel position
        NvU64 Stride[NV_META_COMMAND_NUM_SPATIAL_DIM];

        // The distance per dimension between elements that are multiplied
        NvU64 Dilation[NV_META_COMMAND_NUM_SPATIAL_DIM];

        // Padding at the start of each dimension
        NvU64 StartPadding[NV_META_COMMAND_NUM_SPATIAL_DIM];

        // Padding at the end of each dimension
        NvU64 EndPadding[NV_META_COMMAND_NUM_SPATIAL_DIM];

        // Number of dimensions to which convolution occurs (2 or 3)
        NvU64 DimensionCount;

        // Number of channel groups convolved independently
        NvU64 GroupCount;
    };

#else

    enum NV_META_COMMAND_CONVOLUTION_DIRECTION
    {
        NV_META_COMMAND_CONVOLUTION_DIRECTION_FORWARD,  // Corresponds to regular Convolution
        NV_META_COMMAND_CONVOLUTION_DIRECTION_BACKWARD, // Corresponds to ConvolutionTranspose

        NV_META_COMMAND_CONVOLUTION_DIRECTION_COUNT,
    };

    enum NV_META_COMMAND_CONVOLUTION_MODE
    {
        NV_META_COMMAND_CONVOLUTION_MODE_CONVOLUTION,
        NV_META_COMMAND_CONVOLUTION_MODE_CROSS_CORRELATION,

        NV_META_COMMAND_CONVOLUTION_MODE_COUNT,
    };

    struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC
    {
        // Descriptor of the input tensor
        NV_META_COMMAND_TENSOR_DESC DescIn;

        // Descriptor of the tensor acting as the filter kernel
        NV_META_COMMAND_TENSOR_DESC DescFilter;

        // Descriptor of the optional bias tensor
        NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescBias;

        // Descriptor of the output tensor
        NV_META_COMMAND_TENSOR_DESC DescOut;

        // Convolution mode (CROSS_CORRELATION or CONVOLUTION)
        NvU64 Mode; // NV_META_COMMAND_CONVOLUTION_MODE

        // Convolution direction (FORWARD or BACKWARD)
        NvU64 Direction; // NV_META_COMMAND_CONVOLUTION_DIRECTION

        // Precision at which convolution is done
        NvU64 Precision; // NV_META_COMMAND_PRECISION

        // Optional activation function
        NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation;

        // Padding mode (only used when output tensor dimensions are different from input tensor dimensions)
        NV_META_COMMAND_PADDING_DESC Padding;

        // enables per channel scaling i.e, use Alpha1Resource and Alpha2Resource
        // instead of Alpha1 and Alpha2 below
        NV_META_COMMAND_BOOL PerChannelScaling;

        // scaling factors used when PerChannelScaling is FALSE
        // set Alpha1 = 1.0f, Alpha2 = 0.0f for simple convolutions
        // that don't need scaling or skip connection
        float Alpha1;
        float Alpha2;

        // Strides for the filter kernel position
        NvU64 Stride[NV_META_COMMAND_NUM_SPATIAL_DIM];

        // The distance per dimension between elements that are multiplied
        NvU64 Dilation[NV_META_COMMAND_NUM_SPATIAL_DIM];

        // Padding at the start of each dimension
        NvU64 StartPadding[NV_META_COMMAND_NUM_SPATIAL_DIM];

        // Padding at the end of each dimension
        NvU64 EndPadding[NV_META_COMMAND_NUM_SPATIAL_DIM];

        // Number of dimensions to which convolution occurs (2 or 3)
        NvU64 DimensionCount;

        // Number of channel groups convolved independently
        NvU64 GroupCount;
    };
#endif

    // Fused Convolution variants

    // supported combinations right now are:
    //  - Convolution + Max Pooling (also optionally outputs pre-pool data)
    //  - 2x2 upsample + (optional) residual add + Convolution
    //
    // other combinations may be exposed in future

    static const GUID MetaCommand_ConvolutionExFused =
        {0xe1b112eb, 0xdecd, 0x4ff6, {0x85, 0xbb, 0x1f, 0xe, 0x3a, 0xb0, 0x4, 0x14}};

    enum NV_META_COMMAND_CONVOLUTION_POOL_MODE
    {
        NV_META_COMMAND_CONVOLUTION_POOL_MODE_NONE,
        NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_MAX,
        NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_AVG,
        NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_MIN,

        NV_META_COMMAND_CONVOLUTION_POOL_MODE_COUNT,
    };

    enum NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE
    {
        NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_NONE,
        NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_REPLICATE,
        NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_BILINEAR,

        NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_COUNT,
    };

    enum NV_META_COMMAND_CONVOLUTION_SKIP_MODE
    {
        NV_META_COMMAND_CONVOLUTION_SKIP_MODE_NONE,
        NV_META_COMMAND_CONVOLUTION_SKIP_MODE_ADD,
        NV_META_COMMAND_CONVOLUTION_SKIP_MODE_CONCAT,

        NV_META_COMMAND_CONVOLUTION_SKIP_MODE_COUNT,
    };

    struct NV_META_COMMAND_CONVOLUTION_FUSE_DESC
    {
        NV_META_COMMAND_CONVOLUTION_POOL_MODE PoolMode;
        NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE UpsampleMode;
        NV_META_COMMAND_CONVOLUTION_SKIP_MODE SkipMode;

        NV_META_COMMAND_BOOL OutputPrepool; // used with NV_META_COMMAND_CONVOLUTION_POOL_MODE
    };

    // uses same structures for init and execute descriptors
    // SkipConnectionResource is used to specify the resource for pre-pool data or residual add
    struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_FUSED_DESC : NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC
    {
        NV_META_COMMAND_CONVOLUTION_FUSE_DESC FuseDesc;
    };

    // make sure structure sizes match what the driver assumes
    compile_time_assert(sizeof(NV_META_COMMAND_TENSOR_DESC) == 112);
    compile_time_assert(sizeof(NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC) == 640);
    compile_time_assert(sizeof(NV_META_COMMAND_CONVOLUTION_FUSE_DESC) == 20);
    compile_time_assert(sizeof(NV_META_COMMAND_CREATE_CONVOLUTION_EX_FUSED_DESC) == 660);

    // GEMM (General matrix multiply)
    //
    // Y = alpha * t(A) * t(B) + beta * C,
    //
    // where t is a matrix transform option
    //
    // If C is null, and beta is non-zero, the output
    // matrix is used as C matrix. i.e, the operation performed is:
    // Y = alpha * t(A) * t(B) + beta * Y
    //
    static const GUID MetaCommand_Gemm =
        {0x8f9ff059, 0xfe72, 0x488e, {0xa0, 0x66, 0xb1, 0x4e, 0x79, 0x48, 0xec, 0x8}};

#if __cplusplus >= 201103L

    enum NV_META_COMMAND_MATRIX_TRANSFORM : NvU64
    {
        NV_META_COMMAND_MATRIX_TRANSFORM_NONE,
        NV_META_COMMAND_MATRIX_TRANSFORM_TRANSPOSE,

        NV_META_COMMAND_MATRIX_TRANSFORM_COUNT,
    };

    struct NV_META_COMMAND_CREATE_GEMM_DESC
    {
        NV_META_COMMAND_TENSOR_DESC DescA;
        NV_META_COMMAND_TENSOR_DESC DescB;
        NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescC;
        NV_META_COMMAND_TENSOR_DESC DescOut;
        NV_META_COMMAND_PRECISION Precision;

        NV_META_COMMAND_MATRIX_TRANSFORM TransA;
        NV_META_COMMAND_MATRIX_TRANSFORM TransB;
        float Alpha;
        float Beta;

        NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation;
    };

#else

    enum NV_META_COMMAND_MATRIX_TRANSFORM
    {
        NV_META_COMMAND_MATRIX_TRANSFORM_NONE,
        NV_META_COMMAND_MATRIX_TRANSFORM_TRANSPOSE,

        NV_META_COMMAND_MATRIX_TRANSFORM_COUNT,
    };

    struct NV_META_COMMAND_CREATE_GEMM_DESC
    {
        NV_META_COMMAND_TENSOR_DESC DescA;
        NV_META_COMMAND_TENSOR_DESC DescB;
        NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescC;
        NV_META_COMMAND_TENSOR_DESC DescOut;
        NvU64 Precision; // NV_META_COMMAND_PRECISION

        NvU64 TransA; // NV_META_COMMAND_MATRIX_TRANSFORM
        NvU64 TransB; // NV_META_COMMAND_MATRIX_TRANSFORM
        float Alpha;
        float Beta;

        NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation;
    };

#endif

#pragma pack(pop)

#endif // #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))

#if defined(__cplusplus) && defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_EnumerateMetaCommands
    //
    //! \since Release: 400
    //
    //! \code
    //!   DESCRIPTION: Enumerates MetaCommands supported on the system
    //!
    //!         \param [in]        pDevice                A pointer to D3D11 device.
    //!         \param [in/out]    pNumMetaCommands       Should be non-null. When the value pointed by pNumMetaCommands is 0 (or when pDescs is NULL), the function returns number of metacommands supported.
    //!                                                   When the value pointed is non-zero, the value indicates number of Metacommand descriptions to be populated in pDescs array.
    //!         \param [out]       pDescs                 Pointer to array where Metacommand descriptions will be returned. Can be null to indicate that the app is querying the number of supported metacommands.
    //!                                                   Otherwise should have enough space to hold *pNumMetaCommands descriptors
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_EnumerateMetaCommands(__in ID3D11Device *pDevice,
                                                      __inout NvU32 *pNumMetaCommands,
                                                      __out_ecount_opt(*pNumMetaCommands) NVAPI_META_COMMAND_DESC *pDescs);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

#if defined(__cplusplus) && defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateMetaCommand
    //
    //! \since Release: 400
    //
    //! \code
    //!   DESCRIPTION: Creates a MetaCommand object which can be used to execute optimized operations exposed by driver like convolutions.
    //!
    //!         \param [in]        pDevice                      A pointer to D3D11 device.
    //!         \param [in]        CommandId                    GUID of the operations to perform
    //!         \param [in]        pCreationParametersData      structure containing all creation parameters for the requested Metacommand
    //!         \param [in]        CreationParametersDataSize   size of parameter data structure
    //!         \param [out]       ppMetaCommand                A pointer to memory that receives the pointer to the created MetaCommand object.
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //!          NVAPI_NOT_SUPPORTED  - The requested Metacommand is not supported.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

#pragma pack(push, 4)
    struct NV_D3D11_META_COMMAND_RESOURCE
    {
        union
        {
            NVDX_ObjectHandle ResourceHandle; // NVAPI handle of a buffer resource (use NvAPI_D3D11_GetResourceHandle to get this handle)
            NvU64 unused;                     // to get correct sturcutre size on 32 bit builds
        };
        NvU64 Offset; // offset within the resource in bytes
    };

    struct NV_D3D11_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC
    {
        // Persistent resource used as scratch space by driver
        // it's written at time of init, and read at time of execute
        // use GetRequiredParameterResourceSize to query its size
        NV_D3D11_META_COMMAND_RESOURCE PersistentResource;
    };

    struct NV_D3D11_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC
    {
        NV_D3D11_META_COMMAND_RESOURCE InputResource;
        NV_D3D11_META_COMMAND_RESOURCE FilterResource;
        NV_D3D11_META_COMMAND_RESOURCE BiasResource; // optional
        NV_D3D11_META_COMMAND_RESOURCE OutputResource;

        // Alpha1Resource and Alpha2Resource are used only when
        // PerChannelScaling is set. Otherwise the scalars Alpha1/Alpha2 are used
        // should have same dimension as bias
        NV_D3D11_META_COMMAND_RESOURCE Alpha1Resource;
        NV_D3D11_META_COMMAND_RESOURCE Alpha2Resource;

        // optional, same dimension/descriptor as output
        NV_D3D11_META_COMMAND_RESOURCE SkipConnectionResource;

        // should point to same memory that was specified at time of init
        NV_D3D11_META_COMMAND_RESOURCE PersistentResource;

        // temporary resource used as scratch space by driver
        // used for both read and write at the time of execute
        // use GetRequiredParameterResourceSize to query its size
        NV_D3D11_META_COMMAND_RESOURCE TemporaryResource;
    };

    // make sure structure sizes match what the driver assumes
    compile_time_assert(sizeof(NV_D3D11_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC) == 16);
    compile_time_assert(sizeof(NV_D3D11_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC) == 144);

    struct NV_D3D11_META_COMMAND_INITIALIZE_GEMM_DESC
    {
        NV_D3D11_META_COMMAND_RESOURCE PersistentResource;
    };

    struct NV_D3D11_META_COMMAND_EXECUTE_GEMM_DESC
    {
        NV_D3D11_META_COMMAND_RESOURCE AResource;
        NV_D3D11_META_COMMAND_RESOURCE BResource;
        NV_D3D11_META_COMMAND_RESOURCE CResource;
        NV_D3D11_META_COMMAND_RESOURCE OutputResource;

        NV_D3D11_META_COMMAND_RESOURCE PersistentResource;
        NV_D3D11_META_COMMAND_RESOURCE TemporaryResource;
    };

    // make sure structure sizes match what the driver assumes
    compile_time_assert(sizeof(NV_D3D11_META_COMMAND_INITIALIZE_GEMM_DESC) == 16);
    compile_time_assert(sizeof(NV_D3D11_META_COMMAND_EXECUTE_GEMM_DESC) == 96);

#pragma pack(pop)

    DECLARE_INTERFACE_(__declspec(uuid("00BF193A-117B-42BC-BBCD-E964A0EA4F2B")) ID3D11NvMetaCommand_V1, IUnknown)
    {
        BEGIN_INTERFACE

        // *** IUnknown methods ***
        STDMETHOD(QueryInterface)
        (THIS_ REFIID riid, void **ppv) PURE;
        STDMETHOD_(ULONG, AddRef)
        (THIS) PURE;
        STDMETHOD_(ULONG, Release)
        (THIS) PURE;

        // ** ID3D11NvMetaCommand methods ***
        // Return size of parameter
        STDMETHOD(GetRequiredParameterResourceSize)
        (THIS_ NV_META_COMMAND_RESOURCE_TYPE ResourceType, NvU64 * SizeInBytes) const PURE;

        END_INTERFACE
    };

    typedef ID3D11NvMetaCommand_V1 ID3D11NvMetaCommand;
#define ID3D11NvMetaCommand_VER1 MAKE_NVAPI_VERSION(IID3D11NvMetaCommand_V1, 1)

#define ID3D11NvMetaCommand_VER ID3D11NvMetaCommand_VER1


    NVAPI_INTERFACE NvAPI_D3D11_CreateMetaCommand(__in ID3D11Device *pDevice,
                                                  __in REFGUID CommandId,
                                                  __in_bcount(CreationParametersDataSize) const void *pCreationParametersData,
                                                  __in NvU32 CreationParametersDataSize,
                                                  __out ID3D11NvMetaCommand **ppMetaCommand);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

#if defined(__cplusplus) && defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_InitializeMetaCommand
    //
    //! \since Release: 400
    //
    //! \code
    //!   DESCRIPTION: Initializes the given MetaCommand with the parameters passed in
    //!
    //!         \param [in]        pDeviceContext                   A pointer to the d3d11 device context
    //!         \param [in]        pMetaCommand                     the MetaCommand to initialize
    //!         \param [in]        pInitializationParametersData    Structure containing parameters
    //!         \param [in]        InitializationParametersDataSize Size of the parameter structure in bytes
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_InitializeMetaCommand(__in ID3D11DeviceContext *pDeviceContext,
                                                      __in ID3D11NvMetaCommand *pMetaCommand,
                                                      __in_bcount(InitializationParametersDataSize) const void *pInitializationParametersData,
                                                      __in NvU32 InitializationParametersDataSize);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

#if defined(__cplusplus) && defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_ExecuteMetaCommand
    //
    //! \since Release: 400
    //
    //! \code
    //!   DESCRIPTION: Executes the given MetaCommand with the parameters passed in
    //!
    //!         \param [in]        pDeviceContext                   A pointer to the d3d11 device context
    //!         \param [in]        pMetaCommand                     the MetaCommand to execute
    //!         \param [in]        pExecutionParametersData         Structure containing parameters
    //!         \param [in]        ExecutionParametersDataSize      Size of the parameter structure in bytes
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_ExecuteMetaCommand(__in ID3D11DeviceContext *pDeviceContext,
                                                   __in ID3D11NvMetaCommand *pMetaCommand,
                                                   __in_bcount(ExecutionParametersDataSize) const void *pExecutionParametersData,
                                                   __in NvU32 ExecutionParametersDataSize);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_EnumerateMetaCommands
    //
    //! \since Release: 400
    //
    //! \code
    //!   DESCRIPTION: Enumerates MetaCommands supported on the system
    //!
    //!         \param [in]        pDevice                A pointer to D3D12 device.
    //!         \param [in/out]    pNumMetaCommands       Should be non-null. When the value pointed by pNumMetaCommands is 0 or when pDescs is NULL, the function returns number of metacommands supported.
    //!                                                   When the value pointed is non-zero, the value indicates number of Metacommand descriptions to be populated in pDescs array.
    //!         \param [out]       pDescs                 Pointer to array where Metacommand descriptions will be returned. Can be null to indicate that the app is querying the number of supported metacommands.
    //!                                                   Otherwise should have enough space to hold *pNumMetaCommands descriptors
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_EnumerateMetaCommands(__in ID3D12Device *pDevice,
                                                      __inout NvU32 *pNumMetaCommands,
                                                      __out_ecount_opt(*pNumMetaCommands) NVAPI_META_COMMAND_DESC *pDescs);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreateMetaCommand
    //
    //! \since Release: 400
    //
    //! \code
    //!   DESCRIPTION: Creates a MetaCommand object which can be used to execute optimized operations exposed by driver like convolutions.
    //!
    //!         \param [in]        pDevice                      A pointer to D3D12 device.
    //!         \param [in]        CommandId                    GUID of the operations to perform
    //!         \param [in]        NodeMask                     GPU mask for which metacommand is to be created. Set it to 0 for single GPU systems
    //!         \param [in]        pCreationParametersData      structure containing all creation parameters for the requested Metacommand
    //!         \param [in]        CreationParametersDataSize   size of parameter data structure
    //!         \param [out]       ppMetaCommand                A pointer to memory that receives the pointer to the created MetaCommand object.
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //!          NVAPI_NOT_SUPPORTED  - The requested Metacommand is not supported.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

#pragma pack(push, 4)
    struct NV_D3D12_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC
    {
        // Persistent resource used as scratch space by driver
        // it's written at time of init, and read at time of execute
        // use GetRequiredParameterResourceSize to query its size
        D3D12_GPU_VIRTUAL_ADDRESS PersistentResource;
    };

    struct NV_D3D12_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC
    {
        D3D12_GPU_VIRTUAL_ADDRESS InputResource;
        D3D12_GPU_VIRTUAL_ADDRESS FilterResource;
        D3D12_GPU_VIRTUAL_ADDRESS BiasResource; // optional
        D3D12_GPU_VIRTUAL_ADDRESS OutputResource;

        // Alpha1Resource and Alpha2Resource are used only when
        // PerChannelScaling is set. Otherwise the scalars Alpha1/Alpha2 are used
        // should have same dimension as bias
        D3D12_GPU_VIRTUAL_ADDRESS Alpha1Resource;
        D3D12_GPU_VIRTUAL_ADDRESS Alpha2Resource;

        // optional, same dimension/descriptor as output
        D3D12_GPU_VIRTUAL_ADDRESS SkipConnectionResource;

        // should point to same memory that was specified at time of init
        D3D12_GPU_VIRTUAL_ADDRESS PersistentResource;

        // temporary resource used as scratch space by driver
        // both written and read at time of execute
        // use GetRequiredParameterResourceSize to query its size
        D3D12_GPU_VIRTUAL_ADDRESS TemporaryResource;
    };

    // make sure structure sizes match what the driver assumes
    compile_time_assert(sizeof(NV_D3D12_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC) == 8);
    compile_time_assert(sizeof(NV_D3D12_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC) == 72);

    struct NV_D3D12_META_COMMAND_INITIALIZE_GEMM_DESC
    {
        NvU64 PersistentResource;
    };

    struct NV_D3D12_META_COMMAND_EXECUTE_GEMM_DESC
    {
        NvU64 AResource;
        NvU64 BResource;
        NvU64 CResource;
        NvU64 OutputResource;

        NvU64 PersistentResource;
        NvU64 TemporaryResource;
    };

    // make sure structure sizes match what the driver assumes
    compile_time_assert(sizeof(NV_D3D12_META_COMMAND_INITIALIZE_GEMM_DESC) == 8);
    compile_time_assert(sizeof(NV_D3D12_META_COMMAND_EXECUTE_GEMM_DESC) == 48);

#pragma pack(pop)

    DECLARE_INTERFACE_(__declspec(uuid("00BF193A-117B-42BC-BBCD-E964A0EA4F2B")) ID3D12NvMetaCommand_V1, IUnknown)
    {
        BEGIN_INTERFACE

        // *** IUnknown methods ***
        STDMETHOD(QueryInterface)
        (THIS_ REFIID riid, void **ppv) PURE;
        STDMETHOD_(ULONG, AddRef)
        (THIS) PURE;
        STDMETHOD_(ULONG, Release)
        (THIS) PURE;

        // ** ID3D12NvMetaCommand methods ***
        // Return size of parameter
        STDMETHOD(GetRequiredParameterResourceSize)
        (THIS_ NV_META_COMMAND_RESOURCE_TYPE ResourceType, NvU64 * SizeInBytes) const PURE;

        END_INTERFACE
    };

    typedef ID3D12NvMetaCommand_V1 ID3D12NvMetaCommand;
#define ID3D12NvMetaCommand_VER1 MAKE_NVAPI_VERSION(IID3D12NvMetaCommand_V1, 1)

#define ID3D12NvMetaCommand_VER ID3D12NvMetaCommand_VER1


    NVAPI_INTERFACE NvAPI_D3D12_CreateMetaCommand(__in ID3D12Device *pDevice,
                                                  __in REFGUID CommandId,
                                                  __in NvU32 NodeMask,
                                                  __in_bcount(CreationParametersDataSize) const void *pCreationParametersData,
                                                  __in NvU32 CreationParametersDataSize,
                                                  __out ID3D12NvMetaCommand **ppMetaCommand);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_InitializeMetaCommand
    //
    //! \since Release: 400
    //
    //! \code
    //!   DESCRIPTION: Initializes the given MetaCommand with the parameters passed in
    //!
    //!         \param [in]        pCommandList                     A pointer to D3D12 command list.
    //!         \param [in]        pMetaCommand                     the MetaCommand to initialize
    //!         \param [in]        pInitializationParametersData    Structure containing parameters
    //!         \param [in]        InitializationParametersDataSize Size of the parameter structure in bytes
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_InitializeMetaCommand(__in ID3D12GraphicsCommandList *pCommandlist,
                                                      __in ID3D12NvMetaCommand *pMetaCommand,
                                                      __in_bcount(InitializationParametersDataSize) const void *pInitializationParametersData,
                                                      __in NvU32 InitializationParametersDataSize);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_ExecuteMetaCommand
    //
    //! \since Release: 400
    //
    //! \code
    //!   DESCRIPTION: Executes the given MetaCommand with the parameters passed in
    //!
    //!         \param [in]        pCommandList                     A pointer to D3D12 command list.
    //!         \param [in]        pMetaCommand                     the MetaCommand to execute
    //!         \param [in]        pExecutionParametersData         Structure containing parameters
    //!         \param [in]        ExecutionParametersDataSize      Size of the parameter structure in bytes
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_ExecuteMetaCommand(__in ID3D12GraphicsCommandList *pCommandlist,
                                                   __in ID3D12NvMetaCommand *pMetaCommand,
                                                   __in_bcount(ExecutionParametersDataSize) const void *pExecutionParametersData,
                                                   __in NvU32 ExecutionParametersDataSize);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CreateCommittedResource
    //
    //! \since Release: 384
    //
    //! \code
    //!   DESCRIPTION: Wrapper around ID3D12Device::CreateCommittedResource to allow creation of resources according to params provided.
    //!                HTEX resource is created when NV_D3D12_RESOURCE_FLAG_HTEX is set in the nvResourceFlags parameter.
    //!                NV_D3D12_RESOURCE_FLAG_CPUVISIBLE_VIDMEM gives driver hint to create the resource on cpu visible vidmem
    //!                only upload resources use this flag currently, others behave exactly as ID3D12Device::CreateCommittedResource
    //!                Otherwise the function behaves exactly same as regular ID3D12Device::CreateCommittedResource.
    //!                When NV_D3D12_RESOURCE_FLAG_HTEX is set, the texels are centered on integer coordinates and filtering
    //!                and LOD are calculated based on the size minus one, which then allows the edges to filter to the exact texels on the edge,
    //!                eliminating the border/edge filtering issue. Dimension of next mip level is CEIL(currentMipDimension/2), and size of smallest mip is 2x2.
    //!                Note that NV_D3D12_RESOURCE_FLAG_HTEX can't be used for shared resources.
    //!                Best practice: Query available space in cpu visible vidmem using NvAPI_D3D12_QueryCpuVisibleVidmem
    //!                before using NV_D3D12_RESOURCE_FLAG_CPUVISIBLE_VIDMEM
    //!
    //!         \param [in]        pDevice                A pointer to D3D12 device.
    //!         \param [in]        pHeapProperties        A pointer to a D3D12_HEAP_PROPERTIES structure that provides properties for the resource's heap.
    //!         \param [in]        HeapFlags              Heap options, as a bitwise-OR'd combination of D3D12_HEAP_FLAGS enumeration constants.
    //!         \param [in]        pDesc                  A pointer to a D3D12_RESOURCE_DESC structure that describes the resource.
    //!         \param [in]        InitialState           The initial state of the resource, as a bitwise-OR'd combination of D3D12_RESOURCE_STATES enumeration constants.
    //!         \param [in]        pOptimizedClearValue   Specifies a D3D12_CLEAR_VALUE that describes the default value for a clear color.
    //!         \param [in]        pNVResourceParams      A pointer to a structure containing additional NV specific resource creation information (see NV_D3D12_RESOURCE_FLAGS below for more info on flags)
    //!         \param [in]        riid                   The globally unique identifier (GUID) for the resource interface.
    //!         \param [out]       ppvResource            A pointer to memory that receives the requested interface pointer to the created resource object.
    //!                                                   ppvResource can be NULL, to enable capability testing. When ppvResource is NULL, no object will be created and pSupported
    //!                                                   will be set to true when pResourceDesc is valid.
    //!         \param [out]       pSupported             optional, needed only for capability testing when ppvResource is NULL
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    typedef enum
    {
        NV_D3D12_RESOURCE_FLAG_NONE = 0,
        NV_D3D12_RESOURCE_FLAG_HTEX = 1,              //!< Create HTEX texture
        NV_D3D12_RESOURCE_FLAG_CPUVISIBLE_VIDMEM = 2, //!< Hint to create resource in cpuvisible vidmem
    } NV_D3D12_RESOURCE_FLAGS;

    typedef struct _NV_RESOURCE_PARAMS_V1
    {
        NvU32 version;                           //!< Version of structure. Must always be first member
        NV_D3D12_RESOURCE_FLAGS NVResourceFlags; //!< Additional NV specific flags (set the NV_D3D12_RESOURCE_FLAG_HTEX bit to create HTEX texture)
    } NV_RESOURCE_PARAMS_V1;

#define NV_RESOURCE_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_RESOURCE_PARAMS_V1, 1)


#define NV_RESOURCE_PARAMS_VER NV_RESOURCE_PARAMS_VER_1

    typedef NV_RESOURCE_PARAMS_V1 NV_RESOURCE_PARAMS;

    NVAPI_INTERFACE NvAPI_D3D12_CreateCommittedResource(__in ID3D12Device *pDevice,
                                                        __in const D3D12_HEAP_PROPERTIES *pHeapProperties,
                                                        __in D3D12_HEAP_FLAGS HeapFlags,
                                                        __in const D3D12_RESOURCE_DESC *pDesc,
                                                        __in D3D12_RESOURCE_STATES InitialState,
                                                        __in const D3D12_CLEAR_VALUE *pOptimizedClearValue,
                                                        __in const NV_RESOURCE_PARAMS *pNVResourceParams,
                                                        __in REFIID riid,
                                                        __out_opt void **ppvResource,
                                                        __out_opt bool *pSupported);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_GetCopyableFootprints
    //
    //! \since Release: 384
    //
    //! \code
    //!   DESCRIPTION: Wrapper around ID3D12Device::GetCopyableFootprints for getting correct staging resource footprint for HTEX resources
    //!                created using NvAPI_D3D12_CreateCommittedResource / NvAPI_D3D12_CreatePlacedResource with NV_D3D12_RESOURCE_FLAG_HTEX flag
    //!
    //!         \param [in]        pDevice                A pointer to D3D12 device.
    //!         \param [in]        pResourceDesc          A description of the resource, as a pointer to a D3D12_RESOURCE_DESC structure.
    //!         \param [in]        pNVResourceParams      A pointer to a structure containing additional NV specific resource information
    //!         \param [in]        FirstSubresource       Index of the first subresource in the resource. The range of valid values is 0 to D3D12_REQ_SUBRESOURCES
    //!         \param [in]        NumSubresources        The number of subresources in the resource. The range of valid values is 0 to (D3D12_REQ_SUBRESOURCES - FirstSubresource).
    //!         \param [in]        BaseOffset             The offset, in bytes, to the resource.
    //!         \param [out]       pLayouts               A pointer to an array (of length NumSubresources) of D3D12_PLACED_SUBRESOURCE_FOOTPRINT structures, to be filled with the
    //!                                                   description and placement of each subresource.
    //!         \param [out]       pRowSizeInBytes        A pointer to an array (of length NumSubresources) of integer variables, each entry to be
    //!                                                   filled with the unpadded size in bytes of a row, of each subresource.
    //!         \param [out]       pTotalBytes            A pointer to an integer variable, to be filled with the total size, in bytes.
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_GetCopyableFootprints(__in ID3D12Device *pDevice,
                                                      __in const D3D12_RESOURCE_DESC *pResourceDesc,
                                                      __in const NV_RESOURCE_PARAMS *pNVResourceParams,
                                                      __in UINT FirstSubresource,
                                                      __in UINT NumSubresources,
                                                      __in UINT64 BaseOffset,
                                                      __out_ecount_opt(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
                                                      __out_ecount_opt(NumSubresources) UINT *pNumRows,
                                                      __out_ecount_opt(NumSubresources) UINT64 *pRowSizeInBytes,
                                                      __out_opt UINT64 *pTotalBytes);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_CopyTextureRegion
    //
    //! \since Release: 384
    //
    //! \code
    //!   DESCRIPTION: Wrapper around ID3D12GraphicsCommandList::CopyTextureRegion for allowing copying to/from HTEX resources
    //!                created using NvAPI_D3D12_CreatePlacedResource with NV_D3D12_RESOURCE_FLAG_HTEX flag.
    //!
    //!         \param [in]        pCommandList           A pointer to D3D12 graphics command list.
    //!         \param [in]        pDst                   Specifies the destination D3D12_TEXTURE_COPY_LOCATION. The subresource referred to must be in the D3D12_RESOURCE_STATE_COPY_DEST state.
    //!         \param [in]        DstX                   The x-coordinate of the upper left corner of the destination region.
    //!         \param [in]        DstY                   The y-coordinate of the upper left corner of the destination region.
    //!         \param [in]        DstZ                   The z-coordinate of the upper left corner of the destination region.
    //!         \param [in]        pSrc                   Specifies the source D3D12_TEXTURE_COPY_LOCATION. The subresource referred to must be in the D3D12_RESOURCE_STATE_COPY_SOURCE state.
    //!         \param [in]        pSrcBox                Specifies an optional D3D12_BOX that sets the size of the source texture to copy.
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_CopyTextureRegion(__in ID3D12GraphicsCommandList *pCommandList,
                                                  __in const D3D12_TEXTURE_COPY_LOCATION *pDst,
                                                  __in UINT DstX,
                                                  __in UINT DstY,
                                                  __in UINT DstZ,
                                                  __in const D3D12_TEXTURE_COPY_LOCATION *pSrc,
                                                  __in_opt const D3D12_BOX *pSrcBox);

#endif // defined(__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_IsNvShaderExtnOpCodeSupported
    //
    //!   DESCRIPTION: This function checks if a nv HLSL shader extension opcode is
    //!                supported on current hardware. List of opcodes is in nvShaderExtnEnums.h
    //!                To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
    //!                in the hlsl shader code. See nvHLSLExtns.h for more details on supported opcodes.
    //!
    //! \since Release: 364
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //!
    //! \param [in]        pDev         The device on which to query for support
    //! \param [in]        opCode       the opcode to check
    //! \param [out]       pSupported   true if supported, false otherwise
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //! \retval ::         NVAPI_OK if the call succeeded
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_IsNvShaderExtnOpCodeSupported(__in ID3D12Device *pDevice,
                                                              __in NvU32 opCode,
                                                              __out bool *pSupported);

#endif // defined (__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_GetOptimalThreadCountForMesh
    //
    //!   DESCRIPTION: This function returns optimal thread count for mesh and task aka amplification shaders if Meshlets supported
    //!                Otherwise returns 0.
    //!
    //!
    //! \since Release: 510
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //!
    //! \param [in]        pDevice       The device on which to query thread count
    //! \param [out]       pThreadCount  optimal thread count if Meshlets supported, 0 otherwise
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //! \retval ::         NVAPI_OK if the call succeeded
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D12_GetOptimalThreadCountForMesh(__in ID3D12Device *pDevice,
                                                             __out NvU32 *pThreadCount);

#endif // defined (__cplusplus) && defined(__d3d12_h__)

#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_D3D_IsGSyncCapable
    //!   DESCRIPTION: This API gets G-Sync capability for the given device context.
    //!                This is only reliable after the first present call has completed.
    //! \param [in]    pDeviceOrContext    The D3D9, D3D10, D3D11 device, or D3D11 device context
    //! \param [in]    NVDX_ObjectHandle   The handle of primary surface
    //! \param [out]   pIsGsyncCapable     if G-Sync can be enabled, *pIsGsyncCapable is true.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_IsGSyncCapable(__in IUnknown *pDeviceOrContext, __in NVDX_ObjectHandle primarySurface, __out BOOL *pIsGsyncCapable);
#endif // if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)

#if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)

    ///////////////////////////////////////////////////////////////////////////////
    //!
    //! FUNCTION NAME: NvAPI_D3D_IsGSyncActive
    //!   DESCRIPTION: This API get the G-Sync state for the given device context.
    //!                This is only reliable after the first present call has completed.
    //!                As it is a bit time consuming, It should not be called per frame.
    //! \param [in]    pDeviceOrContext    The D3D9, D3D10, D3D11 device, or D3D11 device context
    //! \param [in]    NVDX_ObjectHandle   The handle of primary surface
    //! \param [out]   pIsGsyncActive      if G-Sync is active, *pisGsyncActive is true.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_IsGSyncActive(__in IUnknown *pDeviceOrContext, __in NVDX_ObjectHandle primarySurface, __out BOOL *pIsGsyncActive);
#endif // if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_DisableShaderDiskCache
    //
    //! DESCRIPTION: Disables driver managed caching of shader compilations to disk
    //!
    //! \param [in]    pDevice               Device to disabled the shader disk cache on
    //!
    //!
    //! \retval ::NVAPI_OK                   Shader disk cache was disabled
    //! \retval ::NVAPI_ERROR                The operation failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT     Argument passed in is invalid.
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D1x_DisableShaderDiskCache(IUnknown *pDevice);

#endif // defined (__cplusplus) && ( defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_MultiGPU_GetCaps
    //
    //! DESCRIPTION: Request to get multi GPU extension caps.
    //!
    //! \param [in/out]    pMultiGPUCaps     Pointer to a structure returning multi GPU caps
    //! \retval ::NVAPI_OK                   Call succeeded.
    //! \retval ::NVAPI_ERROR                Call failed.
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    //! \ingroup dx
    typedef struct _NV_MULTIGPU_CAPS_V1
    {
        NvU32 multiGPUVersion;
        NvU32 reserved;
        NvU32 nTotalGPUs;
        NvU32 nSLIGPUs;
        NvU32 videoBridgePresent;
    } NV_MULTIGPU_CAPS_V1, *PNV_MULTIGPU_CAPS_V1;

#endif // defined(__cplusplus) && defined(__d3d11_h__)

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && defined(__d3d11_h__)

    typedef struct _NV_MULTIGPU_CAPS_V2
    {
        NvU32 multiGPUVersion;
        union
        {
            NvU32 reserved;
            NvU32 version; //!< The version of the structure
        };
        NvU32 nTotalGPUs;
        NvU32 nSLIGPUs;
        NvU32 videoBridgePresent;
        NvU32 NvLinkPresent;
        NvU32 fastNvLinkReads;
    } NV_MULTIGPU_CAPS_V2, *PNV_MULTIGPU_CAPS_V2;

#define NV_MULTIGPU_CAPS_VER1 MAKE_NVAPI_VERSION(NV_MULTIGPU_CAPS_V1, 1)

#define NV_MULTIGPU_CAPS_VER2 MAKE_NVAPI_VERSION(NV_MULTIGPU_CAPS_V2, 2)


#define NV_MULTIGPU_CAPS_VER NV_MULTIGPU_CAPS_VER2

    typedef NV_MULTIGPU_CAPS_V2 NV_MULTIGPU_CAPS;
    typedef PNV_MULTIGPU_CAPS_V2 PNV_MULTIGPU_CAPS;

#endif // defined(__cplusplus) && defined(__d3d11_h__)

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && defined(__d3d11_h__)
    //! \ingroup dx

#ifndef NV_MULTIGPU_CAPS_VER
    typedef NV_MULTIGPU_CAPS_V1 NV_MULTIGPU_CAPS;
    typedef PNV_MULTIGPU_CAPS_V1 PNV_MULTIGPU_CAPS;
#endif

    NVAPI_INTERFACE NvAPI_D3D11_MultiGPU_GetCaps(__inout PNV_MULTIGPU_CAPS pMultiGPUCaps);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_MultiGPU_Init
    //
    //! DESCRIPTION: Request to enable/disable multi GPU extension. Also if enabled automatically disables auto stereo.
    //!
    //! \param [in]    bEnable               if true enables the extension for all subsequently created devices. Otherwise disables it
    //! \retval ::NVAPI_OK                   Call succeeded.
    //! \retval ::NVAPI_ERROR                Call failed.
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D11_MultiGPU_Init(__in bool bEnable);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateMultiGPUDevice
    //! \code
    //!   DESCRIPTION: This function returns ID3D11MultiGPUDevice used for multi GPU VR support
    //!
    //!         \param [in]        pDevice                  current d3d device
    //!         \param [in]        version                  version of requested ID3D11MultiGPUDevice.
    //!         \param [out]       currentVersion           pointer to returned current version of ID3D11MultiGPUDevice.
    //!         \param [out]       ppD3D11MultiGPUDevice    pointer to returned ID3D11MultiGPUDevice.
    //!         \param [in]        maxGpus                  max number of gpus this ID3D11MultiGPUDevice is allowed to use
    //!
    //!
    //! \return ::NVAPI_OK                          if the call succeeds.
    //!           NVAPI_INVALID_ARGUMENT            if NvAPI_D3D11_MultiGPU_Init() was not enabled prior to the creation of the D3D11 device,
    //!                                             or if maxGpus is greater than the number of GPUs in the SLI group.
    //!           NVAPI_NO_ACTIVE_SLI_TOPOLOGY      on single-GPU systems, or
    //!                                             if SLI has not been enabled in the NVIDIA control panel.
    //!           NVAPI_INVALID_CALL                if there is already an ID3D11MultiGPUDevice created for the specified ID3D11Device.
    //!           NVAPI_INCOMPATIBLE_STRUCT_VERSION if requested interface version is greater than the one that is supported by installed.
    //!                                             driver. In this case currentVersion will contain version supported by installed driver.
    //! \endcode
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup dx

#define NVAPI_COPY_ASYNCHRONOUSLY 1

#endif // defined(__cplusplus) && defined(__d3d11_h__)

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && defined(__d3d11_h__)
#define NVAPI_COPY_P2P_READ 2

#endif // defined(__cplusplus) && defined(__d3d11_h__)

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && defined(__d3d11_h__)

#define NVAPI_CPU_RESOURCE 0xffffffff


    DECLARE_INTERFACE(ID3D11MultiGPUDevice_V1)
    {
        //////////////////////////////   VER1 methods //////////////////////////////////////////
        STDMETHOD_(void, Destroy)
        (THIS) PURE;
        STDMETHOD_(UINT, SetGPUMask)
        (THIS_ __in UINT GPUMask) PURE;
        STDMETHOD_(NvAPI_Status, CopySubresourceRegion)
        (THIS_ __in ID3D11DeviceContext * pContext, __in ID3D11Resource * pDstResource, __in UINT DstSubresource,
         __in UINT DstGPUIndex, __in UINT DstX, __in UINT DstY, __in UINT DstZ,
         __in ID3D11Resource * pSrcResource, __in UINT SrcSubresource, __in UINT SrcGPUIndex,
         __in const D3D11_BOX *pSrcBox, __in UINT ExtendedFlags = 0) PURE;
#if defined(__d3d11_1_h__)
        STDMETHOD_(NvAPI_Status, CopySubresourceRegion1)
        (THIS_ __in ID3D11DeviceContext1 * pContext1, __in ID3D11Resource * pDstResource, __in UINT DstSubresource,
         __in UINT DstGPUIndex, __in UINT DstX, __in UINT DstY, __in UINT DstZ,
         __in ID3D11Resource * pSrcResource, __in UINT SrcSubresource, __in UINT SrcGPUIndex,
         __in const D3D11_BOX *pSrcBox, __in UINT CopyFlags, __in UINT ExtendedFlags = 0) PURE;
#else
        STDMETHOD_(NvAPI_Status, CopySubresourceRegion1)
        (THIS_ __in void *pContext1, __in ID3D11Resource *pDstResource, __in UINT DstSubresource,
         __in UINT DstGPUIndex, __in UINT DstX, __in UINT DstY, __in UINT DstZ,
         __in ID3D11Resource *pSrcResource, __in UINT SrcSubresource, __in UINT SrcGPUIndex,
         __in const D3D11_BOX *pSrcBox, __in UINT CopyFlags, __in UINT ExtendedFlags = 0) PURE;
#endif
        STDMETHOD_(NvAPI_Status, UpdateSubresource)
        (THIS_ __in ID3D11DeviceContext * pContext, __in ID3D11Resource * pDstResource, __in UINT DstSubresource, __in UINT DstGPUIndex,
         __in const D3D11_BOX *pDstBox, __in const void *pSrcData, __in UINT SrcRowPitch, __in UINT SrcDepthPitch) PURE;
        STDMETHOD_(NvAPI_Status, VSSetConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT GPUMask, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
         __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
        STDMETHOD_(NvAPI_Status, PSSetConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT GPUMask, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
         __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
        STDMETHOD_(NvAPI_Status, GSSetConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT GPUMask, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
         __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
        STDMETHOD_(NvAPI_Status, DSSetConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT GPUMask, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
         __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
        STDMETHOD_(NvAPI_Status, HSSetConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT GPUMask, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
         __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
        STDMETHOD_(NvAPI_Status, CSSetConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT GPUMask, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
         __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
        STDMETHOD_(NvAPI_Status, SetViewports)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT GPUMask, __in UINT NumViewports,
         __in const D3D11_VIEWPORT *pViewports) PURE;
        STDMETHOD_(NvAPI_Status, SetScissorRects)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT GPUMask, __in UINT NumRects,
         __in const D3D11_RECT *pRects) PURE;
        STDMETHOD_(HRESULT, GetData)
        (THIS_ __in ID3D11DeviceContext * pContext, __in ID3D11Asynchronous * pAsync, __in UINT GPUIndex,
         __out void *pData, __in UINT DataSize, __in UINT GetDataFlags) PURE;
#if defined(__d3d11_2_h__)
        STDMETHOD_(NvAPI_Status, UpdateTiles)
        (THIS_ __in ID3D11DeviceContext2 * pContext2, __in ID3D11Resource * pDestTiledResource,
         __in UINT GPUMask, __in const D3D11_TILED_RESOURCE_COORDINATE *pDestTileRegionStartCoordinate,
         __in const D3D11_TILE_REGION_SIZE *pDestTileRegionSize, __in const void *pSourceTileData,
         __in UINT Flags) PURE;
#else
        STDMETHOD_(NvAPI_Status, UpdateTiles)
        (THIS_ __in void *pContext2, __in ID3D11Resource *pDestTiledResource,
         __in UINT GPUMask, __in const void *pDestTileRegionStartCoordinate,
         __in const void *pDestTileRegionSize, __in const void *pSourceTileData,
         __in UINT Flags) PURE;
#endif

        STDMETHOD_(NvAPI_Status, CreateFences)
        (THIS_ __in UINT count, __out void **ppFences) PURE;
        STDMETHOD_(NvAPI_Status, SetFence)
        (THIS_ __in UINT GPUIndex, __in void *hFence, __in UINT64 value) PURE;
        STDMETHOD_(NvAPI_Status, WaitForFence)
        (THIS_ __in UINT GPUIMask, __in void *hFence, __in UINT64 value) PURE;
        STDMETHOD_(NvAPI_Status, FreeFences)
        (THIS_ __in UINT count, __in void **ppFences) PURE;
        STDMETHOD_(NvAPI_Status, PresentCompositingConfig)
        (THIS_ __in IUnknown * pSwapChain, __in UINT GPUMask,
         __in const D3D11_RECT *pRects, __in UINT flags) PURE;
        //////////////////////////////   end of VER1 methods   //////////////////////////////////////////

        //////////////////////////////   Methods added in VER2 //////////////////////////////////////////
        STDMETHOD_(NvAPI_Status, SetContextGPUMask)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT GPUMask) PURE;
        STDMETHOD_(NvAPI_Status, GetVideoBridgeStatus)
        (THIS_ __in IUnknown * pSwapChain, __in UINT * pVideoBridgeStatus) PURE;
        //////////////////////////////   end of VER2 methods   //////////////////////////////////////////

        //////////////////////////////   Methods added in VER3 //////////////////////////////////////////
        STDMETHOD_(NvAPI_Status, CreateMultiGPUConstantBuffer)
        (THIS_ __in const D3D11_BUFFER_DESC *pDesc, __in_opt const D3D11_SUBRESOURCE_DATA **ppInitialData, __out ID3D11Buffer **ppBuffer) PURE;
        STDMETHOD_(NvAPI_Status, ReleaseMultiGPUConstantBuffer)
        (THIS_ __in ID3D11Buffer * pBuffer) PURE;

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // Following XXSetMGPUConstantBuffers work the same way as DX XXSetConstantBuffers
        // The difference is that
        // 1. They are setting constant buffers on GPUs that are defined by
        //    current GPU mask that is set via SetGPUMask.
        // 2. For constant buffer created via CreateMultiGPUConstantBuffer these calls set GPU specific constant buffer.
        // 3. For regular constant buffers these calls set the same constant buffer on all GPUs defined by 1.
        // 4. If these functions are called in deferred context then GPUs are defined as GlobalGPUmask&LocalGPUMask
        //      where GlobalGPUmask is GPUMask set before CL execution
        //      and  LocalGPUMask is current GPUMask set in  CL.
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        STDMETHOD_(NvAPI_Status, VSSetMGPUConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
        STDMETHOD_(NvAPI_Status, PSSetMGPUConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
        STDMETHOD_(NvAPI_Status, GSSetMGPUConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
        STDMETHOD_(NvAPI_Status, DSSetMGPUConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
        STDMETHOD_(NvAPI_Status, HSSetMGPUConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
        STDMETHOD_(NvAPI_Status, CSSetMGPUConstantBuffers)
        (THIS_ __in ID3D11DeviceContext * pContext, __in UINT StartSlot,
         __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;

        STDMETHOD_(NvAPI_Status, UpdateConstantBuffer)
        (__in ID3D11DeviceContext * pContext, __in ID3D11Buffer * pBuffer, __in const void *pSrcData, __in_opt UINT GPUMask = 0) PURE;
        //////////////////////////////   end of VER3 methods   //////////////////////////////////////////
    };

//! Synchronization macros based on fences.
#define FENCE_SYNCHRONIZATION_START(pMultiGPUDevice, hFence, Value, srcGpu, dstGpu) \

    pMultiGPUDevice->SetFence(dstGpu, hFence, Value);                               \
    pMultiGPUDevice->WaitForFence(1 << (srcGpu), hFence, Value);                    \
    Value++;

#define FENCE_SYNCHRONIZATION_END(pMultiGPUDevice, hFence, Value, srcGpu, dstGpu) \

    pMultiGPUDevice->SetFence(srcGpu, hFence, Value);                             \
    pMultiGPUDevice->WaitForFence(1 << (dstGpu), hFence, Value);                  \
    Value++;

//! PresentCompositingConfig method flags.
#define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_USE_VIDEO_BRIDGE 0x01

#define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_CLEAR_OUTBANDS 0x02

#define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_GET_VIDEO_BRIDGE_STATUS 0x80000000


#define NVAPI_VIDEO_BRIDGE_STATUS_AVAILABLE 0

#define NVAPI_VIDEO_BRIDGE_STATUS_NOT_AVAILABLE 1

#define NVAPI_VIDEO_BRIDGE_STATUS_FAILED_ACCESS 2

#define NVAPI_VIDEO_BRIDGE_STATUS_UNKNOWN 3


#define NVAPI_ALL_GPUS 0

    typedef ID3D11MultiGPUDevice_V1 ID3D11MultiGPUDevice;

#define ID3D11MultiGPUDevice_VER1 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 1)

#define ID3D11MultiGPUDevice_VER2 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 2)

#define ID3D11MultiGPUDevice_VER3 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 3)

#define ID3D11MultiGPUDevice_VER ID3D11MultiGPUDevice_VER3


#define ALL_GPUS 0


    //! \ingroup dx
    NVAPI_INTERFACE NvAPI_D3D11_CreateMultiGPUDevice(__in ID3D11Device *pDevice, __in ULONG version, __out ULONG *currentVersion, __out ID3D11MultiGPUDevice **ppD3D11MultiGPUDevice, __in UINT maxGpus = ALL_GPUS);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! Used to query the support of Single Pass Stereo HW feature
    //! \ingroup dx
    typedef struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1
    {
        NvU32 version;                    // parameter struct version
        NvU32 bSinglePassStereoSupported; // Single Pass Stereo supported
    } NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1;

    typedef struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2
    {
        NvU32 version;                            // _IN_     parameter struct version
        NvU32 bSinglePassStereoSupported : 1;     // _OUT_    Single Pass Stereo supported
        NvU32 bSinglePassStereoXYZWSupported : 1; // _OUT_    Single Pass Stereo XYZW supported
        NvU32 reserved : 30;                      // _INOUT_  bits reserved for future use
    } NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2;

    typedef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2 NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS;
#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1, 1)

#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2, 2)

#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER2


#ifndef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER
    typedef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1 NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS;
#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1, 1)

#define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1

#endif

#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_QuerySinglePassStereoSupport
    //
    //!   DESCRIPTION: Queries the support of Single Pass Stereo feature on current setup and returns appropriate boolean value.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     pDevice                                 The ID3D11Device to use.
    //! \param [inout]  pSinglePassStereoSupportedParams        Stores value of whether Single Pass Stereo is supported on current setup or not.
    //!
    //! \retval  NVAPI_OK                           Call succeeded.
    //! \retval  NVAPI_ERROR                        Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT             One or more arguments are invalid.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_QuerySinglePassStereoSupport(__in IUnknown *pDevice,
                                                           __inout NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS *pQuerySinglePassStereoSupportedParams);

#endif // defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))

#if defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_SetSinglePassStereoMode
    //
    //!   DESCRIPTION: Set the Single Pass Stereo state
    //!
    //! \note   Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid.
    //!         Returned value NVAPI_OK does not reflect that Single Pass Stereo is supported or is set in hardware.
    //!         One must call NvAPI_D3D_QuerySinglePassStereoSupport() to confirm that the current setup
    //!         supports Single Pass Stereo before calling this set-function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  pDevOrContext                  The ID3D11Device or ID3D11DeviceContext to use.
    //! \param [in]  numViews                       Number of views to render.
    //! \param [in]  renderTargetIndexOffset        Offset between render targets of the different views.
    //! \param [in]  independentViewportMaskEnable  Is the independent viewport mask enabled.
    //!
    //! \retval  NVAPI_OK                           Call succeeded.
    //! \retval  NVAPI_ERROR                        Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT             One or more arguments are invalid.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_SetSinglePassStereoMode(__in IUnknown *pDevOrContext, __in NvU32 numViews, __in NvU32 renderTargetIndexOffset, __in NvU8 independentViewportMaskEnable);

#endif // defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)

#if defined(__cplusplus) && (defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_QuerySinglePassStereoSupport
    //
    //!   DESCRIPTION: Queries the support of Single Pass Stereo feature on current setup and returns appropriate boolean value.
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //!
    //! \param [in]     pDevice                                 The IDirect3DDevice12 to use.
    //! \param [inout]  pQuerySinglePassStereoSupportedParams   Stores value of whether Single Pass Stereo is supported on current setup or not.
    //!
    //! \retval  NVAPI_OK                                       Call succeeded.
    //! \retval  NVAPI_ERROR                                    Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT                         One or more arguments are invalid.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_QuerySinglePassStereoSupport(__in ID3D12Device *pDevice,
                                                             __inout NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS *pQuerySinglePassStereoSupportedParams);

#endif // defined(__cplusplus) && ( defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_SetSinglePassStereoMode
    //
    //!   DESCRIPTION: Set the Single Pass Stereo state.
    //!
    //! \note   Note that Single Pass Stereo state persists on a particular CommandList till it is closed.
    //!         The state is reset to default (disabled) for every newly created CommandList.
    //!         One must call NvAPI_D3D12_QuerySinglePassStereoSupport() to confirm that the current setup
    //!         supports Single Pass Stereo before calling this set-function.
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //!
    //! \param [in]  pCommandList                   The command list in which we will add push buffer commmands for enabling Single Pass Stereo feature
    //!                                             Note: Command list of type D3D12_COMMAND_LIST_TYPE_BUNDLE is not allowed for setting the state of this feature.
    //! \param [in]  numViews                       Number of views to render.
    //! \param [in]  RenderTargetIndexOffset        Offset between render targets of the different views.
    //! \param [in]  IndependentViewportMaskEnable  Is the independent viewport mask enabled.
    //!
    //! \retval  NVAPI_OK                           Call succeeded.
    //! \retval  NVAPI_ERROR                        Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT             One or more arguments are invalid.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_SetSinglePassStereoMode(__in ID3D12GraphicsCommandList *pCommandList,
                                                        __in NvU32 numViews,
                                                        __in NvU32 renderTargetIndexOffset,
                                                        __in NvU8 independentViewportMaskEnable);

#endif // defined(__cplusplus) && ( defined(__d3d12_h__))

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! Used to query the support of MultiView HW feature
    //! \ingroup dx

    typedef struct _NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1
    {
        NvU32 version;                            //  _IN_     parameter struct version
        NvU32 bMultiViewSupported : 1;            //  _OUT_    MultiView supported (Render 4 views in a single pass)
        NvU32 bSinglePassStereoSupported : 1;     //  _OUT_    StereoX supported (Render 2 views in a single pass)
        NvU32 bSinglePassStereoXYZWSupported : 1; //  _OUT_    StereoXYZW supported (Render 2 views in a single pass)
        NvU32 reserved : 29;                      //  _INOUT_  bits reserved for future use
    } NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1;

    typedef NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1 NV_QUERY_MULTIVIEW_SUPPORT_PARAMS;
#define NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1, 1)

#define NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER1

#define NV_MULTIVIEW_MAX_SUPPORTED_VIEWS 4


#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_QueryMultiViewSupport
    //
    //!   DESCRIPTION: Queries the support of MultiView feature on current setup and returns appropriate boolean value.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since          Release: 410
    //!
    //! \param [in]     pDevice                                 The ID3D11Device to use.
    //! \param [inout]  pMultiViewSupportedParams               Stores value of whether MultiView is supported on current setup or not.
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_QueryMultiViewSupport(__in IUnknown *pDevice,
                                                    __inout NV_QUERY_MULTIVIEW_SUPPORT_PARAMS *pQueryMultiViewSupportedParams);

#endif // defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! Used for setting the Mode for MultiView HW Feature.
    //! \ingroup dx
    typedef struct _NV_MULTIVIEW_PARAMS_V1
    {
        NvU32 version;                                                   // _IN_  parameter struct version
        NvU32 numViews;                                                  // _IN_  Number of views to render.
        NvU32 renderTargetIndexOffset[NV_MULTIVIEW_MAX_SUPPORTED_VIEWS]; // _IN_  Offset between render targets for each of the per views.
        NvU8 independentViewportMaskEnable;                              // _IN_  Is the independent viewport mask enabled.
    } NV_MULTIVIEW_PARAMS_V1;

    typedef NV_MULTIVIEW_PARAMS_V1 NV_MULTIVIEW_PARAMS;
#define NV_MULTIVIEW_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_MULTIVIEW_PARAMS_V1, 1)

#define NV_MULTIVIEW_PARAMS_VER NV_MULTIVIEW_PARAMS_VER1


#if defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_SetMultiViewMode
    //
    //!   DESCRIPTION: Set the MultiView state
    //!
    //! \note   Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid.
    //!         Returned value NVAPI_OK does not reflect that MultiView is supported or is set in hardware.
    //!         One must call NvAPI_D3D_QueryMultiViewSupport() to confirm that the current setup
    //!         supports MultiView before calling this set-function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since          Release: 410
    //!
    //! \param [in]  pDevOrContext                      The ID3D11Device or ID3D11DeviceContext to use.
    //! \param [in]  pMultiViewParams                   MultiView Params
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_SetMultiViewMode(__in IUnknown *pDevOrContext, __in NV_MULTIVIEW_PARAMS *pMultiViewParams);

#endif // defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! Used to query the support of Lens Matched Shading HW feature
    //! \ingroup dx
    typedef struct _NV_QUERY_MODIFIED_W_SUPPORT_PARAMS
    {
        NvU32 version;             // parameter struct version
        NvU32 bModifiedWSupported; // Modified W supported
    } NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1;

    typedef NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1 NV_QUERY_MODIFIED_W_SUPPORT_PARAMS;
#define NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1, 1)

#define NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER1


#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_QueryModifiedWSupport
    //
    //!   DESCRIPTION: Queries the support of Modified W feature on current setup and returns appropriate boolean value.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     pDevice                             The ID3D11Device to use.
    //! \param [inout]  pQueryModifiedWSupportedParams      Stores value of whether Modified W is supported on current setup or not.
    //!
    //! \retval  NVAPI_OK                           Call succeeded.
    //! \retval  NVAPI_ERROR                        Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT             One or more arguments are invalid.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_QueryModifiedWSupport(__in IUnknown *pDev,
                                                    __inout NV_QUERY_MODIFIED_W_SUPPORT_PARAMS *pQueryModifiedWSupportedParams);
#endif // defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))

//! SUPPORTED OS:  Windows 7 and higher
//!
#define NV_MODIFIED_W_MAX_VIEWPORTS 16


    typedef struct _NV_MODIFIED_W_COEFFICIENTS
    {
        float fA;         // A coefficient in w' = w + Ax + By
        float fB;         // B coefficient in w' = w + Ax + By
        float fAReserved; // reserved
        float fBReserved; // reserved

        float fReserved[2]; // reserved
    } NV_MODIFIED_W_COEFFICIENTS;

    typedef struct _NV_MODIFIED_W_PARAMS
    {
        NvU32 version;                                                                 // parameter struct version
        NvU32 numEntries;                                                              // number of valid NV_MODIFIED_W_COEFFICIENTS structs in array
        NV_MODIFIED_W_COEFFICIENTS modifiedWCoefficients[NV_MODIFIED_W_MAX_VIEWPORTS]; // coefficients

        NvU32 id;                                    // reserved
        NvU32 reserved[NV_MODIFIED_W_MAX_VIEWPORTS]; // reserved
    } NV_MODIFIED_W_PARAMS_V1;

    typedef NV_MODIFIED_W_PARAMS_V1 NV_MODIFIED_W_PARAMS;
#define NV_MODIFIED_W_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_MODIFIED_W_PARAMS_V1, 1)

#define NV_MODIFIED_W_PARAMS_VER NV_MODIFIED_W_PARAMS_VER1


#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_SetModifiedWMode
    //
    //!   DESCRIPTION: Set the Modified W state and A,B coefficients for HW support
    //!
    //! \note   Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid.
    //!         Returned value NVAPI_OK does not reflect that Modified-W is supported or is set in hardware.
    //!         One must call NvAPI_D3D_QueryModifiedWSupport() to confirm that the current setup
    //!         supports Modified-W before calling this set-function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  pDevOrContext                  The ID3D11Device or ID3D11DeviceContext to use.
    //! \param [in]  psModifiedWParams              Modified W parameters.
    //!
    //! \retval  NVAPI_OK                           Call succeeded.
    //! \retval  NVAPI_ERROR                        Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT             One or more arguments are invalid.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_SetModifiedWMode(__in IUnknown *pDevOrContext, __in NV_MODIFIED_W_PARAMS *psModifiedWParams);

#endif // defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))

#if defined(__cplusplus) && (defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_QueryModifiedWSupport
    //
    //!   DESCRIPTION: Queries the support of Modified-W feature on current setup and returns appropriate boolean value.
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //!
    //! \param [in]     pDevice                         The ID3D12Device Device created by application
    //! \param [inout]  pQueryModifiedWSupportedParams  Stores value of whether Modified-W is supported on current setup or not.
    //!
    //! \retval  NVAPI_OK                               Call succeeded.
    //! \retval  NVAPI_ERROR                            Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT                 One or more arguments are invalid.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_QueryModifiedWSupport(__in ID3D12Device *pDevice,
                                                      __inout NV_QUERY_MODIFIED_W_SUPPORT_PARAMS *pQueryModifiedWSupportedParams);

#endif // defined(__cplusplus) && ( defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_SetModifiedWMode
    //
    //!   DESCRIPTION: Set the Modified-W state and A, B coefficients for HW support
    //!
    //! \note   Note that Modified-W state persists on a particular CommandList till it is closed.
    //!         The state is reset to default (disabled) for every newly created CommandList.
    //!         One must call NvAPI_D3D12_QueryModifiedWSupport() to confirm that the current setup
    //!         supports Modified-W before calling this set-function.
    //!
    //! SUPPORTED OS:  Windows 10
    //!
    //!
    //! \param [in]  pCommandList                   The command list in which we will add push buffer commmands for enabling Modified-W feature
    //!                                             Note: Command list of type D3D12_COMMAND_LIST_TYPE_BUNDLE is not allowed for setting the state of this feature.
    //! \param [in]  pModifiedWParams               Modified-W parameters.
    //!
    //! \retval  NVAPI_OK                           Call succeeded.
    //! \retval  NVAPI_ERROR                        Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT             One or more arguments are invalid.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_SetModifiedWMode(__in ID3D12GraphicsCommandList *pCommandList,
                                                 __in NV_MODIFIED_W_PARAMS *pModifiedWParams);

#endif // defined(__cplusplus) && ( defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__))

    //! \ingroup dx
    //! See NvAPI_D3D_CreateLateLatchObject
    DECLARE_INTERFACE(ID3DLateLatchObject_V1)
    {
        STDMETHOD_(UINT, Release)
        (THIS) PURE; //! Release the created LateLatch object and associated buffers.
        STDMETHOD_(NvAPI_Status, Latch)
        (THIS_ __in IUnknown *pContext = NULL) PURE; //! Request to queue the latch operation to the GPU.
        STDMETHOD_(ID3D11Buffer *, GetD3D11Buffer)
        (THIS_ __in UINT index = 0) PURE; //! Get ID3D11Buffer* available at the given 'index'
        STDMETHOD_(UINT, GetBufferCount)
        (THIS) PURE; //! Returns the number of late latch buffers created for this LateLatchObject.
        STDMETHOD_(NvAPI_Status, UpdateData)
        (THIS_ __in void **ppData) PURE; //! Fully update all LateLatch buffers with new data.
        STDMETHOD_(NvAPI_Status, UpdateData)
        (THIS_ __in void *pData, __in size_t offset,
         __in size_t size, __in UINT index = 0) PURE; //! Partially update one of the LateLatch buffers with new data.
    };

    //! \ingroup dx
    //! See NvAPI_D3D_CreateLateLatchObject
    typedef ID3DLateLatchObject_V1 ID3DLateLatchObject;
#define ID3DLateLatchObject_VER1 MAKE_NVAPI_VERSION(ID3DLateLatchObject_V1, 1)

#define ID3DLateLatchObject_VER ID3DLateLatchObject_VER1


    typedef struct _NV_D3D_LATELATCH_OBJECT_DESC_V1
    {
        NvU32 version;
        NvU32 numBuffers;                           // _IN_  Number of LateLatch buffers that the app wants to create.
        D3D11_BUFFER_DESC **ppBufferDesc;           // _IN_  Description of buffers
        ID3DLateLatchObject **ppD3DLateLatchObject; // _Out_ Pointer to created interface
    } NV_D3D_LATELATCH_OBJECT_DESC_V1;

    typedef NV_D3D_LATELATCH_OBJECT_DESC_V1 NV_D3D_LATELATCH_OBJECT_DESC;
#define NV_D3D_LATELATCH_OBJECT_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D_LATELATCH_OBJECT_DESC_V1, 1)

#define NV_D3D_LATELATCH_OBJECT_DESC_VER NV_D3D_LATELATCH_OBJECT_DESC_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_CreateLateLatchObject
    //
    //! DESCRIPTION: Creates a Late Latch Object interface
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 384
    //!
    //! \param [in]      pDevice                   Current ID3D11Device.
    //! \param [inout]   pLateLatchObjectDesc      Pointer to in/out structure for late latch object creation
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D_CreateLateLatchObject(__in IUnknown *pDevice, __inout NV_D3D_LATELATCH_OBJECT_DESC *pLateLatchObjectDesc);

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
    //! \ingroup dx
    //! See NvAPI_D3D_QueryLateLatchSupport
    typedef struct _NV_QUERY_LATELATCH_SUPPORT_PARAMS
    {
        NvU32 version;             //!< (IN)  Parameter structure version
        NvU32 bLateLatchSupported; //!< (OUT) LateLatch supported
    } NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1;

    typedef NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1 NV_QUERY_LATELATCH_SUPPORT_PARAMS;
#define NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1, 1)

#define NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_QueryLateLatchSupport
    //
    //!   DESCRIPTION: Queries the support of DX11 Late Latch feature on current setup.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 384
    //!
    //! \param [in]     pDevice                             Current ID3D11Device.
    //! \param [inout]  pQueryLateLatchSupportParams        Stores value of whether Late Latch is supported on current setup or not.
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_QueryLateLatchSupport(__in IUnknown *pDevice,
                                                    __inout NV_QUERY_LATELATCH_SUPPORT_PARAMS *pQueryLateLatchSupportParams);
#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_RegisterDevice
    //
    //!   DESCRIPTION: Tells NvAPI about a D3D device. This must be called prior to using any DX1x
    //!                deferred-context calls.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  pDev                           The ID3D10Device or ID3D11Device to use.
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_RegisterDevice(__in IUnknown *pDev);

#endif // if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_MultiDrawInstancedIndirect
    //
    //!   DESCRIPTION: Extension of DrawInstancedIndirect that takes a draw count in. The effect of this function is to loop over
    //!                that draw count and perform the DrawInstancedIndirect operation each time, incrementing the buffer offset
    //!                by the supplied stride each time.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]        *pDevContext11                  Pointer to D3D11 device context (IC or DC)
    //! \param [in]         drawCount                      Do DrawInstancedIndirect operation this many times
    //! \param [in]        *pBuffer                        ID3D11Buffer that contains the command parameters
    //! \param [in]         alignedByteOffsetForArgs       Start in pBuffer of the command parameters
    //! \param [in]         alignedByteStrideForArgs       Stride of the command parameters - must be >= 4 * sizeof(NvU32)
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \retval  NVAPI_D3D_DEVICE_NOT_REGISTERED     When MultiDraw is called on a deferred context, and the device has not yet
    //!                                              been registered (NvAPI_D3D_RegisterDevice), this error is returned.
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_MultiDrawInstancedIndirect(__in ID3D11DeviceContext *pDevContext11,
                                                           __in NvU32 drawCount,
                                                           __in ID3D11Buffer *pBuffer,
                                                           __in NvU32 alignedByteOffsetForArgs,
                                                           __in NvU32 alignedByteStrideForArgs);

#endif // defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_MultiDrawIndexedInstancedIndirect
    //
    //!   DESCRIPTION: Extension of DrawIndexedInstancedIndirect that takes a draw count in. The effect of this function is to loop over
    //!                that draw count and perform the DrawIndexedInstancedIndirect operation each time, incrementing the buffer offset
    //!                by the supplied stride each time.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]        *pDevContext11                  Pointer to D3D11 device context (IC or DC)
    //! \param [in]         drawCount                      Do DrawIndexedInstancedIndirect operation this many times
    //! \param [in]        *pBuffer                        ID3D11Buffer that contains the command parameters
    //! \param [in]         alignedByteOffsetForArgs       Start in pBuffer of the command parameters
    //! \param [in]         alignedByteStrideForArgs       Stride of the command parameters - must be >= 5 * sizeof(NvU32)
    //!
    //! RETURN STATUS:     This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                    If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \retval  NVAPI_D3D_DEVICE_NOT_REGISTERED     When MultiDraw is called on a deferred context, and the device has not yet
    //!                                              been registered (NvAPI_D3D_RegisterDevice), this error is returned.
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_MultiDrawIndexedInstancedIndirect(__in ID3D11DeviceContext *pDevContext11,
                                                                  __in NvU32 drawCount,
                                                                  __in ID3D11Buffer *pBuffer,
                                                                  __in NvU32 alignedByteOffsetForArgs,
                                                                  __in NvU32 alignedByteStrideForArgs);

#endif // defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME:   NvAPI_D3D_ImplicitSLIControl
    //
    //! This function enables/disables the SLI rendering mode. It has to be called prior to D3D device creation. Once this function is called with DISABLE_IMPLICIT_SLI
    //! parameter all subsequently created devices will be forced to run in a single gpu mode until the same function is called with ENABLE_IMPLICIT_SLI parameter. The enable
    //! call will force all subsequently created devices to run in default implicit SLI mode being determined by an application profile or a global control panel SLI setting.
    //! This NvAPI call is supported in all DX10+ versions of the driver. It is supported on all Windows versions.
    //!
    //! \retval    NVAPI_OK                             Completed request
    //! \retval    NVAPI_ERROR                          Error occurred
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup dx
    typedef enum _IMPLICIT_SLI_CONTROL
    {
        DISABLE_IMPLICIT_SLI = 0,
        ENABLE_IMPLICIT_SLI = 1,
    } IMPLICIT_SLI_CONTROL;

    //! \ingroup dx
    NVAPI_INTERFACE NvAPI_D3D_ImplicitSLIControl(__in IMPLICIT_SLI_CONTROL implicitSLIControl);

#endif // defined (__cplusplus) && ( defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) ||defined(__d3d11_h__) )

    //! SUPPORTED OS:  Windows 10
    //!

#if defined(__cplusplus) && defined(__d3d12_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_UseDriverHeapPriorities
    //
    //! \code
    //!   DESCRIPTION: Sets the driver to override Microsoft's heap allocation priority values with Nvidia driver priority values. Use this once per process before allocating resources.
    //!
    //! \param [in] pDevice The IDirect3DDevice12 to use.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \since Release: 381
    //!
    //! \endcode
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_UseDriverHeapPriorities(__in ID3D12Device *pDevice);

#endif // defined (__cplusplus) && defined(__d3d12_h__)

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus) && (defined(__d3d12_h__))

    typedef struct _NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS
    {
        __in NvU32 version;                            //!< Structure version
        __in ID3D12Device *pDevice;                    //!< The ID3D12Device created by application.
        __in ID3D12Resource *pSwapChainBuffer;         //!< The ID3D12Resource part of the application swap chain that has companion allocations.
        __in NvU32 companionBufferCount;               //!< The number of ID3D12Resource pointers requested to be returned in the ppComanionResources array, which should match ID3D12Device::GetNodeCount for the complete set of companion allocations.
        __inout ID3D12Resource **ppCompanionResources; //!< An array of ID3D12Resource pointers sized to match companionBufferCount, which will receive the companion allocations.
    } NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1;

    typedef NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1 NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS;
#define NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1, 1)

#define NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_Mosaic_GetCompanionAllocations
    //
    //!   DESCRIPTION: Queries the driver for internally created allocations that accompany a swap chain buffer for present-related operations.
    //!                Surfaces returned by this interface must be destroied at the same time that the original swap chain buffer is destroyed.
    //!                In general this occurs prior to a ResizeBuffers call, or when the swap chain is released.
    //!                Note that this function only works in Landscape orientation due to Windows behavior, and attempts to utilize it with any type of display
    //!                rotation will result in failure.
    //!
    //! \param [inout]  companionBufferCount            The parameters for this function.
    //!
    //! \retval  NVAPI_OK                               Call succeeded.
    //! \retval  NVAPI_ERROR                            Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT                 One or more arguments are invalid.
    //! \retval  NVAPI_INVALID_CALL                     System configuration does not support this interface (eg, display is rotated, mosaic not enabled, etc)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_Mosaic_GetCompanionAllocations(__inout NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS *params);

#endif // defined(__cplusplus) && ( defined(__d3d12_h__))

//! SUPPORTED OS:  Windows 10 and higher
//!
#if defined(__cplusplus) && (defined(__d3d12_h__))

    typedef struct _NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS
    {
        __in NvU32 version;                    //!< Structure version
        __in ID3D12Device *pDevice;            //!< The ID3D12Device created by application.
        __in ID3D12Resource *pSwapChainBuffer; //!< The ID3D12Resource part of the application swap chain.
        __inout NvU32 *pPartitionCount;        //!< A variable to receive the number of NV_MGPU_MOSAIC_DISPLAY_SURFACE_PARTITION elements returned or that holds the size of pPartitions when it is non-NULL.
        __inout RECT *pViewport;               //!< An optional array to hold the viewport information per partition. When this is valid pNodeMask must also be valid.
        __inout NvU32 *pNodeMask;              //!< An optional array to hold the GPU mask where this viewport must be valid per partition. When this is valid pViewport must also be valid.
    } NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1;

    typedef NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1 NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS;
#define NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1, 1)

#define NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions
    //
    //!   DESCRIPTION: Queries the driver for how a swap chain display surface is subdivided across devices in relation to display connectivity.
    //!                Call this interface with NULL pPartitions in order to know how many subdivisions exist and allocate the proper size to hold all data.
    //!                Call it a second time with a properly sized partitions array to receive all subdivisions along with GPU node masks of each rectangle.
    //!                Note that this function only works in Landscape orientation due to Windows behavior, and attempts to utilize it with any type of display
    //!                rotation will result in failure.
    //!
    //! \param [inout]  params                          The parameters for this function.
    //!
    //! \retval  NVAPI_OK                               Call succeeded.
    //! \retval  NVAPI_ERROR                            Call failed.
    //! \retval  NVAPI_INVALID_ARGUMENT                 One or more arguments are invalid.
    //! \retval  NVAPI_INVALID_CALL                     System configuration does not support this interface (eg, display is rotated, mosaic not enabled, etc)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions(__inout NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS *params);

#endif // defined(__cplusplus) && ( defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__))
    //! \ingroup dx
    //! See NvAPI_D3D1x_GetGraphicsCapabilities

    typedef struct _NV_D3D1x_GRAPHICS_CAPS_V1
    {
        NvU32 bExclusiveScissorRectsSupported : 1;    //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not
        NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not
        NvU32 reservedBits : 30;                      // Reserved bits for future expansion
        NvU32 reserved[7];                            // Reserved for future expansion
    } NV_D3D1x_GRAPHICS_CAPS_V1;

#define NV_D3D1x_GRAPHICS_CAPS_VER1 MAKE_NVAPI_VERSION(NV_D3D1x_GRAPHICS_CAPS_V1, 1)


    typedef struct _NV_D3D1x_GRAPHICS_CAPS_V2
    {
        NvU32 bExclusiveScissorRectsSupported : 1;    //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not
        NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not
        NvU32 bFastUAVClearSupported : 1;             //!< (OUT) Outputs whether UAVClear is implemented using ZBC rather than compute shader
        NvU32 reservedBits : 29;                      // Reserved bits for future expansion
        NvU16 majorSMVersion;                         //!< (OUT) Major SM version of the device
        NvU16 minorSMVersion;                         //!< (OUT) Minor SM version of the device
        NvU32 reserved[14];                           // Reserved for future expansion
    } NV_D3D1x_GRAPHICS_CAPS_V2;

    typedef NV_D3D1x_GRAPHICS_CAPS_V2 NV_D3D1x_GRAPHICS_CAPS;
#define NV_D3D1x_GRAPHICS_CAPS_VER2 MAKE_NVAPI_VERSION(NV_D3D1x_GRAPHICS_CAPS_V2, 2)

#define NV_D3D1x_GRAPHICS_CAPS_VER NV_D3D1x_GRAPHICS_CAPS_VER2


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_GetGraphicsCapabilities
    //
    //! DESCRIPTION: Get the graphics capabilities for current hardware/software setup
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 410
    //!
    //! \param [in]        pDevice              The ID3D11Device device to be used for getting the graphics capabilities.
    //! \param [in]        structVersion        Version of the caps struct. Should be set to NV_D3D1x_GRAPHICS_CAPS_VER.
    //! \param [inout]     pGraphicsCaps        Pointer to a NV_D3D1x_GRAPHICS_CAPS_CAPS struct created by app.
    //!                                         Graphics capabilities will be filled in this struct by the driver.
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D1x_GetGraphicsCapabilities(__in IUnknown *pDevice,
                                                        __in NvU32 structVersion,
                                                        __inout NV_D3D1x_GRAPHICS_CAPS *pGraphicsCaps);

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

#if defined(__cplusplus) && (defined(__d3d12_h__))
    //! \ingroup dx
    //! See NvAPI_D3D12_GetGraphicsCapabilities

    typedef struct _NV_D3D12_GRAPHICS_CAPS_V1
    {
        NvU32 bExclusiveScissorRectsSupported : 1;    //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not
        NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not
        NvU32 bFastUAVClearSupported : 1;             //!< (OUT) Outputs whether UAVClear is implemented using ZBC rather than compute shader
        NvU32 reservedBits : 29;                      // Reserved bits for future expansion
        NvU16 majorSMVersion;                         //!< (OUT) Major SM version of the device
        NvU16 minorSMVersion;                         //!< (OUT) Minor SM version of the device
        NvU32 reserved[6];                            // Reserved for future expansion
    } NV_D3D12_GRAPHICS_CAPS_V1;

    typedef NV_D3D12_GRAPHICS_CAPS_V1 NV_D3D12_GRAPHICS_CAPS;
#define NV_D3D12_GRAPHICS_CAPS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_GRAPHICS_CAPS_V1, 1)

#define NV_D3D12_GRAPHICS_CAPS_VER NV_D3D12_GRAPHICS_CAPS_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D12_GetGraphicsCapabilities
    //
    //! DESCRIPTION: Get the graphics capabilities for current hardware/software setup
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //!
    //! \since Release: 410
    //!
    //! \param [in]        pDevice              The ID3D12Device device to be used for getting the graphics capabilities.
    //! \param [in]        structVersion        Version of the caps struct. Should be set to NV_D3D12_GRAPHICS_CAPS_VER.
    //! \param [inout]     pGraphicsCaps        Pointer to a NV_D3D12_GRAPHICS_CAPS_CAPS struct created by app.
    //!                                         Graphics capabilities will be filled in this struct by the driver.
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D12_GetGraphicsCapabilities(__in IUnknown *pDevice,
                                                        __in NvU32 structVersion,
                                                        __inout NV_D3D12_GRAPHICS_CAPS *pGraphicsCaps);

#endif // defined(__cplusplus) && (defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
#define NV_MAX_NUM_EXCLUSIVE_SCISSOR_RECTS 16

#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__))
    //! \ingroup dx
    //! See NvAPI_D3D11_RSSetExclusiveScissorRects

    typedef struct _NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1
    {
        bool enableExclusiveScissorRect; //!< (IN) Control of enabling Exclusive ScissorRect per rect
        D3D11_RECT scissorRect;          //!< (IN) Single rect dimensions
    } NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1;

    typedef struct _NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1
    {
        NvU32 version;                                   //!< (IN) Parameter struct version
        NvU32 numRects;                                  //!< (IN) Number of Exclusive Scissor Rects to be set.
                                                         //        \note Passing zero will globally disable Exclusive Scissor Rects
                                                         //        \note Max value can be equal to NV_MAX_NUM_EXCLUSIVE_SCISSOR_RECTS
        NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1 *pRects; //!< (IN) Array of NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC with number of elements equal to Exclusive Scissor Rects
    } NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1;

    typedef NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1 NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC;
    typedef NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1 NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC;
#define NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1, 1)

#define NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_RSSetExclusiveScissorRects
    //
    //! DESCRIPTION: Sets Exclusive Scissor Rects. The content bounded within the Scissor Rects
    //!              will be excluded from rendering unlike regular Scissor Rects. These are
    //!              orthogonal with Regular Scissor Rects.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 410
    //!
    //! \param [in]        pContext                     The device context (ID3D11DeviceContext) to be used for setting the Exclusive Scissor Rects.
    //! \param [in]        pExclusiveScissorRectsDesc   Description of the Exclusive Scissor Rects duly filled with their dimensions
    //!                                                 and control over enablement of individual ScissorRect
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_RSSetExclusiveScissorRects(__in IUnknown *pContext,
                                                           __in NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC *pExclusiveScissorRectsDesc);

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
    //! \ingroup dx
    //! See NvAPI_D3D11_RSSetViewportsPixelShadingRates

#define NV_MAX_PIXEL_SHADING_RATES 16 // Currently only 12 Shading Rates are available

#define NV_MAX_NUM_VIEWPORTS 16


    // Every element in Shading Rate Resource represents the shading rate for all pixels in the corresponding tile
    // The Shading Rate Resource dimensions must be the bound render target size divided by the tile dimensions (width/height)

#define NV_VARIABLE_PIXEL_SHADING_TILE_WIDTH 16  // Width of the tile, in pixels

#define NV_VARIABLE_PIXEL_SHADING_TILE_HEIGHT 16 // Height of the tile, in pixels


    typedef enum
    {
        NV_PIXEL_X0_CULL_RASTER_PIXELS,    // No shading, tiles are culled
        NV_PIXEL_X16_PER_RASTER_PIXEL,     // 16 shading passes per 1 raster pixel
        NV_PIXEL_X8_PER_RASTER_PIXEL,      //  8 shading passes per 1 raster pixel
        NV_PIXEL_X4_PER_RASTER_PIXEL,      //  4 shading passes per 1 raster pixel
        NV_PIXEL_X2_PER_RASTER_PIXEL,      //  2 shading passes per 1 raster pixel
        NV_PIXEL_X1_PER_RASTER_PIXEL,      //  Per-pixel shading
        NV_PIXEL_X1_PER_2X1_RASTER_PIXELS, //  1 shading pass per  2 raster pixels
        NV_PIXEL_X1_PER_1X2_RASTER_PIXELS, //  1 shading pass per  2 raster pixels
        NV_PIXEL_X1_PER_2X2_RASTER_PIXELS, //  1 shading pass per  4 raster pixels
        NV_PIXEL_X1_PER_4X2_RASTER_PIXELS, //  1 shading pass per  8 raster pixels
        NV_PIXEL_X1_PER_2X4_RASTER_PIXELS, //  1 shading pass per  8 raster pixels
        NV_PIXEL_X1_PER_4X4_RASTER_PIXELS  //  1 shading pass per 16 raster pixels
    } NV_PIXEL_SHADING_RATE;
#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__))
    typedef struct _NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1
    {
        bool enableVariablePixelShadingRate;                                //!< (IN) Control of enabling Variable Pixel Shading Rate per viewport
        NV_PIXEL_SHADING_RATE shadingRateTable[NV_MAX_PIXEL_SHADING_RATES]; //!< (IN) Lookup table of converting Shading Rate Index to NV_PIXEL_SHADING_RATE
                                                                            //        \note Shading Rate Resource View would be populated by application with indices of this table
    } NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1;

    typedef struct _NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1
    {
        NvU32 version;                                      //!< (IN) Struct version
        NvU32 numViewports;                                 //!< (IN) Number of viewports with shading rate set.
                                                            //        \note Passing zero will globally disable Variable Pixel Rate Shading for all viewports immaterial of values in pViewports
                                                            //        \note Max value can be equal to NV_MAX_NUM_VIEWPORTS
        NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 *pViewports; //!< (IN) Array of NV_D3D11_VIEWPORT_SHADING_RATE_DESC with number of elements equal to NumViewports
    } NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1;

    typedef NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1 NV_D3D11_VIEWPORTS_SHADING_RATE_DESC;
    typedef NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 NV_D3D11_VIEWPORT_SHADING_RATE_DESC;
#define NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1, 1)

#define NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_RSSetViewportsPixelShadingRates
    //
    //! DESCRIPTION: Sets Pixel Shading Rates and Enables/Disables per-viewport Variable Pixel Shading Rate feature
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 410
    //!
    //! \param [in]        pContext             The device context (ID3D11DeviceContext) to be used for setting the Viewports Shading Rates
    //! \param [in]        pShadingRateDesc     Shading rate descriptor
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_RSSetViewportsPixelShadingRates(__in IUnknown *pContext,
                                                                __in NV_D3D11_VIEWPORTS_SHADING_RATE_DESC *pShadingRateDesc);

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))

    typedef enum _NV_SRRV_DIMENSION
    {
        NV_SRRV_DIMENSION_TEXTURE2D = 4,
        NV_SRRV_DIMENSION_TEXTURE2DARRAY = 5,
    } NV_SRRV_DIMENSION;

    typedef struct _NV_TEX2D_SRRV
    {
        UINT MipSlice;
    } NV_TEX2D_SRRV;

    typedef struct _NV_TEX2D_ARRAY_SRRV
    {
        UINT MipSlice;
        UINT FirstArraySlice;
        UINT ArraySize;
    } NV_TEX2D_ARRAY_SRRV;
#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__))
    typedef struct _NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1
    {
        NvU32 version;                   //!< (IN) Parameter struct version
        DXGI_FORMAT Format;              //!< (IN) Format of the resource used as Shading Rate Surface. Should be either DXGI_FORMAT_R8_UINT or DXGI_FORMAT_R8_TYPELESS
        NV_SRRV_DIMENSION ViewDimension; //!< (IN) This declares whether the Shading Rate Surface is a simple 2D Texture or Array of 2D Textures
        union
        {
            NV_TEX2D_SRRV Texture2D;
            NV_TEX2D_ARRAY_SRRV Texture2DArray;
        };
    } NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1;

    typedef NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1 NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC;
#define NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1, 1)

#define NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER1


    DECLARE_INTERFACE_(__declspec(uuid("E14BE7F6-8FF5-4F5E-B63A-AD016EB8FBE5")) ID3D11NvShadingRateResourceView_V1, ID3D11View)
    {
        BEGIN_INTERFACE

        // *** IUnknown methods ***
        STDMETHOD(QueryInterface)
        (THIS_ REFIID riid, void **ppv) PURE;
        STDMETHOD_(ULONG, AddRef)
        (THIS) PURE;
        STDMETHOD_(ULONG, Release)
        (THIS) PURE;

        // **** ID3D11View method **/
        // Get Shading Rate Resource used while creating the Shading Rate Resource View
        STDMETHOD_(void, GetResource)
        (THIS_ _Outptr_ ID3D11Resource * *ppResource) PURE;

        // ** ID3D11NvShadingRateResourceView methods ***
        // The descriptor used while creating the Shading Rate Resource View
        STDMETHOD(GetDesc)
        (THIS_ NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC * pDesc) PURE;

        END_INTERFACE
    };

    typedef ID3D11NvShadingRateResourceView_V1 ID3D11NvShadingRateResourceView;
#define ID3D11NvShadingRateResourceView_VER1 MAKE_NVAPI_VERSION(ID3D11NvShadingRateResourceView_V1, 1)

#define ID3D11NvShadingRateResourceView_VER ID3D11NvShadingRateResourceView_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_CreateShadingRateResourceView
    //
    //! DESCRIPTION: Creates Shading Rate Resource View by taking ID3D11Resource as an input Shading Rate Surface.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 410
    //!
    //! \param [in]        pDevice                      The device to be used for creating the Shading Rate Resource View
    //! \param [in]        pShadingRateResource         Shading Rate Resource on which the view is to be created.
    //!                                                 \note This should be of format DXGI_FORMAT_R8_UINT or DXGI_FORMAT_R8_TYPELESS
    //!                                                 \note This should be confined to size calculated using render target dimensions,
    //!                                                       NV_VARIABLE_PIXEL_SHADING_TILE_WIDTH and NV_VARIABLE_PIXEL_SHADING_TILE_HEIGHT
    //! \param [in]        pShadingRateDesc             Shading Rate Resource View descriptor
    //! \param [out]       ppShadingRateResourceView    Address of a pointer to ID3D11NvShadingRateResourceView for returning the newly created Shading Rate Resource View
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_CreateShadingRateResourceView(__in ID3D11Device *pDevice,
                                                              __in ID3D11Resource *pShadingRateResource,
                                                              __in NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC *pShadingRateResourceViewDesc,
                                                              __out ID3D11NvShadingRateResourceView **ppShadingRateResourceView);

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_RSSetShadingRateResourceView
    //
    //! DESCRIPTION: Sets Shading Rate Resource View
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 410
    //!
    //! \param [in]        pContext                     The device context (ID3D11DeviceContext) used for setting the Shading Rate Resource View
    //! \param [out]       pShadingRateResourceView     Shading Rate Resource View to be set
    //!                                                 \note See NvAPI_D3D11_CreateShadingRateResourceView
    //!                                                 \note Passing this as null will reset Shading Rate Resource View to defaults
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_RSSetShadingRateResourceView(__in IUnknown *pContext,
                                                             __in ID3D11NvShadingRateResourceView *pShadingRateResourceView);

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
    //! \ingroup dx
    //! See NvAPI_D3D11_RSGetPixelShadingRateSampleOrder
    //! See NvAPI_D3D11_RSSetPixelShadingRateSampleOrder

    // X, Y = sample position. S = sample number.
    // The inner-most dimension is the sample number, followed by X and Y.

    typedef struct _NV_PIXEL_SRSO_1x2
    {
        struct NV_PIXEL_SRSO_1x2_X1
        {
            NvU8 Y[2];
        } X1;
        struct NV_PIXEL_SRSO_1x2_X2
        {
            NvU8 YS[2][2];
        } X2;
        struct NV_PIXEL_SRSO_1x2_X4
        {
            NvU8 YS[2][4];
        } X4;
        struct NV_PIXEL_SRSO_1x2_X8
        {
            NvU8 YS[2][8];
        } X8;
    } NV_PIXEL_SRSO_1x2;

    typedef struct _NV_PIXEL_SRSO_2x1
    {
        struct NV_PIXEL_SRSO_2x1_X1
        {
            NvU8 X[2];
        } X1;
        struct NV_PIXEL_SRSO_2x1_X2
        {
            NvU8 XS[2][2];
        } X2;
        struct NV_PIXEL_SRSO_2x1_X4
        {
            NvU8 XS[2][4];
        } X4;
    } NV_PIXEL_SRSO_2x1;

    typedef struct _NV_PIXEL_SRSO_2x2
    {
        struct NV_PIXEL_SRSO_2x2_X1
        {
            NvU8 YX[2][2];
        } X1;
        struct NV_PIXEL_SRSO_2x2_X2
        {
            NvU8 YXS[2][2][2];
        } X2;
        struct NV_PIXEL_SRSO_2x2_X4
        {
            NvU8 YXS[2][2][4];
        } X4;
    } NV_PIXEL_SRSO_2x2;

    typedef struct _NV_PIXEL_SRSO_2x4
    {
        struct NV_PIXEL_SRSO_2x4_X1
        {
            NvU8 YX[4][2];
        } X1;
        struct NV_PIXEL_SRSO_2x4_X2
        {
            NvU8 YXS[4][2][2];
        } X2;
    } NV_PIXEL_SRSO_2x4;

    typedef struct _NV_PIXEL_SRSO_4x2
    {
        struct NV_PIXEL_SRSO_4x2_X1
        {
            NvU8 YX[2][4];
        } X1;
    } NV_PIXEL_SRSO_4x2;

    typedef struct _NV_PIXEL_SRSO_4x4
    {
        struct NV_PIXEL_SRSO_4x4_X1
        {
            NvU8 YX[4][4];
        } X1;
    } NV_PIXEL_SRSO_4x4;

    typedef struct _NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1
    {
        NvU32 version;
        NV_PIXEL_SRSO_1x2 Pixel_1x2;
        NV_PIXEL_SRSO_2x1 Pixel_2x1;
        NV_PIXEL_SRSO_2x2 Pixel_2x2;
        NV_PIXEL_SRSO_2x4 Pixel_2x4;
        NV_PIXEL_SRSO_4x2 Pixel_4x2;
        NV_PIXEL_SRSO_4x4 Pixel_4x4;
    } NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1;

    typedef NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1 NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE;
#define NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER1 MAKE_NVAPI_VERSION(NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1, 1)

#define NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER1


#endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_RSGetPixelShadingRateSampleOrder
    //
    //! DESCRIPTION: Get the Sample Order for Variable Shading Rate
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 410
    //!
    //! \param [in]        pContext                     The device context (ID3D11DeviceContext) used for getting the Shading Rate Sample Order
    //! \param [out]       pSampleOrderTable            A pointer to NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE where the current Sample Order for Variable Pixel Rate Shading that is returned
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_RSGetPixelShadingRateSampleOrder(__in IUnknown *pContext,
                                                                 __out NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE *pSampleOrderTable);

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

#if defined(__cplusplus) && (defined(__d3d11_h__))

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D11_RSSetPixelShadingRateSampleOrder
    //
    //! DESCRIPTION: Set the Sample Order for Variable Shading Rate
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 410
    //!
    //! \param [in]        pContext                     The device context (ID3D11DeviceContext) used for setting the Shading Rate Sample Order
    //! \param [out]       pSampleOrderTable            Sample Order for Variable Shading Rate to be set
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D11_RSSetPixelShadingRateSampleOrder(__in IUnknown *pContext,
                                                                 __in NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE *pSampleOrderTable);

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && (defined(__d3d11_h__))
    typedef struct _NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1
    {
        NvU32 version; //!< (IN) Struct version
        NvU32 flags;   //!< (IN) Reserved for future use
    } NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1;

    typedef NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1 NV_VRS_HELPER_LATCH_GAZE_PARAMS;
#define NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1, 1)

#define NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER1


    typedef enum _NV_VRS_CONTENT_TYPE
    {
        NV_VRS_CONTENT_TYPE_INVALID = 0x0,
        NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING = 0x1,
        NV_VRS_CONTENT_TYPE_MAX = NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING
    } NV_VRS_CONTENT_TYPE;

    typedef enum _NV_FOVEATED_RENDERING_SHADING_RATE_PRESET
    {
        NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_INVALID = 0,
        NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGHEST_PERFORMANCE = 1,
        NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGH_PERFORMANCE = 2,
        NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_BALANCED = 3,
        NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGH_QUALITY = 4,
        NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGHEST_QUALITY = 5,
        NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM = 6,
        NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_MAX = NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM
    } NV_FOVEATED_RENDERING_SHADING_RATE_PRESET;

    typedef struct _NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1
    {
        NvU32 version;

        NV_PIXEL_SHADING_RATE InnerMostRegionShadingRate;  //!< (IN) Shading Rate for the inner-most region of the foveated rendering pattern
        NV_PIXEL_SHADING_RATE MiddleRegionShadingRate;     //!< (IN) Shading Rate for the middle region of the foveated rendering pattern
        NV_PIXEL_SHADING_RATE PeripheralRegionShadingRate; //!< (IN) Shading Rate for the peripheral region of the foveated rendering pattern
    } NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1;

    typedef NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1 NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC;
#define NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1, 1)

#define NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER1


    typedef enum _NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET
    {
        NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_INVALID = 0,
        NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_WIDE = 1,
        NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_BALANCED = 2,
        NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_NARROW = 3,
        NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM = 4,
        NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_MAX = NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM
    } NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET;

    typedef struct _NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1
    {
        NvU32 version;

        float fInnermostRadii[2];  //!< (IN) Horizontal and vertical radius for the inner-most region of the foveated rendering pattern
        float fMiddleRadii[2];     //!< (IN) Horizontal and vertical radius for the middle region of the foveated rendering pattern
        float fPeripheralRadii[2]; //!< (IN) Horizontal and vertical radius for the peripheral region of the foveated rendering pattern
    } NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1;

    typedef NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1 NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC;
#define NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1, 1)

#define NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER1


    typedef struct _NV_FOVEATED_RENDERING_DESC_V1
    {
        NvU32 version; //!< (IN) Struct version
        NvU32 flags;   //!< (IN) Reserved for future use

        NV_FOVEATED_RENDERING_SHADING_RATE_PRESET ShadingRatePreset;                          //!< (IN) Preset of the shading rate
        NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1 ShadingRateCustomPresetDesc; //!< (IN) To be provided only if ShadingRatePreset is NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM

        NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET FoveationPatternPreset;                          //!< (IN) Preset of the foveation pattern
        NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1 FoveationPatternCustomPresetDesc; //!< (IN) To be provided only if FoveationPatternPreset is NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM

        NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking.
                                //        Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1)

    } NV_FOVEATED_RENDERING_DESC_V1;

    typedef NV_FOVEATED_RENDERING_DESC_V1 NV_FOVEATED_RENDERING_DESC;
#define NV_FOVEATED_RENDERING_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_DESC_V1, 1)

#define NV_FOVEATED_RENDERING_DESC_VER NV_FOVEATED_RENDERING_DESC_VER1


    typedef enum _NV_VRS_RENDER_MODE
    {
        NV_VRS_RENDER_MODE_INVALID = 0,
        NV_VRS_RENDER_MODE_MONO = 1,      // States mono rendering on the entire render target
        NV_VRS_RENDER_MODE_LEFT_EYE = 2,  // States Left eye rendering of a stereo pair on the entire render target
        NV_VRS_RENDER_MODE_RIGHT_EYE = 3, // States Right eye rendering of a stereo pair on the entire render target
        NV_VRS_RENDER_MODE_STEREO = 4,    // States side-by-side stereo rendering on the render target
        NV_VRS_RENDER_MODE_MAX = NV_VRS_RENDER_MODE_STEREO
    } NV_VRS_RENDER_MODE;

#define MAX_NUMBER_OF_GAZE_DATA_PROVIDERS 8 // Maximum number of gaze data providers / devices.


    typedef struct _NV_VRS_HELPER_ENABLE_PARAMS_V1
    {
        NvU32 version; //!< (IN) Struct version
        NvU32 flags;   //!< (IN) Reserved for future use

        NV_VRS_RENDER_MODE RenderMode;   //!< (IN) This defines whether subsequent render calls are for mono/stereo
        NV_VRS_CONTENT_TYPE ContentType; //!< (IN) This defines the type of content with which the VRS pattern will be generated

        NV_FOVEATED_RENDERING_DESC_V1 sFoveatedRenderingDesc; //!< (IN) Provide this if ContentType has NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING flag
    } NV_VRS_HELPER_ENABLE_PARAMS_V1;

    typedef NV_VRS_HELPER_ENABLE_PARAMS_V1 NV_VRS_HELPER_ENABLE_PARAMS;
#define NV_VRS_HELPER_ENABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_ENABLE_PARAMS_V1, 1)

#define NV_VRS_HELPER_ENABLE_PARAMS_VER NV_VRS_HELPER_ENABLE_PARAMS_VER1


    typedef struct _NV_VRS_HELPER_DISABLE_PARAMS_V1
    {
        NvU32 version;  //!< (IN) Struct version
        NvU32 reserved; //!< (IN) Reserved for future use
    } NV_VRS_HELPER_DISABLE_PARAMS_V1;

    typedef NV_VRS_HELPER_DISABLE_PARAMS_V1 NV_VRS_HELPER_DISABLE_PARAMS;
#define NV_VRS_HELPER_DISABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_DISABLE_PARAMS_V1, 1)

#define NV_VRS_HELPER_DISABLE_PARAMS_VER NV_VRS_HELPER_DISABLE_PARAMS_VER1


    typedef struct _NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1
    {
        NvU32 version;                                                      //!< (IN)  Struct version
        IUnknown **ppShadingRateResource;                                   //!< (OUT) Pointer to 2D Texture resource with currently applied shading rate pattern
        NV_PIXEL_SHADING_RATE shadingRateTable[NV_MAX_PIXEL_SHADING_RATES]; //!< (OUT) Shading Rate Table filled by the driver
    } NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1;

    typedef NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1 NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS;
#define NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1, 1)

#define NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER1


    typedef struct _NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1
    {
        NvU32 version;  //!< (IN) Struct version
        NvU32 reserved; //!< (IN) Reserved for future use
    } NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1;

    typedef NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1 NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS;
#define NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1, 1)

#define NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER1


    DECLARE_INTERFACE(ID3DNvVRSHelper_V1)
    {
        BEGIN_INTERFACE

        STDMETHOD_(ULONG, AddRef)
        (THIS) PURE;
        STDMETHOD_(ULONG, Release)
        (THIS) PURE;

        // Latches the latest gaze which will be used for subsequent foveated rendering. Recommended to be called once per frame before scene drawing begins.
        STDMETHOD_(NvAPI_Status, LatchGaze)
        (THIS_ IUnknown * pContext, NV_VRS_HELPER_LATCH_GAZE_PARAMS * pLatchGazeParams) PURE;

        // Enables VRS with sepcified content type and preset. This can be called per draw call.
        STDMETHOD_(NvAPI_Status, Enable)
        (THIS_ IUnknown * pContext, NV_VRS_HELPER_ENABLE_PARAMS * pEnableParams) PURE;

        // Disables VRS till re-enabled.
        STDMETHOD_(NvAPI_Status, Disable)
        (THIS_ IUnknown * pContext, NV_VRS_HELPER_DISABLE_PARAMS * pDisableParams) PURE;

        // Creates a 2D texture, copies the current shading rate pattern on it and returns the pointer to this texture.
        // It also returns an array that conveys which value in the shading rate resource corresponds to which exact pixel shading rate.
        STDMETHOD_(NvAPI_Status, GetShadingRateResource)
        (THIS_ IUnknown * pContext, NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS * pGetShadingRateResourceParams) PURE;

        // Destroys all internally created shading rate resources and views.
        STDMETHOD_(NvAPI_Status, PurgeInternalShadingRateResources)
        (THIS_ IUnknown * pContext, NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS * pPurgeParams) PURE;

        END_INTERFACE
    };

    typedef ID3DNvVRSHelper_V1 ID3DNvVRSHelper;
#define ID3DNvVRSHelper_VER1 MAKE_NVAPI_VERSION(ID3DNvVRSHelper_V1, 1)

#define ID3DNvVRSHelper_VER ID3DNvVRSHelper_VER1


    typedef struct _NV_VRS_HELPER_INIT_PARAMS_V1
    {
        NvU32 version; //!< (IN) Struct version
        NvU32 flags;   //!< (IN) Reserved for future use

        ID3DNvVRSHelper_V1 **ppVRSHelper; //!< (OUT) Interface for Shading Rate Pattern Tracker
    } NV_VRS_HELPER_INIT_PARAMS_V1;

    typedef NV_VRS_HELPER_INIT_PARAMS_V1 NV_VRS_HELPER_INIT_PARAMS;
#define NV_VRS_HELPER_INIT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_INIT_PARAMS_V1, 1)

#define NV_VRS_HELPER_INIT_PARAMS_VER NV_VRS_HELPER_INIT_PARAMS_VER1


    //! SUPPORTED OS:  Windows 7 and higher
    //!
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_InitializeVRSHelper
    //
    //! DESCRIPTION: Creates an interface for updating, enabling and disabling internally tracked shading rate pattern for Variable Rate Shading
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 430
    //!
    //! \param [in]        pDevice                              The device to be used for creating the VRS Handler interface
    //!                                                         \note This should be same the device used for Gaze Handler. See also: NvAPI_D3D_InitializeNvGazeHandler.
    //! \param [in]        pInitializeVRSHelperParams           Descriptor for VRS Helper initialization
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D_InitializeVRSHelper(__in IUnknown *pDevice,
                                                  __inout NV_VRS_HELPER_INIT_PARAMS *pInitializeVRSHelperParams);

    typedef enum _NV_GAZE_DATA_VALIDITY_FLAGS
    {
        NV_GAZE_ORIGIN_VALID = 0x1,
        NV_GAZE_DIRECTION_VALID = 0x2,
        NV_GAZE_LOCATION_VALID = 0x4,
        NV_GAZE_VELOCITY_VALID = 0x8,
        NV_GAZE_PUPIL_DIAMETER_VALID = 0x10,
        NV_GAZE_EYE_OPENNESS_VALID = 0x20,
        NV_GAZE_EYE_SACCADE_DATA_VALID = 0x40
    } NV_GAZE_DATA_VALIDITY_FLAGS;

    typedef struct _NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE
    {
        NvU32 version; //!< (IN) Version of the structure

        NvU32 GazeDataValidityFlags; //!< (IN) To be populated with OR'ing flags from NV_GAZE_DATA_VALIDITY_FLAGS

        float fGazeOrigin_mm[3];          //!< (IN) Use flag NV_GAZE_ORIGIN_VALID. Origin of the eye in millimeters. Used mainly to detect whether Left Eye or Right Eye.
        float fGazeDirection[3];          //!< (IN) Use flag NV_GAZE_DIRECTION_VALID. Normalized direction of the gaze of the eye. Used for calculating the gaze location using the FOV.
        float fGazeNormalizedLocation[2]; //!< (IN) Use flag NV_GAZE_LOCATION_VALID. Precalculated normalized gaze location in limits (-1 to +1) for X and Y. Center of the screen denotes (0, 0). If this is valid, this will be given higher priority than direction.
        float fGazeVelocity[2];           //!< (IN) Use flag NV_GAZE_VELOCITY_VALID. Optional: Velocity of the eye on the normalized space in each direction. Central foveated region would be skewed in the direction of the velocity.
        float fPupilDiameter_mm;          //!< (IN) Use flag NV_GAZE_PUPIL_DIAMETER_VALID. Unused at the moment.
        float fEyeOpenness;               //!< (IN) Use flag NV_GAZE_EYE_OPENNESS_VALID. Unused at the moment.
        BOOL bInSaccade;                  //!< (IN) Use flag NV_GAZE_EYE_SACCADE_DATA_VALID. Denotes whether eye is currently in saccade movement or not.
    } NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1;

    typedef NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE;
#define NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1, 1)

#define NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER1


    typedef struct _NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS
    {
        NvU32 version; //!< (IN) Struct version
        NvU32 flags;   //!< (IN) Reserved for future use

        NvU64 Timestamp; //!< (IN) Timestamp at which the gaze data has been captured. Should be larger than timestamp provided at previous update.
        union
        {
            NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sMonoData; //!< (IN) Gaze data for Mono rendering mode
            struct
            {
                NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sLeftEye;  //!< (IN) Gaze data for Left Eye of Stereo rendering mode
                NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sRightEye; //!< (IN) Gaze data for Right Eye of Stereo rendering mode
            } sStereoData;
        };
    } NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1;

    typedef NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1 NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS;
#define NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1, 1)

#define NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER1


    DECLARE_INTERFACE(ID3DNvGazeHandler_V2)
    {
        BEGIN_INTERFACE

        STDMETHOD_(ULONG, AddRef)
        (THIS) PURE;
        STDMETHOD_(ULONG, Release)
        (THIS) PURE;

        // Updates the gaze data for foveated rendering
        STDMETHOD_(NvAPI_Status, UpdateGazeData)
        (THIS_ IUnknown * pContext, NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS * pUpdateGazeDataParams) PURE;

        END_INTERFACE
    };
    typedef ID3DNvGazeHandler_V2 ID3DNvGazeHandler;
#define ID3DNvGazeHandler_VER2 MAKE_NVAPI_VERSION(ID3DNvGazeHandler_V2, 2)

#define ID3DNvGazeHandler_VER ID3DNvGazeHandler_VER2


    DECLARE_INTERFACE(ID3DNvGazeHandler_V1)
    {
        BEGIN_INTERFACE

        STDMETHOD_(ULONG, AddRef)
        (THIS) PURE;
        STDMETHOD_(ULONG, Release)
        (THIS) PURE;

        // Updates the gaze data for foveated rendering
        STDMETHOD_(NvAPI_Status, UpdateGazeData)
        (THIS_ IUnknown * pContext, NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS * pUpdateGazeDataParams) PURE;

        END_INTERFACE
    };
#define ID3DNvGazeHandler_VER1 MAKE_NVAPI_VERSION(ID3DNvGazeHandler_V1, 1)

#ifndef ID3DNvGazeHandler_VER
    typedef ID3DNvGazeHandler_V1 ID3DNvGazeHandler;
#define ID3DNvGazeHandler_VER ID3DNvGazeHandler_VER1

#endif

    typedef enum _NV_GAZE_DATA_TYPE
    {
        NV_GAZE_DATA_INVALID = 0,
        NV_GAZE_DATA_MONO = 1,
        NV_GAZE_DATA_STEREO = 2,
        NV_GAZE_DATA_MAX = NV_GAZE_DATA_STEREO
    } NV_GAZE_DATA_TYPE;

    typedef struct _NV_GAZE_HANDLER_INIT_PARAMS_V2
    {
        NvU32 version; //!< (IN) Struct version

        NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking.
                                //        Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1)

        NV_GAZE_DATA_TYPE GazeDataType; //!< (IN) Describes whether gaze is Mono or Stereo
        NvU32 flags;                    //!< (IN) Reserved for future use
        float fHorizontalFOV;           //!< (IN) Horizontal Field of View
        float fVericalFOV;              //!< (IN) Vertical Field of View

        ID3DNvGazeHandler_V2 **ppNvGazeHandler; //!< (OUT) Interface for Gaze Data Handler
    } NV_GAZE_HANDLER_INIT_PARAMS_V2;

    typedef NV_GAZE_HANDLER_INIT_PARAMS_V2 NV_GAZE_HANDLER_INIT_PARAMS;
#define NV_GAZE_HANDLER_INIT_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_GAZE_HANDLER_INIT_PARAMS_V2, 2)

#define NV_GAZE_HANDLER_INIT_PARAMS_VER NV_GAZE_HANDLER_INIT_PARAMS_VER2


    typedef struct _NV_GAZE_HANDLER_INIT_PARAMS_V1
    {
        NvU32 version; //!< (IN) Struct version

        NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking.
                                //        Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1)

        NV_GAZE_DATA_TYPE GazeDataType; //!< (IN) Describes whether gaze is Mono or Stereo
        NvU32 flags;                    //!< (IN) Reserved for future use
        float fHorizontalFOV;           //!< (IN) Horizontal Field of View
        float fVericalFOV;              //!< (IN) Vertical Field of View

        ID3DNvGazeHandler_V1 **ppNvGazeHandler; //!< (OUT) Interface for Gaze Data Handler
    } NV_GAZE_HANDLER_INIT_PARAMS_V1;

#define NV_GAZE_HANDLER_INIT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GAZE_HANDLER_INIT_PARAMS_V1, 1)

#ifndef NV_GAZE_HANDLER_INIT_PARAMS_VER
    typedef NV_GAZE_HANDLER_INIT_PARAMS_V1 NV_GAZE_HANDLER_INIT_PARAMS;
#define NV_GAZE_HANDLER_INIT_PARAMS_VER NV_GAZE_HANDLER_INIT_PARAMS_VER1

#endif

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

    //! SUPPORTED OS:  Windows 7 and higher
    //!

#if defined(__cplusplus) && (defined(__d3d11_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_InitializeNvGazeHandler
    //
    //! DESCRIPTION: Creates an interface for updating and managing gaze data
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 430
    //!
    //! \param [in]        pDevice                          The device to be used for creating the Gaze Handler interface
    //!                                                     \note This should be same as the device used with VRS Handler. See also: NvAPI_D3D_InitializeVRSHelper.
    //! \param [in]        pInitializeNvGazeHandlerParams   Descriptor for Gaze Data Handler initialization
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!         (none)
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////

    NVAPI_INTERFACE NvAPI_D3D_InitializeNvGazeHandler(__in IUnknown *pDevice,
                                                      __inout NV_GAZE_HANDLER_INIT_PARAMS *pInitializeNvGazeHandlerParams);

#endif // defined(__cplusplus) && (defined(__d3d11_h__))

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && defined(__d3d11_h__)

    //! \ingroup dx

    typedef enum NV_SMP_ASSIST_TYPE
    {
        NV_SMP_ASSIST_NONE = 0,
        NV_SMP_ASSIST_MRS = 1, // SMP Assist required for Multi-Res Shading
        NV_SMP_ASSIST_LMS = 2, // SMP Assist required for Lens Matched Shading
        NV_SMP_ASSIST_NUM_TYPES
    } NV_SMP_ASSIST_TYPE;

    typedef enum NV_SMP_ASSIST_LEVEL
    {
        NV_SMP_ASSIST_LEVEL_FULL = 0,    // Full assistance. App selects a pre-baked MRS/LMS config, driver handles correct setting of viewport, scissors and FastGS
        NV_SMP_ASSIST_LEVEL_PARTIAL = 1, // Partial assistance. App provides a custom MRS/LMS config, driver handles correct setting of viewport, scissors and FastGS
        NV_SMP_ASSIST_LEVEL_MINIMAL = 2, // Minimal assistance. App provides viewports and scissors. App sets FastGS as required. App sets LMS params as required (NvAPI_D3D_SetModifiedWMode). App provides SMPType as NONE. Driver handles correct setting of viewports and scissors.
        NV_SMP_ASSIST_NUM_LEVELS
    } NV_SMP_ASSIST_LEVEL;

    typedef enum NV_MRS_CONFIG
    {
        NV_MRS_CONFIG_BALANCED = 0,
        NV_MRS_CONFIG_AGGRESSIVE = 1,
        NV_MRS_CONFIG_OCULUSRIFT_CV1_CONSERVATIVE = 2,
        NV_MRS_CONFIG_OCULUSRIFT_CV1_BALANCED = 3,
        NV_MRS_CONFIG_OCULUSRIFT_CV1_AGGRESSIVE = 4,
        NV_MRS_CONFIG_HTC_VIVE_CONSERVATIVE = 5,
        NV_MRS_CONFIG_HTC_VIVE_BALANCED = 6,
        NV_MRS_CONFIG_HTC_VIVE_AGGRESSIVE = 7,
        NV_MRS_NUM_CONFIGS
    } NV_MRS_CONFIG;

    typedef enum NV_LMS_CONFIG
    {
        NV_LMS_CONFIG_OCULUSRIFT_CV1_CONSERVATIVE = 0,
        NV_LMS_CONFIG_OCULUSRIFT_CV1_BALANCED = 1,
        NV_LMS_CONFIG_OCULUSRIFT_CV1_AGGRESSIVE = 2,
        NV_LMS_CONFIG_HTC_VIVE_CONSERVATIVE = 3,
        NV_LMS_CONFIG_HTC_VIVE_BALANCED = 4,
        NV_LMS_CONFIG_HTC_VIVE_AGGRESSIVE = 5,
        NV_LMS_NUM_CONFIGS
    } NV_LMS_CONFIG;

#define NV_SMP_ASSIST_FLAGS_DEFAULT 0x00000000


#define NV_SMP_ASSIST_MAX_VIEWPORTS 16


    typedef struct _NV_MRS_CUSTOM_CONFIG_V1
    {
        float centerWidth; //!< (IN) Size of the central viewport, ranging (0,1], where 1 is full original viewport size
        float centerHeight;
        float centerX; //!< (IN) Location of the central viewport, ranging 0..1, where 0.5 is the center of the screen
        float centerY;
        float densityScaleX[3]; //!< (IN) Pixel density scale factors: how much the linear pixel density is scaled within each row and column (1.0 = full density)
        float densityScaleY[3];
    } NV_MRS_CUSTOM_CONFIG_V1;

    typedef NV_MRS_CUSTOM_CONFIG_V1 NV_MRS_CUSTOM_CONFIG;

    typedef struct _NV_MRS_INSTANCED_STEREO_CONFIG_V1
    {                         //!< (OUT) MRS Instanced stereo config returned by the SMP Assist GetConstants API
        float centerWidth[2]; //!< (OUT) Size of the central viewport, ranging (0,1], where 1 is full original viewport size
        float centerHeight;
        float centerX[2]; //!< (OUT) Location of the central viewport, ranging 0..1, where 0.5 is the center of the screen
        float centerY;
        float densityScaleX[5]; //!< (OUT) Pixel density scale factors: how much the linear pixel density is scaled within each row and column (1.0 = full density)
        float densityScaleY[3];
    } NV_MRS_INSTANCED_STEREO_CONFIG_V1;

    typedef NV_MRS_INSTANCED_STEREO_CONFIG_V1 NV_MRS_INSTANCED_STEREO_CONFIG;

    typedef struct _NV_LMS_CUSTOM_CONFIG_V1
    {
        float warpLeft;  //!< (IN) LMS params to control warping of the 2 left quadrants
        float warpRight; //!< (IN) LMS params to control warping of the 2 right quadrants
        float warpUp;    //!< (IN) LMS params to control warping of the 2 upper quadrants
        float warpDown;  //!< (IN) LMS params to control warping of the 2 lower quadrants

        float relativeSizeLeft;  //!< (IN) LMS params to control the width of the 2 left quandrants relative to the bounding box width
        float relativeSizeRight; //!< (IN) LMS params to control the width of the 2 right quandrants relative to the bounding box width
        float relativeSizeUp;    //!< (IN) LMS params to control the height of the 2 upper quandrants relative to the bounding box height
        float relativeSizeDown;  //!< (IN) LMS params to control the height of the 2 lower quandrants relative to the bounding box height
    } NV_LMS_CUSTOM_CONFIG_V1;

    typedef NV_LMS_CUSTOM_CONFIG_V1 NV_LMS_CUSTOM_CONFIG;

    typedef struct _NV_LMS_INSTANCED_STEREO_CONFIG_V1
    {                                         //!< (OUT) LMS Instanced stereo config returned by the SMP Assist GetConstants API
        NV_LMS_CUSTOM_CONFIG_V1 sLeftConfig;  //!< (OUT) LMS config for the Left eye view
        NV_LMS_CUSTOM_CONFIG_V1 sRightConfig; //!< (OUT) LMS config for the Right eye view
    } NV_LMS_INSTANCED_STEREO_CONFIG_V1;

    typedef NV_LMS_INSTANCED_STEREO_CONFIG_V1 NV_LMS_INSTANCED_STEREO_CONFIG;

    typedef enum _NV_SMP_ASSIST_EYE_INDEX
    {
        NV_SMP_ASSIST_EYE_INDEX_MONO = 0,             // Non-stereo rendering
        NV_SMP_ASSIST_EYE_INDEX_LEFT_EYE = 1,         // Stereo - Rendering left eye
        NV_SMP_ASSIST_EYE_INDEX_RIGHT_EYE = 2,        // Stereo - Rendering right eye
        NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO = 3, // Stereo - Rendering both eyes
    } NV_SMP_ASSIST_EYE_INDEX;

#define NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES 4


    typedef struct _NV_CUSTOM_RECTS_V1
    {
        NvU32 numViewports[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES];
        D3D11_VIEWPORT *pViewports[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES]; //!< (IN) Viewports, for each eye index, that should be set when app calls Enable(eyeIndex)
        D3D11_RECT *pScissors[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES];      //!< (IN) Scissors, for each eye index, that should be set when app calls Enable(eyeIndex)
    } NV_CUSTOM_RECTS_V1;

    typedef NV_CUSTOM_RECTS_V1 NV_CUSTOM_RECTS;

    typedef struct _NV_SMP_ASSIST_ENABLE_PARAMS_V1
    {
        NvU32 version;                     //!< (IN) Structure version
        NV_SMP_ASSIST_EYE_INDEX eEyeIndex; //!< (IN) Rendering mode for upcoming draw calls (Mono/Stereo-Left/Stereo-Right/Instanced Stereo)
    } NV_SMP_ASSIST_ENABLE_PARAMS_V1;

    typedef NV_SMP_ASSIST_ENABLE_PARAMS_V1 NV_SMP_ASSIST_ENABLE_PARAMS;
#define NV_SMP_ASSIST_ENABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_ENABLE_PARAMS_V1, 1)

#define NV_SMP_ASSIST_ENABLE_PARAMS_VER NV_SMP_ASSIST_ENABLE_PARAMS_VER1


    typedef struct _NV_SMP_ASSIST_DISABLE_PARAMS_V1
    {
        NvU32 version;  //!< (IN) Structure version
        NvU32 Reserved; //!< (IN) Unused.
    } NV_SMP_ASSIST_DISABLE_PARAMS_V1;

    typedef NV_SMP_ASSIST_DISABLE_PARAMS_V1 NV_SMP_ASSIST_DISABLE_PARAMS;
#define NV_SMP_ASSIST_DISABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_DISABLE_PARAMS_V1, 1)

#define NV_SMP_ASSIST_DISABLE_PARAMS_VER NV_SMP_ASSIST_DISABLE_PARAMS_VER1


    // FastGS constant buffer data returned by the GetConstants API.
    // Refer VRWorks SDK's multiprojection_dx app (struct FastGSCBData)
    typedef struct _NV_SMP_ASSIST_FASTGSCBDATA_V1
    {
        float NDCSplitsX[2]; //!< (OUT) FastGS constant buffer data for Multi-Res Shading/ Lens Matched Shading
        float NDCSplitsY[2];
    } NV_SMP_ASSIST_FASTGSCBDATA_V1;

    typedef NV_SMP_ASSIST_FASTGSCBDATA_V1 NV_SMP_ASSIST_FASTGSCBDATA;

    typedef struct _NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1
    {
        float NDCSplitsX[4]; //!< (OUT) FastGS constant buffer data for Multi-Res Shading (Instanced stereo). 2 splits for left eye followed by 2 splits for right eye
        float NDCSplitsY[2];
    } NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1;

    typedef NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1 NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO;

    // Constant buffer data to supply the UV-remapping helper functions
    // Refer VRWorks SDK's multiprojection_dx app (struct RemapCBData)
    typedef struct _NV_SMP_ASSIST_REMAPCBDATA_V1
    {
        //!< (OUT) Constant buffer data to supply the UV-remapping helper functions
        float ClipToWindowSplitsX[2];
        float ClipToWindowSplitsY[2];
        float ClipToWindowX[3][2]; // ClipToWindowX[i][0] is Scale and ClipToWindowX[i][1] is Bias
        float ClipToWindowY[3][2]; // ClipToWindowY[i][0] is Scale and ClipToWindowY[i][1] is Bias
        float ClipToWindowZ[2];    // ClipToWindowZ[0] is Scale and ClipToWindowZ[1] is Bias

        float WindowToClipSplitsX[2];
        float WindowToClipSplitsY[2];
        float WindowToClipX[3][2]; // WindowToClipX[i][0] is Scale and WindowToClipX[i][1] is Bias
        float WindowToClipY[3][2]; // WindowToClipY[i][0] is Scale and WindowToClipY[i][1] is Bias
        float WindowToClipZ[2];    // WindowToClipZ[0] is Scale and WindowToClipZ[1] is Bias

        float BoundingRectOriginX;
        float BoundingRectOriginY;
        float BoundingRectSizeWidth;
        float BoundingRectSizeHeight;
        float BoundingRectSizeInvWidth;
        float BoundingRectSizeInvHeight;

        float Padding[2];
    } NV_SMP_ASSIST_REMAPCBDATA_V1;

    typedef NV_SMP_ASSIST_REMAPCBDATA_V1 NV_SMP_ASSIST_REMAPCBDATA;

    //! SUPPORTED OS:  Windows 7 and higher
    //!

    typedef struct _NV_SMP_ASSIST_GET_CONSTANTS_V3
    {
        NvU32 version;                     //!< (IN) Structure version
        NV_SMP_ASSIST_EYE_INDEX eEyeIndex; //!< (IN) Viewports/scissors/constant buffer data corresponding to the input eEyeIndex will be returned
        NvU32 numViewports;                //!< (OUT) Number of valid viewport entries
        D3D11_VIEWPORT *pViewports;        //!< (OUT) If not NULL, this will contain the viewports computed by driver based on init params
        D3D11_RECT *pScissors;             //!< (OUT) If not NULL, this will contain the scissors computed by the driver based on init params

        NV_SMP_ASSIST_TYPE eSMPAssistType;   //!< (OUT) SMP type provided in Init call
        NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (OUT) SMP Assist level provided in Init call

        union
        {
            NV_MRS_CUSTOM_CONFIG_V1 sMRSConfig; //!< (OUT) If eSMPAssistType is MRS, then MRS config will be populated
            NV_LMS_CUSTOM_CONFIG_V1 sLMSConfig; //!< (OUT) If eSMPAssistType is LMS, then LMS config will be populated
        };

        float projectionSizeWidth;  //!< (OUT) MRS/LMS projection size
        float projectionSizeHeight; //!< (OUT)

        NV_SMP_ASSIST_FASTGSCBDATA_V1 *pFastGSCBData; //!< (OUT) If not NULL, this will contain constant buffer data to supply the FastGS for culling primitives per-viewport
        NV_SMP_ASSIST_REMAPCBDATA_V1 *pRemapCBData;   //!< (OUT) If not NULL, this will contain constant buffer data to supply the UV-remapping helper functions

        D3D11_VIEWPORT boundingViewport; //!< (OUT) If eSMPType is MRS or LMS then this will be a union of the individual viewports populated in pViewports
        D3D11_RECT boundingScissor;      //!< (OUT) If eSMPType is MRS or LMS then this will be a union of the individual scissor rects populated in pScissors

        union
        {
            NV_MRS_INSTANCED_STEREO_CONFIG_V1 sMRS_ISConfig; //!< (OUT) If eSMPAssistType is MRS and eEyeIndex is NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO then MRS Instanced stereo config will be populated
            NV_LMS_INSTANCED_STEREO_CONFIG_V1 sLMS_ISConfig; //!< (OUT) If eSMPAssistType is LMS and eEyeIndex is NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO then LMS Instanced stereo config will be populated
        };

        NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1 *pFastGSCBDataMRS_IS; //!< (OUT) If non-NULL and eSMPAssistType is MRS and eEyeIndex is NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO then MRS Instanced stereo FastGS constant buffer data will be populated
    } NV_SMP_ASSIST_GET_CONSTANTS_V3;

#define NV_SMP_ASSIST_GET_CONSTANTS_VER3 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_GET_CONSTANTS_V3, 3)

    typedef NV_SMP_ASSIST_GET_CONSTANTS_V3 NV_SMP_ASSIST_GET_CONSTANTS;
#define NV_SMP_ASSIST_GET_CONSTANTS_VER NV_SMP_ASSIST_GET_CONSTANTS_VER3


    //! SUPPORTED OS:  Windows 7 and higher
    //!

    typedef struct _NV_SMP_ASSIST_SETUP_PARAMS_V1
    {
        NvU32 version; //!< (IN) Structure version
        union
        {
            NV_MRS_CONFIG eMRSConfig;                 //!< (IN) If eSMPAssistType is MRS and SMP Assist Level is Full then provide MRS config enum
            NV_LMS_CONFIG eLMSConfig;                 //!< (IN) If eSMPAssistType is LMS and SMP Assist Level is Full then provide LMS config enum
            NV_MRS_CUSTOM_CONFIG_V1 sMRSCustomConfig; //!< (IN) If eSMPAssistType is MRS and SMP Assist Level is Partial, then provide MRS config
            NV_LMS_CUSTOM_CONFIG_V1 sLMSCustomConfig; //!< (IN) If eSMPAssistType is LMS and SMP Assist Level is Partial, then provide LMS config
            NV_CUSTOM_RECTS_V1 sCustomRects;          //!< (IN) If SMP Assist Level is Minimal, provide custom viewports and scissor rects for each eye index.
        };

        float resolutionScale;      //!< (IN) A resolution multiplier in the range [0.1, 3.0] if app wants to render at higher resolution
        D3D11_VIEWPORT boundingBox; //!< (IN) Rect on the rendertarget, to place the projection
        float vpOffsets[2];         //!< (IN) Default set to 0. If non-zero, MRS/LMS viewports' TopLeftX and TopLeftY will be
                                    //!<      offset by vpOffsets[0] and vpOffsets[1] respectively.
    } NV_SMP_ASSIST_SETUP_PARAMS_V1;

    typedef NV_SMP_ASSIST_SETUP_PARAMS_V1 NV_SMP_ASSIST_SETUP_PARAMS;
#define NV_SMP_ASSIST_SETUP_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_SETUP_PARAMS_V1, 1)

#define NV_SMP_ASSIST_SETUP_PARAMS_VER NV_SMP_ASSIST_SETUP_PARAMS_VER1


    typedef struct _NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1
    {
        NvU32 version;                     //!< (IN) Structure version
        NV_SMP_ASSIST_TYPE eSMPAssistType; // Patch instanced stereo shaders (created with packed eye index) with this SMPAssistType (NV_SMP_ASSIST_LMS only)
        float leftCoeffs[4];               // Left eye: outpos.x = dotproduct(outputpos, leftCoeffs) + leftConst
        float leftConst;
        float rightCoeffs[4]; // Right eye: outpos.x = dotproduct(outputpos, rightCoeffs) + rightConst
        float rightConst;
    } NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1;

    typedef NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1 NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS;
#define NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1, 1)

#define NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER1


    //! SUPPORTED OS:  Windows 7 and higher
    //!

    DECLARE_INTERFACE(ID3DNvSMPAssist_V1)
    {
        //////////////////////////////   VER1 methods //////////////////////////////////////////
        // Disable SMP Assist for further Draw calls
        STDMETHOD_(NvAPI_Status, Disable)
        (THIS_ __in IUnknown * pDevContext, __in const NV_SMP_ASSIST_DISABLE_PARAMS *psSMPAssistDisableParams) PURE;

        // Enable SMP Assist for further Draw calls. App has to provide the type of rendering done in upcoming Draw calls - Mono/Left eye/Right eye/Instanced Stereo
        STDMETHOD_(NvAPI_Status, Enable)
        (THIS_ __in IUnknown * pDevContext, __in const NV_SMP_ASSIST_ENABLE_PARAMS *psSMPAssistEnableParams) PURE;

        // Get the constants used by the drivers
        STDMETHOD_(NvAPI_Status, GetConstants)
        (THIS_ __inout NV_SMP_ASSIST_GET_CONSTANTS * psSMPAssistGetConstants) PURE;

        // Setup the projections (rects, constant buffer data etc.)
        STDMETHOD_(NvAPI_Status, SetupProjections)
        (THIS_ __in IUnknown * pDevice, __in const NV_SMP_ASSIST_SETUP_PARAMS *psSMPAssistSetupParams) PURE;

        // Update instanced stereo specific data
        STDMETHOD_(NvAPI_Status, UpdateInstancedStereoData)
        (THIS_ __in IUnknown * pDevice, __in const NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS *psSMPAssistInstancedStereoParams) PURE;
        //////////////////////////////   end of VER1 methods   //////////////////////////////////////////
    };

    typedef ID3DNvSMPAssist_V1 ID3DNvSMPAssist;
#define ID3DNVSMPASSIST_VER1 MAKE_NVAPI_VERSION(ID3DNvSMPAssist_V1, 1)

#define ID3DNVSMPASSIST_VER ID3DNVSMPASSIST_VER1


    //! SUPPORTED OS:  Windows 7 and higher
    //!

    typedef struct _NV_SMP_ASSIST_INITIALIZE_PARAMS_V1
    {
        NvU32 version;                       //!< (IN) Structure version
        NV_SMP_ASSIST_TYPE eSMPAssistType;   //!< (IN) None/MRS/LMS
        NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (IN) Full/Partial/Minimal
        NvU32 flags;                         //!< (IN) Flags, if any

        ID3DNvSMPAssist **ppD3DNvSMPAssist; //!< (OUT) Interface pointer returned by the Init call. Use for future Enable/Disable etc. calls

    } NV_SMP_ASSIST_INITIALIZE_PARAMS_V1;

#define NV_SMP_ASSIST_INITIALIZE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_INITIALIZE_PARAMS_V1, 1)

#ifndef NV_SMP_ASSIST_INITIALIZE_PARAMS_VER
    typedef NV_SMP_ASSIST_INITIALIZE_PARAMS_V1 NV_SMP_ASSIST_INITIALIZE_PARAMS;
#define NV_SMP_ASSIST_INITIALIZE_PARAMS_VER NV_SMP_ASSIST_INITIALIZE_PARAMS_VER1

#endif

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_InitializeSMPAssist
    //
    //! DESCRIPTION: Initialize SMP Assist extension. Take the SMPAssist(MRS/LMS) params from the application.
    //!              Provide the application with a interface pointer for future use.
    //!
    //! \since Release: 396
    //! \param [in]       pDevice                   Pointer to IUnknown (Currently supports ID3D11Device)
    //! \param [inout]    pSMPAssistInitParams      SMP Assist initialization params
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::NVAPI_OK                          Call succeeded.
    //! \retval ::NVAPI_ERROR                       Call failed.
    //! \retval ::NVAPI_INVALID_ARGUMENT            One of the required input arguments was NULL
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_InitializeSMPAssist(__in IUnknown *pDevice, __inout NV_SMP_ASSIST_INITIALIZE_PARAMS *pSMPAssistInitParams);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

//! SUPPORTED OS:  Windows 7 and higher
//!
#if defined(__cplusplus) && defined(__d3d11_h__)
    //! \ingroup dx
    typedef struct _NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1
    {
        NvU32 version;                       //!< (IN) Structure version
        NV_SMP_ASSIST_TYPE eSMPAssistType;   //!< (IN) None/MRS/LMS
        NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (IN) Full/Partial/Minimal
        NvBool bSMPAssistSupported;          //!< (OUT) SMP Assist supported or not
    } NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1;

    typedef NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1 NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS;
#define NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1, 1)

#define NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER1


    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_QuerySMPAssistSupport
    //
    //! DESCRIPTION: Query SMP assist extension support.
    //!
    //! \since Release: 396
    //! \param [in]     pDev                                Pointer to IUnknown (Currently supports ID3D11Device)
    //! \param [out]    pQuerySMPAssistSupportParams        Pointer to a structure returning requested SMP assist support
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //! \retval ::NVAPI_NOT_SUPPORTED                       Requested SMP assist is not supported.
    //! \retval ::NVAPI_OK                                  Call succeeded. Check value of pQuerySMPAssistSupportParams->bSMPAssistSupported
    //! \retval ::NVAPI_INVALID_POINTER                     pDev or pQuerySMPAssistSupportParams was a NULL pointer
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_QuerySMPAssistSupport(__in IUnknown *pDev, __inout NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS *pQuerySMPAssistSupportParams);

#endif // defined(__cplusplus) && defined(__d3d11_h__)

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! Used to get sleep status
    //! \ingroup dx
    typedef struct _NV_GET_SLEEP_STATUS_PARAMS
    {
        NvU32 version;          //!< (IN) Structure version
        NvBool bLowLatencyMode; //!< (OUT) Is low latency mode enabled?
        NvU8 rsvd[128];         //!< (IN) Reserved. Must be set to 0s.
    } NV_GET_SLEEP_STATUS_PARAMS_V1;

    typedef NV_GET_SLEEP_STATUS_PARAMS_V1 NV_GET_SLEEP_STATUS_PARAMS;
#define NV_GET_SLEEP_STATUS_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GET_SLEEP_STATUS_PARAMS_V1, 1)

#define NV_GET_SLEEP_STATUS_PARAMS_VER NV_GET_SLEEP_STATUS_PARAMS_VER1


#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_GetSleepStatus
    //
    //!   DESCRIPTION: This function can be used to get the latest sleep status.
    //!   bLowLatencyMode indicates whether low latency mode is currently
    //!   enabled in the driver.
    //!   Note that it may not always reflect the previously requested sleep mode,
    //!   as the feature may not be available on the platform, or the setting has
    //!   been overridden by the control panel, for example.
    //!
    //! \since Release: 455
    //! \param [in] pDev                          The target device.
    //! \param [in] pGetSleepStatusParams         Sleep status params.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_GetSleepStatus(__in IUnknown *pDev, __in NV_GET_SLEEP_STATUS_PARAMS *pGetSleepStatusParams);
#endif // defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! Used to set sleep mode
    //! \ingroup dx
    typedef struct _NV_SET_SLEEP_MODE_PARAMS
    {
        NvU32 version;                //!< (IN) Structure version
        NvBool bLowLatencyMode;       //!< (IN) Low latency mode enable/disable.
        NvBool bLowLatencyBoost;      //!< (IN) Request maximum GPU clock frequency regardless of workload.
        NvU32 minimumIntervalUs;      //!< (IN) Minimum frame interval in microseconds. 0 = no frame rate limit.
        NvBool bUseMarkersToOptimize; //!< (IN) Allow latency markers to be used for runtime optimizations.
        NvU8 rsvd[31];                //!< (IN) Reserved. Must be set to 0s.
    } NV_SET_SLEEP_MODE_PARAMS_V1;

    typedef NV_SET_SLEEP_MODE_PARAMS_V1 NV_SET_SLEEP_MODE_PARAMS;
#define NV_SET_SLEEP_MODE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SET_SLEEP_MODE_PARAMS_V1, 1)

#define NV_SET_SLEEP_MODE_PARAMS_VER NV_SET_SLEEP_MODE_PARAMS_VER1


#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_SetSleepMode
    //
    //!   DESCRIPTION: This function can be used to update sleep mode dynamically.
    //!   The settings are not dependent to each other, meaning low latency mode
    //!   can be enabled/disabled regardless of whether minimum interval is set or
    //!   not. The former is to intelligently lower latency without impacting frame
    //!   rate. The later is to limit frame rate (e.g. minimumIntervalUs = 10000
    //!   limits frame rate to 100 FPS). They work well separately and/or together.
    //!   Note that minimumIntervalUs usage is not limited to lowering latency, so
    //!   feel free to use it to limit frame rate for menu, cut scenes, etc.
    //!   Note that low latency mode can be enabled, and/or minimum interval can
    //!   be set, even without using NvAPI_D3D_Sleep(). However, without it, the
    //!   sleep to achieve these features would happen at a less optimal point,
    //!   resulting in higher overall latency.
    //!   The bLowLatencyBoost will request the GPU run at max clocks even in
    //!   scenarios where it is idle most of the frame and would normally try
    //!   to save power.  This can decrease latency in CPU-limited scenarios.
    //!   While this function can be called as often as needed, it is not
    //!   necessary nor recommended to call this too frequently (e.g. every frame),
    //!   as the settings persist for the target device.
    //!
    //! \since Release: 455
    //! \param [in] pDev                          The target device.
    //! \param [in] pSetSleepModeParams           Sleep mode params.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_SetSleepMode(__in IUnknown *pDev, __in NV_SET_SLEEP_MODE_PARAMS *pSetSleepModeParams);
#endif // defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))

#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_Sleep
    //
    //!   DESCRIPTION: It is recommended to call this function at the very start of
    //!   each frame (e.g. before input sampling). If there is a need to sleep,
    //!   due to frame rate limit and/or low latency features, for example,
    //!   this call provides an entry point for the driver to sleep at the most
    //!   optimal spot to achieve the lowest latency.
    //!   It is recommended to call this function even when low latency mode is
    //!   disabled and minimum interval is 0. Other features, such as Maximum Frame
    //!   Rate setting, could be enabled in the control panel to benefit from this.
    //!   It is OK to start (or stop) using this function at any time. However,
    //!   when using this function, it must be called exactly once on each frame.
    //!   If this function is not called, after several frames, the driver would
    //!   fallback to sleep at its less optimal spot.
    //!
    //! \since Release: 455
    //! \param [in] pDev                          The target device.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_Sleep(__in IUnknown *pDev);
#endif // defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! Used to get latency report.
    //! \ingroup dx

    typedef struct _NV_LATENCY_RESULT_PARAMS
    {
        NvU32 version; //!< (IN) Structure version
        struct FrameReport
        {
            NvU64 frameID;
            NvU64 inputSampleTime;
            NvU64 simStartTime;
            NvU64 simEndTime;
            NvU64 renderSubmitStartTime;
            NvU64 renderSubmitEndTime;
            NvU64 presentStartTime;
            NvU64 presentEndTime;
            NvU64 driverStartTime;
            NvU64 driverEndTime;
            NvU64 osRenderQueueStartTime;
            NvU64 osRenderQueueEndTime;
            NvU64 gpuRenderStartTime;
            NvU64 gpuRenderEndTime;
            NvU32 gpuActiveRenderTimeUs; //!< (OUT) Difference between gpuRenderStartTime and gpuRenderEndTime, excluding the idles in between, in microseconds.
            NvU32 gpuFrameTimeUs;        //!< (OUT) Difference between previous and current frame's gpuRenderEndTime, in microseconds.
            NvU8 rsvd[120];
        } frameReport[64];
        NvU8 rsvd[32];
    } NV_LATENCY_RESULT_PARAMS_V1;

    typedef NV_LATENCY_RESULT_PARAMS_V1 NV_LATENCY_RESULT_PARAMS;
#define NV_LATENCY_RESULT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_LATENCY_RESULT_PARAMS_V1, 1)

#define NV_LATENCY_RESULT_PARAMS_VER NV_LATENCY_RESULT_PARAMS_VER1


#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_GetLatency
    //
    //!   DESCRIPTION: Get a latency report including the timestamps of the
    //!   application latency markers set with NvAPI_D3D_SetLatencyMarker as well
    //!   as driver, OS queue and graphics hardware times.  Requires calling
    //!   NvAPI_D3D_SetLatencyMarker with incrementing frameID for valid results.
    //!   Rendering for at least 90 frames is recommended to properly fill out the
    //!   structure.  The newest completed frame is at the end (element 63) and
    //!   is preceeded by older frames.  If not enough frames are valid then all
    //!   frames are returned with all zeroes.
    //!
    //! \since Release: 455
    //! \param [in] pDev                          The target device
    //! \param [in] pGetLatencyParams             The latency result structure.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_GetLatency(__in IUnknown *pDev, __out NV_LATENCY_RESULT_PARAMS *pGetLatencyParams);
#endif // defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! Used define latency marker type
    //! \ingroup dx
    typedef enum
    {
        SIMULATION_START = 0,
        SIMULATION_END = 1,
        RENDERSUBMIT_START = 2,
        RENDERSUBMIT_END = 3,
        PRESENT_START = 4,
        PRESENT_END = 5,
        INPUT_SAMPLE = 6,
        TRIGGER_FLASH = 7,
        PC_LATENCY_PING = 8,
    } NV_LATENCY_MARKER_TYPE;

    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! Used set latency markers
    //! \ingroup dx
    typedef struct _NV_LATENCY_MARKER_PARAMS
    {
        NvU32 version; //!< (IN) Structure version
        NvU64 frameID;
        NV_LATENCY_MARKER_TYPE markerType;
        NvU8 rsvd[64];
    } NV_LATENCY_MARKER_PARAMS_V1;

    typedef NV_LATENCY_MARKER_PARAMS_V1 NV_LATENCY_MARKER_PARAMS;
#define NV_LATENCY_MARKER_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_LATENCY_MARKER_PARAMS_V1, 1)

#define NV_LATENCY_MARKER_PARAMS_VER NV_LATENCY_MARKER_PARAMS_VER1


#if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D_SetLatencyMarker
    //
    //!   DESCRIPTION: Set a latency marker to be tracked by the
    //!   NvAPI_D3D_GetLatency function. SIMULATION_START must be the first marker
    //!   sent in a frame, after the previous frame's Sleep call (if used).
    //!   INPUT_SAMPLE may be sent to record the moment user input was sampled and
    //!   should come between SIMULATION_START and SIMULATION_END.
    //!   RENDERSUBMIT_START should come before any Direct3D calls are made for
    //!   the given frame and RENDERSUBMIT_END should come before calling Present.
    //!   PRESENT_START and END should wrap the Present call to inform the driver
    //!   of a present block done by the OS before the driver receives the Present.
    //!   TRIGGER_FLASH tells the driver to render its flash indicator for latency
    //!   testing, typically driven by a mouse click.
    //!   The frameID can start at an abitrary moment in the application lifetime
    //!   but must strictly increment from that point forward for consistent results.
    //!
    //! \since Release: 455
    //! \param [in] pDev                          The target device
    //! \param [in] pSetLatencyMarkerParams       The latency marker structure
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API, they are listed below.
    //!
    //! \ingroup dx
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D_SetLatencyMarker(__in IUnknown *pDev, __in NV_LATENCY_MARKER_PARAMS *pSetLatencyMarkerParams);
#endif // defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__))

#if defined(__cplusplus) && defined(__d3d12_h__)

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShader(__in ID3D12Device *pDevice,
                                                         __in const void *pCubin,
                                                         __in NvU32 size,
                                                         __in NvU32 blockX,
                                                         __in NvU32 blockY,
                                                         __in NvU32 blockZ,
                                                         __out NVDX_ObjectHandle *phShader);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShaderEx(__in ID3D12Device *pDevice,
                                                           __in const void *pCubin,
                                                           __in NvU32 size,
                                                           __in NvU32 blockX,
                                                           __in NvU32 blockY,
                                                           __in NvU32 blockZ,
                                                           __in NvU32 dynSharedMemBytes,
                                                           __in const char *pShaderName,
                                                           __out NVDX_ObjectHandle *phShader);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D12_CreateCubinComputeShaderWithName(__in ID3D12Device *pDevice,
                                                                 __in const void *pCubin,
                                                                 __in NvU32 size,
                                                                 __in NvU32 blockX,
                                                                 __in NvU32 blockY,
                                                                 __in NvU32 blockZ,
                                                                 __in const char *pShaderName,
                                                                 __out NVDX_ObjectHandle *phShader);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D12_LaunchCubinShader(__in ID3D12GraphicsCommandList *pCommandList,
                                                  __in NVDX_ObjectHandle hShader,
                                                  __in NvU32 gridX,
                                                  __in NvU32 gridY,
                                                  __in NvU32 gridZ,
                                                  __in const void *pParams,
                                                  __in NvU32 paramSize);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D12_DestroyCubinComputeShader(__in ID3D12Device *pDevice,
                                                          __in NVDX_ObjectHandle hShader);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D12_GetCudaTextureObject(__in ID3D12Device *pDevice,
                                                     __in D3D12_CPU_DESCRIPTOR_HANDLE texDesc,
                                                     __in D3D12_CPU_DESCRIPTOR_HANDLE smpDesc,
                                                     __out NvU32 *pTextureHandle);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D12_GetCudaSurfaceObject(__in ID3D12Device *pDevice,
                                                     __in D3D12_CPU_DESCRIPTOR_HANDLE uavDesc,
                                                     __out NvU32 *pSurfaceHandle);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D12_IsFatbinPTXSupported(__in ID3D12Device *pDevice,
                                                     __out bool *pSupported);

#endif // if defined (__cplusplus) && defined(__d3d12_h__)

#if defined(__cplusplus) && defined(__d3d11_h__)

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_CreateCubinComputeShader(__in ID3D11Device *pDevice,
                                                         __in const void *pCubin,
                                                         __in NvU32 size,
                                                         __in NvU32 blockX,
                                                         __in NvU32 blockY,
                                                         __in NvU32 blockZ,
                                                         __out NVDX_ObjectHandle *phShader);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_CreateCubinComputeShaderEx(__in ID3D11Device *pDevice,
                                                           __in const void *pCubin,
                                                           __in NvU32 size,
                                                           __in NvU32 blockX,
                                                           __in NvU32 blockY,
                                                           __in NvU32 blockZ,
                                                           __in NvU32 dynSharedMemBytes,
                                                           __in const char *pShaderName,
                                                           __out NVDX_ObjectHandle *phShader);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_CreateCubinComputeShaderWithName(__in ID3D11Device *pDevice,
                                                                 __in const void *pCubin,
                                                                 __in NvU32 size,
                                                                 __in NvU32 blockX,
                                                                 __in NvU32 blockY,
                                                                 __in NvU32 blockZ,
                                                                 __in const char *pShaderName,
                                                                 __out NVDX_ObjectHandle *phShader);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_LaunchCubinShader(__in ID3D11DeviceContext *pDeviceContext,
                                                  __in NVDX_ObjectHandle hShader,
                                                  __in NvU32 gridX,
                                                  __in NvU32 gridY,
                                                  __in NvU32 gridZ,
                                                  __in const void *pParams,
                                                  __in NvU32 paramSize,
                                                  __in const NVDX_ObjectHandle *pReadResources,
                                                  __in NvU32 numReadResources,
                                                  __in const NVDX_ObjectHandle *pWriteResources,
                                                  __in NvU32 numWriteResources);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_DestroyCubinComputeShader(__in ID3D11Device *pDevice,
                                                          __in NVDX_ObjectHandle hShader);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_IsFatbinPTXSupported(__in ID3D11Device *pDevice,
                                                     __out bool *pSupported);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_CreateUnorderedAccessView(__in ID3D11Device *pDevice,
                                                          __in ID3D11Resource *pResource,
                                                          __in const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
                                                          __out ID3D11UnorderedAccessView **ppUAV,
                                                          __out NvU32 *pDriverHandle);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_CreateShaderResourceView(__in ID3D11Device *pDevice,
                                                         __in ID3D11Resource *pResource,
                                                         __in const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc,
                                                         __out ID3D11ShaderResourceView **ppSRV,
                                                         __out NvU32 *pDriverHandle);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_CreateSamplerState(__in ID3D11Device *pDevice,
                                                   __in const D3D11_SAMPLER_DESC *pSamplerDesc,
                                                   __out ID3D11SamplerState **ppSamplerState,
                                                   __out NvU32 *pDriverHandle);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_GetCudaTextureObject(__in ID3D11Device *pDevice,
                                                     __in NvU32 srvDriverHandle,
                                                     __in NvU32 samplerDriverHandle,
                                                     __out NvU32 *pCudaTextureHandle);

    // Experimental API for internal use. DO NOT USE!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    NVAPI_INTERFACE NvAPI_D3D11_GetResourceGPUVirtualAddress(__in ID3D11Device *pDevice,
                                                             __in const NVDX_ObjectHandle hResource,
                                                             __out NvU64 *pGpuVA);
#endif // defined(__cplusplus) && defined(__d3d11_h__)

    //! \ingroup vidio
    //! Unique identifier for VIO owner (process identifier or NVVIOOWNERID_NONE)
    typedef NvU32 NVVIOOWNERID;

    //! \addtogroup vidio
    //! @{

#define NVVIOOWNERID_NONE 0 //!< Unregistered ownerId


    //! Owner type for device
    typedef enum _NVVIOOWNERTYPE
    {
        NVVIOOWNERTYPE_NONE,        //!<  No owner for the device
        NVVIOOWNERTYPE_APPLICATION, //!<  Application owns the device
        NVVIOOWNERTYPE_DESKTOP,     //!<  Desktop transparent mode owns the device (not applicable for video input)
    } NVVIOOWNERTYPE;

// Access rights for NvAPI_VIO_Open()

//! Read access             (not applicable for video output)
#define NVVIO_O_READ 0x00000000


//! Write exclusive access  (not applicable for video input)
#define NVVIO_O_WRITE_EXCLUSIVE 0x00010001


//!
#define NVVIO_VALID_ACCESSRIGHTS (NVVIO_O_READ | \
                                  NVVIO_O_WRITE_EXCLUSIVE)


//! VIO_DATA.ulOwnerID high-bit is set only if device has been initialized by VIOAPI
//! examined at NvAPI_GetCapabilities|NvAPI_VIO_Open to determine if settings need to be applied from registry or POR state read
#define NVVIO_OWNERID_INITIALIZED 0x80000000


//! VIO_DATA.ulOwnerID next-bit is set only if device is currently in exclusive write access mode from NvAPI_VIO_Open()
#define NVVIO_OWNERID_EXCLUSIVE 0x40000000


//! VIO_DATA.ulOwnerID lower bits are:
//!  NVGVOOWNERTYPE_xxx enumerations indicating use context
#define NVVIO_OWNERID_TYPEMASK 0x0FFFFFFF //!< mask for NVVIOOWNERTYPE_xxx


    //! @}

    //---------------------------------------------------------------------
    // Enumerations
    //---------------------------------------------------------------------

    //! \addtogroup vidio
    //! @{

    //! Video signal format and resolution
    typedef enum _NVVIOSIGNALFORMAT
    {
        NVVIOSIGNALFORMAT_NONE,                     //!< Invalid signal format
        NVVIOSIGNALFORMAT_487I_59_94_SMPTE259_NTSC, //!< 01  487i    59.94Hz  (SMPTE259) NTSC
        NVVIOSIGNALFORMAT_576I_50_00_SMPTE259_PAL,  //!< 02  576i    50.00Hz  (SMPTE259) PAL
        NVVIOSIGNALFORMAT_1035I_60_00_SMPTE260,     //!< 03  1035i   60.00Hz  (SMPTE260)
        NVVIOSIGNALFORMAT_1035I_59_94_SMPTE260,     //!< 04  1035i   59.94Hz  (SMPTE260)
        NVVIOSIGNALFORMAT_1080I_50_00_SMPTE295,     //!< 05  1080i   50.00Hz  (SMPTE295)
        NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274,     //!< 06  1080i   60.00Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274,     //!< 07  1080i   59.94Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274,     //!< 08  1080i   50.00Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274,     //!< 09  1080p   30.00Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274,     //!< 10  1080p   29.97Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274,     //!< 11  1080p   25.00Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274,     //!< 12  1080p   24.00Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080P_23_976_SMPTE274,    //!< 13  1080p   23.976Hz (SMPTE274)
        NVVIOSIGNALFORMAT_720P_60_00_SMPTE296,      //!< 14  720p    60.00Hz  (SMPTE296)
        NVVIOSIGNALFORMAT_720P_59_94_SMPTE296,      //!< 15  720p    59.94Hz  (SMPTE296)
        NVVIOSIGNALFORMAT_720P_50_00_SMPTE296,      //!< 16  720p    50.00Hz  (SMPTE296)
        NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274,     //!< 17  1080I   48.00Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274,     //!< 18  1080I   47.96Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_720P_30_00_SMPTE296,      //!< 19  720p    30.00Hz  (SMPTE296)
        NVVIOSIGNALFORMAT_720P_29_97_SMPTE296,      //!< 20  720p    29.97Hz  (SMPTE296)
        NVVIOSIGNALFORMAT_720P_25_00_SMPTE296,      //!< 21  720p    25.00Hz  (SMPTE296)
        NVVIOSIGNALFORMAT_720P_24_00_SMPTE296,      //!< 22  720p    24.00Hz  (SMPTE296)
        NVVIOSIGNALFORMAT_720P_23_98_SMPTE296,      //!< 23  720p    23.98Hz  (SMPTE296)
        NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372,     //!< 24  2048p   30.00Hz  (SMPTE372)
        NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372,     //!< 25  2048p   29.97Hz  (SMPTE372)
        NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372,     //!< 26  2048i   60.00Hz  (SMPTE372)
        NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372,     //!< 27  2048i   59.94Hz  (SMPTE372)
        NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372,     //!< 28  2048p   25.00Hz  (SMPTE372)
        NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372,     //!< 29  2048i   50.00Hz  (SMPTE372)
        NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372,     //!< 30  2048p   24.00Hz  (SMPTE372)
        NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372,     //!< 31  2048p   23.98Hz  (SMPTE372)
        NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372,     //!< 32  2048i   48.00Hz  (SMPTE372)
        NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372,     //!< 33  2048i   47.96Hz  (SMPTE372)

        NVVIOSIGNALFORMAT_1080PSF_25_00_SMPTE274, //!< 34  1080PsF 25.00Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080PSF_29_97_SMPTE274, //!< 35  1080PsF 29.97Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080PSF_30_00_SMPTE274, //!< 36  1080PsF 30.00Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080PSF_24_00_SMPTE274, //!< 37  1080PsF 24.00Hz  (SMPTE274)
        NVVIOSIGNALFORMAT_1080PSF_23_98_SMPTE274, //!< 38  1080PsF 23.98Hz  (SMPTE274)

        NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_A, //!< 39  1080P   50.00Hz  (SMPTE274) 3G Level A
        NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_A, //!< 40  1080P   59.94Hz  (SMPTE274) 3G Level A
        NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_A, //!< 41  1080P   60.00Hz  (SMPTE274) 3G Level A

        NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_B, //!< 42  1080p   60.00Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274_3G_LEVEL_B, //!< 43  1080i   60.00Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372_3G_LEVEL_B, //!< 44  2048i   60.00Hz  (SMPTE372) 3G Level B
        NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_B, //!< 45  1080p   50.00Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274_3G_LEVEL_B, //!< 46  1080i   50.00Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372_3G_LEVEL_B, //!< 47  2048i   50.00Hz  (SMPTE372) 3G Level B
        NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274_3G_LEVEL_B, //!< 48  1080p   30.00Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372_3G_LEVEL_B, //!< 49  2048p   30.00Hz  (SMPTE372) 3G Level B
        NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274_3G_LEVEL_B, //!< 50  1080p   25.00Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372_3G_LEVEL_B, //!< 51  2048p   25.00Hz  (SMPTE372) 3G Level B
        NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274_3G_LEVEL_B, //!< 52  1080p   24.00Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372_3G_LEVEL_B, //!< 53  2048p   24.00Hz  (SMPTE372) 3G Level B
        NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274_3G_LEVEL_B, //!< 54  1080i   48.00Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372_3G_LEVEL_B, //!< 55  2048i   48.00Hz  (SMPTE372) 3G Level B
        NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_B, //!< 56  1080p   59.94Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274_3G_LEVEL_B, //!< 57  1080i   59.94Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372_3G_LEVEL_B, //!< 58  2048i   59.94Hz  (SMPTE372) 3G Level B
        NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274_3G_LEVEL_B, //!< 59  1080p   29.97Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372_3G_LEVEL_B, //!< 60  2048p   29.97Hz  (SMPTE372) 3G Level B
        NVVIOSIGNALFORMAT_1080P_23_98_SMPTE274_3G_LEVEL_B, //!< 61  1080p   29.98Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372_3G_LEVEL_B, //!< 62  2048p   29.98Hz  (SMPTE372) 3G Level B
        NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274_3G_LEVEL_B, //!< 63  1080i   47.96Hz  (SMPTE274) 3G Level B
        NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372_3G_LEVEL_B, //!< 64  2048i   47.96Hz  (SMPTE372) 3G Level B

        NVVIOSIGNALFORMAT_END //!< 65  To indicate end of signal format list

    } NVVIOSIGNALFORMAT;

    //! SMPTE standards format
    typedef enum _NVVIOVIDEOSTANDARD
    {
        NVVIOVIDEOSTANDARD_SMPTE259, //!< SMPTE259
        NVVIOVIDEOSTANDARD_SMPTE260, //!< SMPTE260
        NVVIOVIDEOSTANDARD_SMPTE274, //!< SMPTE274
        NVVIOVIDEOSTANDARD_SMPTE295, //!< SMPTE295
        NVVIOVIDEOSTANDARD_SMPTE296, //!< SMPTE296
        NVVIOVIDEOSTANDARD_SMPTE372, //!< SMPTE372
    } NVVIOVIDEOSTANDARD;

    //! HD or SD video type
    typedef enum _NVVIOVIDEOTYPE
    {
        NVVIOVIDEOTYPE_SD, //!< Standard-definition (SD)
        NVVIOVIDEOTYPE_HD, //!< High-definition     (HD)
    } NVVIOVIDEOTYPE;

    //! Interlace mode
    typedef enum _NVVIOINTERLACEMODE
    {
        NVVIOINTERLACEMODE_PROGRESSIVE, //!< Progressive               (p)
        NVVIOINTERLACEMODE_INTERLACE,   //!< Interlace                 (i)
        NVVIOINTERLACEMODE_PSF,         //!< Progressive Segment Frame (psf)
    } NVVIOINTERLACEMODE;

    //! Video data format
    typedef enum _NVVIODATAFORMAT
    {
        NVVIODATAFORMAT_UNKNOWN = -1,                     //!< Invalid DataFormat
        NVVIODATAFORMAT_R8G8B8_TO_YCRCB444,               //!< R8:G8:B8                => YCrCb  (4:4:4)
        NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4444,           //!< R8:G8:B8:A8             => YCrCbA (4:4:4:4)
        NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4444,          //!< R8:G8:B8:Z10            => YCrCbZ (4:4:4:4)
        NVVIODATAFORMAT_R8G8B8_TO_YCRCB422,               //!< R8:G8:B8                => YCrCb  (4:2:2)
        NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4224,           //!< R8:G8:B8:A8             => YCrCbA (4:2:2:4)
        NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4224,          //!< R8:G8:B8:Z10            => YCrCbZ (4:2:2:4)
        NVVIODATAFORMAT_X8X8X8_444_PASSTHRU,              //!< R8:G8:B8                => RGB    (4:4:4)
        NVVIODATAFORMAT_X8X8X8A8_4444_PASSTHRU,           //!< R8:G8:B8:A8             => RGBA   (4:4:4:4)
        NVVIODATAFORMAT_X8X8X8Z10_4444_PASSTHRU,          //!< R8:G8:B8:Z10            => RGBZ   (4:4:4:4)
        NVVIODATAFORMAT_X10X10X10_444_PASSTHRU,           //!< Y10:CR10:CB10           => YCrCb  (4:4:4)
        NVVIODATAFORMAT_X10X8X8_444_PASSTHRU,             //!< Y10:CR8:CB8             => YCrCb  (4:4:4)
        NVVIODATAFORMAT_X10X8X8A10_4444_PASSTHRU,         //!< Y10:CR8:CB8:A10         => YCrCbA (4:4:4:4)
        NVVIODATAFORMAT_X10X8X8Z10_4444_PASSTHRU,         //!< Y10:CR8:CB8:Z10         => YCrCbZ (4:4:4:4)
        NVVIODATAFORMAT_DUAL_R8G8B8_TO_DUAL_YCRCB422,     //!< R8:G8:B8 + R8:G8:B8     => YCrCb  (4:2:2 + 4:2:2)
        NVVIODATAFORMAT_DUAL_X8X8X8_TO_DUAL_422_PASSTHRU, //!< Y8:CR8:CB8 + Y8:CR8:CB8 => YCrCb  (4:2:2 + 4:2:2)
        NVVIODATAFORMAT_R10G10B10_TO_YCRCB422,            //!< R10:G10:B10             => YCrCb  (4:2:2)
        NVVIODATAFORMAT_R10G10B10_TO_YCRCB444,            //!< R10:G10:B10             => YCrCb  (4:4:4)
        NVVIODATAFORMAT_X12X12X12_444_PASSTHRU,           //!< X12:X12:X12             => XXX    (4:4:4)
        NVVIODATAFORMAT_X12X12X12_422_PASSTHRU,           //!< X12:X12:X12             => XXX    (4:2:2)
        NVVIODATAFORMAT_Y10CR10CB10_TO_YCRCB422,          //!< Y10:CR10:CB10           => YCrCb  (4:2:2)
        NVVIODATAFORMAT_Y8CR8CB8_TO_YCRCB422,             //!< Y8:CR8:CB8              => YCrCb  (4:2:2)
        NVVIODATAFORMAT_Y10CR8CB8A10_TO_YCRCBA4224,       //!< Y10:CR8:CB8:A10         => YCrCbA (4:2:2:4)
        NVVIODATAFORMAT_R10G10B10_TO_RGB444,              //!< R10:G10:B10             => RGB    (4:4:4)
        NVVIODATAFORMAT_R12G12B12_TO_YCRCB444,            //!< R12:G12:B12             => YCrCb  (4:4:4)
        NVVIODATAFORMAT_R12G12B12_TO_YCRCB422,            //!< R12:G12:B12             => YCrCb  (4:2:2)
    } NVVIODATAFORMAT;

    //! Video output area
    typedef enum _NVVIOOUTPUTAREA
    {
        NVVIOOUTPUTAREA_FULLSIZE,   //!< Output to entire video resolution (full size)
        NVVIOOUTPUTAREA_SAFEACTION, //!< Output to centered 90% of video resolution (safe action)
        NVVIOOUTPUTAREA_SAFETITLE,  //!< Output to centered 80% of video resolution (safe title)
    } NVVIOOUTPUTAREA;

    //! Synchronization source
    typedef enum _NVVIOSYNCSOURCE
    {
        NVVIOSYNCSOURCE_SDISYNC,  //!< SDI Sync  (Digital input)
        NVVIOSYNCSOURCE_COMPSYNC, //!< COMP Sync (Composite input)
    } NVVIOSYNCSOURCE;

    //! Composite synchronization type
    typedef enum _NVVIOCOMPSYNCTYPE
    {
        NVVIOCOMPSYNCTYPE_AUTO,     //!< Auto-detect
        NVVIOCOMPSYNCTYPE_BILEVEL,  //!< Bi-level signal
        NVVIOCOMPSYNCTYPE_TRILEVEL, //!< Tri-level signal
    } NVVIOCOMPSYNCTYPE;

    //! Video input output status
    typedef enum _NVVIOINPUTOUTPUTSTATUS
    {
        NVINPUTOUTPUTSTATUS_OFF,    //!< Not in use
        NVINPUTOUTPUTSTATUS_ERROR,  //!< Error detected
        NVINPUTOUTPUTSTATUS_SDI_SD, //!< SDI (standard-definition)
        NVINPUTOUTPUTSTATUS_SDI_HD, //!< SDI (high-definition)
    } NVVIOINPUTOUTPUTSTATUS;

    //! Synchronization input status
    typedef enum _NVVIOSYNCSTATUS
    {
        NVVIOSYNCSTATUS_OFF,       //!< Sync not detected
        NVVIOSYNCSTATUS_ERROR,     //!< Error detected
        NVVIOSYNCSTATUS_SYNCLOSS,  //!< Genlock in use, format mismatch with output
        NVVIOSYNCSTATUS_COMPOSITE, //!< Composite sync
        NVVIOSYNCSTATUS_SDI_SD,    //!< SDI sync (standard-definition)
        NVVIOSYNCSTATUS_SDI_HD,    //!< SDI sync (high-definition)
    } NVVIOSYNCSTATUS;

    //! Video Capture Status
    typedef enum _NVVIOCAPTURESTATUS
    {
        NVVIOSTATUS_STOPPED, //!< Sync not detected
        NVVIOSTATUS_RUNNING, //!< Error detected
        NVVIOSTATUS_ERROR,   //!< Genlock in use, format mismatch with output
    } NVVIOCAPTURESTATUS;

    //! Video Capture Status
    typedef enum _NVVIOSTATUSTYPE
    {
        NVVIOSTATUSTYPE_IN,  //!< Input Status
        NVVIOSTATUSTYPE_OUT, //!< Output Status
    } NVVIOSTATUSTYPE;

//! Assumption, maximum 4 SDI input and 4 SDI output cards supported on a system
#define NVAPI_MAX_VIO_DEVICES 8


//! 4 physical jacks supported on each SDI input card.
#define NVAPI_MAX_VIO_JACKS 4


//! Each physical jack an on SDI input card can have
//! two "channels" in the case of "3G" VideoFormats, as specified
//! by SMPTE 425; for non-3G VideoFormats, only the first channel within
//! a physical jack is valid.
#define NVAPI_MAX_VIO_CHANNELS_PER_JACK 2


//! 4 Streams, 1 per physical jack
#define NVAPI_MAX_VIO_STREAMS 4


#define NVAPI_MIN_VIO_STREAMS 1


//! SDI input supports a max of 2 links per stream
#define NVAPI_MAX_VIO_LINKS_PER_STREAM 2


#define NVAPI_MAX_FRAMELOCK_MAPPING_MODES 20


//! Min number of capture images
#define NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES 1


//! Max number of capture images
#define NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES 32


//! Default number of capture images
#define NVAPI_GVI_DEFAULT_RAW_CAPTURE_IMAGES 5


    // Data Signal notification events. These need a event handler in RM.
    // Register/Unregister and PopEvent NVAPI's are already available.

    //! Device configuration
    typedef enum _NVVIOCONFIGTYPE
    {
        NVVIOCONFIGTYPE_IN,  //!< Input Status
        NVVIOCONFIGTYPE_OUT, //!< Output Status
    } NVVIOCONFIGTYPE;

    typedef enum _NVVIOCOLORSPACE
    {
        NVVIOCOLORSPACE_UNKNOWN,
        NVVIOCOLORSPACE_YCBCR,
        NVVIOCOLORSPACE_YCBCRA,
        NVVIOCOLORSPACE_YCBCRD,
        NVVIOCOLORSPACE_GBR,
        NVVIOCOLORSPACE_GBRA,
        NVVIOCOLORSPACE_GBRD,
    } NVVIOCOLORSPACE;

    //! Component sampling
    typedef enum _NVVIOCOMPONENTSAMPLING
    {
        NVVIOCOMPONENTSAMPLING_UNKNOWN,
        NVVIOCOMPONENTSAMPLING_4444,
        NVVIOCOMPONENTSAMPLING_4224,
        NVVIOCOMPONENTSAMPLING_444,
        NVVIOCOMPONENTSAMPLING_422
    } NVVIOCOMPONENTSAMPLING;

    typedef enum _NVVIOBITSPERCOMPONENT
    {
        NVVIOBITSPERCOMPONENT_UNKNOWN,
        NVVIOBITSPERCOMPONENT_8,
        NVVIOBITSPERCOMPONENT_10,
        NVVIOBITSPERCOMPONENT_12,
    } NVVIOBITSPERCOMPONENT;

    typedef enum _NVVIOLINKID
    {
        NVVIOLINKID_UNKNOWN,
        NVVIOLINKID_A,
        NVVIOLINKID_B,
        NVVIOLINKID_C,
        NVVIOLINKID_D
    } NVVIOLINKID;

    typedef enum _NVVIOANCPARITYCOMPUTATION
    {
        NVVIOANCPARITYCOMPUTATION_AUTO,
        NVVIOANCPARITYCOMPUTATION_ON,
        NVVIOANCPARITYCOMPUTATION_OFF
    } NVVIOANCPARITYCOMPUTATION;

//! @}

//---------------------------------------------------------------------
// Structures
//---------------------------------------------------------------------

//! \addtogroup vidio
//! @{

//! Supports Serial Digital Interface (SDI) output
#define NVVIOCAPS_VIDOUT_SDI 0x00000001


//! Supports Internal timing source
#define NVVIOCAPS_SYNC_INTERNAL 0x00000100


//! Supports Genlock timing source
#define NVVIOCAPS_SYNC_GENLOCK 0x00000200


//! Supports Serial Digital Interface (SDI) synchronization input
#define NVVIOCAPS_SYNCSRC_SDI 0x00001000


//! Supports Composite synchronization input
#define NVVIOCAPS_SYNCSRC_COMP 0x00002000


//! Supports Desktop transparent mode
#define NVVIOCAPS_OUTPUTMODE_DESKTOP 0x00010000


//! Supports OpenGL application mode
#define NVVIOCAPS_OUTPUTMODE_OPENGL 0x00020000


//! Supports Serial Digital Interface (SDI) input
#define NVVIOCAPS_VIDIN_SDI 0x00100000


//! Supports Packed ANC
#define NVVIOCAPS_PACKED_ANC_SUPPORTED 0x00200000


//! Supports ANC audio blanking
#define NVVIOCAPS_AUDIO_BLANKING_SUPPORTED 0x00400000


//! SDI-class interface: SDI output with two genlock inputs
#define NVVIOCLASS_SDI 0x00000001


    //! Device capabilities
    typedef struct _NVVIOCAPS
    {
        NvU32 version;            //!< Structure version
        NvAPI_String adapterName; //!< Graphics adapter name
        NvU32 adapterClass;       //!< Graphics adapter classes (NVVIOCLASS_SDI mask)
        NvU32 adapterCaps;        //!< Graphics adapter capabilities (NVVIOCAPS_* mask)
        NvU32 dipSwitch;          //!< On-board DIP switch settings bits
        NvU32 dipSwitchReserved;  //!< On-board DIP switch settings reserved bits
        NvU32 boardID;            //!< Board ID
        //! Driver version
        struct //
        {
            NvU32 majorVersion; //!< Major version. For GVI, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD)
            NvU32 minorVersion; //!< Minor version. For GVI, minorVersion contains Revison(HIWORD) And Build(LOWORD)
        } driver;               //
        //! Firmware version
        struct
        {
            NvU32 majorVersion;   //!< Major version. In version 2, for both GVI and GVO, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD)
            NvU32 minorVersion;   //!< Minor version. In version 2, for both GVI and GVO, minorVersion contains Revison(HIWORD) And Build(LOWORD)
        } firmWare;               //
        NVVIOOWNERID ownerId;     //!< Unique identifier for owner of video output (NVVIOOWNERID_INVALID if free running)
        NVVIOOWNERTYPE ownerType; //!< Owner type (OpenGL application or Desktop mode)
    } NVVIOCAPS;

//! Macro for constructing the version field of NVVIOCAPS
#define NVVIOCAPS_VER1 MAKE_NVAPI_VERSION(NVVIOCAPS, 1)

#define NVVIOCAPS_VER2 MAKE_NVAPI_VERSION(NVVIOCAPS, 2)

#define NVVIOCAPS_VER NVVIOCAPS_VER2


    //! Input channel status
    typedef struct _NVVIOCHANNELSTATUS
    {
        NvU32 smpte352;                         //!< 4-byte SMPTE 352 video payload identifier
        NVVIOSIGNALFORMAT signalFormat;         //!< Signal format
        NVVIOBITSPERCOMPONENT bitsPerComponent; //!< Bits per component
        NVVIOCOMPONENTSAMPLING samplingFormat;  //!< Sampling format
        NVVIOCOLORSPACE colorSpace;             //!< Color space
        NVVIOLINKID linkID;                     //!< Link ID
    } NVVIOCHANNELSTATUS;

    //! Input device status
    typedef struct _NVVIOINPUTSTATUS
    {
        NVVIOCHANNELSTATUS vidIn[NVAPI_MAX_VIO_JACKS][NVAPI_MAX_VIO_CHANNELS_PER_JACK]; //!< Video input status per channel within a jack
        NVVIOCAPTURESTATUS captureStatus;                                               //!< status of video capture
    } NVVIOINPUTSTATUS;

    //! Output device status
    typedef struct _NVVIOOUTPUTSTATUS
    {
        NVVIOINPUTOUTPUTSTATUS vid1Out;     //!< Video 1 output status
        NVVIOINPUTOUTPUTSTATUS vid2Out;     //!< Video 2 output status
        NVVIOSYNCSTATUS sdiSyncIn;          //!< SDI sync input status
        NVVIOSYNCSTATUS compSyncIn;         //!< Composite sync input status
        NvU32 syncEnable;                   //!< Sync enable (TRUE if using syncSource)
        NVVIOSYNCSOURCE syncSource;         //!< Sync source
        NVVIOSIGNALFORMAT syncFormat;       //!< Sync format
        NvU32 frameLockEnable;              //!< Framelock enable flag
        NvU32 outputVideoLocked;            //!< Output locked status
        NvU32 dataIntegrityCheckErrorCount; //!< Data integrity check error count
        NvU32 dataIntegrityCheckEnabled;    //!< Data integrity check status enabled
        NvU32 dataIntegrityCheckFailed;     //!< Data integrity check status failed
        NvU32 uSyncSourceLocked;            //!< genlocked to framelocked to ref signal
        NvU32 uPowerOn;                     //!< TRUE: indicates there is sufficient power
    } NVVIOOUTPUTSTATUS;

    //! Video device status.
    typedef struct _NVVIOSTATUS
    {
        NvU32 version;                   //!< Structure version
        NVVIOSTATUSTYPE nvvioStatusType; //!< Input or Output status
        union
        {
            NVVIOINPUTSTATUS inStatus;   //!<  Input device status
            NVVIOOUTPUTSTATUS outStatus; //!<  Output device status
        } vioStatus;
    } NVVIOSTATUS;

//! Macro for constructingthe version field of NVVIOSTATUS
#define NVVIOSTATUS_VER MAKE_NVAPI_VERSION(NVVIOSTATUS, 1)


    //! Output region
    typedef struct _NVVIOOUTPUTREGION
    {
        NvU32 x;      //!< Horizontal origin in pixels
        NvU32 y;      //!< Vertical origin in pixels
        NvU32 width;  //!< Width of region in pixels
        NvU32 height; //!< Height of region in pixels
    } NVVIOOUTPUTREGION;

    //! Gamma ramp (8-bit index)
    typedef struct _NVVIOGAMMARAMP8
    {
        NvU16 uRed[256];   //!< Red channel gamma ramp (8-bit index, 16-bit values)
        NvU16 uGreen[256]; //!< Green channel gamma ramp (8-bit index, 16-bit values)
        NvU16 uBlue[256];  //!< Blue channel gamma ramp (8-bit index, 16-bit values)
    } NVVIOGAMMARAMP8;

    //! Gamma ramp (10-bit index)
    typedef struct _NVVIOGAMMARAMP10
    {
        NvU16 uRed[1024];   //!< Red channel gamma ramp (10-bit index, 16-bit values)
        NvU16 uGreen[1024]; //!< Green channel gamma ramp (10-bit index, 16-bit values)
        NvU16 uBlue[1024];  //!< Blue channel gamma ramp (10-bit index, 16-bit values)
    } NVVIOGAMMARAMP10;

    //! Sync delay
    typedef struct _NVVIOSYNCDELAY
    {
        NvU32 version;         //!< Structure version
        NvU32 horizontalDelay; //!< Horizontal delay in pixels
        NvU32 verticalDelay;   //!< Vertical delay in lines
    } NVVIOSYNCDELAY;

//! Macro for constructing the version field of NVVIOSYNCDELAY
#define NVVIOSYNCDELAY_VER MAKE_NVAPI_VERSION(NVVIOSYNCDELAY, 1)


    //! Video mode information
    typedef struct _NVVIOVIDEOMODE
    {
        NvU32 horizontalPixels;           //!< Horizontal resolution (in pixels)
        NvU32 verticalLines;              //!< Vertical resolution for frame (in lines)
        float fFrameRate;                 //!< Frame rate
        NVVIOINTERLACEMODE interlaceMode; //!< Interlace mode
        NVVIOVIDEOSTANDARD videoStandard; //!< SMPTE standards format
        NVVIOVIDEOTYPE videoType;         //!< HD or SD signal classification
    } NVVIOVIDEOMODE;

    //! Signal format details
    typedef struct _NVVIOSIGNALFORMATDETAIL
    {
        NVVIOSIGNALFORMAT signalFormat; //!< Signal format enumerated value
        NVVIOVIDEOMODE videoMode;       //!< Video mode for signal format
    } NVVIOSIGNALFORMATDETAIL;

//! R8:G8:B8
#define NVVIOBUFFERFORMAT_R8G8B8 0x00000001


//! R8:G8:B8:Z24
#define NVVIOBUFFERFORMAT_R8G8B8Z24 0x00000002


//! R8:G8:B8:A8
#define NVVIOBUFFERFORMAT_R8G8B8A8 0x00000004


//! R8:G8:B8:A8:Z24
#define NVVIOBUFFERFORMAT_R8G8B8A8Z24 0x00000008


//! R16FP:G16FP:B16FP
#define NVVIOBUFFERFORMAT_R16FPG16FPB16FP 0x00000010


//! R16FP:G16FP:B16FP:Z24
#define NVVIOBUFFERFORMAT_R16FPG16FPB16FPZ24 0x00000020


//! R16FP:G16FP:B16FP:A16FP
#define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FP 0x00000040


//! R16FP:G16FP:B16FP:A16FP:Z24
#define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FPZ24 0x00000080


    //! Data format details
    typedef struct _NVVIODATAFORMATDETAIL
    {
        NVVIODATAFORMAT dataFormat; //!< Data format enumerated value
        NvU32 vioCaps;              //!< Data format capabilities (NVVIOCAPS_* mask)
    } NVVIODATAFORMATDETAIL;

    //! Colorspace conversion
    typedef struct _NVVIOCOLORCONVERSION
    {
        NvU32 version;           //!<  Structure version
        float colorMatrix[3][3]; //!<  Output[n] =
        float colorOffset[3];    //!<  Input[0] * colorMatrix[n][0] +
        float colorScale[3];     //!<  Input[1] * colorMatrix[n][1] +
                                 //!<  Input[2] * colorMatrix[n][2] +
                                 //!<  OutputRange * colorOffset[n]
                                 //!<  where OutputRange is the standard magnitude of
                                 //!<  Output[n][n] and colorMatrix and colorOffset
                                 //!<  values are within the range -1.0 to +1.0
        NvU32 compositeSafe;     //!<  compositeSafe constrains luminance range when using composite output
    } NVVIOCOLORCONVERSION;

//! macro for constructing the version field of _NVVIOCOLORCONVERSION.
#define NVVIOCOLORCONVERSION_VER MAKE_NVAPI_VERSION(NVVIOCOLORCONVERSION, 1)


    //! Gamma correction
    typedef struct _NVVIOGAMMACORRECTION
    {
        NvU32 version;                //!< Structure version
        NvU32 vioGammaCorrectionType; //!< Gamma correction type (8-bit or 10-bit)
        //! Gamma correction:
        union
        {
            NVVIOGAMMARAMP8 gammaRamp8;   //!< Gamma ramp (8-bit index, 16-bit values)
            NVVIOGAMMARAMP10 gammaRamp10; //!< Gamma ramp (10-bit index, 16-bit values)
        } gammaRamp;
        float fGammaValueR; //!< Red Gamma value within gamma ranges. 0.5 - 6.0
        float fGammaValueG; //!< Green Gamma value within gamma ranges. 0.5 - 6.0
        float fGammaValueB; //!< Blue Gamma value within gamma ranges. 0.5 - 6.0
    } NVVIOGAMMACORRECTION;

//! Macro for constructing thevesion field of _NVVIOGAMMACORRECTION
#define NVVIOGAMMACORRECTION_VER MAKE_NVAPI_VERSION(NVVIOGAMMACORRECTION, 1)


//! Maximum number of ranges per channel
#define MAX_NUM_COMPOSITE_RANGE 2


    typedef struct _NVVIOCOMPOSITERANGE
    {
        NvU32 uRange;
        NvU32 uEnabled;
        NvU32 uMin;
        NvU32 uMax;
    } NVVIOCOMPOSITERANGE;

// Device configuration (fields masks indicating NVVIOCONFIG fields to use for NvAPI_VIO_GetConfig/NvAPI_VIO_SetConfig() )
//
#define NVVIOCONFIG_SIGNALFORMAT 0x00000001             //!< fields: signalFormat

#define NVVIOCONFIG_DATAFORMAT 0x00000002               //!< fields: dataFormat

#define NVVIOCONFIG_OUTPUTREGION 0x00000004             //!< fields: outputRegion

#define NVVIOCONFIG_OUTPUTAREA 0x00000008               //!< fields: outputArea

#define NVVIOCONFIG_COLORCONVERSION 0x00000010          //!< fields: colorConversion

#define NVVIOCONFIG_GAMMACORRECTION 0x00000020          //!< fields: gammaCorrection

#define NVVIOCONFIG_SYNCSOURCEENABLE 0x00000040         //!< fields: syncSource and syncEnable

#define NVVIOCONFIG_SYNCDELAY 0x00000080                //!< fields: syncDelay

#define NVVIOCONFIG_COMPOSITESYNCTYPE 0x00000100        //!< fields: compositeSyncType

#define NVVIOCONFIG_FRAMELOCKENABLE 0x00000200          //!< fields: EnableFramelock

#define NVVIOCONFIG_422FILTER 0x00000400                //!< fields: bEnable422Filter

#define NVVIOCONFIG_COMPOSITETERMINATE 0x00000800       //!< fields: bCompositeTerminate (Not supported on Quadro FX 4000 SDI)

#define NVVIOCONFIG_DATAINTEGRITYCHECK 0x00001000       //!< fields: bEnableDataIntegrityCheck (Not supported on Quadro FX 4000 SDI)

#define NVVIOCONFIG_CSCOVERRIDE 0x00002000              //!< fields: colorConversion override

#define NVVIOCONFIG_FLIPQUEUELENGTH 0x00004000          //!< fields: flipqueuelength control

#define NVVIOCONFIG_ANCTIMECODEGENERATION 0x00008000    //!< fields: bEnableANCTimeCodeGeneration

#define NVVIOCONFIG_COMPOSITE 0x00010000                //!< fields: bEnableComposite

#define NVVIOCONFIG_ALPHAKEYCOMPOSITE 0x00020000        //!< fields: bEnableAlphaKeyComposite

#define NVVIOCONFIG_COMPOSITE_Y 0x00040000              //!< fields: compRange

#define NVVIOCONFIG_COMPOSITE_CR 0x00080000             //!< fields: compRange

#define NVVIOCONFIG_COMPOSITE_CB 0x00100000             //!< fields: compRange

#define NVVIOCONFIG_FULL_COLOR_RANGE 0x00200000         //!< fields: bEnableFullColorRange

#define NVVIOCONFIG_RGB_DATA 0x00400000                 //!< fields: bEnableRGBData

#define NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE 0x00800000 //!< fields: bEnableSDIOutput

#define NVVIOCONFIG_STREAMS 0x01000000                  //!< fields: streams

#define NVVIOCONFIG_ANC_PARITY_COMPUTATION 0x02000000   //!< fields: ancParityComputation

#define NVVIOCONFIG_ANC_AUDIO_REPEAT 0x04000000         //!< fields: enableAudioBlanking


// Don't forget to update NVVIOCONFIG_VALIDFIELDS in nvapi.spec when NVVIOCONFIG_ALLFIELDS changes.
#define NVVIOCONFIG_ALLFIELDS (NVVIOCONFIG_SIGNALFORMAT |             \
                               NVVIOCONFIG_DATAFORMAT |               \
                               NVVIOCONFIG_OUTPUTREGION |             \
                               NVVIOCONFIG_OUTPUTAREA |               \
                               NVVIOCONFIG_COLORCONVERSION |          \
                               NVVIOCONFIG_GAMMACORRECTION |          \
                               NVVIOCONFIG_SYNCSOURCEENABLE |         \
                               NVVIOCONFIG_SYNCDELAY |                \
                               NVVIOCONFIG_COMPOSITESYNCTYPE |        \
                               NVVIOCONFIG_FRAMELOCKENABLE |          \
                               NVVIOCONFIG_422FILTER |                \
                               NVVIOCONFIG_COMPOSITETERMINATE |       \
                               NVVIOCONFIG_DATAINTEGRITYCHECK |       \
                               NVVIOCONFIG_CSCOVERRIDE |              \
                               NVVIOCONFIG_FLIPQUEUELENGTH |          \
                               NVVIOCONFIG_ANCTIMECODEGENERATION |    \
                               NVVIOCONFIG_COMPOSITE |                \
                               NVVIOCONFIG_ALPHAKEYCOMPOSITE |        \
                               NVVIOCONFIG_COMPOSITE_Y |              \
                               NVVIOCONFIG_COMPOSITE_CR |             \
                               NVVIOCONFIG_COMPOSITE_CB |             \
                               NVVIOCONFIG_FULL_COLOR_RANGE |         \
                               NVVIOCONFIG_RGB_DATA |                 \
                               NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \
                               NVVIOCONFIG_STREAMS |                  \
                               NVVIOCONFIG_ANC_PARITY_COMPUTATION |   \
                               NVVIOCONFIG_ANC_AUDIO_REPEAT)


#define NVVIOCONFIG_VALIDFIELDS (NVVIOCONFIG_SIGNALFORMAT |             \
                                 NVVIOCONFIG_DATAFORMAT |               \
                                 NVVIOCONFIG_OUTPUTREGION |             \
                                 NVVIOCONFIG_OUTPUTAREA |               \
                                 NVVIOCONFIG_COLORCONVERSION |          \
                                 NVVIOCONFIG_GAMMACORRECTION |          \
                                 NVVIOCONFIG_SYNCSOURCEENABLE |         \
                                 NVVIOCONFIG_SYNCDELAY |                \
                                 NVVIOCONFIG_COMPOSITESYNCTYPE |        \
                                 NVVIOCONFIG_FRAMELOCKENABLE |          \
                                 NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \
                                 NVVIOCONFIG_422FILTER |                \
                                 NVVIOCONFIG_COMPOSITETERMINATE |       \
                                 NVVIOCONFIG_DATAINTEGRITYCHECK |       \
                                 NVVIOCONFIG_CSCOVERRIDE |              \
                                 NVVIOCONFIG_FLIPQUEUELENGTH |          \
                                 NVVIOCONFIG_ANCTIMECODEGENERATION |    \
                                 NVVIOCONFIG_COMPOSITE |                \
                                 NVVIOCONFIG_ALPHAKEYCOMPOSITE |        \
                                 NVVIOCONFIG_COMPOSITE_Y |              \
                                 NVVIOCONFIG_COMPOSITE_CR |             \
                                 NVVIOCONFIG_COMPOSITE_CB |             \
                                 NVVIOCONFIG_FULL_COLOR_RANGE |         \
                                 NVVIOCONFIG_RGB_DATA |                 \
                                 NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \
                                 NVVIOCONFIG_STREAMS |                  \
                                 NVVIOCONFIG_ANC_PARITY_COMPUTATION |   \
                                 NVVIOCONFIG_ANC_AUDIO_REPEAT)


#define NVVIOCONFIG_DRIVERFIELDS (NVVIOCONFIG_OUTPUTREGION |    \
                                  NVVIOCONFIG_OUTPUTAREA |      \
                                  NVVIOCONFIG_COLORCONVERSION | \
                                  NVVIOCONFIG_FLIPQUEUELENGTH)


#define NVVIOCONFIG_GAMMAFIELDS (NVVIOCONFIG_GAMMACORRECTION)


#define NVVIOCONFIG_RMCTRLFIELDS (NVVIOCONFIG_SIGNALFORMAT |       \
                                  NVVIOCONFIG_DATAFORMAT |         \
                                  NVVIOCONFIG_SYNCSOURCEENABLE |   \
                                  NVVIOCONFIG_COMPOSITESYNCTYPE |  \
                                  NVVIOCONFIG_FRAMELOCKENABLE |    \
                                  NVVIOCONFIG_422FILTER |          \
                                  NVVIOCONFIG_COMPOSITETERMINATE | \
                                  NVVIOCONFIG_DATAINTEGRITYCHECK | \
                                  NVVIOCONFIG_COMPOSITE |          \
                                  NVVIOCONFIG_ALPHAKEYCOMPOSITE |  \
                                  NVVIOCONFIG_COMPOSITE_Y |        \
                                  NVVIOCONFIG_COMPOSITE_CR |       \
                                  NVVIOCONFIG_COMPOSITE_CB)


#define NVVIOCONFIG_RMSKEWFIELDS (NVVIOCONFIG_SYNCDELAY)


#define NVVIOCONFIG_ALLOWSDIRUNNING_FIELDS (NVVIOCONFIG_DATAINTEGRITYCHECK |    \
                                            NVVIOCONFIG_SYNCDELAY |             \
                                            NVVIOCONFIG_CSCOVERRIDE |           \
                                            NVVIOCONFIG_ANCTIMECODEGENERATION | \
                                            NVVIOCONFIG_COMPOSITE |             \
                                            NVVIOCONFIG_ALPHAKEYCOMPOSITE |     \
                                            NVVIOCONFIG_COMPOSITE_Y |           \
                                            NVVIOCONFIG_COMPOSITE_CR |          \
                                            NVVIOCONFIG_COMPOSITE_CB |          \
                                            NVVIOCONFIG_ANC_PARITY_COMPUTATION)


#define NVVIOCONFIG_RMMODESET_FIELDS (NVVIOCONFIG_SIGNALFORMAT |      \
                                      NVVIOCONFIG_DATAFORMAT |        \
                                      NVVIOCONFIG_SYNCSOURCEENABLE |  \
                                      NVVIOCONFIG_FRAMELOCKENABLE |   \
                                      NVVIOCONFIG_COMPOSITESYNCTYPE | \
                                      NVVIOCONFIG_ANC_AUDIO_REPEAT)


    //! Output device configuration
    // No members can be deleted from below structure. Only add new members at the
    // end of the structure.
    typedef struct _NVVIOOUTPUTCONFIG_V1
    {
        NVVIOSIGNALFORMAT signalFormat;       //!< Signal format for video output
        NVVIODATAFORMAT dataFormat;           //!< Data format for video output
        NVVIOOUTPUTREGION outputRegion;       //!< Region for video output (Desktop mode)
        NVVIOOUTPUTAREA outputArea;           //!< Usable resolution for video output (safe area)
        NVVIOCOLORCONVERSION colorConversion; //!< Color conversion.
        NVVIOGAMMACORRECTION gammaCorrection;
        NvU32 syncEnable;                    //!< Sync enable (TRUE to use syncSource)
        NVVIOSYNCSOURCE syncSource;          //!< Sync source
        NVVIOSYNCDELAY syncDelay;            //!< Sync delay
        NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type
        NvU32 frameLockEnable;               //!< Flag indicating whether framelock was on/off
        NvU32 psfSignalFormat;               //!< Indicates whether contained format is PSF Signal format
        NvU32 enable422Filter;               //!< Enables/Disables 4:2:2 filter
        NvU32 compositeTerminate;            //!< Composite termination
        NvU32 enableDataIntegrityCheck;      //!< Enable data integrity check: true - enable, false - disable
        NvU32 cscOverride;                   //!< Use provided CSC color matrix to overwrite
        NvU32 flipQueueLength;               //!< Number of buffers used for the internal flipqueue
        NvU32 enableANCTimeCodeGeneration;   //!< Enable SDI ANC time code generation
        NvU32 enableComposite;               //!< Enable composite
        NvU32 enableAlphaKeyComposite;       //!< Enable Alpha key composite
        NVVIOCOMPOSITERANGE compRange;       //!< Composite ranges
        NvU8 reservedData[256];              //!< Inicates last stored SDI output state TRUE-ON / FALSE-OFF
        NvU32 enableFullColorRange;          //!< Flag indicating Full Color Range
        NvU32 enableRGBData;                 //!< Indicates data is in RGB format
    } NVVIOOUTPUTCONFIG_V1;

    typedef struct _NVVIOOUTPUTCONFIG_V2
    {
        NVVIOSIGNALFORMAT signalFormat;       //!< Signal format for video output
        NVVIODATAFORMAT dataFormat;           //!< Data format for video output
        NVVIOOUTPUTREGION outputRegion;       //!< Region for video output (Desktop mode)
        NVVIOOUTPUTAREA outputArea;           //!< Usable resolution for video output (safe area)
        NVVIOCOLORCONVERSION colorConversion; //!< Color conversion.
        NVVIOGAMMACORRECTION gammaCorrection;
        NvU32 syncEnable;                               //!< Sync enable (TRUE to use syncSource)
        NVVIOSYNCSOURCE syncSource;                     //!< Sync source
        NVVIOSYNCDELAY syncDelay;                       //!< Sync delay
        NVVIOCOMPSYNCTYPE compositeSyncType;            //!< Composite sync type
        NvU32 frameLockEnable;                          //!< Flag indicating whether framelock was on/off
        NvU32 psfSignalFormat;                          //!< Indicates whether contained format is PSF Signal format
        NvU32 enable422Filter;                          //!< Enables/Disables 4:2:2 filter
        NvU32 compositeTerminate;                       //!< Composite termination
        NvU32 enableDataIntegrityCheck;                 //!< Enable data integrity check: true - enable, false - disable
        NvU32 cscOverride;                              //!< Use provided CSC color matrix to overwrite
        NvU32 flipQueueLength;                          //!< Number of buffers used for the internal flip queue
        NvU32 enableANCTimeCodeGeneration;              //!< Enable SDI ANC time code generation
        NvU32 enableComposite;                          //!< Enable composite
        NvU32 enableAlphaKeyComposite;                  //!< Enable Alpha key composite
        NVVIOCOMPOSITERANGE compRange;                  //!< Composite ranges
        NvU8 reservedData[256];                         //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF
        NvU32 enableFullColorRange;                     //!< Flag indicating Full Color Range
        NvU32 enableRGBData;                            //!< Indicates data is in RGB format
        NVVIOANCPARITYCOMPUTATION ancParityComputation; //!< Enable HW ANC parity bit computation (auto/on/off)
    } NVVIOOUTPUTCONFIG_V2;

    typedef struct _NVVIOOUTPUTCONFIG_V3
    {
        NVVIOSIGNALFORMAT signalFormat;       //!< Signal format for video output
        NVVIODATAFORMAT dataFormat;           //!< Data format for video output
        NVVIOOUTPUTREGION outputRegion;       //!< Region for video output (Desktop mode)
        NVVIOOUTPUTAREA outputArea;           //!< Usable resolution for video output (safe area)
        NVVIOCOLORCONVERSION colorConversion; //!< Color conversion.
        NVVIOGAMMACORRECTION gammaCorrection;
        NvU32 syncEnable;                               //!< Sync enable (TRUE to use syncSource)
        NVVIOSYNCSOURCE syncSource;                     //!< Sync source
        NVVIOSYNCDELAY syncDelay;                       //!< Sync delay
        NVVIOCOMPSYNCTYPE compositeSyncType;            //!< Composite sync type
        NvU32 frameLockEnable;                          //!< Flag indicating whether framelock was on/off
        NvU32 psfSignalFormat;                          //!< Indicates whether contained format is PSF Signal format
        NvU32 enable422Filter;                          //!< Enables/Disables 4:2:2 filter
        NvU32 compositeTerminate;                       //!< Composite termination
        NvU32 enableDataIntegrityCheck;                 //!< Enable data integrity check: true - enable, false - disable
        NvU32 cscOverride;                              //!< Use provided CSC color matrix to overwrite
        NvU32 flipQueueLength;                          //!< Number of buffers used for the internal flip queue
        NvU32 enableANCTimeCodeGeneration;              //!< Enable SDI ANC time code generation
        NvU32 enableComposite;                          //!< Enable composite
        NvU32 enableAlphaKeyComposite;                  //!< Enable Alpha key composite
        NVVIOCOMPOSITERANGE compRange;                  //!< Composite ranges
        NvU8 reservedData[256];                         //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF
        NvU32 enableFullColorRange;                     //!< Flag indicating Full Color Range
        NvU32 enableRGBData;                            //!< Indicates data is in RGB format
        NVVIOANCPARITYCOMPUTATION ancParityComputation; //!< Enable HW ANC parity bit computation (auto/on/off)
        NvU32 enableAudioBlanking;                      //!< Enable HANC audio blanking on repeat frames
    } NVVIOOUTPUTCONFIG_V3;

    //! Stream configuration
    typedef struct _NVVIOSTREAM
    {
        NvU32 bitsPerComponent;          //!< Bits per component
        NVVIOCOMPONENTSAMPLING sampling; //!< Sampling
        NvU32 expansionEnable;           //!< Enable/disable 4:2:2->4:4:4 expansion
        NvU32 numLinks;                  //!< Number of active links
        struct
        {
            NvU32 jack;    //!< This stream's link[i] will use the specified (0-based) channel within the
            NvU32 channel; //!< specified (0-based) jack
        } links[NVAPI_MAX_VIO_LINKS_PER_STREAM];
    } NVVIOSTREAM;

    //! Input device configuration
    typedef struct _NVVIOINPUTCONFIG
    {
        NvU32 numRawCaptureImages;                  //!< numRawCaptureImages is the number of frames to keep in the capture queue.
                                                    //!< must be between NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES and NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES,
        NVVIOSIGNALFORMAT signalFormat;             //!< Signal format.
                                                    //!< Please note that both numRawCaptureImages and signalFormat should be set together.
        NvU32 numStreams;                           //!< Number of active streams.
        NVVIOSTREAM streams[NVAPI_MAX_VIO_STREAMS]; //!< Stream configurations
        NvU32 bTestMode;                            //!< This attribute controls the GVI test mode.
                                                    //!< Possible values 0/1. When testmode enabled, the
                                                    //!< GVI device will generate fake data as quickly as possible.
    } NVVIOINPUTCONFIG;

    typedef struct _NVVIOCONFIG_V1
    {
        NvU32 version;                   //!< Structure version
        NvU32 fields;                    //!< Caller sets to NVVIOCONFIG_* mask for fields to use
        NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration
        union
        {
            NVVIOINPUTCONFIG inConfig;      //!<  Input device configuration
            NVVIOOUTPUTCONFIG_V1 outConfig; //!<  Output device configuration
        } vioConfig;
    } NVVIOCONFIG_V1;

    typedef struct _NVVIOCONFIG_V2
    {
        NvU32 version;                   //!< Structure version
        NvU32 fields;                    //!< Caller sets to NVVIOCONFIG_* mask for fields to use
        NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration
        union
        {
            NVVIOINPUTCONFIG inConfig;      //!< Input device configuration
            NVVIOOUTPUTCONFIG_V2 outConfig; //!< Output device configuration
        } vioConfig;
    } NVVIOCONFIG_V2;

    typedef struct _NVVIOCONFIG_V3
    {
        NvU32 version;                   //!< Structure version
        NvU32 fields;                    //!< Caller sets to NVVIOCONFIG_* mask for fields to use
        NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration
        union
        {
            NVVIOINPUTCONFIG inConfig;      //!< Input device configuration
            NVVIOOUTPUTCONFIG_V3 outConfig; //!< Output device configuration
        } vioConfig;
    } NVVIOCONFIG_V3;
    typedef NVVIOOUTPUTCONFIG_V3 NVVIOOUTPUTCONFIG;
    typedef NVVIOCONFIG_V3 NVVIOCONFIG;

#define NVVIOCONFIG_VER1 MAKE_NVAPI_VERSION(NVVIOCONFIG_V1, 1)

#define NVVIOCONFIG_VER2 MAKE_NVAPI_VERSION(NVVIOCONFIG_V2, 2)

#define NVVIOCONFIG_VER3 MAKE_NVAPI_VERSION(NVVIOCONFIG_V3, 3)

#define NVVIOCONFIG_VER NVVIOCONFIG_VER3


    typedef struct
    {
        NvPhysicalGpuHandle hPhysicalGpu; //!< Handle to Physical GPU (This could be NULL for GVI device if its not binded)
        NvVioHandle hVioHandle;           //!< handle to SDI Input/Output device
        NvU32 vioId;                      //!< device Id of SDI Input/Output device
        NvU32 outputId;                   //!< deviceMask of the SDI display connected to GVO device.
                        //!< outputId will be 0 for GVI device.
    } NVVIOTOPOLOGYTARGET;

    typedef struct _NV_VIO_TOPOLOGY
    {
        NvU32 version;
        NvU32 vioTotalDeviceCount;                            //!< How many video I/O targets are valid
        NVVIOTOPOLOGYTARGET vioTarget[NVAPI_MAX_VIO_DEVICES]; //!< Array of video I/O targets
    } NV_VIO_TOPOLOGY, NVVIOTOPOLOGY;

//! Macro for constructing the version field of NV_VIO_TOPOLOGY
#define NV_VIO_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_VIO_TOPOLOGY, 1)


//! Macro for constructing the version field of NVVIOTOPOLOGY
#define NVVIOTOPOLOGY_VER MAKE_NVAPI_VERSION(NVVIOTOPOLOGY, 1)


    //! @}

    //! \addtogroup vidio
    //! @{
    ///////////////////////////////////////////////////////////////////////////////
    //!
    //!   Function:    NvAPI_VIO_GetCapabilities
    //!
    //!   Description: This API determine the graphics adapter video I/O capabilities.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle   The caller provides the SDI device handle as input.
    //! \param [out] pAdapterCaps  Pointer to receive capabilities
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_GetCapabilities(NvVioHandle hVioHandle,
                                                  NVVIOCAPS *pAdapterCaps);

    ////////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_Open
    //!
    //!   Description: This API opens the graphics adapter for video I/O operations
    //!                using the OpenGL application interface.  Read operations
    //!                are permitted in this mode by multiple clients, but Write
    //!                operations are application exclusive.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle      The caller provides the SDI output device handle as input.
    //! \param [in]  vioClass         Class interface (NVVIOCLASS_* value)
    //! \param [in]  ownerType        Specify NVVIOOWNERTYPE_APPLICATION or NVVIOOWNERTYPE_DESKTOP.
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_Open(NvVioHandle hVioHandle,
                                       NvU32 vioClass,
                                       NVVIOOWNERTYPE ownerType);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_Close
    //!
    //!   Description: This API closes the graphics adapter for graphics-to-video operations
    //!                using the OpenGL application interface.  Closing an
    //!                OpenGL handle releases the device.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle   The caller provides the SDI output device handle as input.
    //! \param [in]  bRelease      boolean value to either keep or release ownership
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_Close(NvVioHandle hVioHandle,
                                        NvU32 bRelease);
    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_Status
    //!
    //!   Description: This API gets the Video I/O LED status.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle   The caller provides the SDI device handle as input.
    //! \param [out] pStatus       Return pointer to NVVIOSTATUS
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_Status(NvVioHandle hVioHandle,
                                         NVVIOSTATUS *pStatus);

    ////////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_SyncFormatDetect
    //!
    //!   Description: This API detects the Video I/O incoming sync video format.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle  The caller provides the SDI device handle as input.
    //! \param [out] pWait        Pointer to receive how many milliseconds will lapse
    //!                           before VIOStatus returns the detected syncFormat.
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_SyncFormatDetect(NvVioHandle hVioHandle,
                                                   NvU32 *pWait);
    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_GetConfig
    //!
    //!   Description: This API gets the graphics-to-video configuration.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle   The caller provides the SDI device handle as input.
    //! \param [out] pConfig       Pointer to the graphics-to-video configuration
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_GetConfig(NvVioHandle hVioHandle,
                                            NVVIOCONFIG *pConfig);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_SetConfig
    //!
    //!   Description: This API sets the graphics-to-video configuration.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
    //! \param [in]  pConfig          Pointer to Graphics-to-Video configuration
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_SetConfig(NvVioHandle hVioHandle,
                                            const NVVIOCONFIG *pConfig);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_SetCSC
    //!
    //!   Description: This API sets the colorspace conversion parameters.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
    //! \param [in]  pCSC             Pointer to CSC parameters
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ////////////////////////////////////////////////////////////////////////////////----
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.")
        NVAPI_INTERFACE NvAPI_VIO_SetCSC(NvVioHandle hVioHandle,
                                         NVVIOCOLORCONVERSION *pCSC);
    ////////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_GetCSC
    //!
    //!   Description: This API gets the colorspace conversion parameters.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
    //! \param [out] pCSC             Pointer to CSC parameters
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ////////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
        NVAPI_INTERFACE NvAPI_VIO_GetCSC(NvVioHandle hVioHandle,
                                         NVVIOCOLORCONVERSION *pCSC);
    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_SetGamma
    //!
    //!   Description: This API sets the gamma conversion parameters.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle       The caller provides the SDI device handle as input.
    //! \param [in]  pGamma            Pointer to gamma parameters
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.")
        NVAPI_INTERFACE NvAPI_VIO_SetGamma(NvVioHandle hVioHandle,
                                           NVVIOGAMMACORRECTION *pGamma);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_GetGamma
    //!
    //!   Description: This API gets the gamma conversion parameters.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
    //! \param [out] pGamma           Pointer to gamma parameters
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
        NVAPI_INTERFACE NvAPI_VIO_GetGamma(NvVioHandle hVioHandle,
                                           NVVIOGAMMACORRECTION *pGamma);
    ////////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_SetSyncDelay
    //!
    //!   Description: This API sets the sync delay parameters.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle   The caller provides the SDI device handle as input.
    //! \param [in]  pSyncDelay    Pointer to sync delay parameters
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.")
        NVAPI_INTERFACE NvAPI_VIO_SetSyncDelay(NvVioHandle hVioHandle,
                                               const NVVIOSYNCDELAY *pSyncDelay);

    ////////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_GetSyncDelay
    //!
    //!   Description: This API gets the sync delay parameters.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
    //! \param [out] pSyncDelay       Pointer to sync delay parameters
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
        NVAPI_INTERFACE NvAPI_VIO_GetSyncDelay(NvVioHandle hVioHandle,
                                               NVVIOSYNCDELAY *pSyncDelay);

    typedef enum _NVVIOPCILINKRATE
    {
        NVVIOPCILINKRATE_UNKNOWN = 0,
        NVVIOPCILINKRATE_GEN1 = 1, //<! 2.5 Gbps.
        NVVIOPCILINKRATE_GEN2 = 2, //<! 5 Gbps.
        NVVIOPCILINKRATE_GEN3 = 3, //<! 8 Gbps.
    } NVVIOPCILINKRATE;

    typedef enum _NVVIOPCILINKWIDTH
    {
        NVVIOPCILINKWIDTH_UNKNOWN = 0,
        NVVIOPCILINKWIDTH_x1 = 1,
        NVVIOPCILINKWIDTH_x2 = 2,
        NVVIOPCILINKWIDTH_x4 = 4,
        NVVIOPCILINKWIDTH_x8 = 8,
        NVVIOPCILINKWIDTH_x16 = 16,
    } NVVIOPCILINKWIDTH;

    typedef struct _NVVIOPCIINFO
    {
        NvU32 version; //!< Structure version

        NvU32 pciDeviceId;              //!< specifies the internal PCI device identifier for the GVI.
        NvU32 pciSubSystemId;           //!< specifies the internal PCI subsystem identifier for the GVI.
        NvU32 pciRevisionId;            //!< specifies the internal PCI device-specific revision identifier for the GVI.
        NvU32 pciDomain;                //!< specifies the PCI domain of the GVI device.
        NvU32 pciBus;                   //!< specifies the PCI bus number of the GVI device.
        NvU32 pciSlot;                  //!< specifies the PCI slot number of the GVI device.
        NVVIOPCILINKWIDTH pciLinkWidth; //!< specifies the the negotiated PCIE link width.
        NVVIOPCILINKRATE pciLinkRate;   //!< specifies the the negotiated PCIE link rate.
    } NVVIOPCIINFO_V1;

    typedef NVVIOPCIINFO_V1 NVVIOPCIINFO;
#define NVVIOPCIINFO_VER1 MAKE_NVAPI_VERSION(NVVIOPCIINFO_V1, 1)

#define NVVIOPCIINFO_VER NVVIOPCIINFO_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_VIO_GetPCIInfo()
    //
    // DESCRIPTION:   This API gets PCI information of the attached SDI(input) capture card.
    //
    // PARAMETERS:      hVioHandle    (IN)    - Handle to SDI capture card.
    //                  pVioPCIInfo    (OUT)    - PCI information of the attached SDI capture card.
    //
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_GetPCIInfo(__in NvVioHandle hVioHandle,
                                             __inout NVVIOPCIINFO *pVioPCIInfo);

    ////////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_IsRunning
    //!
    //!   Description: This API determines if Video I/O is running.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle[IN]          The caller provides the SDI device handle as input.
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_IsRunning(NvVioHandle hVioHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_Start
    //!
    //!   Description: This API starts Video I/O.
    //!              This API should be called for NVVIOOWNERTYPE_DESKTOP only and will not work for OGL applications.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle[IN]     The caller provides the SDI device handle as input.
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_Start(NvVioHandle hVioHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_Stop
    //!
    //!   Description: This API stops Video I/O.
    //!              This API should be called for NVVIOOWNERTYPE_DESKTOP only and will not work for OGL applications.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle[IN]     The caller provides the SDI device handle as input.
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_Stop(NvVioHandle hVioHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_IsFrameLockModeCompatible
    //!
    //!   Description: This API checks whether modes are compatible in frame lock mode.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]   NvVioHandle          The caller provides the SDI device handle as input.
    //! \param [in]   srcEnumIndex         Source Enumeration index
    //! \param [in]   destEnumIndex        Destination Enumeration index
    //! \param [out]  pbCompatible         Pointer to receive compatibility
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_IsFrameLockModeCompatible(NvVioHandle hVioHandle,
                                                            NvU32 srcEnumIndex,
                                                            NvU32 destEnumIndex,
                                                            NvU32 *pbCompatible);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_EnumDevices
    //!
    //!   Description: This API enumerate all VIO devices connected to the system.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [out]  NvVioHandle                  User passes the pointer of NvVioHandle[] array to get handles to
    //!                                            all the connected video I/O devices.
    //! \param [out]  vioDeviceCount               User gets total number of VIO devices connected to the system.
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_EnumDevices(NvVioHandle hVioHandle[NVAPI_MAX_VIO_DEVICES],
                                              NvU32 *vioDeviceCount);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_QueryTopology
    //!
    //!   Description: This API queries the valid SDI topologies.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [out] pNvVIOTopology     User passes the pointer to NVVIOTOPOLOGY to fetch all valid SDI topologies.
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_QueryTopology(NV_VIO_TOPOLOGY *pNvVIOTopology);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_EnumSignalFormats
    //!
    //!   Description: This API enumerates signal formats supported by Video I/O.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]   NvVioHandle          The caller provides the SDI device handle as input.
    //! \param [in]   enumIndex            Enumeration index
    //! \param [out]  pSignalFormatDetail  Pointer to receive detail or NULL
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_EnumSignalFormats(NvVioHandle hVioHandle,
                                                    NvU32 enumIndex,
                                                    NVVIOSIGNALFORMATDETAIL *pSignalFormatDetail);

    ///////////////////////////////////////////////////////////////////////////////
    //!   Function:    NvAPI_VIO_EnumDataFormats
    //!
    //!   Description: This API enumerates data formats supported by Video I/O.
    //!
    //! \deprecated  Do not use this function - it is deprecated in release 440.
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 190
    //!
    //! \param [in]  NvVioHandle         The caller provides the SDI device handle as input.
    //! \param [in]  enumIndex           Enumeration index
    //! \param [out] pDataFormatDetail   Pointer to receive detail or NULL
    //!
    //! \retval :: NVAPI_NOT_SUPPORTED   API is not supported
    //!
    ///////////////////////////////////////////////////////////////////////////////
    __nvapi_deprecated_function("Do not use this function - it is deprecated in release 440.")
        NVAPI_INTERFACE NvAPI_VIO_EnumDataFormats(NvVioHandle hVioHandle,
                                                  NvU32 enumIndex,
                                                  NVVIODATAFORMATDETAIL *pDataFormatDetail);

    //! @}

    ///////////////////////////////////////////////////////////////////////////////////
    //  CAMERA TEST API
    //  These APIs allows test apps to perform low level camera tests

    //! \addtogroup vidio
    //! @{
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_CreateConfigurationProfileRegistryKey
    //
    //! \fn NvAPI_Stereo_CreateConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType)
    //!
    //! DESCRIPTION:   Creates new configuration registry key for current application.
    //!
    //!                If there is no configuration profile prior to the function call,
    //!                this API tries to create a new configuration profile registry key
    //!                for a given application and fill it with the default values.
    //!                If an application already has a configuration profile registry key, the API does nothing.
    //!                The name of the key is automatically set to the name of the executable that calls this function.
    //!                Because of this, the executable should have a distinct and unique name.
    //!                If the application is using only one version of DirectX, then the default profile type will be appropriate.
    //!                If the application is using more than one version of DirectX from the same executable,
    //!                it should use the appropriate profile type for each configuration profile.
    //!
    //! HOW TO USE:    When there is a need for an application to have default stereo parameter values,
    //!                use this function to create a key to store the values.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]    registryProfileType  Type of profile the application wants to create. It should be one of the symbolic constants defined in
    //!                                     ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause function to do nothing and return
    //!                                     ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
    //!
    //! \retval ::NVAPI_OK                                           Key exists in the registry.
    //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED   This profile type is not supported.
    //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED                Access to registry failed.
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                       Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR
    //!
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup stereoapi
    //! Used in NvAPI_Stereo_CreateConfigurationProfileRegistryKey()
    typedef enum _NV_StereoRegistryProfileType
    {
        NVAPI_STEREO_DEFAULT_REGISTRY_PROFILE, //!< Default registry configuration profile.
        NVAPI_STEREO_DX9_REGISTRY_PROFILE,     //!< Separate registry configuration profile for a DirectX 9 executable.
        NVAPI_STEREO_DX10_REGISTRY_PROFILE     //!< Separate registry configuration profile for a DirectX 10 executable.
    } NV_STEREO_REGISTRY_PROFILE_TYPE;

    //! \ingroup stereoapi
    NVAPI_INTERFACE NvAPI_Stereo_CreateConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileRegistryKey
    //
    //! DESCRIPTION:   Removes configuration registry key for current application.
    //!
    //!                If an application already has a configuration profile prior to this function call,
    //!                the function attempts to remove the application's configuration profile registry key from the registry.
    //!                If there is no configuration profile registry key prior to the function call,
    //!                the function does nothing and does not report an error.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]   registryProfileType   Type of profile that the application wants to delete. This should be one of the symbolic
    //!                                     constants defined in ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause the function
    //!                                     to do nothing and return ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
    //!
    //! \retval ::NVAPI_OK                                           Key does not exist in the registry any more.
    //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED   This profile type is not supported.
    //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED                Access to registry failed.
    //! \retval ::NVAPI_API_NOT_INTIALIZED                           NVAPI is not initialized.
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                       Stereo part of NVAPI is not initialized.
    //! \retval ::NVAPI_ERROR
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_DeleteConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_SetConfigurationProfileValue
    //
    //! \fn NvAPI_Stereo_SetConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID, void *pValue)
    //!
    //! DESCRIPTION:   This API sets the given parameter value under the application's registry key.
    //!
    //!                If the value does not exist under the application's registry key,
    //!                the value will be created under the key.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]     registryProfileType  The type of profile the application wants to access. It should be one of the
    //!                                      symbolic constants defined in ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value
    //!                                      will cause function to do nothing and return ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
    //! \param [in]     valueRegistryID      ID of the value that is being set. It should be one of the symbolic constants defined in
    //!                                      ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause function to do nothing
    //!                                      and return ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
    //! \param [in]     pValue               Address of the value that is being set. It should be either address of a DWORD or of a float,
    //!                                      dependent on the type of the stereo parameter whose value is being set. The API will then cast that
    //!                                      address to DWORD* and write whatever is in those 4 bytes as a DWORD to the registry.
    //!
    //! \retval ::NVAPI_OK                                           Value is written to registry.
    //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED   This profile type is not supported.
    //! \retval ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED          This value is not supported.
    //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED                Access to registry failed.
    //! \retval ::NVAPI_API_NOT_INTIALIZED                           NVAPI is not initialized.
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                       Stereo part of NVAPI is not initialized.
    //! \retval ::NVAPI_ERROR                                        Something is wrong (generic error).
    //
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup stereoapi
    //! Used in NvAPI_Stereo_SetConfigurationProfileValue()
    typedef enum _NV_StereoRegistryID
    {
        NVAPI_CONVERGENCE_ID,         //!< Symbolic constant for convergence registry ID.
        NVAPI_FRUSTUM_ADJUST_MODE_ID, //!< Symbolic constant for frustum adjust mode registry ID.
    } NV_STEREO_REGISTRY_ID;

    //! \ingroup stereoapi
    NVAPI_INTERFACE NvAPI_Stereo_SetConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID, void *pValue);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileValue
    //
    //! DESCRIPTION:   This API removes the given value from the application's configuration profile registry key.
    //!                If there is no such value, the function does nothing and does not report an error.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]     registryProfileType   The type of profile the application wants to access. It should be one of the
    //!                                       symbolic constants defined in ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will
    //!                                       cause function to do nothing and return ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
    //! \param [in]     valueRegistryID       ID of the value that is being deleted. It should be one of the symbolic constants defined in
    //!                                       ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause function to do nothing and return
    //!                                       ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
    //!
    //! \retval ::NVAPI_OK                                           Value does not exist in registry any more.
    //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED   This profile type is not supported.
    //! \retval ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED          This value is not supported.
    //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED                Access to registry failed.
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                       Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_DeleteConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID);

    //! \addtogroup stereoapi
    //! @{

    typedef struct _NVAPI_STEREO_CAPS
    {
        NvU32 version;
        NvU32 supportsWindowedModeOff : 1;
        NvU32 supportsWindowedModeAutomatic : 1;
        NvU32 supportsWindowedModePersistent : 1;
        NvU32 reserved : 29; // must be 0
        NvU32 reserved2[3];  // must be 0
    } NVAPI_STEREO_CAPS_V1;

#define NVAPI_STEREO_CAPS_VER1 MAKE_NVAPI_VERSION(NVAPI_STEREO_CAPS, 1)

#define NVAPI_STEREO_CAPS_VER NVAPI_STEREO_CAPS_VER1


    typedef NVAPI_STEREO_CAPS_V1 NVAPI_STEREO_CAPS;

    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_GetStereoSupport
    //
    //! DESCRIPTION:  This API checks what kind of stereo support is currently supported on a particular display.
    //!               If the the display is prohibited from showing stereo (e.g. secondary in a multi-mon setup), we will
    //!               return 0 for all stereo modes (full screen exclusive, automatic windowed, persistent windowed).
    //!               Otherwise, we will check which stereo mode is supported. On 120Hz display, this will be what
    //!               the user chooses in control panel. On HDMI 1.4 display, persistent windowed mode is always assumed to be
    //!               supported. Note that this function does not check if the CURRENT RESOLUTION/REFRESH RATE can support
    //!               stereo. For HDMI 1.4, it is the app's responsibility to change the resolution/refresh rate to one that is
    //!               3D compatible. For 120Hz, the driver will ALWAYS force 120Hz anyway.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 304
    //!
    //! \param [in]     hMonitor handle to monitor that app is going to run on
    //! \param [out]    pCaps    Address where the result of the inquiry will be placed.
    //!                          *pCaps is defined in NVAPI_STEREO_CAPS.
    //! \return       This API can return any of the following error codes enumerated in #NvAPI_Status
    //! \retval ::NVAPI_OK
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_GetStereoSupport(__in NvMonitorHandle hMonitor, __out NVAPI_STEREO_CAPS *pCaps);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_DecreaseSeparation
    //
    //! DESCRIPTION:   This API decreases separation for the given device interface (just like the Ctrl+F3 hotkey).
    //!
    //! WHEN TO USE:   After the stereo handle for device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]   stereoHandle  Stereo handle that corresponds to the device interface.
    //!
    //! \retval ::NVAPI_OK - Decrease of separation percentage was successfull.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR - Something is wrong (generic error).
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_DecreaseSeparation(StereoHandle stereoHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_IncreaseSeparation
    //
    //! DESCRIPTION:   This API increases separation for the given device interface (just like the Ctrl+F4 hotkey).
    //!
    //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]    stereoHandle  Stereo handle that corresponds to the device interface.
    //!
    //! \retval ::NVAPI_OK                               Increase of separation percentage was successfull.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE  Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED               NVAPI not initialized.
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED           Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR                            Something is wrong (generic error).
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_IncreaseSeparation(StereoHandle stereoHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_DecreaseConvergence
    //
    //! DESCRIPTION:   This API decreases convergence for the given device interface (just like the Ctrl+F5 hotkey).
    //!
    //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]     stereoHandle  Stereo handle that corresponds to the device interface.
    //!
    //! \retval ::NVAPI_OK - Decrease of convergence was successfull.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR - Something is wrong (generic error).
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_DecreaseConvergence(StereoHandle stereoHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_IncreaseConvergence
    //
    //! DESCRIPTION:   This API increases convergence for given the device interface (just like the Ctrl+F5 hotkey).
    //!
    //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]    stereoHandle  Stereo handle that corresponds to the device interface.
    //!
    //! \retval ::NVAPI_OK                               Increase of convergence was successfull.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE  Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED           Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_IncreaseConvergence(StereoHandle stereoHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_GetFrustumAdjustMode
    //
    //! \fn NvAPI_Stereo_GetFrustumAdjustMode(StereoHandle stereoHandle, NV_FRUSTUM_ADJUST_MODE *pFrustumAdjustMode)
    //! DESCRIPTION:   This API gets the current frustum adjust mode value.
    //!
    //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]     stereoHandle         Stereo handle that corresponds to the device interface.
    //! \param [out]    pFrustumAdjustMode   Address of the NV_FRUSTUM_ADJUST_MODE type variable to store current frustum value in.
    //!
    //! \retval ::NVAPI_OK - Retrieval of frustum adjust mode was successfull.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR - Something is wrong (generic error).
    //!
    ///////////////////////////////////////////////////////////////////////////////

    //! \ingroup stereoapi
    //! Used in NvAPI_Stereo_GetFrustumAdjustMode().
    typedef enum _NV_FrustumAdjustMode
    {
        NVAPI_NO_FRUSTUM_ADJUST,  //!< Do not adjust frustum.
        NVAPI_FRUSTUM_STRETCH,    //!< Stretch images in X.
        NVAPI_FRUSTUM_CLEAR_EDGES //!< Clear corresponding edges for each eye.
    } NV_FRUSTUM_ADJUST_MODE;

    //! \ingroup stereoapi
    NVAPI_INTERFACE NvAPI_Stereo_GetFrustumAdjustMode(StereoHandle stereoHandle, NV_FRUSTUM_ADJUST_MODE *pFrustumAdjustMode);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_SetFrustumAdjustMode
    //
    //! DESCRIPTION:   This API sets the current frustum adjust mode value.
    //!
    //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]     stereoHandle                Stereo handle that corresponds to the device interface.
    //! \param [in]     newFrustumAdjustModeValue   New value for frustum adjust mode. It should be one of the symbolic constants defined in
    //!                                             ::NV_FRUSTUM_ADJUST_MODE. Any other value will cause function to do nothing and return
    //!                                             ::NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED.
    //!
    //! \retval ::NVAPI_OK                                         Retrieval of frustum adjust mode was successfull.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE            Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                     Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED   Given frustum adjust mode is not supported.
    //! \retval ::NVAPI_ERROR
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_SetFrustumAdjustMode(StereoHandle stereoHandle, NV_FRUSTUM_ADJUST_MODE newFrustumAdjustModeValue);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_CaptureJpegImage
    //
    //! DESCRIPTION:   This API captures the current stereo image in JPEG stereo format with the given quality.
    //!                Only the last capture call per flip will be effective.
    //!
    //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]     stereoHandle  Stereo handle that corresponds to the device interface.
    //! \param [in]     quality        Quality of the JPEG image to be captured. Integer value betweeen 0 and 100.
    //!
    //! \retval ::NVAPI_OK                              Image captured.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED
    //! \retval ::NVAPI_STEREO_PARAMETER_OUT_OF_RANGE   Given quality is out of [0..100] range.
    //! \retval ::NVAPI_ERROR
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_CaptureJpegImage(StereoHandle stereoHandle, NvU32 quality);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_InitActivation
    //
    //! DESCRIPTION:   This API allows an application to enable stereo viewing, without the need of a GUID/Key pair
    //!				   This API cannot be used to enable stereo viewing on 3DTV.
    //!
    //! HOW TO USE:    Call this function immediately after device creation, then follow with a reset. \n
    //!                Very generically:
    //!                Create Device->Create Stereo Handle->InitActivation->Reset Device
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! \since Release: 302
    //!
    //! \param [in]   stereoHandle            Stereo handle corresponding to the device interface.
    //! \param [in]   bDelayed				  Use delayed activation
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API,
    //!         they are listed below.
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////

    //! \addtogroup stereoapi
    //! @{

    //! InitActivation Flags
    typedef enum _NVAPI_STEREO_INIT_ACTIVATION_FLAGS
    {
        NVAPI_STEREO_INIT_ACTIVATION_IMMEDIATE = 0X00,
        NVAPI_STEREO_INIT_ACTIVATION_DELAYED = 0x01,
    } NVAPI_STEREO_INIT_ACTIVATION_FLAGS;

    NVAPI_INTERFACE NvAPI_Stereo_InitActivation(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_INIT_ACTIVATION_FLAGS flags);

    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_Trigger_Activation
    //
    //! DESCRIPTION:   This API allows an application to trigger creation of a stereo desktop,
    //!				   in case the creation was stopped on application launch.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //! \since Release: 302
    //!
    //! \param [in]   stereoHandle   Stereo handle that corresponds to the device interface.
    //!
    //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
    //!         If there are return error codes with specific meaning for this API,
    //!         they are listed below.
    //! \retval ::NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE - Stereo InitActivation not called.
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_Trigger_Activation(__in StereoHandle hStereoHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_CapturePngImage
    //
    //! DESCRIPTION:   This API captures the current stereo image in PNG stereo format.
    //!                Only the last capture call per flip will be effective.
    //!
    //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //! \param [in]     stereoHandle  Stereo handle corresponding to the device interface.
    //!
    //! \retval ::NVAPI_OK                               Image captured.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE  Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED           Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_CapturePngImage(StereoHandle stereoHandle);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_ReverseStereoBlitControl
    //
    //! DESCRIPTION:   This API turns on/off reverse stereo blit.
    //!
    //! HOW TO USE:    Use after the stereo handle for the device interface is created via successfull call to the appropriate
    //!                NvAPI_Stereo_CreateHandleFrom() function.
    //!                After reversed stereo blit control is turned on, blits from the stereo surface will
    //!                produce the right-eye image in the left side of the destination surface and the left-eye
    //!                image in the right side of the destination surface.
    //!
    //!                In DirectX 9, the destination surface must be created as the render target, and StretchRect must be used.
    //!                Conditions:
    //!                - DstWidth == 2*SrcWidth
    //!                - DstHeight == SrcHeight
    //!                - Src surface is the stereo surface.
    //!                - SrcRect must be {0,0,SrcWidth,SrcHeight}
    //!                - DstRect must be {0,0,DstWidth,DstHeight}
    //!
    //!                In DirectX 10, ResourceCopyRegion must be used.
    //!                Conditions:
    //!                - DstWidth == 2*SrcWidth
    //!                - DstHeight == SrcHeight
    //!                - dstX == 0,
    //!                - dstY == 0,
    //!                - dstZ == 0,
    //!                - SrcBox: left=top=front==0; right==SrcWidth; bottom==SrcHeight; back==1;
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 185
    //!
    //! \param [in]    stereoHandle  Stereo handle corresponding to the device interface.
    //! \param [in]    TurnOn         != 0 : Turns on \n
    //!                               == 0 : Turns off
    //!
    //!
    //! \retval ::NVAPI_OK                                Retrieval of frustum adjust mode was successfull.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE   Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED            Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_ReverseStereoBlitControl(StereoHandle hStereoHandle, NvU8 TurnOn);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_Stereo_SetNotificationMessage
    //
    //! DESCRIPTION:   This API is a Setup notification message that the stereo driver uses to notify the application
    //!                when the user changes the stereo driver state.
    //!
    //!                When the user changes the stereo state (Activated or Deactivated, separation or conversion)
    //!                the stereo driver posts a defined message with the following parameters:
    //!
    //!                lParam  is the current conversion. (Actual conversion is *(float*)&lParam )
    //!
    //!                wParam == MAKEWPARAM(l, h) where
    //!                - l == 0 if stereo is deactivated
    //!                - l == 1 if stereo is deactivated
    //!                - h is the current separation. (Actual separation is float(h*100.f/0xFFFF)
    //!
    //!                Call this API with NULL hWnd to prohibit notification.
    //!
    //! WHEN TO USE:   Use after the stereo handle for device interface is created via successful call to appropriate
    //!                NvAPI_Stereo_CreateHandleFrom() function.
    //!
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 180
    //!
    //!
    //! \param [in]     stereoHandle  Stereo handle corresponding to the device interface.
    //! \param [in]     hWnd          Window HWND that will be notified when the user changes the stereo driver state.
    //!                               Actual HWND must be cast to an NvU64.
    //! \param [in]     messageID     MessageID of the message that will be posted to hWnd
    //!
    //! \retval ::NVAPI_OK                                Notification set.
    //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE   Device interface is not valid. Create again, then attach again.
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //! \retval ::NVAPI_STEREO_NOT_INITIALIZED            Stereo part of NVAPI not initialized.
    //! \retval ::NVAPI_ERROR
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_Stereo_SetNotificationMessage(StereoHandle hStereoHandle, NvU64 hWnd, NvU64 messageID);

//! \ingroup stereoapi
#define NVAPI_STEREO_QUADBUFFERED_API_VERSION 0x2


    //! \ingroup stereoapi
    typedef enum _NV_StereoSwapChainMode
    {
        NVAPI_STEREO_SWAPCHAIN_DEFAULT = 0,
        NVAPI_STEREO_SWAPCHAIN_STEREO = 1,
        NVAPI_STEREO_SWAPCHAIN_MONO = 2,
    } NV_STEREO_SWAPCHAIN_MODE;

#if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D1x_CreateSwapChain
    //
    //! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain.
    //!
    //!          NOTE: NvAPI_D3D1x_CreateSwapChain is a wrapper of the method IDXGIFactory::CreateSwapChain which
    //!                additionally notifies the D3D driver of the mode in which stereo mode the swap chain is to be
    //!                created.
    //!
    //! \since Release: 285
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     hStereoHandle      Stereo handle that corresponds to the device interface.
    //!                                   A pointer to the device that will write 2D images to the swap chain.
    //! \param [in]     pDesc             A pointer to the swap-chain description (DXGI_SWAP_CHAIN_DESC). This parameter cannot be NULL.
    //! \param [out]    ppSwapChain       A pointer to the swap chain created.
    //! \param [in]     mode              The stereo mode fot the swap chain.
    //!                                   NVAPI_STEREO_SWAPCHAIN_DEFAULT
    //!                                   NVAPI_STEREO_SWAPCHAIN_STEREO
    //!                                   NVAPI_STEREO_SWAPCHAIN_MONO
    //!
    //! \retval ::NVAPI_OK                 The swap chain was created successfully.
    //! \retval ::NVAPI_ERROR              The operation failed.
    //!
    //! \ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D1x_CreateSwapChain(StereoHandle hStereoHandle,
                                                DXGI_SWAP_CHAIN_DESC *pDesc,
                                                IDXGISwapChain **ppSwapChain,
                                                NV_STEREO_SWAPCHAIN_MODE mode);

#endif // if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)

#if defined(_D3D9_H_) // NvAPI_D3D9_CreateSwapChain

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_D3D9_CreateSwapChain
    //
    //! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain.
    //!
    //!          NOTE: NvAPI_D3D9_CreateSwapChain is a wrapper of the method IDirect3DDevice9::CreateAdditionalSwapChain which
    //!                additionally notifies the D3D driver if the swap chain creation mode must be stereo or mono.
    //!
    //!
    //! \since Release: 285
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      hStereoHandle            Stereo handle that corresponds to the device interface.
    //! \param [in, out] pPresentationParameters  A pointer to the swap-chain description (DXGI). This parameter cannot be NULL.
    //! \param [out]     ppSwapChain              A pointer to the swap chain created.
    //! \param [in]      mode                     The stereo mode for the swap chain.
    //!                                           NVAPI_STEREO_SWAPCHAIN_DEFAULT
    //!                                           NVAPI_STEREO_SWAPCHAIN_STEREO
    //!                                           NVAPI_STEREO_SWAPCHAIN_MONO
    //!
    //! \retval ::NVAPI_OK                        The swap chain creation was successful
    //! \retval ::NVAPI_ERROR                     The operation failed.
    //!
    //!\ingroup stereoapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_D3D9_CreateSwapChain(StereoHandle hStereoHandle,
                                               D3DPRESENT_PARAMETERS *pPresentationParameters,
                                               IDirect3DSwapChain9 **ppSwapChain,
                                               NV_STEREO_SWAPCHAIN_MODE mode);
#endif // if defined(_D3D9_H_) //NvAPI_D3D9_CreateSwapChain

    //! \addtogroup drsapi
    //! @{

    // GPU Profile APIs

    NV_DECLARE_HANDLE(NvDRSSessionHandle);
    NV_DECLARE_HANDLE(NvDRSProfileHandle);

#define NVAPI_DRS_GLOBAL_PROFILE ((NvDRSProfileHandle)-1)


#define NVAPI_SETTING_MAX_VALUES 100


    typedef enum _NVDRS_SETTING_TYPE
    {
        NVDRS_DWORD_TYPE,
        NVDRS_BINARY_TYPE,
        NVDRS_STRING_TYPE,
        NVDRS_WSTRING_TYPE
    } NVDRS_SETTING_TYPE;

    typedef enum _NVDRS_SETTING_LOCATION
    {
        NVDRS_CURRENT_PROFILE_LOCATION,
        NVDRS_GLOBAL_PROFILE_LOCATION,
        NVDRS_BASE_PROFILE_LOCATION,
        NVDRS_DEFAULT_PROFILE_LOCATION
    } NVDRS_SETTING_LOCATION;

    typedef struct _NVDRS_GPU_SUPPORT
    {
        NvU32 geforce : 1;
        NvU32 quadro : 1;
        NvU32 nvs : 1;
        NvU32 reserved4 : 1;
        NvU32 reserved5 : 1;
        NvU32 reserved6 : 1;
        NvU32 reserved7 : 1;
        NvU32 reserved8 : 1;
        NvU32 reserved9 : 1;
        NvU32 reserved10 : 1;
        NvU32 reserved11 : 1;
        NvU32 reserved12 : 1;
        NvU32 reserved13 : 1;
        NvU32 reserved14 : 1;
        NvU32 reserved15 : 1;
        NvU32 reserved16 : 1;
        NvU32 reserved17 : 1;
        NvU32 reserved18 : 1;
        NvU32 reserved19 : 1;
        NvU32 reserved20 : 1;
        NvU32 reserved21 : 1;
        NvU32 reserved22 : 1;
        NvU32 reserved23 : 1;
        NvU32 reserved24 : 1;
        NvU32 reserved25 : 1;
        NvU32 reserved26 : 1;
        NvU32 reserved27 : 1;
        NvU32 reserved28 : 1;
        NvU32 reserved29 : 1;
        NvU32 reserved30 : 1;
        NvU32 reserved31 : 1;
        NvU32 reserved32 : 1;
    } NVDRS_GPU_SUPPORT;

    //! Enum to decide on the datatype of setting value.
    typedef struct _NVDRS_BINARY_SETTING
    {
        NvU32 valueLength; //!< valueLength should always be in number of bytes.
        NvU8 valueData[NVAPI_BINARY_DATA_MAX];
    } NVDRS_BINARY_SETTING;

    typedef struct _NVDRS_SETTING_VALUES
    {
        NvU32 version;                  //!< Structure Version
        NvU32 numSettingValues;         //!< Total number of values available in a setting.
        NVDRS_SETTING_TYPE settingType; //!< Type of setting value.
        union                           //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
        {
            NvU32 u32DefaultValue;                   //!< Accessing default DWORD value of this setting.
            NVDRS_BINARY_SETTING binaryDefaultValue; //!< Accessing default Binary value of this setting.
                                                     //!< Must be allocated by caller with valueLength specifying buffer size, or only valueLength will be filled in.
            NvAPI_UnicodeString wszDefaultValue;     //!< Accessing default unicode string value of this setting.
        };
        union                                 //!< Setting values can be of either DWORD, Binary values or String type,
        {                                     //!< NOT mixed types.
            NvU32 u32Value;                   //!< All possible DWORD values for a setting
            NVDRS_BINARY_SETTING binaryValue; //!< All possible Binary values for a setting
            NvAPI_UnicodeString wszValue;     //!< Accessing current unicode string value of this setting.
        } settingValues[NVAPI_SETTING_MAX_VALUES];
    } NVDRS_SETTING_VALUES;

//! Macro for constructing the version field of ::_NVDRS_SETTING_VALUES
#define NVDRS_SETTING_VALUES_VER MAKE_NVAPI_VERSION(NVDRS_SETTING_VALUES, 1)


    typedef struct _NVDRS_SETTING_V1
    {
        NvU32 version;                          //!< Structure Version
        NvAPI_UnicodeString settingName;        //!< String name of setting
        NvU32 settingId;                        //!< 32 bit setting Id
        NVDRS_SETTING_TYPE settingType;         //!< Type of setting value.
        NVDRS_SETTING_LOCATION settingLocation; //!< Describes where the value in CurrentValue comes from.
        NvU32 isCurrentPredefined;              //!< It is different than 0 if the currentValue is a predefined Value,
                                                //!< 0 if the currentValue is a user value.
        NvU32 isPredefinedValid;                //!< It is different than 0 if the PredefinedValue union contains a valid value.
        union                                   //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
        {
            NvU32 u32PredefinedValue;                   //!< Accessing default DWORD value of this setting.
            NVDRS_BINARY_SETTING binaryPredefinedValue; //!< Accessing default Binary value of this setting.
                                                        //!< Must be allocated by caller with valueLength specifying buffer size,
                                                        //!< or only valueLength will be filled in.
            NvAPI_UnicodeString wszPredefinedValue;     //!< Accessing default unicode string value of this setting.
        };
        union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
        {
            NvU32 u32CurrentValue;                   //!< Accessing current DWORD value of this setting.
            NVDRS_BINARY_SETTING binaryCurrentValue; //!< Accessing current Binary value of this setting.
                                                     //!< Must be allocated by caller with valueLength specifying buffer size,
                                                     //!< or only valueLength will be filled in.
            NvAPI_UnicodeString wszCurrentValue;     //!< Accessing current unicode string value of this setting.
        };
    } NVDRS_SETTING_V1;

//! Macro for constructing the version field of ::_NVDRS_SETTING
#define NVDRS_SETTING_VER1 MAKE_NVAPI_VERSION(NVDRS_SETTING_V1, 1)


    typedef NVDRS_SETTING_V1 NVDRS_SETTING;
#define NVDRS_SETTING_VER NVDRS_SETTING_VER1


    typedef struct _NVDRS_APPLICATION_V1
    {
        NvU32 version;                        //!< Structure Version
        NvU32 isPredefined;                   //!< Is the application userdefined/predefined
        NvAPI_UnicodeString appName;          //!< String name of the Application
        NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application
        NvAPI_UnicodeString launcher;         //!< Indicates the name (if any) of the launcher that starts the application
    } NVDRS_APPLICATION_V1;

    typedef struct _NVDRS_APPLICATION_V2
    {
        NvU32 version;                        //!< Structure Version
        NvU32 isPredefined;                   //!< Is the application userdefined/predefined
        NvAPI_UnicodeString appName;          //!< String name of the Application
        NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application
        NvAPI_UnicodeString launcher;         //!< Indicates the name (if any) of the launcher that starts the Application
        NvAPI_UnicodeString fileInFolder;     //!< Select this application only if this file is found.
                                              //!< When specifying multiple files, separate them using the ':' character.
    } NVDRS_APPLICATION_V2;

    typedef struct _NVDRS_APPLICATION_V3
    {
        NvU32 version;                        //!< Structure Version
        NvU32 isPredefined;                   //!< Is the application userdefined/predefined
        NvAPI_UnicodeString appName;          //!< String name of the Application
        NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application
        NvAPI_UnicodeString launcher;         //!< Indicates the name (if any) of the launcher that starts the Application
        NvAPI_UnicodeString fileInFolder;     //!< Select this application only if this file is found.
                                              //!< When specifying multiple files, separate them using the ':' character.
        NvU32 isMetro : 1;                    //!< Windows 8 style app
        NvU32 isCommandLine : 1;              //!< Command line parsing for the application name
        NvU32 reserved : 30;                  //!< Reserved. Should be 0.
    } NVDRS_APPLICATION_V3;

    typedef struct _NVDRS_APPLICATION_V4
    {
        NvU32 version;                        //!< Structure Version
        NvU32 isPredefined;                   //!< Is the application userdefined/predefined
        NvAPI_UnicodeString appName;          //!< String name of the Application
        NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application
        NvAPI_UnicodeString launcher;         //!< Indicates the name (if any) of the launcher that starts the Application
        NvAPI_UnicodeString fileInFolder;     //!< Select this application only if this file is found.
                                              //!< When specifying multiple files, separate them using the ':' character.
        NvU32 isMetro : 1;                    //!< Windows 8 style app
        NvU32 isCommandLine : 1;              //!< Command line parsing for the application name
        NvU32 reserved : 30;                  //!< Reserved. Should be 0.
        NvAPI_UnicodeString commandLine;      //!< If isCommandLine is set to 0 this must be an empty. If isCommandLine is set to 1
                                              //!< this contains application's command line as if it was returned by GetCommandLineW.
    } NVDRS_APPLICATION_V4;

#define NVDRS_APPLICATION_VER_V1 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V1, 1)

#define NVDRS_APPLICATION_VER_V2 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V2, 2)

#define NVDRS_APPLICATION_VER_V3 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V3, 3)

#define NVDRS_APPLICATION_VER_V4 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V4, 4)


    typedef NVDRS_APPLICATION_V4 NVDRS_APPLICATION;
#define NVDRS_APPLICATION_VER NVDRS_APPLICATION_VER_V4


    typedef struct _NVDRS_PROFILE_V1
    {
        NvU32 version;                   //!< Structure Version
        NvAPI_UnicodeString profileName; //!< String name of the Profile
        NVDRS_GPU_SUPPORT gpuSupport;    //!< This read-only flag indicates the profile support on either
                                         //!< Quadro, or Geforce, or both.
        NvU32 isPredefined;              //!< Is the Profile user-defined, or predefined
        NvU32 numOfApps;                 //!< Total number of applications that belong to this profile. Read-only
        NvU32 numOfSettings;             //!< Total number of settings applied for this Profile. Read-only
    } NVDRS_PROFILE_V1;

    typedef NVDRS_PROFILE_V1 NVDRS_PROFILE;

//! Macro for constructing the version field of ::NVDRS_PROFILE
#define NVDRS_PROFILE_VER1 MAKE_NVAPI_VERSION(NVDRS_PROFILE_V1, 1)

#define NVDRS_PROFILE_VER NVDRS_PROFILE_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_CreateSession
    //
    //!   DESCRIPTION: This API allocates memory and initializes the session.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [out]  *phSession Return pointer to the session handle.
    //!
    //! \retval ::NVAPI_OK SUCCESS
    //! \retval ::NVAPI_ERROR: For miscellaneous errors.
    //
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_CreateSession(NvDRSSessionHandle *phSession);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_DestroySession
    //
    //!   DESCRIPTION: This API frees the allocation: cleanup of NvDrsSession.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in] hSession Input to the session handle.
    //!
    //! \retval ::NVAPI_OK SUCCESS
    //! \retval ::NVAPI_ERROR For miscellaneous errors.
    //
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_DestroySession(NvDRSSessionHandle hSession);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_LoadSettings
    //
    //!   DESCRIPTION: This API loads and parses the settings data.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in] hSession  Input to the session handle.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_LoadSettings(NvDRSSessionHandle hSession);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_SaveSettings
    //
    //!   DESCRIPTION: This API saves the settings data to the system.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in] hSession  Input to the session handle.
    //!
    //! \retval ::NVAPI_OK    SUCCESS
    //! \retval ::NVAPI_ERROR For miscellaneous errors.
    //
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_SaveSettings(NvDRSSessionHandle hSession);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_LoadSettingsFromFile
    //
    //!   DESCRIPTION: This API loads settings from the given file path.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession Input to the session handle
    //! \param [in]  fileName Binary File Name/Path
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_LoadSettingsFromFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_SaveSettingsToFile
    //
    //!   DESCRIPTION: This API saves settings to the given file path.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession  Input to the session handle.
    //! \param [in]  fileName  Binary File Name/Path
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_SaveSettingsToFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName);

    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_CreateProfile
    //
    //!   DESCRIPTION: This API creates an empty profile.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession        Input to the session handle.
    //! \param [in]  *pProfileInfo   Input pointer to NVDRS_PROFILE.
    //! \param [in]  *phProfile      Returns pointer to profile handle.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_CreateProfile(NvDRSSessionHandle hSession, NVDRS_PROFILE *pProfileInfo, NvDRSProfileHandle *phProfile);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_DeleteProfile
    //
    //!   DESCRIPTION: This API deletes a profile or sets it back to a predefined value.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in] hSession  Input to the session handle.
    //! \param [in] hProfile  Input profile handle.
    //!
    //! \retval ::NVAPI_OK     SUCCESS if the profile is found
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_DeleteProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_SetCurrentGlobalProfile
    //
    //!   DESCRIPTION: This API sets the current global profile in the driver.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in] hSession                Input to the session handle.
    //! \param [in] wszGlobalProfileName    Input current Global profile name.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_SetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvAPI_UnicodeString wszGlobalProfileName);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_GetCurrentGlobalProfile
    //
    //!   DESCRIPTION: This API returns the handle to the current global profile.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]   hSession     Input to the session handle.
    //! \param [out]  *phProfile   Returns current Global profile handle.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_GetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_GetProfileInfo
    //
    //!   DESCRIPTION: This API gets information about the given profile. User needs to specify the name of the Profile.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession       Input to the session handle.
    //! \param [in]  hProfile       Input profile handle.
    //! \param [out] *pProfileInfo  Return the profile info.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_GetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_SetProfileInfo
    //
    //!   DESCRIPTION: Specifies flags for a given profile. Currently only the NVDRS_GPU_SUPPORT is
    //!                used to update the profile. Neither the name, number of settings or applications
    //!                or other profile information can be changed with this function.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession       Input to the session handle.
    //! \param [in]  hProfile       Input profile handle.
    //! \param [in]  *pProfileInfo  Input the new profile info.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_SetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_FindProfileByName
    //
    //!   DESCRIPTION: This API finds a profile in the current session.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]   hSession      Input to the session handle.
    //! \param [in]   profileName   Input profileName.
    //! \param [out]  phProfile     Input profile handle.
    //!
    //! \retval ::NVAPI_OK                SUCCESS if the profile is found
    //! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found
    //! \retval ::NVAPI_ERROR             For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_FindProfileByName(NvDRSSessionHandle hSession, NvAPI_UnicodeString profileName, NvDRSProfileHandle *phProfile);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_EnumProfiles
    //
    //!   DESCRIPTION: This API enumerates through all the profiles in the session.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]   hSession        Input to the session handle.
    //! \param [in]   index           Input the index for enumeration.
    //! \param [out]  *phProfile      Returns profile handle.
    //!
    //!   RETURN STATUS: NVAPI_OK: SUCCESS if the profile is found
    //!                  NVAPI_ERROR: For miscellaneous errors.
    //!                  NVAPI_END_ENUMERATION: index exceeds the total number of available Profiles in DB.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_EnumProfiles(NvDRSSessionHandle hSession, NvU32 index, NvDRSProfileHandle *phProfile);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_GetNumProfiles
    //
    //!   DESCRIPTION: This API obtains the number of profiles in the current session object.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession       Input to the session handle.
    //! \param out]  *numProfiles   Returns count of profiles in the current hSession.
    //!
    //! \retval ::NVAPI_OK                  SUCCESS
    //! \retval ::NVAPI_API_NOT_INTIALIZED  Failed to initialize.
    //! \retval ::NVAPI_INVALID_ARGUMENT    Invalid Arguments.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_GetNumProfiles(NvDRSSessionHandle hSession, NvU32 *numProfiles);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_CreateApplication
    //
    //!   DESCRIPTION: This API adds an executable name to a profile.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession       Input to the session handle.
    //! \param [in]  hProfile       Input profile handle.
    //! \param [in]  *pApplication  Input NVDRS_APPLICATION struct with the executable name to be added.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_CreateApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_APPLICATION *pApplication);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_DeleteApplicationEx
    //
    //!   DESCRIPTION: This API removes an executable from a profile.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]   hSession  - Input to the session handle.
    //! \param [in]   hProfile  - Input profile handle.
    //! \param [in]   *pApp     - Input all the information about the application to be removed.
    //!
    //! \retval ::NVAPI_OK  SUCCESS
    //! \retval ::NVAPI_ERROR For miscellaneous errors.
    //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables,
    //!                                              this error will be returned.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_DeleteApplicationEx(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_APPLICATION *pApp);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_DeleteApplication
    //
    //!   DESCRIPTION: This API removes an executable name from a profile.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSessionPARAMETERS   Input to the session handle.
    //! \param [in]  hProfile             Input profile handle.
    //! \param [in]  appName              Input the executable name to be removed.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables,
    //!                                              this error will be returned
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_DeleteApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_GetApplicationInfo
    //
    //!   DESCRIPTION: This API gets information about the given application.  The input application name
    //!                must match exactly what the Profile has stored for the application.
    //!                This function is better used to retrieve application information from a previous
    //!                enumeration.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]   hSession       Input to the session handle.
    //! \param [in]   hProfile       Input profile handle.
    //! \param [in]   appName        Input application name.
    //! \param [out]  *pApplication  Returns NVDRS_APPLICATION struct with all the attributes.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!          If there are return error codes with specific meaning for this API,
    //!          they are listed below.
    //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS   The application name could not
    //                                                single out only one executable.
    //! \retval ::NVAPI_EXECUTABLE_NOT_FOUND           No application with that name is found on the profile.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_GetApplicationInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName, NVDRS_APPLICATION *pApplication);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_EnumApplications
    //
    //!   DESCRIPTION: This API enumerates all the applications in a given profile from the starting index to the maximum length.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      hSession         Input to the session handle.
    //! \param [in]      hProfile         Input profile handle.
    //! \param [in]      startIndex       Indicates starting index for enumeration.
    //! \param [in,out]  *appCount        Input maximum length of the passed in arrays. Returns the actual length.
    //! \param [out]     *pApplication    Returns NVDRS_APPLICATION struct with all the attributes.
    //!
    //! \retval ::NVAPI_OK               SUCCESS
    //! \retval ::NVAPI_ERROR            For miscellaneous errors.
    //! \retval ::NVAPI_END_ENUMERATION  startIndex exceeds the total appCount.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_EnumApplications(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *appCount, NVDRS_APPLICATION *pApplication);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_FindApplicationByName
    //
    //!   DESCRIPTION: This API searches the application and the associated profile for the given application name.
    //!                If a fully qualified path is provided, this function will always return the profile
    //!                the driver will apply upon running the application (on the path provided).
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      hSession       Input to the hSession handle
    //! \param [in]      appName        Input appName. For best results, provide a fully qualified path of the type
    //!                                 c:/Folder1/Folder2/App.exe
    //! \param [out]     *phProfile     Returns profile handle.
    //! \param [in,out]  *pApplication  Returns NVDRS_APPLICATION struct pointer.
    //!
    //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
    //!                  If there are return error codes with specific meaning for this API,
    //!                  they are listed below:
    //! \retval ::NVAPI_APPLICATION_NOT_FOUND          If App not found
    //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS   If the input appName was not fully qualified, this error might return in the case of multiple matches
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_FindApplicationByName(__in NvDRSSessionHandle hSession, __in NvAPI_UnicodeString appName, __out NvDRSProfileHandle *phProfile, __inout NVDRS_APPLICATION *pApplication);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_SetSetting
    //
    //!   DESCRIPTION: This API adds/modifies a setting to a profile.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession     Input to the session handle.
    //! \param [in]  hProfile     Input profile handle.
    //! \param [in]   *pSetting   Input NVDRS_SETTING struct pointer.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_SetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_SETTING *pSetting);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_GetSetting
    //
    //!   DESCRIPTION: This API gets information about the given setting.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]   hSession   Input to the session handle.
    //! \param [in]   hProfile   Input profile handle.
    //! \param [in]   settingId  Input settingId.
    //! \param [out]  *pSetting  Returns all the setting info
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_GetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId, NVDRS_SETTING *pSetting);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_EnumSettings
    //
    //!   DESCRIPTION: This API enumerates all the settings of a given profile from startIndex to the maximum length.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      hSession        Input to the session handle.
    //! \param [in]      hProfile        Input profile handle.
    //! \param [in]      startIndex      Indicates starting index for enumeration.
    //! \param [in,out]  *settingsCount  Input max length of the passed in arrays, Returns the actual length.
    //! \param [out]     *pSetting       Returns all the settings info.
    //!
    //! \retval ::NVAPI_OK              SUCCESS
    //! \retval ::NVAPI_ERROR           For miscellaneous errors.
    //! \retval ::NVAPI_END_ENUMERATION startIndex exceeds the total appCount.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_EnumSettings(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *settingsCount, NVDRS_SETTING *pSetting);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingIds
    //
    //!   DESCRIPTION: This API enumerates all the Ids of all the settings recognized by NVAPI.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [out]    pSettingIds     User-provided array of length *pMaxCount that NVAPI will fill with IDs.
    //! \param [in,out] pMaxCount       Input max length of the passed in array, Returns the actual length.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!                  NVAPI_END_ENUMERATION: the provided pMaxCount is not enough to hold all settingIds.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingIds(NvU32 *pSettingIds, NvU32 *pMaxCount);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingValues
    //
    //!   DESCRIPTION: This API enumerates all available setting values for a given setting.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]      settingId          Input settingId.
    //! \param [in,out]  pMaxNumValues      Input max length of the passed in arrays, Returns the actual length.
    //! \param [out]     *pSettingValues    Returns all available setting values and its count.
    //!
    //! \retval ::NVAPI_OK     SUCCESS
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingValues(NvU32 settingId, NvU32 *pMaxNumValues, NVDRS_SETTING_VALUES *pSettingValues);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_GetSettingIdFromName
    //
    //!   DESCRIPTION: This API gets the binary ID of a setting given the setting name.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]   settingName  Input Unicode settingName.
    //! \param [out]  *pSettingId  Returns corresponding settingId.
    //!
    //! \retval ::NVAPI_OK                 SUCCESS if the profile is found
    //! \retval ::NVAPI_PROFILE_NOT_FOUND  if profile is not found
    //! \retval ::NVAPI_SETTING_NOT_FOUND  if setting is not found
    //! \retval ::NVAPI_ERROR              For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_GetSettingIdFromName(NvAPI_UnicodeString settingName, NvU32 *pSettingId);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_GetSettingNameFromId
    //
    //!   DESCRIPTION: This API gets the setting name given the binary ID.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  settingId        Input settingId.
    //! \param [in]  *pSettingName    Returns corresponding Unicode settingName.
    //!
    //! \retval ::NVAPI_OK                 SUCCESS if the profile is found
    //! \retval ::NVAPI_PROFILE_NOT_FOUND  if profile is not found
    //! \retval ::NVAPI_SETTING_NOT_FOUND  if setting is not found
    //! \retval ::NVAPI_ERROR              For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_GetSettingNameFromId(NvU32 settingId, NvAPI_UnicodeString *pSettingName);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_DeleteProfileSetting
    //
    //!   DESCRIPTION: This API deletes a setting or sets it back to predefined value.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession            Input to the session handle.
    //! \param [in]  hProfile            Input profile handle.
    //! \param [in]  settingId           Input settingId to be deleted.
    //!
    //! \retval ::NVAPI_OK     SUCCESS if the profile is found
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_DeleteProfileSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_RestoreAllDefaults
    //
    //!   DESCRIPTION: This API restores the whole system to predefined(default) values.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession  Input to the session handle.
    //!
    //! \retval ::NVAPI_OK     SUCCESS if the profile is found
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_RestoreAllDefaults(NvDRSSessionHandle hSession);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_RestoreProfileDefault
    //
    //!   DESCRIPTION: This API restores the given profile to predefined(default) values.
    //!                Any and all user specified modifications will be removed.
    //!                If the whole profile was set by the user, the profile will be removed.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession  Input to the session handle.
    //! \param [in]  hProfile  Input profile handle.
    //!
    //! \retval ::NVAPI_OK              SUCCESS if the profile is found
    //! \retval ::NVAPI_ERROR           For miscellaneous errors.
    //! \retval ::NVAPI_PROFILE_REMOVED SUCCESS, and the hProfile is no longer valid.
    //! \retval ::NVAPI_ERROR           For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefault(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_RestoreProfileDefaultSetting
    //
    //!   DESCRIPTION: This API restores the given profile setting to predefined(default) values.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession  Input to the session handle.
    //! \param [in]  hProfile  Input profile handle.
    //! \param [in]  settingId Input settingId.
    //!
    //! \retval ::NVAPI_OK     SUCCESS if the profile is found
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefaultSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId);

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_DRS_GetBaseProfile
    //
    //!   DESCRIPTION: Returns the handle to the current global profile.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]  hSession    Input to the session handle.
    //! \param [in]  *phProfile   Returns Base profile handle.
    //!
    //! \retval ::NVAPI_OK     SUCCESS if the profile is found
    //! \retval ::NVAPI_ERROR  For miscellaneous errors.
    //!
    //! \ingroup drsapi
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_DRS_GetBaseProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile);

    //! \addtogroup sysgeneral
    //! @{

    typedef struct
    {
        NvU32 version;                        //!< structure version
        NvU32 vendorId;                       //!< Chipset vendor identification
        NvU32 deviceId;                       //!< Chipset device identification
        NvAPI_ShortString szVendorName;       //!< Chipset vendor Name
        NvAPI_ShortString szChipsetName;      //!< Chipset device Name
        NvU32 flags;                          //!< Chipset info flags - obsolete
        NvU32 subSysVendorId;                 //!< Chipset subsystem vendor identification
        NvU32 subSysDeviceId;                 //!< Chipset subsystem device identification
        NvAPI_ShortString szSubSysVendorName; //!< subsystem vendor Name
        NvU32 HBvendorId;                     //!< Host bridge vendor identification
        NvU32 HBdeviceId;                     //!< Host bridge device identification
        NvU32 HBsubSysVendorId;               //!< Host bridge subsystem vendor identification
        NvU32 HBsubSysDeviceId;               //!< Host bridge subsystem device identification

    } NV_CHIPSET_INFO_v4;

    typedef struct
    {
        NvU32 version;                        //!< structure version
        NvU32 vendorId;                       //!< vendor ID
        NvU32 deviceId;                       //!< device ID
        NvAPI_ShortString szVendorName;       //!< vendor Name
        NvAPI_ShortString szChipsetName;      //!< device Name
        NvU32 flags;                          //!< Chipset info flags - obsolete
        NvU32 subSysVendorId;                 //!< subsystem vendor ID
        NvU32 subSysDeviceId;                 //!< subsystem device ID
        NvAPI_ShortString szSubSysVendorName; //!< subsystem vendor Name
    } NV_CHIPSET_INFO_v3;

    typedef enum
    {
        NV_CHIPSET_INFO_HYBRID = 0x00000001,
    } NV_CHIPSET_INFO_FLAGS;

    typedef struct
    {
        NvU32 version;                   //!< structure version
        NvU32 vendorId;                  //!< vendor ID
        NvU32 deviceId;                  //!< device ID
        NvAPI_ShortString szVendorName;  //!< vendor Name
        NvAPI_ShortString szChipsetName; //!< device Name
        NvU32 flags;                     //!< Chipset info flags
    } NV_CHIPSET_INFO_v2;

    typedef struct
    {
        NvU32 version;                   // structure version
        NvU32 vendorId;                  // vendor ID
        NvU32 deviceId;                  // device ID
        NvAPI_ShortString szVendorName;  // vendor Name
        NvAPI_ShortString szChipsetName; // device Name
    } NV_CHIPSET_INFO_v1;

#define NV_CHIPSET_INFO_VER_1 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v1, 1)

#define NV_CHIPSET_INFO_VER_2 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v2, 2)

#define NV_CHIPSET_INFO_VER_3 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v3, 3)

#define NV_CHIPSET_INFO_VER_4 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v4, 4)


#define NV_CHIPSET_INFO NV_CHIPSET_INFO_v4

#define NV_CHIPSET_INFO_VER NV_CHIPSET_INFO_VER_4


    //! @}

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_SYS_GetChipSetInfo
    //
    //!  This function returns information about the system's chipset.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 95
    //!
    //! \retval  NVAPI_INVALID_ARGUMENT              pChipSetInfo is NULL.
    //! \retval  NVAPI_OK                           *pChipSetInfo is now set.
    //! \retval  NVAPI_INCOMPATIBLE_STRUCT_VERSION   NV_CHIPSET_INFO version not compatible with driver.
    //! \ingroup sysgeneral
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_SYS_GetChipSetInfo(NV_CHIPSET_INFO *pChipSetInfo);

    //! \ingroup sysgeneral
    //! Lid and dock information - used in NvAPI_GetLidDockInfo()
    typedef struct
    {
        NvU32 version; //! Structure version, constructed from the macro #NV_LID_DOCK_PARAMS_VER
        NvU32 currentLidState;
        NvU32 currentDockState;
        NvU32 currentLidPolicy;
        NvU32 currentDockPolicy;
        NvU32 forcedLidMechanismPresent;
        NvU32 forcedDockMechanismPresent;
    } NV_LID_DOCK_PARAMS;

//! ingroup sysgeneral
#define NV_LID_DOCK_PARAMS_VER MAKE_NVAPI_VERSION(NV_LID_DOCK_PARAMS, 1)

    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GetLidDockInfo
    //
    //! DESCRIPTION: This function returns the current lid and dock information.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 177
    //!
    //! \retval ::NVAPI_OK
    //! \retval ::NVAPI_ERROR
    //! \retval ::NVAPI_NOT_SUPPORTED
    //! \retval ::NVAPI_HANDLE_INVALIDATED
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //!
    //! \ingroup sysgeneral
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_SYS_GetLidAndDockInfo(NV_LID_DOCK_PARAMS *pLidAndDock);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_SYS_GetDisplayIdFromGpuAndOutputId
    //
    //! DESCRIPTION:     This API converts a Physical GPU handle and output ID to a
    //!                  display ID.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     hPhysicalGpu   Handle to the physical GPU
    //! \param [in]     outputId       Connected display output ID on the
    //!                                target GPU - must only have one bit set
    //! \param [out]    displayId      Pointer to an NvU32 which contains
    //!                                 the display ID
    //!
    //! \retval  ::NVAPI_OK - completed request
    //! \retval  ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
    //! \retval  ::NVAPI_ERROR - miscellaneous error occurred
    //! \retval  ::NVAPI_INVALID_ARGUMENT - Invalid input parameter.
    //!
    //! \ingroup sysgeneral
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_SYS_GetDisplayIdFromGpuAndOutputId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NvU32 *displayId);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_SYS_GetGpuAndOutputIdFromDisplayId
    //
    //! DESCRIPTION:     This API converts a display ID to a Physical GPU handle and output ID.
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \param [in]     displayId       Display ID of display to retrieve
    //!                                 GPU and outputId for
    //! \param [out]    hPhysicalGpu    Handle to the physical GPU
    //! \param [out]    outputId )      Connected display output ID on the
    //!                                 target GPU will only have one bit set.
    //!
    //! \retval ::NVAPI_OK
    //! \retval ::NVAPI_API_NOT_INTIALIZED
    //! \retval ::NVAPI_ID_OUT_OF_RANGE    The DisplayId corresponds to a
    //!                                    display which is not within the
    //!                                    normal outputId range.
    //! \retval ::NVAPI_ERROR
    //! \retval ::NVAPI_INVALID_ARGUMENT
    //!
    //! \ingroup sysgeneral
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_SYS_GetGpuAndOutputIdFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu, NvU32 *outputId);

    ///////////////////////////////////////////////////////////////////////////////
    // FUNCTION NAME:   NvAPI_SYS_GetPhysicalGpuFromDisplayId
    //
    //! \code
    //! DESCRIPTION:     This API retrieves the Physical GPU handle of the connected display
    //!
    //! \since Release: 313
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! PARAMETERS:      displayId(IN)     - Display ID of display to retrieve
    //!                                      GPU handle
    //!                  hPhysicalGpu(OUT) - Handle to the physical GPU
    //!
    //! RETURN STATUS:
    //!                  NVAPI_OK - completed request
    //!                  NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
    //!                  NVAPI_ERROR - miscellaneous error occurred
    //!                  NVAPI_INVALID_ARGUMENT - Invalid input parameter.
    //! \endcode
    //! \ingroup sysgeneral
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_SYS_GetPhysicalGpuFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu);

    typedef struct _NV_DISPLAY_DRIVER_INFO
    {
        NvU32 version;                                 //!< Structure Version.
        NvU32 driverVersion;                           //!< Contains the driver version after successful return.
        NvAPI_ShortString szBuildBranch;               //!< Contains the driver-branch string after successful return.
        NvU32 bIsDCHDriver : 1;                        //!< Contains the driver DCH status after successful return.
                                                       //!< Value of 1 means that this is DCH driver.
                                                       //!< Value of 0 means that this is not a DCH driver (NVAPI may be unable to query the DCH status of the driver due to some registry API errors, in that case the API will return with NVAPI_ERROR)
        NvU32 bIsNVIDIAStudioPackage : 1;              //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Studio Driver package.
                                                       //!< Value of 1 means that this driver is from the NVIDIA Studio Driver package.
        NvU32 bIsNVIDIAGameReadyPackage : 1;           //!< On successful return, this field provides information about whether the installed driver is from an NVIDIA Game Ready Driver package.
                                                       //!< Value of 1 means that this driver is from the NVIDIA Game Ready Driver package.
        NvU32 bIsNVIDIARTXProductionBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX Enterprise Production Branch which offers ISV certifications, long life-cycle support, regular security updates, and access to the same functionality as corresponding NVIDIA Studio Driver Packages (i.e., of the same driver version number).
                                                       //!< Value of 1 means that this driver is from the NVIDIA RTX Enterprise Production Branch package.
        NvU32 bIsNVIDIARTXNewFeatureBranchPackage : 1; //!< On successful return, this field confirms whether the installed driver package is from an NVIDIA RTX New Feature Branch.
                                                       //!< This driver typically gives access to new features, bug fixes, new operating system support, and other driver enhancements offered between NVIDIA RTX Enterprise Production Branch releases. Support duration for NVIDIA RTX New Feature Branches is shorter than that for NVIDIA RTX Enterprise Production Branches.
                                                       //!< Value of 1 means that this driver is from the NVIDIA RTX New Feature Branch package.
        NvU32 reserved : 27;                           //!< Reserved for future use.
    } NV_DISPLAY_DRIVER_INFO_V1;

#define NV_DISPLAY_DRIVER_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_INFO_V1, 1)

    typedef NV_DISPLAY_DRIVER_INFO_V1 NV_DISPLAY_DRIVER_INFO;
#define NV_DISPLAY_DRIVER_INFO_VER NV_DISPLAY_DRIVER_INFO_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_SYS_GetDisplayDriverInfo
    //
    //! DESCRIPTION: This API will return information related to the NVIDIA Display Driver.
    //!              Note that out of the driver types - Studio, Game Ready, RTX Production Branch, RTX New Feature Branch - only one driver type can be available in system.
    //!              If NVAPI is unable to get the information of particular driver type, we report all flags as 0 (Unknown).
    //!
    //! SUPPORTED OS:  Windows 7 and higher
    //!
    //!
    //! \since Release: 396
    //!
    //! \param [inout] pDriverInfo - This structure will be filled with required information.
    //!
    //! \return  This API can return any of the error codes enumerated in
    //!          #NvAPI_Status.  If there are return error codes with specific
    //!          meaning for this API, they are listed below.
    //!
    //! \ingroup gpu
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_SYS_GetDisplayDriverInfo(__inout NV_DISPLAY_DRIVER_INFO *pDriverInfo);

    /*!
     * Callback settings common to all client callbacks.
     */
    typedef struct _NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1
    {
        /*!
         * [in] Generic callback parameter which will be passed to the callback.
         */
        void *pCallbackParam;

        /*!
         * Reserved bytes for future expansion.
         */
        NvU8 rsvd[64];
    } NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1;

    typedef NV_CLIENT_CALLBACK_SETTINGS_SUPER_V1 NV_GPU_CLIENT_CALLBACK_SETTINGS_SUPER_V1;

    /*!
     * Callback settings common to all periodic client callbacks.
     */
    typedef struct _NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1
    {
        /*!
         * [in] Super class data.
         */
        NV_GPU_CLIENT_CALLBACK_SETTINGS_SUPER_V1 super;

        /*!
         * [in] Minimum interval at which callback will be called.
         *
         * The callback may be invoked slower than this interval if underlying
         * sampling rate does not align precisely to the provided period.
         */
        NvU32 callbackPeriodms;

        /*!
         * Reserved bytes for future expansion.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1;

    /*!
     * Callback data common to all client callbacks.
     */
    typedef struct _NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1
    {
        /*!
         * [out] Generic callback parameter which was passed in at registration time.
         */
        void *pCallbackParam;

        /*!
         * Reserved bytes for future expansion.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1;

    /*!
     * Enumeration of different utilization domains
     */
    typedef enum _NV_GPU_CLIENT_UTIL_DOMAIN_ID
    {
        NV_GPU_CLIENT_UTIL_DOMAIN_GRAPHICS = 0,
        NV_GPU_CLIENT_UTIL_DOMAIN_FRAME_BUFFER = 1,
        NV_GPU_CLIENT_UTIL_DOMAIN_VIDEO = 2,
        /*!
         * Reserved for future use.
         */
        NV_GPU_CLIENT_UTIL_DOMAIN_RSVD = 3,
    } NV_GPU_CLIENT_UTIL_DOMAIN_ID;

#define NV_GPU_CLIENT_UTIL_DOMAINS_MAX_V1 (4)


    /*!
     * Data specific to a single utilization domain.
     */
    typedef struct _NV_GPU_CLIENT_UTILIZATION_DATA_V1
    {
        /*!
         * [out] Utilization domain identifier.
         */
        NV_GPU_CLIENT_UTIL_DOMAIN_ID utilId;

        /*!
         * [out] Percentage of time where the domain is considered busy since the
         * last sample. Units of percent*100; i.e. 5000 = 50%.
         */
        NvU32 utilizationPercent;

        /*!
         * Reserved bytes for future expansion.
         */
        NvU8 rsvd[61];
    } NV_GPU_CLIENT_UTILIZATION_DATA_V1;

    /*!
     * Data passed back to callback registered with
     * @ref NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates.
     */
    typedef struct _NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1
    {
        /*!
         * [out] Super struct.
         */
        NV_GPU_CLIENT_CALLBACK_DATA_SUPER_V1 super;

        /*!
         * [out] Number of valid entries in `utils` array.
         */
        NvU32 numUtils;

        /*!
         * [out] Time at which data was collected. Represented as elapsed
         * microseconds since 00:00:00 UTC on January 1, 1970.
         */
        NvU64 timestamp;

        /*!
         * Reserved bytes for future expansion.
         */
        NvU8 rsvd[64];

        /*!
         * [out] Status data for each utilization domain.
         */
        NV_GPU_CLIENT_UTILIZATION_DATA_V1 utils[NV_GPU_CLIENT_UTIL_DOMAINS_MAX_V1];
    } NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1;

    /*!
     * Function prototype for a periodic utilization data callback that will be registered with NvAPI.
     */
    typedef void(__cdecl *NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_V1)(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_CLIENT_CALLBACK_UTILIZATION_DATA_V1 *pData);

    /*!
     * Data required to register a periodic callback for utilization data.
     */
    typedef struct _NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1
    {
        /*!
         * [in] Structure Version, must always be first.
         */
        NvU32 version;

        /*!
         * [in] Generic callback settings. Some data within will be passed to the
         * callback when invoked.
         */
        NV_GPU_CLIENT_PERIODIC_CALLBACK_SETTINGS_SUPER_V1 super;

        /*!
         * [in] Callback. Pass in NULL or nullptr to indicate request to unregister.
         */
        NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_V1 callback;

        /*!
         * Reserved bytes for future expansion.
         */
        NvU8 rsvd[64];
    } NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1;

#define NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_VER1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1, 1)

    typedef NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_V1 NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS;
#define NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_VER NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS_VER1


    ///////////////////////////////////////////////////////////////////////////////
    //
    // FUNCTION NAME: NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates
    //
    //! \fn NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates()
    //! \code
    //!   DESCRIPTION: Register to receive samples of utilization data periodically
    //!                via a function pointer callback.
    //!
    //! SUPPORTED OS:  Windows 10 and higher
    //!
    //!
    //! \since Release 455
    //!
    //! \return        NVAPI_OK                          - Registration was successful
    //!                NVAPI_API_NOT_INITIALIZED         - NVAPI not initialized
    //!                NVAPI_INCOMPATIBLE_STRUCT_VERSION - Invalid structure version specified
    //!                NVAPI_INVALID_CONFIGURATION       - Invalid software environment configuration
    //!                NVAPI_TIMEOUT                     - Registration request timed out
    //!                NVAPI_ERROR                       - Unknown underlying error
    //!
    //! \endcode
    //! \ingroup nvtopps
    ///////////////////////////////////////////////////////////////////////////////
    NVAPI_INTERFACE NvAPI_GPU_ClientRegisterForUtilizationSampleUpdates(__in NvPhysicalGpuHandle hPhysicalGpu, __in NV_GPU_CLIENT_UTILIZATION_PERIODIC_CALLBACK_SETTINGS *pCallbackSettings);

#ifdef __cplusplus
}; // extern "C" {

#endif

#pragma pack(pop)

#endif // _NVAPI_H

#include "nvapi_lite_salend.h"