一款显示网速、系统利用的软件
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724
  1. #include"nvapi_lite_salstart.h"
  2. #include"nvapi_lite_common.h"
  3. #include"nvapi_lite_sli.h"
  4. #include"nvapi_lite_surround.h"
  5. #include"nvapi_lite_stereo.h"
  6. #include"nvapi_lite_d3dext.h"
  7. /************************************************************************************************************************************\
  8. |* *|
  9. |* Copyright © 2012 NVIDIA Corporation. All rights reserved. *|
  10. |* *|
  11. |* NOTICE TO USER: *|
  12. |* *|
  13. |* This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws. *|
  14. |* *|
  15. |* This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA *|
  16. |* and are being provided solely under the terms and conditions of an NVIDIA software license agreement. *|
  17. |* Otherwise, you have no rights to use or access this software in any manner. *|
  18. |* *|
  19. |* If not covered by the applicable NVIDIA software license agreement: *|
  20. |* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. *|
  21. |* IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. *|
  22. |* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *|
  23. |* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. *|
  24. |* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, *|
  25. |* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, *|
  26. |* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. *|
  27. |* *|
  28. |* U.S. Government End Users. *|
  29. |* This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
  30. |* consisting of "commercial computer software" and "commercial computer software documentation" *|
  31. |* 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. *|
  32. |* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
  33. |* all U.S. Government End Users acquire the software with only those rights set forth herein. *|
  34. |* *|
  35. |* Any use of this software in individual and commercial software must include, *|
  36. |* in the user documentation and internal comments to the code, *|
  37. |* the above Disclaimer (as applicable) and U.S. Government End Users Notice. *|
  38. |* *|
  39. \************************************************************************************************************************************/
  40. ///////////////////////////////////////////////////////////////////////////////
  41. //
  42. // Date: Nov 15, 2019
  43. // File: nvapi.h
  44. //
  45. // NvAPI provides an interface to NVIDIA devices. This file contains the
  46. // interface constants, structure definitions and function prototypes.
  47. //
  48. // Target Profile: developer
  49. // Target Platform: windows
  50. //
  51. ///////////////////////////////////////////////////////////////////////////////
  52. #ifndef _NVAPI_H
  53. #define _NVAPI_H
  54. #pragma pack(push,8) // Make sure we have consistent structure packings
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58. // ====================================================
  59. // Universal NvAPI Definitions
  60. // ====================================================
  61. #ifndef _WIN32
  62. #define __cdecl
  63. #endif
  64. //! @}
  65. //! \ingroup nvapistatus
  66. #define NVAPI_API_NOT_INTIALIZED NVAPI_API_NOT_INITIALIZED //!< Fix typo in error code
  67. ///////////////////////////////////////////////////////////////////////////////
  68. //
  69. // FUNCTION NAME: NvAPI_Initialize
  70. //
  71. //! This function initializes the NvAPI library (if not already initialized) but always increments the ref-counter.
  72. //! This must be called before calling other NvAPI_ functions.
  73. //! Note: It is now mandatory to call NvAPI_Initialize before calling any other NvAPI.
  74. //! NvAPI_Unload should be called to unload the NVAPI Library.
  75. //!
  76. //! SUPPORTED OS: Windows 7 and higher
  77. //!
  78. //!
  79. //! \since Release: 80
  80. //!
  81. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  82. //! specific meaning for this API, they are listed below.
  83. //! \retval NVAPI_LIBRARY_NOT_FOUND Failed to load the NVAPI support library
  84. //! \sa nvapistatus
  85. //! \ingroup nvapifunctions
  86. ///////////////////////////////////////////////////////////////////////////////
  87. NVAPI_INTERFACE NvAPI_Initialize();
  88. ///////////////////////////////////////////////////////////////////////////////
  89. //
  90. // FUNCTION NAME: NvAPI_Unload
  91. //
  92. //! DESCRIPTION: Decrements the ref-counter and when it reaches ZERO, unloads NVAPI library.
  93. //! This must be called in pairs with NvAPI_Initialize.
  94. //!
  95. //! SUPPORTED OS: Windows 7 and higher
  96. //!
  97. //!
  98. //! If the client wants unload functionality, it is recommended to always call NvAPI_Initialize and NvAPI_Unload in pairs.
  99. //!
  100. //! Unloading NvAPI library is not supported when the library is in a resource locked state.
  101. //! Some functions in the NvAPI library initiates an operation or allocates certain resources
  102. //! and there are corresponding functions available, to complete the operation or free the
  103. //! allocated resources. All such function pairs are designed to prevent unloading NvAPI library.
  104. //!
  105. //! For example, if NvAPI_Unload is called after NvAPI_XXX which locks a resource, it fails with
  106. //! NVAPI_ERROR. Developers need to call the corresponding NvAPI_YYY to unlock the resources,
  107. //! before calling NvAPI_Unload again.
  108. //!
  109. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  110. //! specific meaning for this API, they are listed below.
  111. //! \retval NVAPI_API_IN_USE Atleast an API is still being called hence cannot unload requested driver.
  112. //!
  113. //! \ingroup nvapifunctions
  114. ///////////////////////////////////////////////////////////////////////////////
  115. NVAPI_INTERFACE NvAPI_Unload();
  116. ///////////////////////////////////////////////////////////////////////////////
  117. //
  118. // FUNCTION NAME: NvAPI_GetErrorMessage
  119. //
  120. //! This function converts an NvAPI error code into a null terminated string.
  121. //!
  122. //! SUPPORTED OS: Windows 7 and higher
  123. //!
  124. //!
  125. //! \since Release: 80
  126. //!
  127. //! \param nr The error code to convert
  128. //! \param szDesc The string corresponding to the error code
  129. //!
  130. //! \return NULL terminated string (always, never NULL)
  131. //! \ingroup nvapifunctions
  132. ///////////////////////////////////////////////////////////////////////////////
  133. NVAPI_INTERFACE NvAPI_GetErrorMessage(NvAPI_Status nr,NvAPI_ShortString szDesc);
  134. ///////////////////////////////////////////////////////////////////////////////
  135. //
  136. // FUNCTION NAME: NvAPI_GetInterfaceVersionString
  137. //
  138. //! This function returns a string describing the version of the NvAPI library.
  139. //! The contents of the string are human readable. Do not assume a fixed
  140. //! format.
  141. //!
  142. //!
  143. //! SUPPORTED OS: Windows 7 and higher
  144. //!
  145. //!
  146. //! \since Release: 80
  147. //!
  148. //! \param szDesc User readable string giving NvAPI version information
  149. //!
  150. //! \return See \ref nvapistatus for the list of possible return values.
  151. //! \ingroup nvapifunctions
  152. ///////////////////////////////////////////////////////////////////////////////
  153. NVAPI_INTERFACE NvAPI_GetInterfaceVersionString(NvAPI_ShortString szDesc);
  154. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  155. // All display port related data types definition starts
  156. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  157. // This category is intentionally added before the #ifdef. The #endif should also be in the same scope
  158. #ifndef DISPLAYPORT_STRUCTS_DEFINED
  159. #define DISPLAYPORT_STRUCTS_DEFINED
  160. //! \ingroup dispcontrol
  161. //! Used in NV_DISPLAY_PORT_INFO.
  162. typedef enum _NV_DP_LINK_RATE
  163. {
  164. NV_DP_1_62GBPS = 6,
  165. NV_DP_2_70GBPS = 0xA,
  166. NV_DP_5_40GBPS = 0x14,
  167. NV_DP_8_10GBPS = 0x1E
  168. } NV_DP_LINK_RATE;
  169. //! \ingroup dispcontrol
  170. //! Used in NV_DISPLAY_PORT_INFO.
  171. typedef enum _NV_DP_LANE_COUNT
  172. {
  173. NV_DP_1_LANE = 1,
  174. NV_DP_2_LANE = 2,
  175. NV_DP_4_LANE = 4,
  176. } NV_DP_LANE_COUNT;
  177. //! \ingroup dispcontrol
  178. //! Used in NV_DISPLAY_PORT_INFO.
  179. typedef enum _NV_DP_COLOR_FORMAT
  180. {
  181. NV_DP_COLOR_FORMAT_RGB = 0,
  182. NV_DP_COLOR_FORMAT_YCbCr422,
  183. NV_DP_COLOR_FORMAT_YCbCr444,
  184. } NV_DP_COLOR_FORMAT;
  185. //! \ingroup dispcontrol
  186. //! Used in NV_DISPLAY_PORT_INFO.
  187. typedef enum _NV_DP_COLORIMETRY
  188. {
  189. NV_DP_COLORIMETRY_RGB = 0,
  190. NV_DP_COLORIMETRY_YCbCr_ITU601,
  191. NV_DP_COLORIMETRY_YCbCr_ITU709,
  192. } NV_DP_COLORIMETRY;
  193. //! \ingroup dispcontrol
  194. //! Used in NV_DISPLAY_PORT_INFO.
  195. typedef enum _NV_DP_DYNAMIC_RANGE
  196. {
  197. NV_DP_DYNAMIC_RANGE_VESA = 0,
  198. NV_DP_DYNAMIC_RANGE_CEA,
  199. } NV_DP_DYNAMIC_RANGE;
  200. //! \ingroup dispcontrol
  201. //! Used in NV_DISPLAY_PORT_INFO.
  202. typedef enum _NV_DP_BPC
  203. {
  204. NV_DP_BPC_DEFAULT = 0,
  205. NV_DP_BPC_6,
  206. NV_DP_BPC_8,
  207. NV_DP_BPC_10,
  208. NV_DP_BPC_12,
  209. NV_DP_BPC_16,
  210. } NV_DP_BPC;
  211. #endif //#ifndef DISPLAYPORT_STRUCTS_DEFINED
  212. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  213. // All display port related data types definitions end
  214. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  215. ///////////////////////////////////////////////////////////////////////////////
  216. //
  217. // FUNCTION NAME: NvAPI_GPU_GetEDID
  218. //
  219. //! \fn NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID)
  220. //! This function returns the EDID data for the specified GPU handle and connection bit mask.
  221. //! displayOutputId should have exactly 1 bit set to indicate a single display. See \ref handles.
  222. //!
  223. //! SUPPORTED OS: Windows 7 and higher
  224. //!
  225. //!
  226. //! \since Release: 85
  227. //!
  228. //! \retval NVAPI_INVALID_ARGUMENT pEDID is NULL; displayOutputId has 0 or > 1 bits set
  229. //! \retval NVAPI_OK *pEDID contains valid data.
  230. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  231. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  232. //! \retval NVAPI_DATA_NOT_FOUND The requested display does not contain an EDID.
  233. //
  234. ///////////////////////////////////////////////////////////////////////////////
  235. //! \ingroup gpu
  236. //! @{
  237. #define NV_EDID_V1_DATA_SIZE 256
  238. #define NV_EDID_DATA_SIZE NV_EDID_V1_DATA_SIZE
  239. typedef struct
  240. {
  241. NvU32 version; //structure version
  242. NvU8 EDID_Data[NV_EDID_DATA_SIZE];
  243. } NV_EDID_V1;
  244. //! Used in NvAPI_GPU_GetEDID()
  245. typedef struct
  246. {
  247. NvU32 version; //!< Structure version
  248. NvU8 EDID_Data[NV_EDID_DATA_SIZE];
  249. NvU32 sizeofEDID;
  250. } NV_EDID_V2;
  251. //! Used in NvAPI_GPU_GetEDID()
  252. typedef struct
  253. {
  254. NvU32 version; //!< Structure version
  255. NvU8 EDID_Data[NV_EDID_DATA_SIZE];
  256. NvU32 sizeofEDID;
  257. NvU32 edidId; //!< ID which always returned in a monotonically increasing counter.
  258. //!< Across a split-EDID read we need to verify that all calls returned the same edidId.
  259. //!< This counter is incremented if we get the updated EDID.
  260. NvU32 offset; //!< Which 256-byte page of the EDID we want to read. Start at 0.
  261. //!< If the read succeeds with edidSize > NV_EDID_DATA_SIZE,
  262. //!< call back again with offset+256 until we have read the entire buffer
  263. } NV_EDID_V3;
  264. typedef NV_EDID_V3 NV_EDID;
  265. #define NV_EDID_VER1 MAKE_NVAPI_VERSION(NV_EDID_V1,1)
  266. #define NV_EDID_VER2 MAKE_NVAPI_VERSION(NV_EDID_V2,2)
  267. #define NV_EDID_VER3 MAKE_NVAPI_VERSION(NV_EDID_V3,3)
  268. #define NV_EDID_VER NV_EDID_VER3
  269. //! @}
  270. //! \ingroup gpu
  271. NVAPI_INTERFACE NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID);
  272. //! \ingroup gpu
  273. //! Used in NV_GPU_CONNECTOR_DATA
  274. typedef enum _NV_GPU_CONNECTOR_TYPE
  275. {
  276. NVAPI_GPU_CONNECTOR_VGA_15_PIN = 0x00000000,
  277. NVAPI_GPU_CONNECTOR_TV_COMPOSITE = 0x00000010,
  278. NVAPI_GPU_CONNECTOR_TV_SVIDEO = 0x00000011,
  279. NVAPI_GPU_CONNECTOR_TV_HDTV_COMPONENT = 0x00000013,
  280. NVAPI_GPU_CONNECTOR_TV_SCART = 0x00000014,
  281. NVAPI_GPU_CONNECTOR_TV_COMPOSITE_SCART_ON_EIAJ4120 = 0x00000016,
  282. NVAPI_GPU_CONNECTOR_TV_HDTV_EIAJ4120 = 0x00000017,
  283. NVAPI_GPU_CONNECTOR_PC_POD_HDTV_YPRPB = 0x00000018,
  284. NVAPI_GPU_CONNECTOR_PC_POD_SVIDEO = 0x00000019,
  285. NVAPI_GPU_CONNECTOR_PC_POD_COMPOSITE = 0x0000001A,
  286. NVAPI_GPU_CONNECTOR_DVI_I_TV_SVIDEO = 0x00000020,
  287. NVAPI_GPU_CONNECTOR_DVI_I_TV_COMPOSITE = 0x00000021,
  288. NVAPI_GPU_CONNECTOR_DVI_I = 0x00000030,
  289. NVAPI_GPU_CONNECTOR_DVI_D = 0x00000031,
  290. NVAPI_GPU_CONNECTOR_ADC = 0x00000032,
  291. NVAPI_GPU_CONNECTOR_LFH_DVI_I_1 = 0x00000038,
  292. NVAPI_GPU_CONNECTOR_LFH_DVI_I_2 = 0x00000039,
  293. NVAPI_GPU_CONNECTOR_SPWG = 0x00000040,
  294. NVAPI_GPU_CONNECTOR_OEM = 0x00000041,
  295. NVAPI_GPU_CONNECTOR_DISPLAYPORT_EXTERNAL = 0x00000046,
  296. NVAPI_GPU_CONNECTOR_DISPLAYPORT_INTERNAL = 0x00000047,
  297. NVAPI_GPU_CONNECTOR_DISPLAYPORT_MINI_EXT = 0x00000048,
  298. NVAPI_GPU_CONNECTOR_HDMI_A = 0x00000061,
  299. NVAPI_GPU_CONNECTOR_HDMI_C_MINI = 0x00000063,
  300. NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_1 = 0x00000064,
  301. NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_2 = 0x00000065,
  302. NVAPI_GPU_CONNECTOR_VIRTUAL_WFD = 0x00000070,
  303. NVAPI_GPU_CONNECTOR_USB_C = 0x00000071,
  304. NVAPI_GPU_CONNECTOR_UNKNOWN = 0xFFFFFFFF,
  305. } NV_GPU_CONNECTOR_TYPE;
  306. ////////////////////////////////////////////////////////////////////////////////
  307. //
  308. // NvAPI_TVOutput Information
  309. //
  310. ///////////////////////////////////////////////////////////////////////////////
  311. //! \ingroup tvapi
  312. //! Used in NV_DISPLAY_TV_OUTPUT_INFO
  313. typedef enum _NV_DISPLAY_TV_FORMAT
  314. {
  315. NV_DISPLAY_TV_FORMAT_NONE = 0,
  316. NV_DISPLAY_TV_FORMAT_SD_NTSCM = 0x00000001,
  317. NV_DISPLAY_TV_FORMAT_SD_NTSCJ = 0x00000002,
  318. NV_DISPLAY_TV_FORMAT_SD_PALM = 0x00000004,
  319. NV_DISPLAY_TV_FORMAT_SD_PALBDGH = 0x00000008,
  320. NV_DISPLAY_TV_FORMAT_SD_PALN = 0x00000010,
  321. NV_DISPLAY_TV_FORMAT_SD_PALNC = 0x00000020,
  322. NV_DISPLAY_TV_FORMAT_SD_576i = 0x00000100,
  323. NV_DISPLAY_TV_FORMAT_SD_480i = 0x00000200,
  324. NV_DISPLAY_TV_FORMAT_ED_480p = 0x00000400,
  325. NV_DISPLAY_TV_FORMAT_ED_576p = 0x00000800,
  326. NV_DISPLAY_TV_FORMAT_HD_720p = 0x00001000,
  327. NV_DISPLAY_TV_FORMAT_HD_1080i = 0x00002000,
  328. NV_DISPLAY_TV_FORMAT_HD_1080p = 0x00004000,
  329. NV_DISPLAY_TV_FORMAT_HD_720p50 = 0x00008000,
  330. NV_DISPLAY_TV_FORMAT_HD_1080p24 = 0x00010000,
  331. NV_DISPLAY_TV_FORMAT_HD_1080i50 = 0x00020000,
  332. NV_DISPLAY_TV_FORMAT_HD_1080p50 = 0x00040000,
  333. NV_DISPLAY_TV_FORMAT_UHD_4Kp30 = 0x00080000,
  334. NV_DISPLAY_TV_FORMAT_UHD_4Kp30_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp30,
  335. NV_DISPLAY_TV_FORMAT_UHD_4Kp25 = 0x00100000,
  336. NV_DISPLAY_TV_FORMAT_UHD_4Kp25_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp25,
  337. NV_DISPLAY_TV_FORMAT_UHD_4Kp24 = 0x00200000,
  338. NV_DISPLAY_TV_FORMAT_UHD_4Kp24_3840 = NV_DISPLAY_TV_FORMAT_UHD_4Kp24,
  339. NV_DISPLAY_TV_FORMAT_UHD_4Kp24_SMPTE = 0x00400000,
  340. NV_DISPLAY_TV_FORMAT_UHD_4Kp50_3840 = 0x00800000,
  341. NV_DISPLAY_TV_FORMAT_UHD_4Kp60_3840 = 0x00900000,
  342. NV_DISPLAY_TV_FORMAT_UHD_4Kp30_4096 = 0x00A00000,
  343. NV_DISPLAY_TV_FORMAT_UHD_4Kp25_4096 = 0x00B00000,
  344. NV_DISPLAY_TV_FORMAT_UHD_4Kp24_4096 = 0x00C00000,
  345. NV_DISPLAY_TV_FORMAT_UHD_4Kp50_4096 = 0x00D00000,
  346. NV_DISPLAY_TV_FORMAT_UHD_4Kp60_4096 = 0x00E00000,
  347. NV_DISPLAY_TV_FORMAT_SD_OTHER = 0x01000000,
  348. NV_DISPLAY_TV_FORMAT_ED_OTHER = 0x02000000,
  349. NV_DISPLAY_TV_FORMAT_HD_OTHER = 0x04000000,
  350. NV_DISPLAY_TV_FORMAT_ANY = 0x80000000,
  351. } NV_DISPLAY_TV_FORMAT;
  352. //! \ingroup dispcontrol
  353. //! @{
  354. #define NVAPI_MAX_VIEW_TARGET 2
  355. #define NVAPI_ADVANCED_MAX_VIEW_TARGET 4
  356. #ifndef _NV_TARGET_VIEW_MODE_
  357. #define _NV_TARGET_VIEW_MODE_
  358. //! Used in NvAPI_SetView().
  359. typedef enum _NV_TARGET_VIEW_MODE
  360. {
  361. NV_VIEW_MODE_STANDARD = 0,
  362. NV_VIEW_MODE_CLONE = 1,
  363. NV_VIEW_MODE_HSPAN = 2,
  364. NV_VIEW_MODE_VSPAN = 3,
  365. NV_VIEW_MODE_DUALVIEW = 4,
  366. NV_VIEW_MODE_MULTIVIEW = 5,
  367. } NV_TARGET_VIEW_MODE;
  368. #endif
  369. //! @}
  370. // Following definitions are used in NvAPI_SetViewEx.
  371. //! Scaling modes - used in NvAPI_SetViewEx().
  372. //! \ingroup dispcontrol
  373. typedef enum _NV_SCALING
  374. {
  375. NV_SCALING_DEFAULT = 0, //!< No change
  376. // New Scaling Declarations
  377. NV_SCALING_GPU_SCALING_TO_CLOSEST = 1, //!< Balanced - Full Screen
  378. NV_SCALING_GPU_SCALING_TO_NATIVE = 2, //!< Force GPU - Full Screen
  379. NV_SCALING_GPU_SCANOUT_TO_NATIVE = 3, //!< Force GPU - Centered\No Scaling
  380. NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE = 5, //!< Force GPU - Aspect Ratio
  381. NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_CLOSEST = 6, //!< Balanced - Aspect Ratio
  382. NV_SCALING_GPU_SCANOUT_TO_CLOSEST = 7, //!< Balanced - Centered\No Scaling
  383. NV_SCALING_GPU_INTEGER_ASPECT_SCALING = 8, //!< Force GPU - Integer Scaling
  384. // Legacy Declarations
  385. NV_SCALING_MONITOR_SCALING = NV_SCALING_GPU_SCALING_TO_CLOSEST,
  386. NV_SCALING_ADAPTER_SCALING = NV_SCALING_GPU_SCALING_TO_NATIVE,
  387. NV_SCALING_CENTERED = NV_SCALING_GPU_SCANOUT_TO_NATIVE,
  388. NV_SCALING_ASPECT_SCALING = NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE,
  389. NV_SCALING_CUSTOMIZED = 255 //!< For future use
  390. } NV_SCALING;
  391. //! Rotate modes- used in NvAPI_SetViewEx().
  392. //! \ingroup dispcontrol
  393. typedef enum _NV_ROTATE
  394. {
  395. NV_ROTATE_0 = 0,
  396. NV_ROTATE_90 = 1,
  397. NV_ROTATE_180 = 2,
  398. NV_ROTATE_270 = 3,
  399. NV_ROTATE_IGNORED = 4,
  400. } NV_ROTATE;
  401. //! Color formats- used in NvAPI_SetViewEx().
  402. //! \ingroup dispcontrol
  403. #define NVFORMAT_MAKEFOURCC(ch0, ch1, ch2, ch3) \
  404. ((NvU32)(NvU8)(ch0) | ((NvU32)(NvU8)(ch1) << 8) | \
  405. ((NvU32)(NvU8)(ch2) << 16) | ((NvU32)(NvU8)(ch3) << 24 ))
  406. //! Color formats- used in NvAPI_SetViewEx().
  407. //! \ingroup dispcontrol
  408. typedef enum _NV_FORMAT
  409. {
  410. NV_FORMAT_UNKNOWN = 0, //!< unknown. Driver will choose one as following value.
  411. NV_FORMAT_P8 = 41, //!< for 8bpp mode
  412. NV_FORMAT_R5G6B5 = 23, //!< for 16bpp mode
  413. NV_FORMAT_A8R8G8B8 = 21, //!< for 32bpp mode
  414. NV_FORMAT_A16B16G16R16F = 113, //!< for 64bpp(floating point) mode.
  415. } NV_FORMAT;
  416. // TV standard
  417. typedef struct
  418. {
  419. float x; //!< x-coordinate of the viewport top-left point
  420. float y; //!< y-coordinate of the viewport top-left point
  421. float w; //!< Width of the viewport
  422. float h; //!< Height of the viewport
  423. } NV_VIEWPORTF;
  424. //! \ingroup dispcontrol
  425. //! The timing override is not supported yet; must be set to _AUTO. \n
  426. typedef enum _NV_TIMING_OVERRIDE
  427. {
  428. NV_TIMING_OVERRIDE_CURRENT = 0, //!< get the current timing
  429. NV_TIMING_OVERRIDE_AUTO, //!< the timing the driver will use based the current policy
  430. NV_TIMING_OVERRIDE_EDID, //!< EDID timing
  431. NV_TIMING_OVERRIDE_DMT, //!< VESA DMT timing
  432. NV_TIMING_OVERRIDE_DMT_RB, //!< VESA DMT timing with reduced blanking
  433. NV_TIMING_OVERRIDE_CVT, //!< VESA CVT timing
  434. NV_TIMING_OVERRIDE_CVT_RB, //!< VESA CVT timing with reduced blanking
  435. NV_TIMING_OVERRIDE_GTF, //!< VESA GTF timing
  436. NV_TIMING_OVERRIDE_EIA861, //!< EIA 861x pre-defined timing
  437. NV_TIMING_OVERRIDE_ANALOG_TV, //!< analog SD/HDTV timing
  438. NV_TIMING_OVERRIDE_CUST, //!< NV custom timings
  439. NV_TIMING_OVERRIDE_NV_PREDEFINED, //!< NV pre-defined timing (basically the PsF timings)
  440. NV_TIMING_OVERRIDE_NV_PSF = NV_TIMING_OVERRIDE_NV_PREDEFINED,
  441. NV_TIMING_OVERRIDE_NV_ASPR,
  442. NV_TIMING_OVERRIDE_SDI, //!< Override for SDI timing
  443. NV_TIMING_OVRRIDE_MAX,
  444. }NV_TIMING_OVERRIDE;
  445. #ifndef NV_TIMING_STRUCTS_DEFINED
  446. #define NV_TIMING_STRUCTS_DEFINED
  447. //***********************
  448. // The Timing Structure
  449. //***********************
  450. //
  451. //! \ingroup dispcontrol
  452. //! NVIDIA-specific timing extras \n
  453. //! Used in NV_TIMING.
  454. typedef struct tagNV_TIMINGEXT
  455. {
  456. NvU32 flag; //!< Reserved for NVIDIA hardware-based enhancement, such as double-scan.
  457. NvU16 rr; //!< Logical refresh rate to present
  458. NvU32 rrx1k; //!< Physical vertical refresh rate in 0.001Hz
  459. NvU32 aspect; //!< Display aspect ratio Hi(aspect):horizontal-aspect, Low(aspect):vertical-aspect
  460. NvU16 rep; //!< Bit-wise pixel repetition factor: 0x1:no pixel repetition; 0x2:each pixel repeats twice horizontally,..
  461. NvU32 status; //!< Timing standard
  462. NvU8 name[40]; //!< Timing name
  463. }NV_TIMINGEXT;
  464. //! \ingroup dispcontrol
  465. //!The very basic timing structure based on the VESA standard:
  466. //! \code
  467. //! |<----------------------------htotal--------------------------->|
  468. //! ---------"active" video-------->|<-------blanking------>|<-----
  469. //! |<-------hvisible-------->|<-hb->|<-hfp->|<-hsw->|<-hbp->|<-hb->|
  470. //! --------- -+-------------------------+ | | | | |
  471. //! A A | | | | | | |
  472. //! : : | | | | | | |
  473. //! : : | | | | | | |
  474. //! :vertical| addressable video | | | | | |
  475. //! : visible| | | | | | |
  476. //! : : | | | | | | |
  477. //! : : | | | | | | |
  478. //! vertical V | | | | | | |
  479. //! total --+-------------------------+ | | | | |
  480. //! : vb border | | | | |
  481. //! : -----------------------------------+ | | | |
  482. //! : vfp front porch | | | |
  483. //! : -------------------------------------------+ | | |
  484. //! : vsw sync width | | |
  485. //! : ---------------------------------------------------+ | |
  486. //! : vbp back porch | |
  487. //! : -----------------------------------------------------------+ |
  488. //! V vb border |
  489. //! ---------------------------------------------------------------------------+
  490. //! \endcode
  491. typedef struct _NV_TIMING
  492. {
  493. // VESA scan out timing parameters:
  494. NvU16 HVisible; //!< horizontal visible
  495. NvU16 HBorder; //!< horizontal border
  496. NvU16 HFrontPorch; //!< horizontal front porch
  497. NvU16 HSyncWidth; //!< horizontal sync width
  498. NvU16 HTotal; //!< horizontal total
  499. NvU8 HSyncPol; //!< horizontal sync polarity: 1-negative, 0-positive
  500. NvU16 VVisible; //!< vertical visible
  501. NvU16 VBorder; //!< vertical border
  502. NvU16 VFrontPorch; //!< vertical front porch
  503. NvU16 VSyncWidth; //!< vertical sync width
  504. NvU16 VTotal; //!< vertical total
  505. NvU8 VSyncPol; //!< vertical sync polarity: 1-negative, 0-positive
  506. NvU16 interlaced; //!< 1-interlaced, 0-progressive
  507. NvU32 pclk; //!< pixel clock in 10 kHz
  508. //other timing related extras
  509. NV_TIMINGEXT etc;
  510. }NV_TIMING;
  511. #endif //NV_TIMING_STRUCTS_DEFINED
  512. //! \addtogroup dispcontrol
  513. //! Timing-related constants
  514. //! @{
  515. #define NV_TIMING_H_SYNC_POSITIVE 0
  516. #define NV_TIMING_H_SYNC_NEGATIVE 1
  517. #define NV_TIMING_H_SYNC_DEFAULT NV_TIMING_H_SYNC_NEGATIVE
  518. //
  519. #define NV_TIMING_V_SYNC_POSITIVE 0
  520. #define NV_TIMING_V_SYNC_NEGATIVE 1
  521. #define NV_TIMING_V_SYNC_DEFAULT NV_TIMING_V_SYNC_POSITIVE
  522. //
  523. #define NV_TIMING_PROGRESSIVE 0
  524. #define NV_TIMING_INTERLACED 1
  525. #define NV_TIMING_INTERLACED_EXTRA_VBLANK_ON_FIELD2 1
  526. #define NV_TIMING_INTERLACED_NO_EXTRA_VBLANK_ON_FIELD2 2
  527. //! @}
  528. ///////////////////////////////////////////////////////////////////////////////
  529. //
  530. // FUNCTION NAME: NvAPI_SetView
  531. //
  532. //! \fn NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView)
  533. //! This function lets the caller modify the target display arrangement of the selected source display handle in any nView mode.
  534. //! It can also modify or extend the source display in Dualview mode.
  535. //! \note Maps the selected source to the associated target Ids.
  536. //! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
  537. //!
  538. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.
  539. //! SUPPORTED OS: Windows 7 and higher
  540. //!
  541. //!
  542. //! \since Release: 90
  543. //!
  544. //! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
  545. //! \param [in] pTargetInfo Pointer to array of NV_VIEW_TARGET_INFO, specifying device properties in this view.
  546. //! The first device entry in the array is the physical primary.
  547. //! The device entry with the lowest source id is the desktop primary.
  548. //! \param [in] targetCount Count of target devices specified in pTargetInfo.
  549. //! \param [in] targetView Target view selected from NV_TARGET_VIEW_MODE.
  550. //!
  551. //! \retval NVAPI_OK Completed request
  552. //! \retval NVAPI_ERROR Miscellaneous error occurred
  553. //! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter.
  554. //
  555. ///////////////////////////////////////////////////////////////////////////////
  556. //! \ingroup dispcontrol
  557. //! Used in NvAPI_SetView() and NvAPI_GetView()
  558. typedef struct
  559. {
  560. NvU32 version; //!< (IN) structure version
  561. NvU32 count; //!< (IN) target count
  562. struct
  563. {
  564. NvU32 deviceMask; //!< (IN/OUT) Device mask
  565. NvU32 sourceId; //!< (IN/OUT) Source ID - values will be based on the number of heads exposed per GPU.
  566. NvU32 bPrimary:1; //!< (OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
  567. //!< NvAPI_SetView automatically selects the first target in NV_VIEW_TARGET_INFO index 0 as the GPU's primary view.
  568. NvU32 bInterlaced:1; //!< (IN/OUT) Indicates if the timing being used on this monitor is interlaced.
  569. NvU32 bGDIPrimary:1; //!< (IN/OUT) Indicates if this is the desktop GDI primary.
  570. 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.
  571. } target[NVAPI_MAX_VIEW_TARGET];
  572. } NV_VIEW_TARGET_INFO;
  573. //! \ingroup dispcontrol
  574. #define NV_VIEW_TARGET_INFO_VER MAKE_NVAPI_VERSION(NV_VIEW_TARGET_INFO,2)
  575. //! \ingroup dispcontrol
  576. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.")
  577. NVAPI_INTERFACE NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView);
  578. ///////////////////////////////////////////////////////////////////////////////
  579. //
  580. // FUNCTION NAME: NvAPI_SetViewEx
  581. //
  582. //! \fn NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView)
  583. //! This function lets caller to modify the display arrangement for selected source display handle in any of the nview modes.
  584. //! It also allows to modify or extend the source display in dualview mode.
  585. //! \note Maps the selected source to the associated target Ids.
  586. //! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
  587. //!
  588. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.
  589. //! SUPPORTED OS: Windows 7 and higher
  590. //!
  591. //!
  592. //! \since Release: 95
  593. //!
  594. //! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with
  595. //! NvAPI_EnumNVidiaDisplayHandle().
  596. //! \param [in] pPathInfo Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view.
  597. //! The first device entry in the array is the physical primary.
  598. //! The device entry with the lowest source id is the desktop primary.
  599. //! \param [in] pathCount Count of paths specified in pPathInfo.
  600. //! \param [in] displayView Display view selected from NV_TARGET_VIEW_MODE.
  601. //!
  602. //! \retval NVAPI_OK Completed request
  603. //! \retval NVAPI_ERROR Miscellaneous error occurred
  604. //! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter.
  605. //
  606. ///////////////////////////////////////////////////////////////////////////////
  607. //! \ingroup dispcontrol
  608. #define NVAPI_MAX_DISPLAY_PATH NVAPI_MAX_VIEW_TARGET
  609. //! \ingroup dispcontrol
  610. #define NVAPI_ADVANCED_MAX_DISPLAY_PATH NVAPI_ADVANCED_MAX_VIEW_TARGET
  611. //! \ingroup dispcontrol
  612. //! Used in NV_DISPLAY_PATH_INFO.
  613. typedef struct
  614. {
  615. NvU32 deviceMask; //!< (IN) Device mask
  616. NvU32 sourceId; //!< (IN) Values will be based on the number of heads exposed per GPU(0, 1?)
  617. NvU32 bPrimary:1; //!< (IN/OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
  618. //!< NvAPI_SetViewEx() automatically selects the first target in NV_DISPLAY_PATH_INFO index 0 as the GPU's primary view.
  619. NV_GPU_CONNECTOR_TYPE connector; //!< (IN) Specify connector type. For TV only.
  620. // source mode information
  621. NvU32 width; //!< (IN) Width of the mode
  622. NvU32 height; //!< (IN) Height of the mode
  623. NvU32 depth; //!< (IN) Depth of the mode
  624. NV_FORMAT colorFormat; //!< Color format if it needs to be specified. Not used now.
  625. //rotation setting of the mode
  626. NV_ROTATE rotation; //!< (IN) Rotation setting.
  627. // the scaling mode
  628. NV_SCALING scaling; //!< (IN) Scaling setting
  629. // Timing info
  630. NvU32 refreshRate; //!< (IN) Refresh rate of the mode
  631. NvU32 interlaced:1; //!< (IN) Interlaced mode flag
  632. NV_DISPLAY_TV_FORMAT tvFormat; //!< (IN) To choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE
  633. // Windows desktop position
  634. NvU32 posx; //!< (IN/OUT) X-offset of this display on the Windows desktop
  635. NvU32 posy; //!< (IN/OUT) Y-offset of this display on the Windows desktop
  636. NvU32 bGDIPrimary:1; //!< (IN/OUT) Indicates if this is the desktop GDI primary.
  637. 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.
  638. NvU32 bFocusDisplay:1;//!< (IN) If set, this display path should have the focus after the GPU topology change
  639. 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)
  640. } NV_DISPLAY_PATH;
  641. //! \ingroup dispcontrol
  642. //! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx().
  643. typedef struct
  644. {
  645. NvU32 version; //!< (IN) Structure version
  646. NvU32 count; //!< (IN) Path count
  647. NV_DISPLAY_PATH path[NVAPI_MAX_DISPLAY_PATH];
  648. } NV_DISPLAY_PATH_INFO_V3;
  649. //! \ingroup dispcontrol
  650. //! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx().
  651. typedef struct
  652. {
  653. NvU32 version; //!< (IN) Structure version
  654. NvU32 count; //!< (IN) Path count
  655. NV_DISPLAY_PATH path[NVAPI_ADVANCED_MAX_DISPLAY_PATH];
  656. } NV_DISPLAY_PATH_INFO;
  657. //! \addtogroup dispcontrol
  658. //! Macro for constructing the version fields of NV_DISPLAY_PATH_INFO
  659. //! @{
  660. #define NV_DISPLAY_PATH_INFO_VER NV_DISPLAY_PATH_INFO_VER4
  661. #define NV_DISPLAY_PATH_INFO_VER4 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,4)
  662. #define NV_DISPLAY_PATH_INFO_VER3 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,3)
  663. #define NV_DISPLAY_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,2)
  664. #define NV_DISPLAY_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,1)
  665. //! @}
  666. ///////////////////////////////////////////////////////////////////////////////
  667. //
  668. // FUNCTION NAME: NvAPI_SetViewEx
  669. //
  670. //! \fn NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView)
  671. //! This function lets caller to modify the display arrangement for selected source display handle in any of the nview modes.
  672. //! It also allows to modify or extend the source display in dualview mode.
  673. //! \note Maps the selected source to the associated target Ids.
  674. //! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
  675. //!
  676. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.
  677. //! SUPPORTED OS: Windows 7 and higher
  678. //!
  679. //!
  680. //! \since Release: 95
  681. //!
  682. //! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with
  683. //! NvAPI_EnumNVidiaDisplayHandle().
  684. //! \param [in] pPathInfo Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view.
  685. //! The first device entry in the array is the physical primary.
  686. //! The device entry with the lowest source id is the desktop primary.
  687. //! \param [in] pathCount Count of paths specified in pPathInfo.
  688. //! \param [in] displayView Display view selected from NV_TARGET_VIEW_MODE.
  689. //!
  690. //! \retval NVAPI_OK Completed request
  691. //! \retval NVAPI_ERROR Miscellaneous error occurred
  692. //! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter.
  693. //
  694. ///////////////////////////////////////////////////////////////////////////////
  695. //! \ingroup dispcontrol
  696. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.")
  697. NVAPI_INTERFACE NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView);
  698. ///////////////////////////////////////////////////////////////////////////////
  699. // SetDisplayConfig/GetDisplayConfig
  700. ///////////////////////////////////////////////////////////////////////////////
  701. //! \ingroup dispcontrol
  702. typedef struct _NV_POSITION
  703. {
  704. NvS32 x;
  705. NvS32 y;
  706. } NV_POSITION;
  707. //! \ingroup dispcontrol
  708. typedef struct _NV_RESOLUTION
  709. {
  710. NvU32 width;
  711. NvU32 height;
  712. NvU32 colorDepth;
  713. } NV_RESOLUTION;
  714. //! \ingroup dispcontrol
  715. typedef struct _NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1
  716. {
  717. NvU32 version;
  718. // Rotation and Scaling
  719. NV_ROTATE rotation; //!< (IN) rotation setting.
  720. NV_SCALING scaling; //!< (IN) scaling setting.
  721. // Refresh Rate
  722. NvU32 refreshRate1K; //!< (IN) Non-interlaced Refresh Rate of the mode, multiplied by 1000, 0 = ignored
  723. //!< This is the value which driver reports to the OS.
  724. // Flags
  725. NvU32 interlaced:1; //!< (IN) Interlaced mode flag, ignored if refreshRate == 0
  726. NvU32 primary:1; //!< (IN) Declares primary display in clone configuration. This is *NOT* GDI Primary.
  727. //!< Only one target can be primary per source. If no primary is specified, the first
  728. //!< target will automatically be primary.
  729. #ifdef NV_PAN_AND_SCAN_DEFINED
  730. NvU32 isPanAndScanTarget:1; //!< Whether on this target Pan and Scan is enabled or has to be enabled. Valid only
  731. //!< when the target is part of clone topology.
  732. #else
  733. NvU32 reservedBit1:1;
  734. #endif
  735. NvU32 disableVirtualModeSupport:1;
  736. NvU32 isPreferredUnscaledTarget:1;
  737. NvU32 reserved:27;
  738. // TV format information
  739. NV_GPU_CONNECTOR_TYPE connector; //!< Specify connector type. For TV only, ignored if tvFormat == NV_DISPLAY_TV_FORMAT_NONE
  740. NV_DISPLAY_TV_FORMAT tvFormat; //!< (IN) to choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE
  741. //!< In case of NvAPI_DISP_GetDisplayConfig(), this field will indicate the currently applied TV format;
  742. //!< if no TV format is applied, this field will have NV_DISPLAY_TV_FORMAT_NONE value.
  743. //!< In case of NvAPI_DISP_SetDisplayConfig(), this field should only be set in case of TVs;
  744. //!< for other displays this field will be ignored and resolution & refresh rate specified in input will be used to apply the TV format.
  745. // Backend (raster) timing standard
  746. NV_TIMING_OVERRIDE timingOverride; //!< Ignored if timingOverride == NV_TIMING_OVERRIDE_CURRENT
  747. NV_TIMING timing; //!< Scan out timing, valid only if timingOverride == NV_TIMING_OVERRIDE_CUST
  748. //!< The value NV_TIMING::NV_TIMINGEXT::rrx1k is obtained from the EDID. The driver may
  749. //!< tweak this value for HDTV, stereo, etc., before reporting it to the OS.
  750. } NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1;
  751. //! \ingroup dispcontrol
  752. typedef NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO;
  753. //! \ingroup dispcontrol
  754. #define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1,1)
  755. //! \ingroup dispcontrol
  756. #define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1
  757. //! \ingroup dispcontrol
  758. typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1
  759. {
  760. NvU32 displayId; //!< Display ID
  761. NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO* details; //!< May be NULL if no advanced settings are required. NULL for Non-NVIDIA Display.
  762. } NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1;
  763. //! \ingroup dispcontrol
  764. typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2
  765. {
  766. NvU32 displayId; //!< Display ID
  767. NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO* details; //!< May be NULL if no advanced settings are required
  768. NvU32 targetId; //!< Windows CCD target ID. Must be present only for non-NVIDIA adapter, for NVIDIA adapter this parameter is ignored.
  769. } NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2;
  770. //! \ingroup dispcontrol
  771. //! As version is not defined for this structure, we will be using version of NV_DISPLAYCONFIG_PATH_INFO
  772. typedef NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 NV_DISPLAYCONFIG_PATH_TARGET_INFO;
  773. //! \ingroup dispcontrol
  774. typedef enum _NV_DISPLAYCONFIG_SPANNING_ORIENTATION
  775. {
  776. NV_DISPLAYCONFIG_SPAN_NONE = 0,
  777. NV_DISPLAYCONFIG_SPAN_HORIZONTAL = 1,
  778. NV_DISPLAYCONFIG_SPAN_VERTICAL = 2,
  779. } NV_DISPLAYCONFIG_SPANNING_ORIENTATION;
  780. //! \ingroup dispcontrol
  781. typedef struct _NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1
  782. {
  783. NV_RESOLUTION resolution;
  784. NV_FORMAT colorFormat; //!< Ignored at present, must be NV_FORMAT_UNKNOWN (0)
  785. NV_POSITION position; //!< Is all positions are 0 or invalid, displays will be automatically
  786. //!< positioned from left to right with GDI Primary at 0,0, and all
  787. //!< other displays in the order of the path array.
  788. NV_DISPLAYCONFIG_SPANNING_ORIENTATION spanningOrientation; //!< Spanning is only supported on XP
  789. NvU32 bGDIPrimary : 1;
  790. NvU32 bSLIFocus : 1;
  791. NvU32 reserved : 30; //!< Must be 0
  792. } NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1;
  793. //! \ingroup dispcontrol
  794. typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V1
  795. {
  796. NvU32 version;
  797. NvU32 reserved_sourceId; //!< This field is reserved. There is ongoing debate if we need this field.
  798. //!< Identifies sourceIds used by Windows. If all sourceIds are 0,
  799. //!< these will be computed automatically.
  800. NvU32 targetInfoCount; //!< Number of elements in targetInfo array
  801. NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1* targetInfo;
  802. NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1* sourceModeInfo; //!< May be NULL if mode info is not important
  803. } NV_DISPLAYCONFIG_PATH_INFO_V1;
  804. //! \ingroup dispcontrol
  805. //! This define is temporary and must be removed once DVS failure is fixed.
  806. #define _NV_DISPLAYCONFIG_PATH_INFO_V2 _NV_DISPLAYCONFIG_PATH_INFO
  807. //! \ingroup dispcontrol
  808. typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V2
  809. {
  810. NvU32 version;
  811. union {
  812. NvU32 sourceId; //!< Identifies sourceId used by Windows CCD. This can be optionally set.
  813. NvU32 reserved_sourceId; //!< Only for compatibility
  814. };
  815. NvU32 targetInfoCount; //!< Number of elements in targetInfo array
  816. NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2* targetInfo;
  817. NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1* sourceModeInfo; //!< May be NULL if mode info is not important
  818. NvU32 IsNonNVIDIAAdapter : 1; //!< True for non-NVIDIA adapter.
  819. NvU32 reserved : 31; //!< Must be 0
  820. void *pOSAdapterID; //!< Used by Non-NVIDIA adapter for pointer to OS Adapter of LUID
  821. //!< type, type casted to void *.
  822. } NV_DISPLAYCONFIG_PATH_INFO_V2;
  823. //! \ingroup dispcontrol
  824. #define NV_DISPLAYCONFIG_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V1,1)
  825. //! \ingroup dispcontrol
  826. #define NV_DISPLAYCONFIG_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V2,2)
  827. #ifndef NV_DISPLAYCONFIG_PATH_INFO_VER
  828. typedef NV_DISPLAYCONFIG_PATH_INFO_V2 NV_DISPLAYCONFIG_PATH_INFO;
  829. #define NV_DISPLAYCONFIG_PATH_INFO_VER NV_DISPLAYCONFIG_PATH_INFO_VER2
  830. typedef NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 NV_DISPLAYCONFIG_SOURCE_MODE_INFO;
  831. #endif
  832. //! \ingroup dispcontrol
  833. typedef enum _NV_DISPLAYCONFIG_FLAGS
  834. {
  835. NV_DISPLAYCONFIG_VALIDATE_ONLY = 0x00000001,
  836. NV_DISPLAYCONFIG_SAVE_TO_PERSISTENCE = 0x00000002,
  837. NV_DISPLAYCONFIG_DRIVER_RELOAD_ALLOWED = 0x00000004, //!< Driver reload is permitted if necessary
  838. NV_DISPLAYCONFIG_FORCE_MODE_ENUMERATION = 0x00000008, //!< Refresh OS mode list.
  839. NV_FORCE_COMMIT_VIDPN = 0x00000010, //!< Tell OS to avoid optimizing CommitVidPn call during a modeset
  840. } NV_DISPLAYCONFIG_FLAGS;
  841. #define NVAPI_UNICODE_STRING_MAX 2048
  842. #define NVAPI_BINARY_DATA_MAX 4096
  843. typedef NvU16 NvAPI_UnicodeString[NVAPI_UNICODE_STRING_MAX];
  844. typedef const NvU16 *NvAPI_LPCWSTR;
  845. // Common
  846. //! \ingroup gpuclock
  847. //! @{
  848. #define NVAPI_MAX_GPU_CLOCKS 32
  849. #define NVAPI_MAX_GPU_PUBLIC_CLOCKS 32
  850. #define NVAPI_MAX_GPU_PERF_CLOCKS 32
  851. #define NVAPI_MAX_GPU_PERF_VOLTAGES 16
  852. #define NVAPI_MAX_GPU_PERF_PSTATES 16
  853. //! @}
  854. //! \ingroup gpuclock
  855. typedef enum _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID
  856. {
  857. NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_CORE = 0,
  858. NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_UNDEFINED = NVAPI_MAX_GPU_PERF_VOLTAGES,
  859. } NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID;
  860. //! \ingroup gpuclock
  861. typedef enum _NV_GPU_PUBLIC_CLOCK_ID
  862. {
  863. NVAPI_GPU_PUBLIC_CLOCK_GRAPHICS = 0,
  864. NVAPI_GPU_PUBLIC_CLOCK_MEMORY = 4,
  865. NVAPI_GPU_PUBLIC_CLOCK_PROCESSOR = 7,
  866. NVAPI_GPU_PUBLIC_CLOCK_VIDEO = 8,
  867. NVAPI_GPU_PUBLIC_CLOCK_UNDEFINED = NVAPI_MAX_GPU_PUBLIC_CLOCKS,
  868. } NV_GPU_PUBLIC_CLOCK_ID;
  869. //! \addtogroup gpupstate
  870. //! @{
  871. typedef enum _NV_GPU_PERF_PSTATE_ID
  872. {
  873. NVAPI_GPU_PERF_PSTATE_P0 = 0,
  874. NVAPI_GPU_PERF_PSTATE_P1,
  875. NVAPI_GPU_PERF_PSTATE_P2,
  876. NVAPI_GPU_PERF_PSTATE_P3,
  877. NVAPI_GPU_PERF_PSTATE_P4,
  878. NVAPI_GPU_PERF_PSTATE_P5,
  879. NVAPI_GPU_PERF_PSTATE_P6,
  880. NVAPI_GPU_PERF_PSTATE_P7,
  881. NVAPI_GPU_PERF_PSTATE_P8,
  882. NVAPI_GPU_PERF_PSTATE_P9,
  883. NVAPI_GPU_PERF_PSTATE_P10,
  884. NVAPI_GPU_PERF_PSTATE_P11,
  885. NVAPI_GPU_PERF_PSTATE_P12,
  886. NVAPI_GPU_PERF_PSTATE_P13,
  887. NVAPI_GPU_PERF_PSTATE_P14,
  888. NVAPI_GPU_PERF_PSTATE_P15,
  889. NVAPI_GPU_PERF_PSTATE_UNDEFINED = NVAPI_MAX_GPU_PERF_PSTATES,
  890. NVAPI_GPU_PERF_PSTATE_ALL,
  891. } NV_GPU_PERF_PSTATE_ID;
  892. //! @}
  893. //! \addtogroup gpupstate
  894. //! @{
  895. #define NVAPI_MAX_GPU_PSTATE20_PSTATES 16
  896. #define NVAPI_MAX_GPU_PSTATE20_CLOCKS 8
  897. #define NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES 4
  898. //! Used to identify clock type
  899. typedef enum
  900. {
  901. //! Clock domains that use single frequency value within given pstate
  902. NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_SINGLE = 0,
  903. //! Clock domains that allow range of frequency values within given pstate
  904. NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_RANGE,
  905. } NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID;
  906. //! Used to describe both voltage and frequency deltas
  907. typedef struct
  908. {
  909. //! Value of parameter delta (in respective units [kHz, uV])
  910. NvS32 value;
  911. struct
  912. {
  913. //! Min value allowed for parameter delta (in respective units [kHz, uV])
  914. NvS32 min;
  915. //! Max value allowed for parameter delta (in respective units [kHz, uV])
  916. NvS32 max;
  917. } valueRange;
  918. } NV_GPU_PERF_PSTATES20_PARAM_DELTA;
  919. //! Used to describe single clock entry
  920. typedef struct
  921. {
  922. //! ID of the clock domain
  923. NV_GPU_PUBLIC_CLOCK_ID domainId;
  924. //! Clock type ID
  925. NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID typeId;
  926. NvU32 bIsEditable:1;
  927. //! These bits are reserved for future use (must be always 0)
  928. NvU32 reserved:31;
  929. //! Current frequency delta from nominal settings in (kHz)
  930. NV_GPU_PERF_PSTATES20_PARAM_DELTA freqDelta_kHz;
  931. //! Clock domain type dependant information
  932. union
  933. {
  934. struct
  935. {
  936. //! Clock frequency within given pstate in (kHz)
  937. NvU32 freq_kHz;
  938. } single;
  939. struct
  940. {
  941. //! Min clock frequency within given pstate in (kHz)
  942. NvU32 minFreq_kHz;
  943. //! Max clock frequency within given pstate in (kHz)
  944. NvU32 maxFreq_kHz;
  945. //! Voltage domain ID and value range in (uV) required for this clock
  946. NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId;
  947. NvU32 minVoltage_uV;
  948. NvU32 maxVoltage_uV;
  949. } range;
  950. } data;
  951. } NV_GPU_PSTATE20_CLOCK_ENTRY_V1;
  952. //! Used to describe single base voltage entry
  953. typedef struct
  954. {
  955. //! ID of the voltage domain
  956. NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId;
  957. NvU32 bIsEditable:1;
  958. //! These bits are reserved for future use (must be always 0)
  959. NvU32 reserved:31;
  960. //! Current base voltage settings in [uV]
  961. NvU32 volt_uV;
  962. NV_GPU_PERF_PSTATES20_PARAM_DELTA voltDelta_uV; // Current base voltage delta from nominal settings in [uV]
  963. } NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1;
  964. //! Used in NvAPI_GPU_GetPstates20() interface call.
  965. typedef struct
  966. {
  967. //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER<n>)
  968. NvU32 version;
  969. NvU32 bIsEditable:1;
  970. //! These bits are reserved for future use (must be always 0)
  971. NvU32 reserved:31;
  972. //! Number of populated pstates
  973. NvU32 numPstates;
  974. //! Number of populated clocks (per pstate)
  975. NvU32 numClocks;
  976. //! Number of populated base voltages (per pstate)
  977. NvU32 numBaseVoltages;
  978. //! Performance state (P-State) settings
  979. //! Valid index range is 0 to numPstates-1
  980. struct
  981. {
  982. //! ID of the P-State
  983. NV_GPU_PERF_PSTATE_ID pstateId;
  984. NvU32 bIsEditable:1;
  985. //! These bits are reserved for future use (must be always 0)
  986. NvU32 reserved:31;
  987. //! Array of clock entries
  988. //! Valid index range is 0 to numClocks-1
  989. NV_GPU_PSTATE20_CLOCK_ENTRY_V1 clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS];
  990. //! Array of baseVoltage entries
  991. //! Valid index range is 0 to numBaseVoltages-1
  992. NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES];
  993. } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES];
  994. } NV_GPU_PERF_PSTATES20_INFO_V1;
  995. //! Used in NvAPI_GPU_GetPstates20() interface call.
  996. typedef struct _NV_GPU_PERF_PSTATES20_INFO_V2
  997. {
  998. //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER<n>)
  999. NvU32 version;
  1000. NvU32 bIsEditable:1;
  1001. //! These bits are reserved for future use (must be always 0)
  1002. NvU32 reserved:31;
  1003. //! Number of populated pstates
  1004. NvU32 numPstates;
  1005. //! Number of populated clocks (per pstate)
  1006. NvU32 numClocks;
  1007. //! Number of populated base voltages (per pstate)
  1008. NvU32 numBaseVoltages;
  1009. //! Performance state (P-State) settings
  1010. //! Valid index range is 0 to numPstates-1
  1011. struct
  1012. {
  1013. //! ID of the P-State
  1014. NV_GPU_PERF_PSTATE_ID pstateId;
  1015. NvU32 bIsEditable:1;
  1016. //! These bits are reserved for future use (must be always 0)
  1017. NvU32 reserved:31;
  1018. //! Array of clock entries
  1019. //! Valid index range is 0 to numClocks-1
  1020. NV_GPU_PSTATE20_CLOCK_ENTRY_V1 clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS];
  1021. //! Array of baseVoltage entries
  1022. //! Valid index range is 0 to numBaseVoltages-1
  1023. NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES];
  1024. } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES];
  1025. //! OV settings - Please refer to NVIDIA over-volting recommendation to understand impact of this functionality
  1026. //! Valid index range is 0 to numVoltages-1
  1027. struct
  1028. {
  1029. //! Number of populated voltages
  1030. NvU32 numVoltages;
  1031. //! Array of voltage entries
  1032. //! Valid index range is 0 to numVoltages-1
  1033. NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 voltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES];
  1034. } ov;
  1035. } NV_GPU_PERF_PSTATES20_INFO_V2;
  1036. typedef NV_GPU_PERF_PSTATES20_INFO_V2 NV_GPU_PERF_PSTATES20_INFO;
  1037. //! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V1
  1038. #define NV_GPU_PERF_PSTATES20_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V1,1)
  1039. //! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V2
  1040. #define NV_GPU_PERF_PSTATES20_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V2,2)
  1041. //! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V2
  1042. #define NV_GPU_PERF_PSTATES20_INFO_VER3 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V2,3)
  1043. //! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO
  1044. #define NV_GPU_PERF_PSTATES20_INFO_VER NV_GPU_PERF_PSTATES20_INFO_VER3
  1045. //! @}
  1046. ///////////////////////////////////////////////////////////////////////////////
  1047. //
  1048. // FUNCTION NAME: NvAPI_GetDisplayDriverVersion
  1049. //! \fn NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion)
  1050. //! This function returns a struct that describes aspects of the display driver
  1051. //! build.
  1052. //!
  1053. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion.
  1054. //! SUPPORTED OS: Windows 7 and higher
  1055. //!
  1056. //!
  1057. //! \since Release: 80
  1058. //!
  1059. //! \param [in] hNvDisplay NVIDIA display handle.
  1060. //! \param [out] pVersion Pointer to NV_DISPLAY_DRIVER_VERSION struc
  1061. //!
  1062. //! \retval NVAPI_ERROR
  1063. //! \retval NVAPI_OK
  1064. ///////////////////////////////////////////////////////////////////////////////
  1065. //! \ingroup driverapi
  1066. //! Used in NvAPI_GetDisplayDriverVersion()
  1067. typedef struct
  1068. {
  1069. NvU32 version; // Structure version
  1070. NvU32 drvVersion;
  1071. NvU32 bldChangeListNum;
  1072. NvAPI_ShortString szBuildBranchString;
  1073. NvAPI_ShortString szAdapterString;
  1074. } NV_DISPLAY_DRIVER_VERSION;
  1075. //! \ingroup driverapi
  1076. #define NV_DISPLAY_DRIVER_VERSION_VER MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_VERSION,1)
  1077. //! \ingroup driverapi
  1078. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion.")
  1079. NVAPI_INTERFACE NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion);
  1080. ///////////////////////////////////////////////////////////////////////////////
  1081. //
  1082. // FUNCTION NAME: NvAPI_OGL_ExpertModeSet[Get]
  1083. //
  1084. //! \name NvAPI_OGL_ExpertModeSet[Get] Functions
  1085. //@{
  1086. //! This function configures OpenGL Expert Mode, an API usage feedback and
  1087. //! advice reporting mechanism. The effects of this call are
  1088. //! applied only to the current context, and are reset to the
  1089. //! defaults when the context is destroyed.
  1090. //!
  1091. //! \note This feature is valid at runtime only when GLExpert
  1092. //! functionality has been built into the OpenGL driver
  1093. //! installed on the system. All Windows Vista OpenGL
  1094. //! drivers provided by NVIDIA have this instrumentation
  1095. //! included by default. Windows XP, however, requires a
  1096. //! special display driver available with the NVIDIA
  1097. //! PerfSDK found at developer.nvidia.com.
  1098. //!
  1099. //! \note These functions are valid only for the current OpenGL
  1100. //! context. Calling these functions prior to creating a
  1101. //! context and calling MakeCurrent with it will result
  1102. //! in errors and undefined behavior.
  1103. //!
  1104. //! SUPPORTED OS: Windows 7 and higher
  1105. //!
  1106. //!
  1107. //! \since Release: 80
  1108. //!
  1109. //! \param expertDetailMask Mask made up of NVAPI_OGLEXPERT_DETAIL bits,
  1110. //! this parameter specifies the detail level in
  1111. //! the feedback stream.
  1112. //!
  1113. //! \param expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits,
  1114. //! this parameter specifies the areas of
  1115. //! functional interest.
  1116. //!
  1117. //! \param expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
  1118. //! this parameter specifies the feedback output
  1119. //! location.
  1120. //!
  1121. //! \param expertCallback Used in conjunction with OUTPUT_TO_CALLBACK,
  1122. //! this is a simple callback function the user
  1123. //! may use to obtain the feedback stream. The
  1124. //! function will be called once per fully
  1125. //! qualified feedback stream extry.
  1126. //!
  1127. //! \retval NVAPI_API_NOT_INTIALIZED NVAPI not initialized
  1128. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU found
  1129. //! \retval NVAPI_OPENGL_CONTEXT_NOT_CURRENT No NVIDIA OpenGL context
  1130. //! which supports GLExpert
  1131. //! has been made current
  1132. //! \retval NVAPI_ERROR OpenGL driver failed to load properly
  1133. //! \retval NVAPI_OK Success
  1134. //
  1135. ///////////////////////////////////////////////////////////////////////////////
  1136. //! \addtogroup oglapi
  1137. //! @{
  1138. #define NVAPI_OGLEXPERT_DETAIL_NONE 0x00000000
  1139. #define NVAPI_OGLEXPERT_DETAIL_ERROR 0x00000001
  1140. #define NVAPI_OGLEXPERT_DETAIL_SWFALLBACK 0x00000002
  1141. #define NVAPI_OGLEXPERT_DETAIL_BASIC_INFO 0x00000004
  1142. #define NVAPI_OGLEXPERT_DETAIL_DETAILED_INFO 0x00000008
  1143. #define NVAPI_OGLEXPERT_DETAIL_PERFORMANCE_WARNING 0x00000010
  1144. #define NVAPI_OGLEXPERT_DETAIL_QUALITY_WARNING 0x00000020
  1145. #define NVAPI_OGLEXPERT_DETAIL_USAGE_WARNING 0x00000040
  1146. #define NVAPI_OGLEXPERT_DETAIL_ALL 0xFFFFFFFF
  1147. #define NVAPI_OGLEXPERT_REPORT_NONE 0x00000000
  1148. #define NVAPI_OGLEXPERT_REPORT_ERROR 0x00000001
  1149. #define NVAPI_OGLEXPERT_REPORT_SWFALLBACK 0x00000002
  1150. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_VERTEX 0x00000004
  1151. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_GEOMETRY 0x00000008
  1152. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_XFB 0x00000010
  1153. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_RASTER 0x00000020
  1154. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAGMENT 0x00000040
  1155. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_ROP 0x00000080
  1156. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAMEBUFFER 0x00000100
  1157. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_PIXEL 0x00000200
  1158. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_TEXTURE 0x00000400
  1159. #define NVAPI_OGLEXPERT_REPORT_OBJECT_BUFFEROBJECT 0x00000800
  1160. #define NVAPI_OGLEXPERT_REPORT_OBJECT_TEXTURE 0x00001000
  1161. #define NVAPI_OGLEXPERT_REPORT_OBJECT_PROGRAM 0x00002000
  1162. #define NVAPI_OGLEXPERT_REPORT_OBJECT_FBO 0x00004000
  1163. #define NVAPI_OGLEXPERT_REPORT_FEATURE_SLI 0x00008000
  1164. #define NVAPI_OGLEXPERT_REPORT_ALL 0xFFFFFFFF
  1165. #define NVAPI_OGLEXPERT_OUTPUT_TO_NONE 0x00000000
  1166. #define NVAPI_OGLEXPERT_OUTPUT_TO_CONSOLE 0x00000001
  1167. #define NVAPI_OGLEXPERT_OUTPUT_TO_DEBUGGER 0x00000004
  1168. #define NVAPI_OGLEXPERT_OUTPUT_TO_CALLBACK 0x00000008
  1169. #define NVAPI_OGLEXPERT_OUTPUT_TO_ALL 0xFFFFFFFF
  1170. //! @}
  1171. ///////////////////////////////////////////////////////////////////////////////
  1172. //
  1173. // FUNCTION TYPE: NVAPI_OGLEXPERT_CALLBACK
  1174. //
  1175. //! DESCRIPTION: Used in conjunction with OUTPUT_TO_CALLBACK, this is a simple
  1176. //! callback function the user may use to obtain the feedback
  1177. //! stream. The function will be called once per fully qualified
  1178. //! feedback stream entry.
  1179. //!
  1180. //! \param categoryId Contains the bit from the NVAPI_OGLEXPERT_REPORT
  1181. //! mask that corresponds to the current message
  1182. //! \param messageId Unique ID for the current message
  1183. //! \param detailLevel Contains the bit from the NVAPI_OGLEXPERT_DETAIL
  1184. //! mask that corresponds to the current message
  1185. //! \param objectId Unique ID of the object that corresponds to the
  1186. //! current message
  1187. //! \param messageStr Text string from the current message
  1188. //!
  1189. //! \ingroup oglapi
  1190. ///////////////////////////////////////////////////////////////////////////////
  1191. typedef void (* NVAPI_OGLEXPERT_CALLBACK) (unsigned int categoryId, unsigned int messageId, unsigned int detailLevel, int objectId, const char *messageStr);
  1192. //! \ingroup oglapi
  1193. //! SUPPORTED OS: Windows 7 and higher
  1194. //!
  1195. NVAPI_INTERFACE NvAPI_OGL_ExpertModeSet(NvU32 expertDetailLevel,
  1196. NvU32 expertReportMask,
  1197. NvU32 expertOutputMask,
  1198. NVAPI_OGLEXPERT_CALLBACK expertCallback);
  1199. //! \addtogroup oglapi
  1200. //! SUPPORTED OS: Windows 7 and higher
  1201. //!
  1202. NVAPI_INTERFACE NvAPI_OGL_ExpertModeGet(NvU32 *pExpertDetailLevel,
  1203. NvU32 *pExpertReportMask,
  1204. NvU32 *pExpertOutputMask,
  1205. NVAPI_OGLEXPERT_CALLBACK *pExpertCallback);
  1206. //@}
  1207. ///////////////////////////////////////////////////////////////////////////////
  1208. //
  1209. //! \name NvAPI_OGL_ExpertModeDefaultsSet[Get] Functions
  1210. //!
  1211. //@{
  1212. //! This function configures OpenGL Expert Mode global defaults. These settings
  1213. //! apply to any OpenGL application which starts up after these
  1214. //! values are applied (i.e. these settings *do not* apply to
  1215. //! currently running applications).
  1216. //!
  1217. //! SUPPORTED OS: Windows 7 and higher
  1218. //!
  1219. //!
  1220. //! \since Release: 80
  1221. //!
  1222. //! \param expertDetailLevel Value which specifies the detail level in
  1223. //! the feedback stream. This is a mask made up
  1224. //! of NVAPI_OGLEXPERT_LEVEL bits.
  1225. //!
  1226. //! \param expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits,
  1227. //! this parameter specifies the areas of
  1228. //! functional interest.
  1229. //!
  1230. //! \param expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
  1231. //! this parameter specifies the feedback output
  1232. //! location. Note that using OUTPUT_TO_CALLBACK
  1233. //! here is meaningless and has no effect, but
  1234. //! using it will not cause an error.
  1235. //!
  1236. //! \return ::NVAPI_ERROR or ::NVAPI_OK
  1237. //
  1238. ///////////////////////////////////////////////////////////////////////////////
  1239. //! \ingroup oglapi
  1240. //! SUPPORTED OS: Windows 7 and higher
  1241. //!
  1242. NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsSet(NvU32 expertDetailLevel,
  1243. NvU32 expertReportMask,
  1244. NvU32 expertOutputMask);
  1245. //! \addtogroup oglapi
  1246. //! SUPPORTED OS: Windows 7 and higher
  1247. //!
  1248. NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsGet(NvU32 *pExpertDetailLevel,
  1249. NvU32 *pExpertReportMask,
  1250. NvU32 *pExpertOutputMask);
  1251. //@}
  1252. ///////////////////////////////////////////////////////////////////////////////
  1253. //
  1254. // FUNCTION NAME: NvAPI_EnumTCCPhysicalGPUs
  1255. //
  1256. //! This function returns an array of physical GPU handles that are in TCC Mode.
  1257. //! Each handle represents a physical GPU present in the system in TCC Mode.
  1258. //! That GPU may not be visible to the OS directly.
  1259. //!
  1260. //! The array nvGPUHandle will be filled with physical GPU handle values. The returned
  1261. //! gpuCount determines how many entries in the array are valid.
  1262. //!
  1263. //! NOTE: Handles enumerated by this API are only valid for NvAPIs that are tagged as TCC_SUPPORTED
  1264. //! If handle is passed to any other API, it will fail with NVAPI_INVALID_HANDLE
  1265. //!
  1266. //! For WDDM GPU handles please use NvAPI_EnumPhysicalGPUs()
  1267. //!
  1268. //! SUPPORTED OS: Windows 7 and higher
  1269. //!
  1270. //!
  1271. //!
  1272. //! \param [out] nvGPUHandle Physical GPU array that will contain all TCC Physical GPUs
  1273. //! \param [out] pGpuCount count represent the number of valid entries in nvGPUHandle
  1274. //!
  1275. //!
  1276. //! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL
  1277. //! \ingroup gpu
  1278. ///////////////////////////////////////////////////////////////////////////////
  1279. NVAPI_INTERFACE NvAPI_EnumTCCPhysicalGPUs( NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
  1280. ///////////////////////////////////////////////////////////////////////////////
  1281. //
  1282. // FUNCTION NAME: NvAPI_EnumLogicalGPUs
  1283. //
  1284. //! This function returns an array of logical GPU handles.
  1285. //!
  1286. //! Each handle represents one or more GPUs acting in concert as a single graphics device.
  1287. //!
  1288. //! At least one GPU must be present in the system and running an NVIDIA display driver.
  1289. //!
  1290. //! The array nvGPUHandle will be filled with logical GPU handle values. The returned
  1291. //! gpuCount determines how many entries in the array are valid.
  1292. //!
  1293. //! \note All logical GPUs handles get invalidated on a GPU topology change, so the calling
  1294. //! application is required to renum the logical GPU handles to get latest physical handle
  1295. //! mapping after every GPU topology change activated by a call to NvAPI_SetGpuTopologies().
  1296. //!
  1297. //! To detect if SLI rendering is enabled, use NvAPI_D3D_GetCurrentSLIState().
  1298. //!
  1299. //! SUPPORTED OS: Windows 7 and higher
  1300. //!
  1301. //!
  1302. //! \since Release: 80
  1303. //!
  1304. //! \retval NVAPI_INVALID_ARGUMENT nvGPUHandle or pGpuCount is NULL
  1305. //! \retval NVAPI_OK One or more handles were returned
  1306. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1307. //! \ingroup gpu
  1308. ///////////////////////////////////////////////////////////////////////////////
  1309. NVAPI_INTERFACE NvAPI_EnumLogicalGPUs(NvLogicalGpuHandle nvGPUHandle[NVAPI_MAX_LOGICAL_GPUS], NvU32 *pGpuCount);
  1310. ///////////////////////////////////////////////////////////////////////////////
  1311. //
  1312. // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromDisplay
  1313. //
  1314. //! This function returns an array of physical GPU handles associated with the specified display.
  1315. //!
  1316. //! At least one GPU must be present in the system and running an NVIDIA display driver.
  1317. //!
  1318. //! The array nvGPUHandle will be filled with physical GPU handle values. The returned
  1319. //! gpuCount determines how many entries in the array are valid.
  1320. //!
  1321. //! If the display corresponds to more than one physical GPU, the first GPU returned
  1322. //! is the one with the attached active output.
  1323. //!
  1324. //! SUPPORTED OS: Windows 7 and higher
  1325. //!
  1326. //!
  1327. //! \since Release: 80
  1328. //!
  1329. //! \retval NVAPI_INVALID_ARGUMENT hNvDisp is not valid; nvGPUHandle or pGpuCount is NULL
  1330. //! \retval NVAPI_OK One or more handles were returned
  1331. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND no NVIDIA GPU driving a display was found
  1332. //! \ingroup gpu
  1333. ///////////////////////////////////////////////////////////////////////////////
  1334. NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromDisplay(NvDisplayHandle hNvDisp, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
  1335. ///////////////////////////////////////////////////////////////////////////////
  1336. //
  1337. // FUNCTION NAME: NvAPI_GetPhysicalGPUFromUnAttachedDisplay
  1338. //
  1339. //! This function returns a physical GPU handle associated with the specified unattached display.
  1340. //! The source GPU is a physical render GPU which renders the frame buffer but may or may not drive the scan out.
  1341. //!
  1342. //! At least one GPU must be present in the system and running an NVIDIA display driver.
  1343. //!
  1344. //! SUPPORTED OS: Windows 7 and higher
  1345. //!
  1346. //!
  1347. //! \since Release: 80
  1348. //!
  1349. //! \retval NVAPI_INVALID_ARGUMENT hNvUnAttachedDisp is not valid or pPhysicalGpu is NULL.
  1350. //! \retval NVAPI_OK One or more handles were returned
  1351. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1352. //! \ingroup gpu
  1353. ///////////////////////////////////////////////////////////////////////////////
  1354. NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvPhysicalGpuHandle *pPhysicalGpu);
  1355. ///////////////////////////////////////////////////////////////////////////////
  1356. //
  1357. // FUNCTION NAME: NvAPI_GetLogicalGPUFromDisplay
  1358. //
  1359. //! This function returns the logical GPU handle associated with the specified display.
  1360. //! At least one GPU must be present in the system and running an NVIDIA display driver.
  1361. //! hNvDisp can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  1362. //!
  1363. //! SUPPORTED OS: Windows 7 and higher
  1364. //!
  1365. //!
  1366. //! \since Release: 80
  1367. //!
  1368. //! \retval NVAPI_INVALID_ARGUMENT hNvDisp is not valid; pLogicalGPU is NULL
  1369. //! \retval NVAPI_OK One or more handles were returned
  1370. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1371. //! \ingroup gpu
  1372. ///////////////////////////////////////////////////////////////////////////////
  1373. NVAPI_INTERFACE NvAPI_GetLogicalGPUFromDisplay(NvDisplayHandle hNvDisp, NvLogicalGpuHandle *pLogicalGPU);
  1374. ///////////////////////////////////////////////////////////////////////////////
  1375. //
  1376. // FUNCTION NAME: NvAPI_GetLogicalGPUFromPhysicalGPU
  1377. //
  1378. //! This function returns the logical GPU handle associated with specified physical GPU handle.
  1379. //! At least one GPU must be present in the system and running an NVIDIA display driver.
  1380. //!
  1381. //! SUPPORTED OS: Windows 7 and higher
  1382. //!
  1383. //!
  1384. //! \since Release: 80
  1385. //!
  1386. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGPU is not valid; pLogicalGPU is NULL
  1387. //! \retval NVAPI_OK One or more handles were returned
  1388. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1389. //! \ingroup gpu
  1390. ///////////////////////////////////////////////////////////////////////////////
  1391. NVAPI_INTERFACE NvAPI_GetLogicalGPUFromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGPU, NvLogicalGpuHandle *pLogicalGPU);
  1392. ///////////////////////////////////////////////////////////////////////////////
  1393. //
  1394. // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromLogicalGPU
  1395. //
  1396. //! This function returns the physical GPU handles associated with the specified logical GPU handle.
  1397. //! At least one GPU must be present in the system and running an NVIDIA display driver.
  1398. //!
  1399. //! The array hPhysicalGPU will be filled with physical GPU handle values. The returned
  1400. //! gpuCount determines how many entries in the array are valid.
  1401. //!
  1402. //! SUPPORTED OS: Windows 7 and higher
  1403. //!
  1404. //!
  1405. //! \since Release: 80
  1406. //!
  1407. //! \retval NVAPI_INVALID_ARGUMENT hLogicalGPU is not valid; hPhysicalGPU is NULL
  1408. //! \retval NVAPI_OK One or more handles were returned
  1409. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1410. //! \retval NVAPI_EXPECTED_LOGICAL_GPU_HANDLE hLogicalGPU was not a logical GPU handle
  1411. //! \ingroup gpu
  1412. ///////////////////////////////////////////////////////////////////////////////
  1413. NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromLogicalGPU(NvLogicalGpuHandle hLogicalGPU,NvPhysicalGpuHandle hPhysicalGPU[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
  1414. ///////////////////////////////////////////////////////////////////////////////
  1415. //
  1416. // FUNCTION NAME: NvAPI_GPU_GetShaderSubPipeCount
  1417. //
  1418. //! DESCRIPTION: This function retrieves the number of Shader SubPipes on the GPU
  1419. //! On newer architectures, this corresponds to the number of SM units
  1420. //!
  1421. //! SUPPORTED OS: Windows 7 and higher
  1422. //!
  1423. //!
  1424. //! TCC_SUPPORTED
  1425. //!
  1426. //! \since Release: 170
  1427. //!
  1428. //! RETURN STATUS: NVAPI_INVALID_ARGUMENT: pCount is NULL
  1429. //! NVAPI_OK: *pCount is set
  1430. //! NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1431. //! NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1432. //!
  1433. //! \ingroup gpu
  1434. ///////////////////////////////////////////////////////////////////////////////
  1435. NVAPI_INTERFACE NvAPI_GPU_GetShaderSubPipeCount(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pCount);
  1436. ///////////////////////////////////////////////////////////////////////////////
  1437. //
  1438. // FUNCTION NAME: NvAPI_GPU_GetGpuCoreCount
  1439. //
  1440. //! DESCRIPTION: Retrieves the total number of cores defined for a GPU.
  1441. //! Returns 0 on architectures that don't define GPU cores.
  1442. //!
  1443. //! SUPPORTED OS: Windows 7 and higher
  1444. //!
  1445. //!
  1446. //! TCC_SUPPORTED
  1447. //!
  1448. //! \retval ::NVAPI_INVALID_ARGUMENT pCount is NULL
  1449. //! \retval ::NVAPI_OK *pCount is set
  1450. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND no NVIDIA GPU driving a display was found
  1451. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle
  1452. //! \retval ::NVAPI_NOT_SUPPORTED API call is not supported on current architecture
  1453. //!
  1454. //! \ingroup gpu
  1455. ///////////////////////////////////////////////////////////////////////////////
  1456. NVAPI_INTERFACE NvAPI_GPU_GetGpuCoreCount(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pCount);
  1457. ///////////////////////////////////////////////////////////////////////////////
  1458. //
  1459. // FUNCTION NAME: NvAPI_GPU_GetAllOutputs
  1460. //
  1461. //! This function returns set of all GPU-output identifiers as a bitmask.
  1462. //!
  1463. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds.
  1464. //! SUPPORTED OS: Windows 7 and higher
  1465. //!
  1466. //!
  1467. //! \since Release: 85
  1468. //!
  1469. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL.
  1470. //! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers.
  1471. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  1472. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  1473. //! \ingroup gpu
  1474. ///////////////////////////////////////////////////////////////////////////////
  1475. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds.")
  1476. NVAPI_INTERFACE NvAPI_GPU_GetAllOutputs(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pOutputsMask);
  1477. ///////////////////////////////////////////////////////////////////////////////
  1478. //
  1479. // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputs
  1480. //
  1481. //! This function is the same as NvAPI_GPU_GetAllOutputs() but returns only the set of GPU output
  1482. //! identifiers that are connected to display devices.
  1483. //!
  1484. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
  1485. //! SUPPORTED OS: Windows 7 and higher
  1486. //!
  1487. //!
  1488. //! \since Release: 80
  1489. //!
  1490. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL.
  1491. //! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers.
  1492. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  1493. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  1494. //! \ingroup gpu
  1495. ///////////////////////////////////////////////////////////////////////////////
  1496. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
  1497. NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1498. ///////////////////////////////////////////////////////////////////////////////
  1499. //
  1500. // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputs
  1501. //
  1502. //! DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputs() but returns only the set of GPU-output
  1503. //! identifiers that can be selected in an SLI configuration.
  1504. //! NOTE: This function matches NvAPI_GPU_GetConnectedOutputs()
  1505. //! - On systems which are not SLI capable.
  1506. //! - If the queried GPU is not part of a valid SLI group.
  1507. //!
  1508. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
  1509. //! SUPPORTED OS: Windows 7 and higher
  1510. //!
  1511. //!
  1512. //! \since Release: 170
  1513. //!
  1514. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL
  1515. //! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers
  1516. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1517. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1518. //!
  1519. //! \ingroup gpu
  1520. ///////////////////////////////////////////////////////////////////////////////
  1521. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
  1522. NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1523. //! \ingroup gpu
  1524. typedef enum
  1525. {
  1526. NV_MONITOR_CONN_TYPE_UNINITIALIZED = 0,
  1527. NV_MONITOR_CONN_TYPE_VGA,
  1528. NV_MONITOR_CONN_TYPE_COMPONENT,
  1529. NV_MONITOR_CONN_TYPE_SVIDEO,
  1530. NV_MONITOR_CONN_TYPE_HDMI,
  1531. NV_MONITOR_CONN_TYPE_DVI,
  1532. NV_MONITOR_CONN_TYPE_LVDS,
  1533. NV_MONITOR_CONN_TYPE_DP,
  1534. NV_MONITOR_CONN_TYPE_COMPOSITE,
  1535. NV_MONITOR_CONN_TYPE_UNKNOWN = -1
  1536. } NV_MONITOR_CONN_TYPE;
  1537. //! \addtogroup gpu
  1538. //! @{
  1539. #define NV_GPU_CONNECTED_IDS_FLAG_UNCACHED NV_BIT(0) //!< Get uncached connected devices
  1540. #define NV_GPU_CONNECTED_IDS_FLAG_SLI NV_BIT(1) //!< Get devices such that those can be selected in an SLI configuration
  1541. #define NV_GPU_CONNECTED_IDS_FLAG_LIDSTATE NV_BIT(2) //!< Get devices such that to reflect the Lid State
  1542. #define NV_GPU_CONNECTED_IDS_FLAG_FAKE NV_BIT(3) //!< Get devices that includes the fake connected monitors
  1543. #define NV_GPU_CONNECTED_IDS_FLAG_EXCLUDE_MST NV_BIT(4) //!< Excludes devices that are part of the multi stream topology.
  1544. //! @}
  1545. //! \ingroup gpu
  1546. typedef struct _NV_GPU_DISPLAYIDS
  1547. {
  1548. NvU32 version;
  1549. 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
  1550. //!< GPU connector type from NvAPI_GPU_GetConnectorInfo/NvAPI_GPU_GetConnectorInfoEx
  1551. NvU32 displayId; //!< this is a unique identifier for each device
  1552. NvU32 isDynamic : 1; //!< if bit is set then this display is part of MST topology and it's a dynamic
  1553. 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
  1554. //!< a single multi stream capable monitor is connected to it, the monitor will share the display id with the RootNode.
  1555. //!< When there is more than one monitor connected in a multi stream topology, then the root node will have a separate displayId.
  1556. NvU32 isActive : 1; //!< if bit is set then this display is being actively driven
  1557. NvU32 isCluster : 1; //!< if bit is set then this display is the representative display
  1558. NvU32 isOSVisible : 1; //!< if bit is set, then this display is reported to the OS
  1559. NvU32 isWFD : 1; //!< if bit is set, then this display is wireless
  1560. NvU32 isConnected : 1; //!< if bit is set, then this display is connected
  1561. NvU32 reservedInternal :10; //!< Do not use
  1562. NvU32 isPhysicallyConnected : 1; //!< if bit is set, then this display is a phycially connected display; Valid only when isConnected bit is set
  1563. NvU32 reserved : 14; //!< must be zero
  1564. } NV_GPU_DISPLAYIDS;
  1565. //! \ingroup gpu
  1566. //! Macro for constructing the version field of ::_NV_GPU_DISPLAYIDS
  1567. #define NV_GPU_DISPLAYIDS_VER1 MAKE_NVAPI_VERSION(NV_GPU_DISPLAYIDS,1)
  1568. #define NV_GPU_DISPLAYIDS_VER2 MAKE_NVAPI_VERSION(NV_GPU_DISPLAYIDS,3)
  1569. #define NV_GPU_DISPLAYIDS_VER NV_GPU_DISPLAYIDS_VER2
  1570. ///////////////////////////////////////////////////////////////////////////////
  1571. //
  1572. // FUNCTION NAME: NvAPI_GPU_GetConnectedDisplayIds
  1573. //
  1574. //! \code
  1575. //! DESCRIPTION: Due to space limitation NvAPI_GPU_GetConnectedOutputs can return maximum 32 devices, but
  1576. //! this is no longer true for DPMST. NvAPI_GPU_GetConnectedDisplayIds will return all
  1577. //! the connected display devices in the form of displayIds for the associated hPhysicalGpu.
  1578. //! This function can accept set of flags to request cached, uncached, sli and lid to get the connected devices.
  1579. //! Default value for flags will be cached .
  1580. //! HOW TO USE: 1) for each PhysicalGpu, make a call to get the number of connected displayId's
  1581. //! using NvAPI_GPU_GetConnectedDisplayIds by passing the pDisplayIds as NULL
  1582. //! On call success:
  1583. //! 2) If pDisplayIdCount is greater than 0, allocate memory based on pDisplayIdCount. Then make a call NvAPI_GPU_GetConnectedDisplayIds to populate DisplayIds.
  1584. //! However, if pDisplayIdCount is 0, do not make this call.
  1585. //! SUPPORTED OS: Windows 7 and higher
  1586. //!
  1587. //! PARAMETERS: hPhysicalGpu (IN) - GPU selection
  1588. //! flags (IN) - One or more defines from NV_GPU_CONNECTED_IDS_FLAG_* as valid flags.
  1589. //! pDisplayIds (IN/OUT) - Pointer to an NV_GPU_DISPLAYIDS struct, each entry represents a one displayID and its attributes
  1590. //! pDisplayIdCount(OUT)- Number of displayId's.
  1591. //!
  1592. //! RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pDisplayIds or pDisplayIdCount is NULL
  1593. //! NVAPI_OK: *pDisplayIds contains a set of GPU-output identifiers
  1594. //! NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1595. //! NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1596. //! \endcode
  1597. //! \ingroup gpu
  1598. ///////////////////////////////////////////////////////////////////////////////
  1599. NVAPI_INTERFACE NvAPI_GPU_GetConnectedDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu, __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS* pDisplayIds, __inout NvU32* pDisplayIdCount, __in NvU32 flags);
  1600. ///////////////////////////////////////////////////////////////////////////////
  1601. //
  1602. // FUNCTION NAME: NvAPI_GPU_GetAllDisplayIds
  1603. //
  1604. //! DESCRIPTION: This API returns display IDs for all possible outputs on the GPU.
  1605. //! For DPMST connector, it will return display IDs for all the video sinks in the topology. \n
  1606. //! 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
  1607. //! a) hPhysicalGpu - a valid GPU handle(enumerated using NvAPI_EnumPhysicalGPUs()) as input, \n
  1608. //! b) pDisplayIds - NULL, as we just want to get the display ID count. \n
  1609. //! c) pDisplayIdCount - a valid pointer to NvU32, whose value is set to ZERO. \n
  1610. //! If all parameters are correct and this call is successful, this call will return the display ID's count. \n
  1611. //! 2. To get the display ID array, make the second call to NvAPI_GPU_GetAllDisplayIds() with \n
  1612. //! a) hPhysicalGpu - should be same value which was sent in first call, \n
  1613. //! b) pDisplayIds - pointer to the display ID array allocated by caller based on display ID count, \n
  1614. //! eg. malloc(sizeof(NV_GPU_DISPLAYIDS) * pDisplayIdCount). \n
  1615. //! c) pDisplayIdCount - a valid pointer to NvU32. This indicates for how many display IDs \n
  1616. //! the memory is allocated(pDisplayIds) by the caller. \n
  1617. //! If all parameters are correct and this call is successful, this call will return the display ID array and actual
  1618. //! display ID count (which was obtained in the first call to NvAPI_GPU_GetAllDisplayIds). If the input display ID count is
  1619. //! less than the actual display ID count, it will overwrite the input and give the pDisplayIdCount as actual count and the
  1620. //! API will return NVAPI_INSUFFICIENT_BUFFER.
  1621. //!
  1622. //! SUPPORTED OS: Windows 7 and higher
  1623. //!
  1624. //!
  1625. //! \param [in] hPhysicalGpu GPU selection.
  1626. //! \param [in,out] DisplayIds Pointer to an array of NV_GPU_DISPLAYIDS structures, each entry represents one displayID
  1627. //! and its attributes.
  1628. //! \param [in,out] pDisplayIdCount As input, this parameter indicates the number of display's id's for which caller has
  1629. //! allocated the memory. As output, it will return the actual number of display IDs.
  1630. //!
  1631. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  1632. //! specific meaning for this API, they are listed below.
  1633. //!
  1634. //! \retval NVAPI_INSUFFICIENT_BUFFER When the input buffer(pDisplayIds) is less than the actual number of display IDs, this API
  1635. //! will return NVAPI_INSUFFICIENT_BUFFER.
  1636. //!
  1637. //! \ingroup gpu
  1638. ///////////////////////////////////////////////////////////////////////////////
  1639. NVAPI_INTERFACE NvAPI_GPU_GetAllDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu, __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS* pDisplayIds, __inout NvU32* pDisplayIdCount);
  1640. ///////////////////////////////////////////////////////////////////////////////
  1641. //
  1642. // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputsWithLidState
  1643. //
  1644. //! This function is similar to NvAPI_GPU_GetConnectedOutputs(), and returns the connected display identifiers that are connected
  1645. //! as an output mask but unlike NvAPI_GPU_GetConnectedOutputs() this API "always" reflects the Lid State in the output mask.
  1646. //! Thus if you expect the LID close state to be available in the connection mask use this API.
  1647. //! - If LID is closed then this API will remove the LID panel from the connected display identifiers.
  1648. //! - If LID is open then this API will reflect the LID panel in the connected display identifiers.
  1649. //!
  1650. //! \note This API should be used on notebook systems and on systems where the LID state is required in the connection
  1651. //! output mask. On desktop systems the returned identifiers will match NvAPI_GPU_GetConnectedOutputs().
  1652. //!
  1653. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
  1654. //! SUPPORTED OS: Windows 7 and higher
  1655. //!
  1656. //!
  1657. //! \since Release: 95
  1658. //!
  1659. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL
  1660. //! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers
  1661. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1662. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle
  1663. //! \ingroup gpu
  1664. ///////////////////////////////////////////////////////////////////////////////
  1665. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
  1666. NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1667. ///////////////////////////////////////////////////////////////////////////////
  1668. //
  1669. // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputsWithLidState
  1670. //
  1671. //! DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputsWithLidState() but returns only the set
  1672. //! of GPU-output identifiers that can be selected in an SLI configuration. With SLI disabled,
  1673. //! this function matches NvAPI_GPU_GetConnectedOutputsWithLidState().
  1674. //!
  1675. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
  1676. //! SUPPORTED OS: Windows 7 and higher
  1677. //!
  1678. //!
  1679. //! \since Release: 170
  1680. //!
  1681. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL
  1682. //! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers
  1683. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1684. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle
  1685. //!
  1686. //! \ingroup gpu
  1687. ///////////////////////////////////////////////////////////////////////////////
  1688. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
  1689. NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1690. ///////////////////////////////////////////////////////////////////////////////
  1691. //
  1692. // FUNCTION NAME: NvAPI_GPU_GetSystemType
  1693. //
  1694. //! \fn NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType)
  1695. //! This function identifies whether the GPU is a notebook GPU or a desktop GPU.
  1696. //!
  1697. //! SUPPORTED OS: Windows 7 and higher
  1698. //!
  1699. //!
  1700. //! TCC_SUPPORTED
  1701. //!
  1702. //! \since Release: 95
  1703. //!
  1704. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL
  1705. //! \retval NVAPI_OK *pSystemType contains the GPU system type
  1706. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1707. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1708. //
  1709. ///////////////////////////////////////////////////////////////////////////////
  1710. //! \ingroup gpu
  1711. //! Used in NvAPI_GPU_GetSystemType()
  1712. typedef enum
  1713. {
  1714. NV_SYSTEM_TYPE_UNKNOWN = 0,
  1715. NV_SYSTEM_TYPE_LAPTOP = 1,
  1716. NV_SYSTEM_TYPE_DESKTOP = 2,
  1717. } NV_SYSTEM_TYPE;
  1718. //! \ingroup gpu
  1719. NVAPI_INTERFACE NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType);
  1720. ///////////////////////////////////////////////////////////////////////////////
  1721. //
  1722. // FUNCTION NAME: NvAPI_GPU_GetActiveOutputs
  1723. //
  1724. //! This function is the same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU output
  1725. //! identifiers that are actively driving display devices.
  1726. //!
  1727. //! SUPPORTED OS: Windows 7 and higher
  1728. //!
  1729. //!
  1730. //! \since Release: 85
  1731. //!
  1732. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL.
  1733. //! \retval NVAPI_OK *pOutputsMask contains a set of GPU-output identifiers.
  1734. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  1735. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  1736. //! \ingroup gpu
  1737. ///////////////////////////////////////////////////////////////////////////////
  1738. NVAPI_INTERFACE NvAPI_GPU_GetActiveOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1739. ///////////////////////////////////////////////////////////////////////////////
  1740. //
  1741. // FUNCTION NAME: NvAPI_GPU_SetEDID
  1742. //
  1743. //! Thus function sets the EDID data for the specified GPU handle and connection bit mask.
  1744. //! User can either send (Gpu handle & output id) or only display Id in variable displayOutputId parameter & hPhysicalGpu parameter can be default handle (0).
  1745. //! \note The EDID will be cached across the boot session and will be enumerated to the OS in this call.
  1746. //! To remove the EDID set sizeofEDID to zero.
  1747. //! OS and NVAPI connection status APIs will reflect the newly set or removed EDID dynamically.
  1748. //!
  1749. //! This feature will NOT be supported on the following boards:
  1750. //! - GeForce
  1751. //! - Quadro VX
  1752. //! - Tesla
  1753. //!
  1754. //! SUPPORTED OS: Windows 7 and higher
  1755. //!
  1756. //!
  1757. //! \since Release: 100
  1758. //!
  1759. //! \retval NVAPI_INVALID_ARGUMENT pEDID is NULL; displayOutputId has 0 or > 1 bits set
  1760. //! \retval NVAPI_OK *pEDID data was applied to the requested displayOutputId.
  1761. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  1762. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle.
  1763. //! \retval NVAPI_NOT_SUPPORTED For the above mentioned GPUs
  1764. //! \ingroup gpu
  1765. ///////////////////////////////////////////////////////////////////////////////
  1766. NVAPI_INTERFACE NvAPI_GPU_SetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID);
  1767. ///////////////////////////////////////////////////////////////////////////////
  1768. //
  1769. // FUNCTION NAME: NvAPI_GPU_GetOutputType
  1770. //
  1771. //! \fn NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType)
  1772. //! This function returns the output type. User can either specify both 'physical GPU handle and outputId (exactly 1 bit set - see \ref handles)' or
  1773. //! a valid displayId in the outputId parameter.
  1774. //!
  1775. //! SUPPORTED OS: Windows 7 and higher
  1776. //!
  1777. //!
  1778. //! \Version Earliest supported ForceWare version: 82.61
  1779. //!
  1780. //! \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.
  1781. //! \retval NVAPI_OK *pOutputType contains a NvGpuOutputType value
  1782. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1783. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle
  1784. //
  1785. ///////////////////////////////////////////////////////////////////////////////
  1786. //! \ingroup gpu
  1787. //! used in NvAPI_GPU_GetOutputType()
  1788. typedef enum _NV_GPU_OUTPUT_TYPE
  1789. {
  1790. NVAPI_GPU_OUTPUT_UNKNOWN = 0,
  1791. NVAPI_GPU_OUTPUT_CRT = 1, //!< CRT display device
  1792. NVAPI_GPU_OUTPUT_DFP = 2, //!< Digital Flat Panel display device
  1793. NVAPI_GPU_OUTPUT_TV = 3, //!< TV display device
  1794. } NV_GPU_OUTPUT_TYPE;
  1795. //! \ingroup gpu
  1796. NVAPI_INTERFACE NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType);
  1797. ///////////////////////////////////////////////////////////////////////////////
  1798. //
  1799. // FUNCTION NAME: NvAPI_GPU_ValidateOutputCombination
  1800. //
  1801. //! This function determines if a set of GPU outputs can be active
  1802. //! simultaneously. While a GPU may have <n> outputs, typically they cannot
  1803. //! all be active at the same time due to internal resource sharing.
  1804. //!
  1805. //! Given a physical GPU handle and a mask of candidate outputs, this call
  1806. //! will return NVAPI_OK if all of the specified outputs can be driven
  1807. //! simultaneously. It will return NVAPI_INVALID_COMBINATION if they cannot.
  1808. //!
  1809. //! Use NvAPI_GPU_GetAllOutputs() to determine which outputs are candidates.
  1810. //!
  1811. //! SUPPORTED OS: Windows 7 and higher
  1812. //!
  1813. //!
  1814. //! \since Release: 85
  1815. //!
  1816. //! \retval NVAPI_OK Combination of outputs in outputsMask are valid (can be active simultaneously).
  1817. //! \retval NVAPI_INVALID_COMBINATION Combination of outputs in outputsMask are NOT valid.
  1818. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or outputsMask does not have at least 2 bits set.
  1819. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  1820. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  1821. //! \ingroup gpu
  1822. ///////////////////////////////////////////////////////////////////////////////
  1823. NVAPI_INTERFACE NvAPI_GPU_ValidateOutputCombination(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputsMask);
  1824. ///////////////////////////////////////////////////////////////////////////////
  1825. //
  1826. // FUNCTION NAME: NvAPI_GPU_GetFullName
  1827. //
  1828. //! This function retrieves the full GPU name as an ASCII string - for example, "Quadro FX 1400".
  1829. //!
  1830. //! SUPPORTED OS: Windows 7 and higher
  1831. //!
  1832. //!
  1833. //! TCC_SUPPORTED
  1834. //!
  1835. //! \since Release: 90
  1836. //!
  1837. //! \return NVAPI_ERROR or NVAPI_OK
  1838. //! \ingroup gpu
  1839. ///////////////////////////////////////////////////////////////////////////////
  1840. NVAPI_INTERFACE NvAPI_GPU_GetFullName(NvPhysicalGpuHandle hPhysicalGpu, NvAPI_ShortString szName);
  1841. ///////////////////////////////////////////////////////////////////////////////
  1842. //
  1843. // FUNCTION NAME: NvAPI_GPU_GetPCIIdentifiers
  1844. //
  1845. //! This function returns the PCI identifiers associated with this GPU.
  1846. //!
  1847. //! SUPPORTED OS: Windows 7 and higher
  1848. //!
  1849. //!
  1850. //! TCC_SUPPORTED
  1851. //!
  1852. //! \since Release: 90
  1853. //!
  1854. //! \param DeviceId The internal PCI device identifier for the GPU.
  1855. //! \param SubSystemId The internal PCI subsystem identifier for the GPU.
  1856. //! \param RevisionId The internal PCI device-specific revision identifier for the GPU.
  1857. //! \param ExtDeviceId The external PCI device identifier for the GPU.
  1858. //!
  1859. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or an argument is NULL
  1860. //! \retval NVAPI_OK Arguments are populated with PCI identifiers
  1861. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1862. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle
  1863. //! \ingroup gpu
  1864. ///////////////////////////////////////////////////////////////////////////////
  1865. NVAPI_INTERFACE NvAPI_GPU_GetPCIIdentifiers(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pDeviceId,NvU32 *pSubSystemId,NvU32 *pRevisionId,NvU32 *pExtDeviceId);
  1866. //! \ingroup gpu
  1867. //! Used in NvAPI_GPU_GetGPUType().
  1868. typedef enum _NV_GPU_TYPE
  1869. {
  1870. NV_SYSTEM_TYPE_GPU_UNKNOWN = 0,
  1871. NV_SYSTEM_TYPE_IGPU = 1, //!< Integrated GPU
  1872. NV_SYSTEM_TYPE_DGPU = 2, //!< Discrete GPU
  1873. } NV_GPU_TYPE;
  1874. ///////////////////////////////////////////////////////////////////////////////
  1875. //
  1876. // FUNCTION NAME: NvAPI_GPU_GetGPUType
  1877. //
  1878. //! DESCRIPTION: This function returns the GPU type (integrated or discrete).
  1879. //! See ::NV_GPU_TYPE.
  1880. //!
  1881. //! SUPPORTED OS: Windows 7 and higher
  1882. //!
  1883. //!
  1884. //! TCC_SUPPORTED
  1885. //!
  1886. //! \since Release: 173
  1887. //!
  1888. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu
  1889. //! \retval NVAPI_OK *pGpuType contains the GPU type
  1890. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  1891. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1892. //!
  1893. //! \ingroup gpu
  1894. ///////////////////////////////////////////////////////////////////////////////
  1895. NVAPI_INTERFACE NvAPI_GPU_GetGPUType(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_TYPE *pGpuType);
  1896. //! \ingroup gpu
  1897. //! Used in NvAPI_GPU_GetBusType()
  1898. typedef enum _NV_GPU_BUS_TYPE
  1899. {
  1900. NVAPI_GPU_BUS_TYPE_UNDEFINED = 0,
  1901. NVAPI_GPU_BUS_TYPE_PCI = 1,
  1902. NVAPI_GPU_BUS_TYPE_AGP = 2,
  1903. NVAPI_GPU_BUS_TYPE_PCI_EXPRESS = 3,
  1904. NVAPI_GPU_BUS_TYPE_FPCI = 4,
  1905. NVAPI_GPU_BUS_TYPE_AXI = 5,
  1906. } NV_GPU_BUS_TYPE;
  1907. ///////////////////////////////////////////////////////////////////////////////
  1908. //
  1909. // FUNCTION NAME: NvAPI_GPU_GetBusType
  1910. //
  1911. //! This function returns the type of bus associated with this GPU.
  1912. //!
  1913. //! SUPPORTED OS: Windows 7 and higher
  1914. //!
  1915. //!
  1916. //! TCC_SUPPORTED
  1917. //!
  1918. //! \since Release: 90
  1919. //!
  1920. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  1921. //! specific meaning for this API, they are listed below.
  1922. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusType is NULL.
  1923. //! \retval NVAPI_OK *pBusType contains bus identifier.
  1924. //! \ingroup gpu
  1925. ///////////////////////////////////////////////////////////////////////////////
  1926. NVAPI_INTERFACE NvAPI_GPU_GetBusType(NvPhysicalGpuHandle hPhysicalGpu,NV_GPU_BUS_TYPE *pBusType);
  1927. ///////////////////////////////////////////////////////////////////////////////
  1928. //
  1929. // FUNCTION NAME: NvAPI_GPU_GetBusId
  1930. //
  1931. //! DESCRIPTION: Returns the ID of the bus associated with this GPU.
  1932. //!
  1933. //! SUPPORTED OS: Windows 7 and higher
  1934. //!
  1935. //!
  1936. //! TCC_SUPPORTED
  1937. //!
  1938. //! \since Release: 167
  1939. //!
  1940. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusId is NULL.
  1941. //! \retval NVAPI_OK *pBusId contains the bus ID.
  1942. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  1943. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  1944. //!
  1945. //! \ingroup gpu
  1946. ///////////////////////////////////////////////////////////////////////////////
  1947. NVAPI_INTERFACE NvAPI_GPU_GetBusId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId);
  1948. ///////////////////////////////////////////////////////////////////////////////
  1949. //
  1950. // FUNCTION NAME: NvAPI_GPU_GetBusSlotId
  1951. //
  1952. //! DESCRIPTION: Returns the ID of the bus slot associated with this GPU.
  1953. //!
  1954. //! SUPPORTED OS: Windows 7 and higher
  1955. //!
  1956. //!
  1957. //! TCC_SUPPORTED
  1958. //!
  1959. //! \since Release: 167
  1960. //!
  1961. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusSlotId is NULL.
  1962. //! \retval NVAPI_OK *pBusSlotId contains the bus slot ID.
  1963. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  1964. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  1965. //!
  1966. //! \ingroup gpu
  1967. ///////////////////////////////////////////////////////////////////////////////
  1968. NVAPI_INTERFACE NvAPI_GPU_GetBusSlotId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId);
  1969. ///////////////////////////////////////////////////////////////////////////////
  1970. //
  1971. // FUNCTION NAME: NvAPI_GPU_GetIRQ
  1972. //
  1973. //! This function returns the interrupt number associated with this GPU.
  1974. //!
  1975. //! SUPPORTED OS: Windows 7 and higher
  1976. //!
  1977. //!
  1978. //! TCC_SUPPORTED
  1979. //!
  1980. //! \since Release: 90
  1981. //!
  1982. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pIRQ is NULL.
  1983. //! \retval NVAPI_OK *pIRQ contains interrupt number.
  1984. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  1985. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  1986. //! \ingroup gpu
  1987. ///////////////////////////////////////////////////////////////////////////////
  1988. NVAPI_INTERFACE NvAPI_GPU_GetIRQ(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pIRQ);
  1989. ///////////////////////////////////////////////////////////////////////////////
  1990. //
  1991. // FUNCTION NAME: NvAPI_GPU_GetVbiosRevision
  1992. //
  1993. //! This function returns the revision of the video BIOS associated with this GPU.
  1994. //!
  1995. //! SUPPORTED OS: Windows 7 and higher
  1996. //!
  1997. //!
  1998. //! TCC_SUPPORTED
  1999. //!
  2000. //! \since Release: 90
  2001. //!
  2002. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBiosRevision is NULL.
  2003. //! \retval NVAPI_OK *pBiosRevision contains revision number.
  2004. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  2005. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  2006. //! \ingroup gpu
  2007. ///////////////////////////////////////////////////////////////////////////////
  2008. NVAPI_INTERFACE NvAPI_GPU_GetVbiosRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision);
  2009. ///////////////////////////////////////////////////////////////////////////////
  2010. //
  2011. // FUNCTION NAME: NvAPI_GPU_GetVbiosOEMRevision
  2012. //
  2013. //! This function returns the OEM revision of the video BIOS associated with this GPU.
  2014. //!
  2015. //! SUPPORTED OS: Windows 7 and higher
  2016. //!
  2017. //!
  2018. //! TCC_SUPPORTED
  2019. //!
  2020. //! \since Release: 90
  2021. //!
  2022. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBiosRevision is NULL
  2023. //! \retval NVAPI_OK *pBiosRevision contains revision number
  2024. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  2025. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle
  2026. //! \ingroup gpu
  2027. ///////////////////////////////////////////////////////////////////////////////
  2028. NVAPI_INTERFACE NvAPI_GPU_GetVbiosOEMRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision);
  2029. ///////////////////////////////////////////////////////////////////////////////
  2030. //
  2031. // FUNCTION NAME: NvAPI_GPU_GetVbiosVersionString
  2032. //
  2033. //! This function returns the full video BIOS version string in the form of xx.xx.xx.xx.yy where
  2034. //! - xx numbers come from NvAPI_GPU_GetVbiosRevision() and
  2035. //! - yy comes from NvAPI_GPU_GetVbiosOEMRevision().
  2036. //!
  2037. //! SUPPORTED OS: Windows 7 and higher
  2038. //!
  2039. //!
  2040. //! TCC_SUPPORTED
  2041. //!
  2042. //! \since Release: 90
  2043. //!
  2044. //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu is NULL.
  2045. //! \retval NVAPI_OK szBiosRevision contains version string.
  2046. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  2047. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  2048. //! \ingroup gpu
  2049. ///////////////////////////////////////////////////////////////////////////////
  2050. NVAPI_INTERFACE NvAPI_GPU_GetVbiosVersionString(NvPhysicalGpuHandle hPhysicalGpu,NvAPI_ShortString szBiosRevision);
  2051. ///////////////////////////////////////////////////////////////////////////////
  2052. //
  2053. // FUNCTION NAME: NvAPI_GPU_GetAGPAperture
  2054. //
  2055. //! This function returns the AGP aperture in megabytes.
  2056. //!
  2057. //! SUPPORTED OS: Windows 7 and higher
  2058. //!
  2059. //!
  2060. //! TCC_SUPPORTED
  2061. //!
  2062. //! \since Release: 90
  2063. //!
  2064. //! \retval NVAPI_INVALID_ARGUMENT pSize is NULL.
  2065. //! \retval NVAPI_OK Call successful.
  2066. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  2067. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  2068. //! \ingroup gpu
  2069. ///////////////////////////////////////////////////////////////////////////////
  2070. NVAPI_INTERFACE NvAPI_GPU_GetAGPAperture(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize);
  2071. ///////////////////////////////////////////////////////////////////////////////
  2072. //
  2073. // FUNCTION NAME: NvAPI_GPU_GetCurrentAGPRate
  2074. //
  2075. //! This function returns the current AGP Rate (0 = AGP not present, 1 = 1x, 2 = 2x, etc.).
  2076. //!
  2077. //! SUPPORTED OS: Windows 7 and higher
  2078. //!
  2079. //!
  2080. //! TCC_SUPPORTED
  2081. //!
  2082. //! \since Release: 90
  2083. //!
  2084. //! \retval NVAPI_INVALID_ARGUMENT pRate is NULL.
  2085. //! \retval NVAPI_OK Call successful.
  2086. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  2087. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  2088. //! \ingroup gpu
  2089. ///////////////////////////////////////////////////////////////////////////////
  2090. NVAPI_INTERFACE NvAPI_GPU_GetCurrentAGPRate(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pRate);
  2091. ///////////////////////////////////////////////////////////////////////////////
  2092. //
  2093. // FUNCTION NAME: NvAPI_GPU_GetCurrentPCIEDownstreamWidth
  2094. //
  2095. //! This function returns the number of PCIE lanes being used for the PCIE interface
  2096. //! downstream from the GPU.
  2097. //!
  2098. //! SUPPORTED OS: Windows 7 and higher
  2099. //!
  2100. //!
  2101. //! TCC_SUPPORTED
  2102. //!
  2103. //! \since Release: 90
  2104. //!
  2105. //! \retval NVAPI_INVALID_ARGUMENT pWidth is NULL.
  2106. //! \retval NVAPI_OK Call successful.
  2107. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  2108. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  2109. //! \ingroup gpu
  2110. ///////////////////////////////////////////////////////////////////////////////
  2111. NVAPI_INTERFACE NvAPI_GPU_GetCurrentPCIEDownstreamWidth(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pWidth);
  2112. ///////////////////////////////////////////////////////////////////////////////
  2113. //
  2114. // FUNCTION NAME: NvAPI_GPU_GetPhysicalFrameBufferSize
  2115. //
  2116. //! This function returns the physical size of framebuffer in KB. This does NOT include any
  2117. //! system RAM that may be dedicated for use by the GPU.
  2118. //!
  2119. //! SUPPORTED OS: Windows 7 and higher
  2120. //!
  2121. //!
  2122. //! TCC_SUPPORTED
  2123. //!
  2124. //! \since Release: 90
  2125. //!
  2126. //! \retval NVAPI_INVALID_ARGUMENT pSize is NULL
  2127. //! \retval NVAPI_OK Call successful
  2128. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  2129. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle
  2130. //! \ingroup gpu
  2131. ///////////////////////////////////////////////////////////////////////////////
  2132. NVAPI_INTERFACE NvAPI_GPU_GetPhysicalFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize);
  2133. ///////////////////////////////////////////////////////////////////////////////
  2134. //
  2135. // FUNCTION NAME: NvAPI_GPU_GetVirtualFrameBufferSize
  2136. //
  2137. //! This function returns the virtual size of framebuffer in KB. This includes the physical RAM plus any
  2138. //! system RAM that has been dedicated for use by the GPU.
  2139. //!
  2140. //! SUPPORTED OS: Windows 7 and higher
  2141. //!
  2142. //!
  2143. //! TCC_SUPPORTED
  2144. //!
  2145. //! \since Release: 90
  2146. //!
  2147. //! \retval NVAPI_INVALID_ARGUMENT pSize is NULL.
  2148. //! \retval NVAPI_OK Call successful.
  2149. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  2150. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu was not a physical GPU handle.
  2151. //! \ingroup gpu
  2152. ///////////////////////////////////////////////////////////////////////////////
  2153. NVAPI_INTERFACE NvAPI_GPU_GetVirtualFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize);
  2154. ///////////////////////////////////////////////////////////////////////////////
  2155. //
  2156. // FUNCTION NAME: NvAPI_GPU_GetQuadroStatus
  2157. //
  2158. //! This function retrieves the Quadro status for the GPU (1 if Quadro, 0 if GeForce)
  2159. //!
  2160. //! SUPPORTED OS: Windows 7 and higher
  2161. //!
  2162. //!
  2163. //! \since Release: 80
  2164. //!
  2165. //! \return NVAPI_ERROR or NVAPI_OK
  2166. //! \ingroup gpu
  2167. ///////////////////////////////////////////////////////////////////////////////
  2168. NVAPI_INTERFACE NvAPI_GPU_GetQuadroStatus(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pStatus);
  2169. //! \ingroup gpu
  2170. typedef struct _NV_BOARD_INFO
  2171. {
  2172. NvU32 version; //!< structure version
  2173. NvU8 BoardNum[16]; //!< Board Serial Number
  2174. }NV_BOARD_INFO_V1;
  2175. #define NV_BOARD_INFO_VER1 MAKE_NVAPI_VERSION(NV_BOARD_INFO_V1,1)
  2176. #ifndef NV_BOARD_INFO_VER
  2177. //! \ingroup gpu
  2178. typedef NV_BOARD_INFO_V1 NV_BOARD_INFO;
  2179. //! \ingroup gpu
  2180. //! \ingroup gpu
  2181. #define NV_BOARD_INFO_VER NV_BOARD_INFO_VER1
  2182. #endif
  2183. //! SUPPORTED OS: Windows 7 and higher
  2184. //!
  2185. ///////////////////////////////////////////////////////////////////////////////
  2186. //
  2187. // FUNCTION NAME: NvAPI_GPU_GetBoardInfo
  2188. //
  2189. //! DESCRIPTION: This API Retrieves the Board information (a unique GPU Board Serial Number) stored in the InfoROM.
  2190. //!
  2191. //! \param [in] hPhysicalGpu Physical GPU Handle.
  2192. //! \param [in,out] NV_BOARD_INFO Board Information.
  2193. //!
  2194. //! TCC_SUPPORTED
  2195. //!
  2196. //! \retval ::NVAPI_OK completed request
  2197. //! \retval ::NVAPI_ERROR miscellaneous error occurred
  2198. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE handle passed is not a physical GPU handle
  2199. //! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized
  2200. //! \retval ::NVAPI_INVALID_POINTER pBoardInfo is NULL
  2201. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION the version of the INFO struct is not supported
  2202. //!
  2203. //! \ingroup gpu
  2204. ///////////////////////////////////////////////////////////////////////////////
  2205. NVAPI_INTERFACE NvAPI_GPU_GetBoardInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_BOARD_INFO *pBoardInfo);
  2206. ///////////////////////////////////////////////////////////////////////////////////
  2207. // I2C API
  2208. // Provides ability to read or write data using I2C protocol.
  2209. // These APIs allow I2C access only to DDC monitors
  2210. //! \addtogroup i2capi
  2211. //! @{
  2212. #define NVAPI_MAX_SIZEOF_I2C_DATA_BUFFER 4096
  2213. #define NVAPI_MAX_SIZEOF_I2C_REG_ADDRESS 4
  2214. #define NVAPI_DISPLAY_DEVICE_MASK_MAX 24
  2215. #define NVAPI_I2C_SPEED_DEPRECATED 0xFFFF
  2216. typedef enum
  2217. {
  2218. NVAPI_I2C_SPEED_DEFAULT, //!< Set i2cSpeedKhz to I2C_SPEED_DEFAULT if default I2C speed is to be chosen, ie.use the current frequency setting.
  2219. NVAPI_I2C_SPEED_3KHZ,
  2220. NVAPI_I2C_SPEED_10KHZ,
  2221. NVAPI_I2C_SPEED_33KHZ,
  2222. NVAPI_I2C_SPEED_100KHZ,
  2223. NVAPI_I2C_SPEED_200KHZ,
  2224. NVAPI_I2C_SPEED_400KHZ,
  2225. } NV_I2C_SPEED;
  2226. //! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()
  2227. typedef struct
  2228. {
  2229. NvU32 version; //!< The structure version.
  2230. NvU32 displayMask; //!< The Display Mask of the concerned display.
  2231. NvU8 bIsDDCPort; //!< This flag indicates either the DDC port (TRUE) or the communication port
  2232. //!< (FALSE) of the concerned display.
  2233. NvU8 i2cDevAddress; //!< The address of the I2C slave. The address should be shifted left by one. For
  2234. //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored
  2235. //!< here as 0xA0. This matches the position within the byte sent by the master, as
  2236. //!< the last bit is reserved to specify the read or write direction.
  2237. NvU8* pbI2cRegAddress; //!< The I2C target register address. May be NULL, which indicates no register
  2238. //!< address should be sent.
  2239. NvU32 regAddrSize; //!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this
  2240. //!< field must be 0.
  2241. NvU8* pbData; //!< The buffer of data which is to be read or written (depending on the command).
  2242. NvU32 cbSize; //!< The size of the data buffer, pbData, to be read or written.
  2243. NvU32 i2cSpeed; //!< The target speed of the transaction (between 28Kbps to 40Kbps; not guaranteed).
  2244. } NV_I2C_INFO_V1;
  2245. //! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()
  2246. typedef struct
  2247. {
  2248. NvU32 version; //!< The structure version.
  2249. NvU32 displayMask; //!< The Display Mask of the concerned display.
  2250. NvU8 bIsDDCPort; //!< This flag indicates either the DDC port (TRUE) or the communication port
  2251. //!< (FALSE) of the concerned display.
  2252. NvU8 i2cDevAddress; //!< The address of the I2C slave. The address should be shifted left by one. For
  2253. //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored
  2254. //!< here as 0xA0. This matches the position within the byte sent by the master, as
  2255. //!< the last bit is reserved to specify the read or write direction.
  2256. NvU8* pbI2cRegAddress; //!< The I2C target register address. May be NULL, which indicates no register
  2257. //!< address should be sent.
  2258. NvU32 regAddrSize; //!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this
  2259. //!< field must be 0.
  2260. NvU8* pbData; //!< The buffer of data which is to be read or written (depending on the command).
  2261. NvU32 cbSize; //!< The size of the data buffer, pbData, to be read or written.
  2262. NvU32 i2cSpeed; //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED.
  2263. NV_I2C_SPEED i2cSpeedKhz; //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED).
  2264. } NV_I2C_INFO_V2;
  2265. //! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()
  2266. typedef struct
  2267. {
  2268. NvU32 version; //!< The structure version.
  2269. NvU32 displayMask; //!< The Display Mask of the concerned display.
  2270. NvU8 bIsDDCPort; //!< This flag indicates either the DDC port (TRUE) or the communication port
  2271. //!< (FALSE) of the concerned display.
  2272. NvU8 i2cDevAddress; //!< The address of the I2C slave. The address should be shifted left by one. For
  2273. //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored
  2274. //!< here as 0xA0. This matches the position within the byte sent by the master, as
  2275. //!< the last bit is reserved to specify the read or write direction.
  2276. NvU8* pbI2cRegAddress; //!< The I2C target register address. May be NULL, which indicates no register
  2277. //!< address should be sent.
  2278. NvU32 regAddrSize; //!< The size in bytes of target register address. If pbI2cRegAddress is NULL, this
  2279. //!< field must be 0.
  2280. NvU8* pbData; //!< The buffer of data which is to be read or written (depending on the command).
  2281. NvU32 cbSize; //!< The size of the data buffer, pbData, to be read or written.
  2282. NvU32 i2cSpeed; //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED.
  2283. NV_I2C_SPEED i2cSpeedKhz; //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED).
  2284. NvU8 portId; //!< The portid on which device is connected (remember to set bIsPortIdSet if this value is set)
  2285. //!< Optional for pre-Kepler
  2286. NvU32 bIsPortIdSet; //!< set this flag on if and only if portid value is set
  2287. } NV_I2C_INFO_V3;
  2288. typedef NV_I2C_INFO_V3 NV_I2C_INFO;
  2289. #define NV_I2C_INFO_VER3 MAKE_NVAPI_VERSION(NV_I2C_INFO_V3,3)
  2290. #define NV_I2C_INFO_VER2 MAKE_NVAPI_VERSION(NV_I2C_INFO_V2,2)
  2291. #define NV_I2C_INFO_VER1 MAKE_NVAPI_VERSION(NV_I2C_INFO_V1,1)
  2292. #define NV_I2C_INFO_VER NV_I2C_INFO_VER3
  2293. //! @}
  2294. /***********************************************************************************/
  2295. ///////////////////////////////////////////////////////////////////////////////
  2296. //
  2297. // FUNCTION NAME: NvAPI_I2CRead
  2298. //
  2299. //! This function reads the data buffer from the I2C port.
  2300. //! The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.
  2301. //!
  2302. //! A data buffer size larger than 16 bytes may be rejected if a register address is specified. In such a case,
  2303. //! NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.
  2304. //!
  2305. //! If a register address is specified (i.e. regAddrSize is positive), then the transaction will be performed in
  2306. //! the combined format described in the I2C specification. The register address will be written, followed by
  2307. //! reading into the data buffer.
  2308. //!
  2309. //! SUPPORTED OS: Windows 7 and higher
  2310. //!
  2311. //!
  2312. //! \since Release: 85
  2313. //!
  2314. //! \param [in] hPhysicalGPU GPU selection.
  2315. //! \param [out] NV_I2C_INFO *pI2cInfo The I2C data input structure
  2316. //!
  2317. //! \retval NVAPI_OK Completed request
  2318. //! \retval NVAPI_ERROR Miscellaneous error occurred.
  2319. //! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide).
  2320. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle.
  2321. //! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION Structure version is not supported.
  2322. //! \retval NVAPI_INVALID_ARGUMENT - argument does not meet specified requirements
  2323. //! \retval NVAPI_ARGUMENT_EXCEED_MAX_SIZE - an argument exceeds the maximum
  2324. //!
  2325. //! \ingroup i2capi
  2326. ///////////////////////////////////////////////////////////////////////////////
  2327. NVAPI_INTERFACE NvAPI_I2CRead(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo);
  2328. ///////////////////////////////////////////////////////////////////////////////
  2329. //
  2330. // FUNCTION NAME: NvAPI_I2CWrite
  2331. //
  2332. //! This function writes the data buffer to the I2C port.
  2333. //!
  2334. //! The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.
  2335. //!
  2336. //! A data buffer size larger than 16 bytes may be rejected if a register address is specified. In such a case,
  2337. //! NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.
  2338. //!
  2339. //! If a register address is specified (i.e. regAddrSize is positive), then the register address will be written
  2340. //! and the data buffer will immediately follow without a restart.
  2341. //!
  2342. //! SUPPORTED OS: Windows 7 and higher
  2343. //!
  2344. //!
  2345. //! \since Release: 85
  2346. //!
  2347. //! \param [in] hPhysicalGPU GPU selection.
  2348. //! \param [in] pI2cInfo The I2C data input structure
  2349. //!
  2350. //! \retval NVAPI_OK Completed request
  2351. //! \retval NVAPI_ERROR Miscellaneous error occurred.
  2352. //! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide).
  2353. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle.
  2354. //! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION Structure version is not supported.
  2355. //! \retval NVAPI_INVALID_ARGUMENT Argument does not meet specified requirements
  2356. //! \retval NVAPI_ARGUMENT_EXCEED_MAX_SIZE Argument exceeds the maximum
  2357. //!
  2358. //! \ingroup i2capi
  2359. ///////////////////////////////////////////////////////////////////////////////
  2360. NVAPI_INTERFACE NvAPI_I2CWrite(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo);
  2361. ///////////////////////////////////////////////////////////////////////////////
  2362. //
  2363. // FUNCTION NAME: NvAPI_GPU_WorkstationFeatureSetup
  2364. //
  2365. //! \fn NvAPI_GPU_WorkstationFeatureSetup(NvPhysicalGpuHandle hPhysicalGpu, NvU32 featureEnableMask, NvU32 featureDisableMask)
  2366. //! DESCRIPTION: This API configures the driver for a set of workstation features.
  2367. //! The driver can allocate the memory resources accordingly.
  2368. //!
  2369. //! SUPPORTED OS: Windows 7
  2370. //!
  2371. //!
  2372. //! \param [in] hPhysicalGpu Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved
  2373. //! using NvAPI_EnumPhysicalGPUs. A value of NULL is permitted and applies the same operation
  2374. //! to all GPU handles enumerated by NvAPI_EnumPhysicalGPUs.
  2375. //! \param [in] featureEnableMask Mask of features the caller requests to enable for use
  2376. //! \param [in] featureDisableMask Mask of features the caller requests to disable
  2377. //!
  2378. //! As a general rule, features in the enable and disable masks are expected to be disjoint, although the disable
  2379. //! mask has precedence and a feature flagged in both masks will be disabled.
  2380. //!
  2381. //! \retval ::NVAPI_OK configuration request succeeded
  2382. //! \retval ::NVAPI_ERROR configuration request failed
  2383. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu is not a physical GPU handle.
  2384. //! \retval ::NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE requested feature set does not have all resources allocated for completeness.
  2385. //! \retval ::NVAPI_NO_IMPLEMENTATION OS below Win7, implemented only for Win7 but returns NVAPI_OK on OS above Win7 to
  2386. //! keep compatibility with apps written against Win7.
  2387. //
  2388. ///////////////////////////////////////////////////////////////////////////////
  2389. //! \ingroup gpu
  2390. typedef enum
  2391. {
  2392. NVAPI_GPU_WORKSTATION_FEATURE_MASK_SWAPGROUP = 0x00000001,
  2393. NVAPI_GPU_WORKSTATION_FEATURE_MASK_STEREO = 0x00000010,
  2394. NVAPI_GPU_WORKSTATION_FEATURE_MASK_WARPING = 0x00000100,
  2395. NVAPI_GPU_WORKSTATION_FEATURE_MASK_PIXINTENSITY = 0x00000200,
  2396. NVAPI_GPU_WORKSTATION_FEATURE_MASK_GRAYSCALE = 0x00000400,
  2397. NVAPI_GPU_WORKSTATION_FEATURE_MASK_BPC10 = 0x00001000
  2398. } NVAPI_GPU_WORKSTATION_FEATURE_MASK;
  2399. //! \ingroup gpu
  2400. NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureSetup(__in NvPhysicalGpuHandle hPhysicalGpu, __in NvU32 featureEnableMask, __in NvU32 featureDisableMask);
  2401. ///////////////////////////////////////////////////////////////////////////////
  2402. //
  2403. // FUNCTION NAME: NvAPI_GPU_WorkstationFeatureQuery
  2404. //
  2405. //! DESCRIPTION: This API queries the current set of workstation features.
  2406. //!
  2407. //! SUPPORTED OS: Windows 7
  2408. //!
  2409. //!
  2410. //! \param [in] hPhysicalGpu Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved
  2411. //! using NvAPI_EnumPhysicalGPUs.
  2412. //! \param [out] pConfiguredFeatureMask Mask of features requested for use by client drivers
  2413. //! \param [out] pConsistentFeatureMask Mask of features that have all resources allocated for completeness.
  2414. //!
  2415. //! \retval ::NVAPI_OK configuration request succeeded
  2416. //! \retval ::NVAPI_ERROR configuration request failed
  2417. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE hPhysicalGpu is not a physical GPU handle.
  2418. //! \retval ::NVAPI_NO_IMPLEMENTATION OS below Win7, implemented only for Win7 but returns NVAPI_OK on OS above Win7 to
  2419. //! keep compatibility with apps written against Win7.
  2420. //
  2421. ///////////////////////////////////////////////////////////////////////////////
  2422. //! \ingroup gpu
  2423. NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureQuery(__in NvPhysicalGpuHandle hPhysicalGpu, __out_opt NvU32 *pConfiguredFeatureMask, __out_opt NvU32 *pConsistentFeatureMask);
  2424. ///////////////////////////////////////////////////////////////////////////////
  2425. //
  2426. // FUNCTION NAME: NvAPI_GPU_GetHDCPSupportStatus
  2427. //
  2428. //! \fn NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus)
  2429. //! DESCRIPTION: This function returns a GPU's HDCP support status.
  2430. //!
  2431. //! SUPPORTED OS: Windows 7 and higher
  2432. //!
  2433. //!
  2434. //! TCC_SUPPORTED
  2435. //!
  2436. //! \since Release: 175
  2437. //!
  2438. //! \retval ::NVAPI_OK
  2439. //! \retval ::NVAPI_ERROR
  2440. //! \retval ::NVAPI_INVALID_ARGUMENT
  2441. //! \retval ::NVAPI_HANDLE_INVALIDATED
  2442. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE
  2443. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION
  2444. //
  2445. ////////////////////////////////////////////////////////////////////////////////
  2446. //! \addtogroup gpu
  2447. //! @{
  2448. //! HDCP fuse states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS
  2449. typedef enum _NV_GPU_HDCP_FUSE_STATE
  2450. {
  2451. NV_GPU_HDCP_FUSE_STATE_UNKNOWN = 0,
  2452. NV_GPU_HDCP_FUSE_STATE_DISABLED = 1,
  2453. NV_GPU_HDCP_FUSE_STATE_ENABLED = 2,
  2454. } NV_GPU_HDCP_FUSE_STATE;
  2455. //! HDCP key sources - used in NV_GPU_GET_HDCP_SUPPORT_STATUS
  2456. typedef enum _NV_GPU_HDCP_KEY_SOURCE
  2457. {
  2458. NV_GPU_HDCP_KEY_SOURCE_UNKNOWN = 0,
  2459. NV_GPU_HDCP_KEY_SOURCE_NONE = 1,
  2460. NV_GPU_HDCP_KEY_SOURCE_CRYPTO_ROM = 2,
  2461. NV_GPU_HDCP_KEY_SOURCE_SBIOS = 3,
  2462. NV_GPU_HDCP_KEY_SOURCE_I2C_ROM = 4,
  2463. NV_GPU_HDCP_KEY_SOURCE_FUSES = 5,
  2464. } NV_GPU_HDCP_KEY_SOURCE;
  2465. //! HDCP key source states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS
  2466. typedef enum _NV_GPU_HDCP_KEY_SOURCE_STATE
  2467. {
  2468. NV_GPU_HDCP_KEY_SOURCE_STATE_UNKNOWN = 0,
  2469. NV_GPU_HDCP_KEY_SOURCE_STATE_ABSENT = 1,
  2470. NV_GPU_HDCP_KEY_SOURCE_STATE_PRESENT = 2,
  2471. } NV_GPU_HDCP_KEY_SOURCE_STATE;
  2472. //! HDPC support status - used in NvAPI_GPU_GetHDCPSupportStatus()
  2473. typedef struct
  2474. {
  2475. NvU32 version; //! Structure version constucted by macro #NV_GPU_GET_HDCP_SUPPORT_STATUS
  2476. NV_GPU_HDCP_FUSE_STATE hdcpFuseState; //! GPU's HDCP fuse state
  2477. NV_GPU_HDCP_KEY_SOURCE hdcpKeySource; //! GPU's HDCP key source
  2478. NV_GPU_HDCP_KEY_SOURCE_STATE hdcpKeySourceState; //! GPU's HDCP key source state
  2479. } NV_GPU_GET_HDCP_SUPPORT_STATUS;
  2480. //! Macro for constructing the version for structure NV_GPU_GET_HDCP_SUPPORT_STATUS
  2481. #define NV_GPU_GET_HDCP_SUPPORT_STATUS_VER MAKE_NVAPI_VERSION(NV_GPU_GET_HDCP_SUPPORT_STATUS,1)
  2482. //! @}
  2483. //! \ingroup gpu
  2484. NVAPI_INTERFACE NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus);
  2485. ///////////////////////////////////////////////////////////////////////////////
  2486. //
  2487. // FUNCTION NAME: NvAPI_GPU_GetTachReading
  2488. //
  2489. //! DESCRIPTION: This API retrieves the fan speed tachometer reading for the specified physical GPU.
  2490. //!
  2491. //! HOW TO USE:
  2492. //! - NvU32 Value = 0;
  2493. //! - ret = NvAPI_GPU_GetTachReading(hPhysicalGpu, &Value);
  2494. //! - On call success:
  2495. //! - Value contains the tachometer reading
  2496. //!
  2497. //! SUPPORTED OS: Windows 7 and higher
  2498. //!
  2499. //!
  2500. //! TCC_SUPPORTED
  2501. //!
  2502. //! \param [in] hPhysicalGpu GPU selection.
  2503. //! \param [out] pValue Pointer to a variable to get the tachometer reading
  2504. //!
  2505. //! \retval ::NVAPI_OK - completed request
  2506. //! \retval ::NVAPI_ERROR - miscellaneous error occurred
  2507. //! \retval ::NVAPI_NOT_SUPPORTED - functionality not supported
  2508. //! \retval ::NVAPI_API_NOT_INTIALIZED - nvapi not initialized
  2509. //! \retval ::NVAPI_INVALID_ARGUMENT - invalid argument passed
  2510. //! \retval ::NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
  2511. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  2512. //!
  2513. //! \ingroup gpucooler
  2514. ///////////////////////////////////////////////////////////////////////////////
  2515. NVAPI_INTERFACE NvAPI_GPU_GetTachReading(NvPhysicalGpuHandle hPhysicalGPU, NvU32 *pValue);
  2516. ///////////////////////////////////////////////////////////////////////////////
  2517. //
  2518. // FUNCTION NAME: NvAPI_GPU_GetECCStatusInfo
  2519. //
  2520. //! \fn NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu,
  2521. //! NV_GPU_ECC_STATUS_INFO *pECCStatusInfo);
  2522. //! DESCRIPTION: This function returns ECC memory status information.
  2523. //!
  2524. //! SUPPORTED OS: Windows 7 and higher
  2525. //!
  2526. //!
  2527. //! TCC_SUPPORTED
  2528. //!
  2529. //! \param [in] hPhysicalGpu A handle identifying the physical GPU for which ECC
  2530. //! status information is to be retrieved.
  2531. //! \param [out] pECCStatusInfo A pointer to an ECC status structure.
  2532. //!
  2533. //! \retval ::NVAPI_OK The request was completed successfully.
  2534. //! \retval ::NVAPI_ERROR An unknown error occurred.
  2535. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle.
  2536. //! \retval ::NVAPI_INVALID_HANDLE The provided GPU handle is invalid.
  2537. //! \retval ::NVAPI_HANDLE_INVALIDATED The provided GPU handle is no longer valid.
  2538. //! \retval ::NVAPI_INVALID_POINTER An invalid argument pointer was provided.
  2539. //! \retval ::NVAPI_NOT_SUPPORTED The request is not supported.
  2540. //! \retval ::NVAPI_API_NOT_INTIALIZED NvAPI was not yet initialized.
  2541. //
  2542. ///////////////////////////////////////////////////////////////////////////////
  2543. //! \addtogroup gpuecc
  2544. //! Used in NV_GPU_ECC_STATUS_INFO.
  2545. typedef enum _NV_ECC_CONFIGURATION
  2546. {
  2547. NV_ECC_CONFIGURATION_NOT_SUPPORTED = 0,
  2548. NV_ECC_CONFIGURATION_DEFERRED, //!< Changes require a POST to take effect
  2549. NV_ECC_CONFIGURATION_IMMEDIATE, //!< Changes can optionally be made to take effect immediately
  2550. } NV_ECC_CONFIGURATION;
  2551. //! \ingroup gpuecc
  2552. //! Used in NvAPI_GPU_GetECCStatusInfo().
  2553. typedef struct
  2554. {
  2555. NvU32 version; //!< Structure version
  2556. NvU32 isSupported : 1; //!< ECC memory feature support
  2557. NV_ECC_CONFIGURATION configurationOptions; //!< Supported ECC memory feature configuration options
  2558. NvU32 isEnabled : 1; //!< Active ECC memory setting
  2559. } NV_GPU_ECC_STATUS_INFO;
  2560. //! \ingroup gpuecc
  2561. //! Macro for constructing the version field of NV_GPU_ECC_STATUS_INFO
  2562. #define NV_GPU_ECC_STATUS_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_STATUS_INFO,1)
  2563. //! \ingroup gpuecc
  2564. NVAPI_INTERFACE NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu,
  2565. NV_GPU_ECC_STATUS_INFO *pECCStatusInfo);
  2566. //! \ingroup gpuecc
  2567. //! Used in NvAPI_GPU_GetECCErrorInfo()/
  2568. typedef struct
  2569. {
  2570. NvU32 version; //!< Structure version
  2571. struct
  2572. {
  2573. NvU64 singleBitErrors; //!< Number of single-bit ECC errors detected since last boot
  2574. NvU64 doubleBitErrors; //!< Number of double-bit ECC errors detected since last boot
  2575. } current;
  2576. struct
  2577. {
  2578. NvU64 singleBitErrors; //!< Number of single-bit ECC errors detected since last counter reset
  2579. NvU64 doubleBitErrors; //!< Number of double-bit ECC errors detected since last counter reset
  2580. } aggregate;
  2581. } NV_GPU_ECC_ERROR_INFO;
  2582. //! \ingroup gpuecc
  2583. //! Macro for constructing the version field of NV_GPU_ECC_ERROR_INFO
  2584. #define NV_GPU_ECC_ERROR_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_ERROR_INFO,1)
  2585. ///////////////////////////////////////////////////////////////////////////////
  2586. //
  2587. // FUNCTION NAME: NvAPI_GPU_GetECCErrorInfo
  2588. //
  2589. //! \fn NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu,
  2590. //! NV_GPU_ECC_ERROR_INFO *pECCErrorInfo);
  2591. //!
  2592. //! DESCRIPTION: This function returns ECC memory error information.
  2593. //!
  2594. //! SUPPORTED OS: Windows 7 and higher
  2595. //!
  2596. //!
  2597. //! TCC_SUPPORTED
  2598. //!
  2599. //! \param [in] hPhysicalGpu A handle identifying the physical GPU for
  2600. //! which ECC error information is to be
  2601. //! retrieved.
  2602. //! \param [out] pECCErrorInfo A pointer to an ECC error structure.
  2603. //!
  2604. //! \retval ::NVAPI_OK The request was completed successfully.
  2605. //! \retval ::NVAPI_ERROR An unknown error occurred.
  2606. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle.
  2607. //! \retval ::NVAPI_INVALID_ARGUMENT incorrect param value
  2608. //! \retval ::NVAPI_INVALID_POINTER An invalid argument pointer was provided.
  2609. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION structure version is not supported, initialize to NV_GPU_ECC_ERROR_INFO_VER.
  2610. //! \retval ::NVAPI_HANDLE_INVALIDATED The provided GPU handle is no longer valid.
  2611. //! \retval ::NVAPI_NOT_SUPPORTED The request is not supported.
  2612. //! \retval ::NVAPI_API_NOT_INTIALIZED NvAPI was not yet initialized.
  2613. //
  2614. ///////////////////////////////////////////////////////////////////////////////
  2615. //! \ingroup gpuecc
  2616. NVAPI_INTERFACE NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu,
  2617. NV_GPU_ECC_ERROR_INFO *pECCErrorInfo);
  2618. ///////////////////////////////////////////////////////////////////////////////
  2619. //
  2620. // FUNCTION NAME: NvAPI_GPU_ResetECCErrorInfo
  2621. //
  2622. //! DESCRIPTION: This function resets ECC memory error counters.
  2623. //!
  2624. //! SUPPORTED OS: Windows 7 and higher
  2625. //!
  2626. //!
  2627. //! TCC_SUPPORTED
  2628. //!
  2629. //! \requires Administrator privileges since release 430.39
  2630. //!
  2631. //! \param [in] hPhysicalGpu A handle identifying the physical GPU for
  2632. //! which ECC error information is to be
  2633. //! cleared.
  2634. //! \param [in] bResetCurrent Reset the current ECC error counters.
  2635. //! \param [in] bResetAggregate Reset the aggregate ECC error counters.
  2636. //!
  2637. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  2638. //! specific meaning for this API, they are listed below.
  2639. //!
  2640. //! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The application will require Administrator privileges to access this API.
  2641. //! The application can be elevated to a higher permission level by selecting "Run as Administrator".
  2642. //!
  2643. //! \ingroup gpuecc
  2644. ///////////////////////////////////////////////////////////////////////////////
  2645. NVAPI_INTERFACE NvAPI_GPU_ResetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bResetCurrent,
  2646. NvU8 bResetAggregate);
  2647. ///////////////////////////////////////////////////////////////////////////////
  2648. //
  2649. // FUNCTION NAME: NvAPI_GPU_GetECCConfigurationInfo
  2650. //
  2651. //! \fn NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu,
  2652. //! NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo);
  2653. //! DESCRIPTION: This function returns ECC memory configuration information.
  2654. //!
  2655. //! SUPPORTED OS: Windows 7 and higher
  2656. //!
  2657. //!
  2658. //! TCC_SUPPORTED
  2659. //!
  2660. //! \param [in] hPhysicalGpu A handle identifying the physical GPU for
  2661. //! which ECC configuration information
  2662. //! is to be retrieved.
  2663. //! \param [out] pECCConfigurationInfo A pointer to an ECC
  2664. //! configuration structure.
  2665. //!
  2666. //! \retval ::NVAPI_OK The request was completed successfully.
  2667. //! \retval ::NVAPI_ERROR An unknown error occurred.
  2668. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle.
  2669. //! \retval ::NVAPI_INVALID_HANDLE The provided GPU handle is invalid.
  2670. //! \retval ::NVAPI_HANDLE_INVALIDATED The provided GPU handle is no longer valid.
  2671. //! \retval ::NVAPI_INVALID_POINTER An invalid argument pointer was provided.
  2672. //! \retval ::NVAPI_NOT_SUPPORTED The request is not supported.
  2673. //! \retval ::NVAPI_API_NOT_INTIALIZED NvAPI was not yet initialized.
  2674. //
  2675. ///////////////////////////////////////////////////////////////////////////////
  2676. //! \ingroup gpuecc
  2677. //! Used in NvAPI_GPU_GetECCConfigurationInfo().
  2678. typedef struct
  2679. {
  2680. NvU32 version; //! Structure version
  2681. NvU32 isEnabled : 1; //! Current ECC configuration stored in non-volatile memory
  2682. NvU32 isEnabledByDefault : 1; //! Factory default ECC configuration (static)
  2683. } NV_GPU_ECC_CONFIGURATION_INFO;
  2684. //! \ingroup gpuecc
  2685. //! Macro for consstructing the verion field of NV_GPU_ECC_CONFIGURATION_INFO
  2686. #define NV_GPU_ECC_CONFIGURATION_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_CONFIGURATION_INFO,1)
  2687. //! \ingroup gpuecc
  2688. NVAPI_INTERFACE NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu,
  2689. NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo);
  2690. ///////////////////////////////////////////////////////////////////////////////
  2691. //
  2692. // FUNCTION NAME: NvAPI_GPU_SetECCConfiguration
  2693. //
  2694. //! DESCRIPTION: This function updates the ECC memory configuration setting.
  2695. //!
  2696. //! SUPPORTED OS: Windows 7 and higher
  2697. //!
  2698. //!
  2699. //! TCC_SUPPORTED
  2700. //!
  2701. //! \requires Administrator privileges since release 430.39
  2702. //!
  2703. //! \param [in] hPhysicalGpu A handle identifying the physical GPU for
  2704. //! which to update the ECC configuration
  2705. //! setting.
  2706. //! \param [in] bEnable The new ECC configuration setting.
  2707. //! \param [in] bEnableImmediately Request that the new setting take effect immediately.
  2708. //!
  2709. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  2710. //! specific meaning for this API, they are listed below.
  2711. //!
  2712. //! \retval ::NVAPI_INVALID_CONFIGURATION - Possibly SLI is enabled. Disable SLI and retry.
  2713. //! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The application will require Administrator privileges to access this API.
  2714. //! The application can be elevated to a higher permission level by selecting "Run as Administrator".
  2715. //!
  2716. //! \ingroup gpuecc
  2717. ///////////////////////////////////////////////////////////////////////////////
  2718. NVAPI_INTERFACE NvAPI_GPU_SetECCConfiguration(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bEnable,
  2719. NvU8 bEnableImmediately);
  2720. //! \ingroup gpu
  2721. typedef enum _NV_GPU_WORKSTATION_FEATURE_TYPE
  2722. {
  2723. NV_GPU_WORKSTATION_FEATURE_TYPE_QUADRO_VR_READY = 1, //!< Quadro VR Ready
  2724. } NV_GPU_WORKSTATION_FEATURE_TYPE;
  2725. ///////////////////////////////////////////////////////////////////////////////
  2726. // FUNCTION NAME: NvAPI_GPU_QueryWorkstationFeatureSupport
  2727. //
  2728. //! \fn NvAPI_GPU_QueryWorkstationFeatureSupport(NvPhysicalGpuHandle physicalGpu, NV_GPU_WORKSTATION_FEATURE_TYPE gpuWorkstationFeature)
  2729. //! \code
  2730. //! DESCRIPTION: Indicates whether a queried workstation feature is supported by the requested GPU.
  2731. //!
  2732. //! SUPPORTED OS: Windows 10 and higher
  2733. //!
  2734. //! \since Release: 440
  2735. //!
  2736. //! 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.
  2737. //!
  2738. //! PARAMETERS: physicalGpu(IN) : The handle of the GPU for the which caller wants to get the support information.
  2739. //! gpuWorkstationFeature(IN ) : The feature for the GPU in question. One of the values from enum NV_GPU_WORKSTATION_FEATURE_TYPE.
  2740. //!
  2741. //! \return This API can return any of the error codes enumerated in #NvAPI_Status listed below
  2742. //!
  2743. //! \retval ::NVAPI_OK the queried workstation feature is supported on the given GPU.
  2744. //! \retval ::NVAPI_NO_IMPLEMENTATION the current driver doesn't support this interface.
  2745. //! \retval ::NVAPI_INVALID_HANDLE the incoming physicalGpu handle is invalid.
  2746. //! \retval ::NVAPI_NOT_SUPPORTED the requested gpuWorkstationFeature is not supported in the selected GPU.
  2747. //! \retval ::NVAPI_SETTING_NOT_FOUND the requested gpuWorkstationFeature is unknown to the current driver version.
  2748. //!
  2749. //! \endcode
  2750. //! \ingroup gpu
  2751. ///////////////////////////////////////////////////////////////////////////////
  2752. NVAPI_INTERFACE NvAPI_GPU_QueryWorkstationFeatureSupport(NvPhysicalGpuHandle physicalGpu, NV_GPU_WORKSTATION_FEATURE_TYPE gpuWorkstationFeature);
  2753. //! \ingroup gpu
  2754. typedef struct
  2755. {
  2756. NvU32 version; //!< version of this structure
  2757. NvU32 width; //!< width of the input texture
  2758. NvU32 height; //!< height of the input texture
  2759. float* blendingTexture; //!< array of floating values building an intensity RGB texture
  2760. } NV_SCANOUT_INTENSITY_DATA_V1;
  2761. //! \ingroup gpu
  2762. typedef struct
  2763. {
  2764. NvU32 version; //!< version of this structure
  2765. NvU32 width; //!< width of the input texture
  2766. NvU32 height; //!< height of the input texture
  2767. float* blendingTexture; //!< array of floating values building an intensity RGB texture
  2768. float* offsetTexture; //!< array of floating values building an offset texture
  2769. NvU32 offsetTexChannels; //!< number of channels per pixel in the offset texture
  2770. } NV_SCANOUT_INTENSITY_DATA_V2;
  2771. typedef NV_SCANOUT_INTENSITY_DATA_V2 NV_SCANOUT_INTENSITY_DATA;
  2772. //! \ingroup gpu
  2773. #define NV_SCANOUT_INTENSITY_DATA_VER1 MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V1, 1)
  2774. #define NV_SCANOUT_INTENSITY_DATA_VER2 MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V2, 2)
  2775. #define NV_SCANOUT_INTENSITY_DATA_VER NV_SCANOUT_INTENSITY_DATA_VER2
  2776. ///////////////////////////////////////////////////////////////////////////////
  2777. // FUNCTION NAME: NvAPI_GPU_SetScanoutIntensity
  2778. //
  2779. //! DESCRIPTION: This API enables and sets up per-pixel intensity feature on the specified display.
  2780. //!
  2781. //! SUPPORTED OS: Windows 7 and higher
  2782. //!
  2783. //!
  2784. //! \param [in] displayId combined physical display and GPU identifier of the display to apply the intensity control.
  2785. //! \param [in] scanoutIntensityData the intensity texture info.
  2786. //! \param [out] pbSticky(OUT) indicates whether the settings will be kept over a reboot.
  2787. //!
  2788. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
  2789. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
  2790. //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs
  2791. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data.
  2792. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_INTENSITY_DATA structure version mismatch.
  2793. //! \retval ::NVAPI_OK Feature enabled.
  2794. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  2795. //!
  2796. //! \ingroup gpu
  2797. ///////////////////////////////////////////////////////////////////////////////
  2798. NVAPI_INTERFACE NvAPI_GPU_SetScanoutIntensity(NvU32 displayId, NV_SCANOUT_INTENSITY_DATA* scanoutIntensityData, int *pbSticky);
  2799. //! \ingroup gpu
  2800. typedef struct _NV_SCANOUT_INTENSITY_STATE_DATA
  2801. {
  2802. NvU32 version; //!< version of this structure
  2803. NvU32 bEnabled; //!< intensity is enabled or not
  2804. } NV_SCANOUT_INTENSITY_STATE_DATA;
  2805. //! \ingroup gpu
  2806. #define NV_SCANOUT_INTENSITY_STATE_VER MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_STATE_DATA, 1)
  2807. ///////////////////////////////////////////////////////////////////////////////
  2808. // FUNCTION NAME: NvAPI_GPU_GetScanoutIntensityState
  2809. //
  2810. //! DESCRIPTION: This API queries current state of the intensity feature on the specified display.
  2811. //!
  2812. //! SUPPORTED OS: Windows 7 and higher
  2813. //!
  2814. //!
  2815. //! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration.
  2816. //! \param [in,out] scanoutIntensityStateData intensity state data.
  2817. //!
  2818. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  2819. //! specific meaning for this API, they are listed below.
  2820. //!
  2821. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
  2822. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
  2823. //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
  2824. //! \retval ::NVAPI_OK Feature enabled.
  2825. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  2826. //!
  2827. //! \ingroup gpu
  2828. ///////////////////////////////////////////////////////////////////////////////
  2829. NVAPI_INTERFACE NvAPI_GPU_GetScanoutIntensityState(__in NvU32 displayId, __inout NV_SCANOUT_INTENSITY_STATE_DATA* scanoutIntensityStateData);
  2830. //! \ingroup gpu
  2831. typedef enum
  2832. {
  2833. NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLESTRIP_XYUVRQ = 0,
  2834. NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLES_XYUVRQ = 1,
  2835. } NV_GPU_WARPING_VERTICE_FORMAT;
  2836. //! \ingroup gpu
  2837. typedef struct
  2838. {
  2839. NvU32 version; //!< version of this structure
  2840. float* vertices; //!< width of the input texture
  2841. NV_GPU_WARPING_VERTICE_FORMAT vertexFormat; //!< format of the input vertices
  2842. int numVertices; //!< number of the input vertices
  2843. NvSBox* textureRect; //!< rectangle in desktop coordinates describing the source area for the warping
  2844. } NV_SCANOUT_WARPING_DATA;
  2845. //! \ingroup gpu
  2846. #define NV_SCANOUT_WARPING_VER MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_DATA, 1)
  2847. ///////////////////////////////////////////////////////////////////////////////
  2848. // FUNCTION NAME: NvAPI_GPU_SetScanoutWarping
  2849. //
  2850. //! DESCRIPTION: This API enables and sets up the warping feature on the specified display.
  2851. //!
  2852. //! SUPPORTED OS: Windows 7 and higher
  2853. //!
  2854. //!
  2855. //! \param [in] displayId Combined physical display and GPU identifier of the display to apply the intensity control
  2856. //! \param [in] scanoutWarpingData The warping data info
  2857. //! \param [out] pbSticky Indicates whether the settings will be kept over a reboot.
  2858. //!
  2859. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
  2860. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
  2861. //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs
  2862. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data.
  2863. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_WARPING_DATA structure version mismatch.
  2864. //! \retval ::NVAPI_OK Feature enabled.
  2865. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  2866. //!
  2867. //! \ingroup gpu
  2868. ///////////////////////////////////////////////////////////////////////////////
  2869. NVAPI_INTERFACE NvAPI_GPU_SetScanoutWarping(NvU32 displayId, NV_SCANOUT_WARPING_DATA* scanoutWarpingData, int* piMaxNumVertices, int* pbSticky);
  2870. //! \ingroup gpu
  2871. typedef struct _NV_SCANOUT_WARPING_STATE_DATA
  2872. {
  2873. NvU32 version; //!< version of this structure
  2874. NvU32 bEnabled; //!< warping is enabled or not
  2875. } NV_SCANOUT_WARPING_STATE_DATA;
  2876. //! \ingroup gpu
  2877. #define NV_SCANOUT_WARPING_STATE_VER MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_STATE_DATA, 1)
  2878. ///////////////////////////////////////////////////////////////////////////////
  2879. // FUNCTION NAME: NvAPI_GPU_GetScanoutWarpingState
  2880. //
  2881. //! DESCRIPTION: This API queries current state of the warping feature on the specified display.
  2882. //!
  2883. //! SUPPORTED OS: Windows 7 and higher
  2884. //!
  2885. //!
  2886. //! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration.
  2887. //! \param [in,out] scanoutWarpingStateData warping state data.
  2888. //!
  2889. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  2890. //! specific meaning for this API, they are listed below.
  2891. //!
  2892. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
  2893. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
  2894. //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
  2895. //! \retval ::NVAPI_OK Feature enabled.
  2896. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  2897. //!
  2898. //! \ingroup gpu
  2899. ///////////////////////////////////////////////////////////////////////////////
  2900. NVAPI_INTERFACE NvAPI_GPU_GetScanoutWarpingState(__in NvU32 displayId, __inout NV_SCANOUT_WARPING_STATE_DATA* scanoutWarpingStateData);
  2901. typedef enum
  2902. {
  2903. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_WARPING_RESAMPLING_METHOD = 0
  2904. } NV_GPU_SCANOUT_COMPOSITION_PARAMETER;
  2905. //! This enum defines a collection of possible scanout composition values that can be used to configure
  2906. //! possible scanout composition settings. (Currently the only parameter defined is the WARPING_RESAMPLING_METHOD).
  2907. typedef enum
  2908. {
  2909. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_SET_TO_DEFAULT = 0, // Set parameter to default value.
  2910. // WARPING_RESAMPLING_METHOD section:
  2911. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BILINEAR = 0x100,
  2912. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_TRIANGULAR = 0x101,
  2913. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BELL_SHAPED = 0x102,
  2914. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_BSPLINE = 0x103,
  2915. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_TRIANGULAR = 0x104,
  2916. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BELL_SHAPED = 0x105,
  2917. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE_WARPING_RESAMPLING_METHOD_BICUBIC_ADAPTIVE_BSPLINE = 0x106
  2918. } NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE;
  2919. ///////////////////////////////////////////////////////////////////////////////
  2920. // FUNCTION NAME: NvAPI_GPU_SetScanoutCompositionParameter
  2921. //
  2922. //! DESCRIPTION: This API sets various parameters that configure the scanout composition feature on the specified display.
  2923. //! (currently there is only one configurable parameter defined: WARPING_RESAMPLING_METHOD,
  2924. //! but this function is designed to support the addition of parameters as needed.)
  2925. //!
  2926. //! SUPPORTED OS: Windows 7 and higher
  2927. //!
  2928. //!
  2929. //! \param [in] displayId Combined physical display and GPU identifier of the display to apply the intensity control
  2930. //! \param [in] parameter The scanout composition parameter to be set
  2931. //! \param [in] parameterValue The data to be set for the specified parameter
  2932. //! \param [in] pContainer Additional container for data associated with the specified parameter
  2933. //!
  2934. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
  2935. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
  2936. //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs
  2937. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data.
  2938. //! \retval ::NVAPI_OK Feature enabled.
  2939. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  2940. //!
  2941. //! \ingroup gpu
  2942. ///////////////////////////////////////////////////////////////////////////////
  2943. NVAPI_INTERFACE NvAPI_GPU_SetScanoutCompositionParameter(NvU32 displayId, NV_GPU_SCANOUT_COMPOSITION_PARAMETER parameter,
  2944. NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE parameterValue, float *pContainer);
  2945. ///////////////////////////////////////////////////////////////////////////////
  2946. // FUNCTION NAME: NvAPI_GPU_GetScanoutCompositionParameter
  2947. //
  2948. //! DESCRIPTION: This API queries current state of one of the various scanout composition parameters on the specified display.
  2949. //!
  2950. //! SUPPORTED OS: Windows 7 and higher
  2951. //!
  2952. //!
  2953. //! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration.
  2954. //! \param [in] parameter scanout composition parameter to by queried.
  2955. //! \param [out] parameterData scanout composition parameter data.
  2956. //! \param [out] pContainer Additional container for returning data associated with the specified parameter
  2957. //!
  2958. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  2959. //! specific meaning for this API, they are listed below.
  2960. //!
  2961. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
  2962. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
  2963. //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
  2964. //! \retval ::NVAPI_OK Feature enabled.
  2965. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  2966. //!
  2967. //! \ingroup gpu
  2968. ///////////////////////////////////////////////////////////////////////////////
  2969. NVAPI_INTERFACE NvAPI_GPU_GetScanoutCompositionParameter(__in NvU32 displayId, __in NV_GPU_SCANOUT_COMPOSITION_PARAMETER parameter,
  2970. __out NV_GPU_SCANOUT_COMPOSITION_PARAMETER_VALUE *parameterData, __out float *pContainer);
  2971. ///////////////////////////////////////////////////////////////////////////////
  2972. // FUNCTION NAME: NvAPI_GPU_GetScanoutConfiguration
  2973. //
  2974. //! DESCRIPTION: This API queries the desktop and scanout portion of the specified display.
  2975. //!
  2976. //! SUPPORTED OS: Windows 7 and higher
  2977. //!
  2978. //!
  2979. //! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration.
  2980. //! \param [in,out] desktopRect desktop area of the display in desktop coordinates.
  2981. //! \param [in,out] scanoutRect scanout area of the display relative to desktopRect.
  2982. //!
  2983. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
  2984. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
  2985. //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
  2986. //! \retval ::NVAPI_OK Feature enabled.
  2987. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  2988. //!
  2989. //! \ingroup gpu
  2990. ///////////////////////////////////////////////////////////////////////////////
  2991. NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfiguration(NvU32 displayId, NvSBox* desktopRect, NvSBox* scanoutRect);
  2992. //! \ingroup gpu
  2993. //! Used in NvAPI_GPU_GetScanoutConfigurationEx().
  2994. typedef struct _NV_SCANOUT_INFORMATION
  2995. {
  2996. NvU32 version; //!< Structure version, needs to be initialized with NV_SCANOUT_INFORMATION_VER.
  2997. NvSBox sourceDesktopRect; //!< Operating system display device rect in desktop coordinates displayId is scanning out from.
  2998. NvSBox sourceViewportRect; //!< Area inside the sourceDesktopRect which is scanned out to the display.
  2999. NvSBox targetViewportRect; //!< Area inside the rect described by targetDisplayWidth/Height sourceViewportRect is scanned out to.
  3000. NvU32 targetDisplayWidth; //!< Horizontal size of the active resolution scanned out to the display.
  3001. NvU32 targetDisplayHeight; //!< Vertical size of the active resolution scanned out to the display.
  3002. NvU32 cloneImportance; //!< If targets are cloned views of the sourceDesktopRect the cloned targets have an importance assigned (0:primary,1 secondary,...).
  3003. NV_ROTATE sourceToTargetRotation; //!< Rotation performed between the sourceViewportRect and the targetViewportRect.
  3004. } NV_SCANOUT_INFORMATION;
  3005. #define NV_SCANOUT_INFORMATION_VER MAKE_NVAPI_VERSION(NV_SCANOUT_INFORMATION,1)
  3006. ///////////////////////////////////////////////////////////////////////////////
  3007. // FUNCTION NAME: NvAPI_GPU_GetScanoutConfigurationEx
  3008. //
  3009. //! DESCRIPTION: This API queries the desktop and scanout portion of the specified display.
  3010. //!
  3011. //! SUPPORTED OS: Windows 7 and higher
  3012. //!
  3013. //! \since Release: 331
  3014. //!
  3015. //! \param [in] displayId combined physical display and GPU identifier of the display to query the configuration.
  3016. //! \param [in,out] pScanoutInformation desktop area to displayId mapping information.
  3017. //!
  3018. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  3019. //!
  3020. //! \ingroup gpu
  3021. ///////////////////////////////////////////////////////////////////////////////
  3022. NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfigurationEx(__in NvU32 displayId, __inout NV_SCANOUT_INFORMATION *pScanoutInformation);
  3023. //! \ingroup gpu
  3024. typedef struct _NV_LOGICAL_GPU_DATA_V1
  3025. {
  3026. NvU32 version; //!< [in] Structure version.
  3027. 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.
  3028. NvU32 physicalGpuCount; //!< [out] Number of physical GPU handles associated with the specified logical GPU handle.
  3029. NvPhysicalGpuHandle physicalGpuHandles[NVAPI_MAX_PHYSICAL_GPUS]; //!< [out] This array will be filled with physical GPU handles associated with the given logical GPU handle.
  3030. //!< The array index refers to the Physical Gpu Index (Idx).
  3031. //!< Idx value is the same as D3D11 MultiGPUDevice GPU index, D3D12 node index, OpenGL GL_NV_gpu_multicast GPU index.
  3032. //!< When converted to a bit mask (1 << Idx), it matches:
  3033. //!< 1. Vulkan deviceNodeMask in VkPhysicalDeviceIDProperties
  3034. //!< 2. CUDA deviceNodeMask returned by cuDeviceGetLuid
  3035. NvU32 reserved[8]; //!< Reserved for future use. Should be set to ZERO.
  3036. } NV_LOGICAL_GPU_DATA_V1;
  3037. //! \ingroup gpu
  3038. typedef NV_LOGICAL_GPU_DATA_V1 NV_LOGICAL_GPU_DATA;
  3039. #define NV_LOGICAL_GPU_DATA_VER1 MAKE_NVAPI_VERSION(NV_LOGICAL_GPU_DATA_V1,1)
  3040. #define NV_LOGICAL_GPU_DATA_VER NV_LOGICAL_GPU_DATA_VER1
  3041. ///////////////////////////////////////////////////////////////////////////////
  3042. //
  3043. // FUNCTION NAME: NvAPI_GPU_GetLogicalGpuInfo
  3044. //
  3045. //! This function is used to query Logical GPU information.
  3046. //!
  3047. //! SUPPORTED OS: Windows 7 and higher
  3048. //!
  3049. //!
  3050. //! \since Release: 421
  3051. //!
  3052. //! \param [in] hLogicalGpu logical GPU Handle.
  3053. //! \param [inout] pLogicalGpuData Pointer to NV_LOGICAL_GPU_DATA structure.
  3054. //!
  3055. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  3056. //! specific meaning for this API, they are listed below.
  3057. //!
  3058. //! \ingroup gpu
  3059. ///////////////////////////////////////////////////////////////////////////////
  3060. NVAPI_INTERFACE NvAPI_GPU_GetLogicalGpuInfo(__in NvLogicalGpuHandle hLogicalGpu, __inout NV_LOGICAL_GPU_DATA *pLogicalGpuData);
  3061. //! Used in NvAPI_GPU_GetPerfDecreaseInfo.
  3062. //! Bit masks for knowing the exact reason for performance decrease
  3063. typedef enum _NVAPI_GPU_PERF_DECREASE
  3064. {
  3065. NV_GPU_PERF_DECREASE_NONE = 0, //!< No Slowdown detected
  3066. NV_GPU_PERF_DECREASE_REASON_THERMAL_PROTECTION = 0x00000001, //!< Thermal slowdown/shutdown/POR thermal protection
  3067. NV_GPU_PERF_DECREASE_REASON_POWER_CONTROL = 0x00000002, //!< Power capping / pstate cap
  3068. NV_GPU_PERF_DECREASE_REASON_AC_BATT = 0x00000004, //!< AC->BATT event
  3069. NV_GPU_PERF_DECREASE_REASON_API_TRIGGERED = 0x00000008, //!< API triggered slowdown
  3070. NV_GPU_PERF_DECREASE_REASON_INSUFFICIENT_POWER = 0x00000010, //!< Power connector missing
  3071. NV_GPU_PERF_DECREASE_REASON_UNKNOWN = 0x80000000, //!< Unknown reason
  3072. } NVAPI_GPU_PERF_DECREASE;
  3073. ///////////////////////////////////////////////////////////////////////////////
  3074. //
  3075. // FUNCTION NAME: NvAPI_GPU_GetPerfDecreaseInfo
  3076. //
  3077. //! DESCRIPTION: This function retrieves - in NvU32 variable - reasons for the current performance decrease.
  3078. //!
  3079. //! SUPPORTED OS: Windows 7 and higher
  3080. //!
  3081. //! \param [in] hPhysicalGPU (IN) - GPU for which performance decrease is to be evaluated.
  3082. //! \param [out] pPerfDecrInfo (OUT) - Pointer to a NvU32 variable containing performance decrease info
  3083. //!
  3084. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  3085. //!
  3086. //! \ingroup gpuPerf
  3087. ///////////////////////////////////////////////////////////////////////////////
  3088. NVAPI_INTERFACE NvAPI_GPU_GetPerfDecreaseInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NvU32 *pPerfDecrInfo);
  3089. //! \ingroup gpupstate
  3090. //! Used in NvAPI_GPU_GetPstatesInfoEx()
  3091. typedef struct
  3092. {
  3093. NvU32 version;
  3094. NvU32 flags; //!< - bit 0 indicates if perfmon is enabled or not
  3095. //!< - bit 1 indicates if dynamic Pstate is capable or not
  3096. //!< - bit 2 indicates if dynamic Pstate is enable or not
  3097. //!< - all other bits must be set to 0
  3098. NvU32 numPstates; //!< The number of available p-states
  3099. NvU32 numClocks; //!< The number of clock domains supported by each P-State
  3100. struct
  3101. {
  3102. NV_GPU_PERF_PSTATE_ID pstateId; //!< ID of the p-state.
  3103. NvU32 flags; //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2
  3104. //!< - bit 1 indicates if the Pstate is overclocked or not
  3105. //!< - bit 2 indicates if the Pstate is overclockable or not
  3106. //!< - all other bits must be set to 0
  3107. struct
  3108. {
  3109. NV_GPU_PUBLIC_CLOCK_ID domainId; //!< ID of the clock domain
  3110. NvU32 flags; //!< Reserved. Must be set to 0
  3111. NvU32 freq; //!< Clock frequency in kHz
  3112. } clocks[NVAPI_MAX_GPU_PERF_CLOCKS];
  3113. } pstates[NVAPI_MAX_GPU_PERF_PSTATES];
  3114. } NV_GPU_PERF_PSTATES_INFO_V1;
  3115. //! \ingroup gpupstate
  3116. typedef struct
  3117. {
  3118. NvU32 version;
  3119. NvU32 flags; //!< - bit 0 indicates if perfmon is enabled or not
  3120. //!< - bit 1 indicates if dynamic Pstate is capable or not
  3121. //!< - bit 2 indicates if dynamic Pstate is enable or not
  3122. //!< - all other bits must be set to 0
  3123. NvU32 numPstates; //!< The number of available p-states
  3124. NvU32 numClocks; //!< The number of clock domains supported by each P-State
  3125. NvU32 numVoltages;
  3126. struct
  3127. {
  3128. NV_GPU_PERF_PSTATE_ID pstateId; //!< ID of the p-state.
  3129. NvU32 flags; //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2
  3130. //!< - bit 1 indicates if the Pstate is overclocked or not
  3131. //!< - bit 2 indicates if the Pstate is overclockable or not
  3132. //!< - all other bits must be set to 0
  3133. struct
  3134. {
  3135. NV_GPU_PUBLIC_CLOCK_ID domainId;
  3136. NvU32 flags; //!< bit 0 indicates if this clock is overclockable
  3137. //!< all other bits must be set to 0
  3138. NvU32 freq;
  3139. } clocks[NVAPI_MAX_GPU_PERF_CLOCKS];
  3140. struct
  3141. {
  3142. NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId; //!< ID of the voltage domain, containing flags and mvolt info
  3143. NvU32 flags; //!< Reserved for future use. Must be set to 0
  3144. NvU32 mvolt; //!< Voltage in mV
  3145. } voltages[NVAPI_MAX_GPU_PERF_VOLTAGES];
  3146. } pstates[NVAPI_MAX_GPU_PERF_PSTATES]; //!< Valid index range is 0 to numVoltages-1
  3147. } NV_GPU_PERF_PSTATES_INFO_V2;
  3148. //! \ingroup gpupstate
  3149. typedef NV_GPU_PERF_PSTATES_INFO_V2 NV_GPU_PERF_PSTATES_INFO;
  3150. //! \ingroup gpupstate
  3151. //! @{
  3152. //! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V1
  3153. #define NV_GPU_PERF_PSTATES_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V1,1)
  3154. //! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V2
  3155. #define NV_GPU_PERF_PSTATES_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V2,2)
  3156. //! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V2
  3157. #define NV_GPU_PERF_PSTATES_INFO_VER3 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V2,3)
  3158. //! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO
  3159. #define NV_GPU_PERF_PSTATES_INFO_VER NV_GPU_PERF_PSTATES_INFO_VER3
  3160. //! @}
  3161. ///////////////////////////////////////////////////////////////////////////////
  3162. //
  3163. // FUNCTION NAME: NvAPI_GPU_GetPstatesInfoEx
  3164. //
  3165. //! DESCRIPTION: This API retrieves all performance states (P-States) information. This is the same as
  3166. //! NvAPI_GPU_GetPstatesInfo(), but supports an input flag for various options.
  3167. //!
  3168. //! P-States are GPU active/executing performance capability and power consumption states.
  3169. //!
  3170. //! P-States ranges from P0 to P15, with P0 being the highest performance/power state, and
  3171. //! P15 being the lowest performance/power state. Each P-State, if available, maps to a
  3172. //! performance level. Not all P-States are available on a given system. The definitions
  3173. //! of each P-State are currently as follows: \n
  3174. //! - P0/P1 - Maximum 3D performance
  3175. //! - P2/P3 - Balanced 3D performance-power
  3176. //! - P8 - Basic HD video playback
  3177. //! - P10 - DVD playback
  3178. //! - P12 - Minimum idle power consumption
  3179. //!
  3180. //! \deprecated Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20.
  3181. //! SUPPORTED OS: Windows 7 and higher
  3182. //!
  3183. //!
  3184. //! \param [in] hPhysicalGPU GPU selection.
  3185. //! \param [out] pPerfPstatesInfo P-States information retrieved, as detailed below: \n
  3186. //! - flags is reserved for future use.
  3187. //! - numPstates is the number of available P-States
  3188. //! - numClocks is the number of clock domains supported by each P-State
  3189. //! - pstates has valid index range from 0 to numPstates - 1
  3190. //! - pstates[i].pstateId is the ID of the P-State,
  3191. //! containing the following info:
  3192. //! - pstates[i].flags containing the following info:
  3193. //! - bit 0 indicates if the PCIE limit is GEN1 or GEN2
  3194. //! - bit 1 indicates if the Pstate is overclocked or not
  3195. //! - bit 2 indicates if the Pstate is overclockable or not
  3196. //! - pstates[i].clocks has valid index range from 0 to numClocks -1
  3197. //! - pstates[i].clocks[j].domainId is the public ID of the clock domain,
  3198. //! containing the following info:
  3199. //! - pstates[i].clocks[j].flags containing the following info:
  3200. //! bit 0 indicates if the clock domain is overclockable or not
  3201. //! - pstates[i].clocks[j].freq is the clock frequency in kHz
  3202. //! - pstates[i].voltages has a valid index range from 0 to numVoltages - 1
  3203. //! - pstates[i].voltages[j].domainId is the ID of the voltage domain,
  3204. //! containing the following info:
  3205. //! - pstates[i].voltages[j].flags is reserved for future use.
  3206. //! - pstates[i].voltages[j].mvolt is the voltage in mV
  3207. //! inputFlags(IN) - This can be used to select various options:
  3208. //! - if bit 0 is set, pPerfPstatesInfo would contain the default settings
  3209. //! instead of the current, possibily overclocked settings.
  3210. //! - if bit 1 is set, pPerfPstatesInfo would contain the maximum clock
  3211. //! frequencies instead of the nominal frequencies.
  3212. //! - if bit 2 is set, pPerfPstatesInfo would contain the minimum clock
  3213. //! frequencies instead of the nominal frequencies.
  3214. //! - all other bits must be set to 0.
  3215. //!
  3216. //! \retval ::NVAPI_OK Completed request
  3217. //! \retval ::NVAPI_ERROR Miscellaneous error occurred
  3218. //! \retval ::NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide)
  3219. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle
  3220. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the NV_GPU_PERF_PSTATES struct is not supported
  3221. //!
  3222. //! \ingroup gpupstate
  3223. ///////////////////////////////////////////////////////////////////////////////
  3224. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20.")
  3225. NVAPI_INTERFACE NvAPI_GPU_GetPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATES_INFO *pPerfPstatesInfo, NvU32 inputFlags);
  3226. ///////////////////////////////////////////////////////////////////////////////
  3227. //
  3228. // FUNCTION NAME: NvAPI_GPU_GetPstates20
  3229. //
  3230. //! DESCRIPTION: This API retrieves all performance states (P-States) 2.0 information.
  3231. //!
  3232. //! P-States are GPU active/executing performance capability states.
  3233. //! They range from P0 to P15, with P0 being the highest performance state,
  3234. //! and P15 being the lowest performance state. Each P-State, if available,
  3235. //! maps to a performance level. Not all P-States are available on a given system.
  3236. //! The definition of each P-States are currently as follow:
  3237. //! - P0/P1 - Maximum 3D performance
  3238. //! - P2/P3 - Balanced 3D performance-power
  3239. //! - P8 - Basic HD video playback
  3240. //! - P10 - DVD playback
  3241. //! - P12 - Minimum idle power consumption
  3242. //!
  3243. //! TCC_SUPPORTED
  3244. //!
  3245. //! \since Release: 295
  3246. //!
  3247. //! SUPPORTED OS: Windows 7 and higher
  3248. //!
  3249. //!
  3250. //! \param [in] hPhysicalGPU GPU selection
  3251. //! \param [out] pPstatesInfo P-States information retrieved, as documented in declaration above
  3252. //!
  3253. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  3254. //! If there are return error codes with specific meaning for this API,
  3255. //! they are listed below.
  3256. //!
  3257. //! \ingroup gpupstate
  3258. ///////////////////////////////////////////////////////////////////////////////
  3259. NVAPI_INTERFACE NvAPI_GPU_GetPstates20(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_PERF_PSTATES20_INFO *pPstatesInfo);
  3260. ///////////////////////////////////////////////////////////////////////////////
  3261. //
  3262. // FUNCTION NAME: NvAPI_GPU_GetCurrentPstate
  3263. //
  3264. //! DESCRIPTION: This function retrieves the current performance state (P-State).
  3265. //!
  3266. //! SUPPORTED OS: Windows 7 and higher
  3267. //!
  3268. //!
  3269. //! \since Release: 165
  3270. //!
  3271. //! TCC_SUPPORTED
  3272. //!
  3273. //! \param [in] hPhysicalGPU GPU selection
  3274. //! \param [out] pCurrentPstate The ID of the current P-State of the GPU - see \ref NV_GPU_PERF_PSTATES.
  3275. //!
  3276. //! \retval NVAPI_OK Completed request
  3277. //! \retval NVAPI_ERROR Miscellaneous error occurred.
  3278. //! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide).
  3279. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle.
  3280. //! \retval NVAPI_NOT_SUPPORTED P-States is not supported on this setup.
  3281. //!
  3282. //! \ingroup gpupstate
  3283. ///////////////////////////////////////////////////////////////////////////////
  3284. NVAPI_INTERFACE NvAPI_GPU_GetCurrentPstate(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATE_ID *pCurrentPstate);
  3285. //! \ingroup gpupstate
  3286. #define NVAPI_MAX_GPU_UTILIZATIONS 8
  3287. //! \ingroup gpupstate
  3288. //! Used in NvAPI_GPU_GetDynamicPstatesInfoEx().
  3289. typedef struct
  3290. {
  3291. NvU32 version; //!< Structure version
  3292. NvU32 flags; //!< bit 0 indicates if the dynamic Pstate is enabled or not
  3293. struct
  3294. {
  3295. NvU32 bIsPresent:1; //!< Set if this utilization domain is present on this GPU
  3296. NvU32 percentage; //!< Percentage of time where the domain is considered busy in the last 1 second interval
  3297. } utilization[NVAPI_MAX_GPU_UTILIZATIONS];
  3298. } NV_GPU_DYNAMIC_PSTATES_INFO_EX;
  3299. //! \ingroup gpupstate
  3300. //! Macro for constructing the version field of NV_GPU_DYNAMIC_PSTATES_INFO_EX
  3301. #define NV_GPU_DYNAMIC_PSTATES_INFO_EX_VER MAKE_NVAPI_VERSION(NV_GPU_DYNAMIC_PSTATES_INFO_EX,1)
  3302. ///////////////////////////////////////////////////////////////////////////////
  3303. //
  3304. // FUNCTION NAME: NvAPI_GPU_GetDynamicPstatesInfoEx
  3305. //
  3306. //! DESCRIPTION: This API retrieves the NV_GPU_DYNAMIC_PSTATES_INFO_EX structure for the specified physical GPU.
  3307. //! Each domain's info is indexed in the array. For example:
  3308. //! - pDynamicPstatesInfo->utilization[NVAPI_GPU_UTILIZATION_DOMAIN_GPU] holds the info for the GPU domain. \p
  3309. //! There are currently 4 domains for which GPU utilization and dynamic P-State thresholds can be retrieved:
  3310. //! graphic engine (GPU), frame buffer (FB), video engine (VID), and bus interface (BUS).
  3311. //!
  3312. //! SUPPORTED OS: Windows 7 and higher
  3313. //!
  3314. //!
  3315. //!
  3316. //! TCC_SUPPORTED
  3317. //! \since Release: 185
  3318. //!
  3319. //! \retval ::NVAPI_OK
  3320. //! \retval ::NVAPI_ERROR
  3321. //! \retval ::NVAPI_INVALID_ARGUMENT pDynamicPstatesInfo is NULL
  3322. //! \retval ::NVAPI_HANDLE_INVALIDATED
  3323. //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE
  3324. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the INFO struct is not supported
  3325. //!
  3326. //! \ingroup gpupstate
  3327. ///////////////////////////////////////////////////////////////////////////////
  3328. NVAPI_INTERFACE NvAPI_GPU_GetDynamicPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_DYNAMIC_PSTATES_INFO_EX *pDynamicPstatesInfoEx);
  3329. ///////////////////////////////////////////////////////////////////////////////////
  3330. // Thermal API
  3331. // Provides ability to get temperature levels from the various thermal sensors associated with the GPU
  3332. //! \ingroup gputhermal
  3333. #define NVAPI_MAX_THERMAL_SENSORS_PER_GPU 3
  3334. //! \ingroup gputhermal
  3335. //! Used in NV_GPU_THERMAL_SETTINGS
  3336. typedef enum
  3337. {
  3338. NVAPI_THERMAL_TARGET_NONE = 0,
  3339. NVAPI_THERMAL_TARGET_GPU = 1, //!< GPU core temperature requires NvPhysicalGpuHandle
  3340. NVAPI_THERMAL_TARGET_MEMORY = 2, //!< GPU memory temperature requires NvPhysicalGpuHandle
  3341. NVAPI_THERMAL_TARGET_POWER_SUPPLY = 4, //!< GPU power supply temperature requires NvPhysicalGpuHandle
  3342. NVAPI_THERMAL_TARGET_BOARD = 8, //!< GPU board ambient temperature requires NvPhysicalGpuHandle
  3343. NVAPI_THERMAL_TARGET_VCD_BOARD = 9, //!< Visual Computing Device Board temperature requires NvVisualComputingDeviceHandle
  3344. NVAPI_THERMAL_TARGET_VCD_INLET = 10, //!< Visual Computing Device Inlet temperature requires NvVisualComputingDeviceHandle
  3345. NVAPI_THERMAL_TARGET_VCD_OUTLET = 11, //!< Visual Computing Device Outlet temperature requires NvVisualComputingDeviceHandle
  3346. NVAPI_THERMAL_TARGET_ALL = 15,
  3347. NVAPI_THERMAL_TARGET_UNKNOWN = -1,
  3348. } NV_THERMAL_TARGET;
  3349. //! \ingroup gputhermal
  3350. //! Used in NV_GPU_THERMAL_SETTINGS
  3351. typedef enum
  3352. {
  3353. NVAPI_THERMAL_CONTROLLER_NONE = 0,
  3354. NVAPI_THERMAL_CONTROLLER_GPU_INTERNAL,
  3355. NVAPI_THERMAL_CONTROLLER_ADM1032,
  3356. NVAPI_THERMAL_CONTROLLER_MAX6649,
  3357. NVAPI_THERMAL_CONTROLLER_MAX1617,
  3358. NVAPI_THERMAL_CONTROLLER_LM99,
  3359. NVAPI_THERMAL_CONTROLLER_LM89,
  3360. NVAPI_THERMAL_CONTROLLER_LM64,
  3361. NVAPI_THERMAL_CONTROLLER_ADT7473,
  3362. NVAPI_THERMAL_CONTROLLER_SBMAX6649,
  3363. NVAPI_THERMAL_CONTROLLER_VBIOSEVT,
  3364. NVAPI_THERMAL_CONTROLLER_OS,
  3365. NVAPI_THERMAL_CONTROLLER_UNKNOWN = -1,
  3366. } NV_THERMAL_CONTROLLER;
  3367. //! \ingroup gputhermal
  3368. //! Used in NvAPI_GPU_GetThermalSettings()
  3369. typedef struct
  3370. {
  3371. NvU32 version; //!< structure version
  3372. NvU32 count; //!< number of associated thermal sensors
  3373. struct
  3374. {
  3375. NV_THERMAL_CONTROLLER controller; //!< internal, ADM1032, MAX6649...
  3376. NvU32 defaultMinTemp; //!< The min default temperature value of the thermal sensor in degree Celsius
  3377. NvU32 defaultMaxTemp; //!< The max default temperature value of the thermal sensor in degree Celsius
  3378. NvU32 currentTemp; //!< The current temperature value of the thermal sensor in degree Celsius
  3379. NV_THERMAL_TARGET target; //!< Thermal sensor targeted @ GPU, memory, chipset, powersupply, Visual Computing Device, etc.
  3380. } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU];
  3381. } NV_GPU_THERMAL_SETTINGS_V1;
  3382. //! \ingroup gputhermal
  3383. typedef struct
  3384. {
  3385. NvU32 version; //!< structure version
  3386. NvU32 count; //!< number of associated thermal sensors
  3387. struct
  3388. {
  3389. NV_THERMAL_CONTROLLER controller; //!< internal, ADM1032, MAX6649...
  3390. NvS32 defaultMinTemp; //!< Minimum default temperature value of the thermal sensor in degree Celsius
  3391. NvS32 defaultMaxTemp; //!< Maximum default temperature value of the thermal sensor in degree Celsius
  3392. NvS32 currentTemp; //!< Current temperature value of the thermal sensor in degree Celsius
  3393. NV_THERMAL_TARGET target; //!< Thermal sensor targeted - GPU, memory, chipset, powersupply, Visual Computing Device, etc
  3394. } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU];
  3395. } NV_GPU_THERMAL_SETTINGS_V2;
  3396. //! \ingroup gputhermal
  3397. typedef NV_GPU_THERMAL_SETTINGS_V2 NV_GPU_THERMAL_SETTINGS;
  3398. //! \ingroup gputhermal
  3399. //! @{
  3400. //! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V1
  3401. #define NV_GPU_THERMAL_SETTINGS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V1,1)
  3402. //! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V2
  3403. #define NV_GPU_THERMAL_SETTINGS_VER_2 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V2,2)
  3404. //! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS
  3405. #define NV_GPU_THERMAL_SETTINGS_VER NV_GPU_THERMAL_SETTINGS_VER_2
  3406. //! @}
  3407. ///////////////////////////////////////////////////////////////////////////////
  3408. //
  3409. // FUNCTION NAME: NvAPI_GPU_GetThermalSettings
  3410. //
  3411. //! This function retrieves the thermal information of all thermal sensors or specific thermal sensor associated with the selected GPU.
  3412. //! Thermal sensors are indexed 0 to NVAPI_MAX_THERMAL_SENSORS_PER_GPU-1.
  3413. //!
  3414. //! - To retrieve specific thermal sensor info, set the sensorIndex to the required thermal sensor index.
  3415. //! - To retrieve info for all sensors, set sensorIndex to NVAPI_THERMAL_TARGET_ALL.
  3416. //!
  3417. //! SUPPORTED OS: Windows 7 and higher
  3418. //!
  3419. //!
  3420. //! TCC_SUPPORTED
  3421. //!
  3422. //! \since Release: 85
  3423. //!
  3424. //! \param [in] hPhysicalGPU GPU selection.
  3425. //! \param [in] sensorIndex Explicit thermal sensor index selection.
  3426. //! \param [out] pThermalSettings Array of thermal settings.
  3427. //!
  3428. //! \retval NVAPI_OK Completed request
  3429. //! \retval NVAPI_ERROR Miscellaneous error occurred.
  3430. //! \retval NVAPI_INVALID_ARGUMENT pThermalInfo is NULL.
  3431. //! \retval NVAPI_HANDLE_INVALIDATED Handle passed has been invalidated (see user guide).
  3432. //! \retval NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle.
  3433. //! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the INFO struct is not supported.
  3434. //! \ingroup gputhermal
  3435. ///////////////////////////////////////////////////////////////////////////////
  3436. NVAPI_INTERFACE NvAPI_GPU_GetThermalSettings(NvPhysicalGpuHandle hPhysicalGpu, NvU32 sensorIndex, NV_GPU_THERMAL_SETTINGS *pThermalSettings);
  3437. //! \ingroup gpuclock
  3438. //! Used in NvAPI_GPU_GetAllClockFrequencies()
  3439. typedef struct
  3440. {
  3441. NvU32 version; //!< Structure version
  3442. NvU32 reserved; //!< These bits are reserved for future use.
  3443. struct
  3444. {
  3445. NvU32 bIsPresent:1; //!< Set if this domain is present on this GPU
  3446. NvU32 reserved:31; //!< These bits are reserved for future use.
  3447. NvU32 frequency; //!< Clock frequency (kHz)
  3448. }domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS];
  3449. } NV_GPU_CLOCK_FREQUENCIES_V1;
  3450. #ifndef NV_GPU_MAX_CLOCK_FREQUENCIES
  3451. #define NV_GPU_MAX_CLOCK_FREQUENCIES 3
  3452. #endif
  3453. //! \ingroup gpuclock
  3454. //! Used in NvAPI_GPU_GetAllClockFrequencies()
  3455. typedef enum
  3456. {
  3457. NV_GPU_CLOCK_FREQUENCIES_CURRENT_FREQ = 0,
  3458. NV_GPU_CLOCK_FREQUENCIES_BASE_CLOCK = 1,
  3459. NV_GPU_CLOCK_FREQUENCIES_BOOST_CLOCK = 2,
  3460. NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NUM = NV_GPU_MAX_CLOCK_FREQUENCIES
  3461. } NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE;
  3462. //! \ingroup gpuclock
  3463. //! Used in NvAPI_GPU_GetAllClockFrequencies()
  3464. typedef struct
  3465. {
  3466. NvU32 version; //!< Structure version
  3467. NvU32 ClockType:4; //!< One of NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE. Used to specify the type of clock to be returned.
  3468. NvU32 reserved:20; //!< These bits are reserved for future use. Must be set to 0.
  3469. NvU32 reserved1:8; //!< These bits are reserved.
  3470. struct
  3471. {
  3472. NvU32 bIsPresent:1; //!< Set if this domain is present on this GPU
  3473. NvU32 reserved:31; //!< These bits are reserved for future use.
  3474. NvU32 frequency; //!< Clock frequency (kHz)
  3475. }domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS];
  3476. } NV_GPU_CLOCK_FREQUENCIES_V2;
  3477. //! \ingroup gpuclock
  3478. //! Used in NvAPI_GPU_GetAllClockFrequencies()
  3479. typedef NV_GPU_CLOCK_FREQUENCIES_V2 NV_GPU_CLOCK_FREQUENCIES;
  3480. //! \addtogroup gpuclock
  3481. //! @{
  3482. #define NV_GPU_CLOCK_FREQUENCIES_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V1,1)
  3483. #define NV_GPU_CLOCK_FREQUENCIES_VER_2 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V2,2)
  3484. #define NV_GPU_CLOCK_FREQUENCIES_VER_3 MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V2,3)
  3485. #define NV_GPU_CLOCK_FREQUENCIES_VER NV_GPU_CLOCK_FREQUENCIES_VER_3
  3486. //! @}
  3487. ///////////////////////////////////////////////////////////////////////////////
  3488. //
  3489. // FUNCTION NAME: NvAPI_GPU_GetAllClockFrequencies
  3490. //
  3491. //! This function retrieves the NV_GPU_CLOCK_FREQUENCIES structure for the specified physical GPU.
  3492. //!
  3493. //! For each clock domain:
  3494. //! - bIsPresent is set for each domain that is present on the GPU
  3495. //! - frequency is the domain's clock freq in kHz
  3496. //!
  3497. //! Each domain's info is indexed in the array. For example:
  3498. //! clkFreqs.domain[NVAPI_GPU_PUBLIC_CLOCK_MEMORY] holds the info for the MEMORY domain.
  3499. //!
  3500. //! SUPPORTED OS: Windows 7 and higher
  3501. //!
  3502. //!
  3503. //! TCC_SUPPORTED
  3504. //!
  3505. //! \since Release: 295
  3506. //!
  3507. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  3508. //! If there are return error codes with specific meaning for this API,
  3509. //! they are listed below.
  3510. //! \retval NVAPI_INVALID_ARGUMENT pClkFreqs is NULL.
  3511. //! \ingroup gpuclock
  3512. ///////////////////////////////////////////////////////////////////////////////
  3513. NVAPI_INTERFACE NvAPI_GPU_GetAllClockFrequencies(__in NvPhysicalGpuHandle hPhysicalGPU, __inout NV_GPU_CLOCK_FREQUENCIES *pClkFreqs);
  3514. ///////////////////////////////////////////////////////////////////////////////
  3515. //!
  3516. //! FUNCTION NAME: NvAPI_GPU_QueryIlluminationSupport
  3517. //!
  3518. //! \fn NvAPI_GPU_QueryIlluminationSupport(__inout NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo)
  3519. //! DESCRIPTION: This function reports if the specified illumination attribute is supported.
  3520. //!
  3521. //! \note Only a single GPU can manage an given attribute on a given HW element,
  3522. //! regardless of how many are attatched. I.E. only one GPU will be used to control
  3523. //! the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached.
  3524. //! You should enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
  3525. //!
  3526. //! SUPPORTED OS: Windows 7 and higher
  3527. //!
  3528. //!
  3529. //! TCC_SUPPORTED
  3530. //!
  3531. //! \since Release: 300.05
  3532. //!
  3533. //! \param [in] hPhysicalGpu Physical GPU handle
  3534. //! \param Attribute An enumeration value specifying the Illumination attribute to be querried
  3535. //! \param [out] pSupported A boolean indicating if the attribute is supported.
  3536. //!
  3537. //! \return See \ref nvapistatus for the list of possible return values.
  3538. //
  3539. //////////////////////////////////////////////////////////////////////////////
  3540. //! \ingroup gpu
  3541. typedef enum _NV_GPU_ILLUMINATION_ATTRIB
  3542. {
  3543. NV_GPU_IA_LOGO_BRIGHTNESS = 0,
  3544. NV_GPU_IA_SLI_BRIGHTNESS = 1,
  3545. } NV_GPU_ILLUMINATION_ATTRIB;
  3546. //! \ingroup gpu
  3547. typedef struct _NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 {
  3548. // IN
  3549. NvU32 version; //!< Version of this structure
  3550. NvPhysicalGpuHandle hPhysicalGpu; //!< The handle of the GPU that you are checking for the specified attribute.
  3551. //!< note that this is the GPU that is managing the attribute.
  3552. //!< Only a single GPU can manage an given attribute on a given HW element,
  3553. //!< regardless of how many are attatched.
  3554. //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,
  3555. //!< regardless of how many are physicaly attached.
  3556. //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
  3557. NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried.
  3558. //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB.
  3559. // OUT
  3560. NvU32 bSupported; //!< A boolean indicating if the attribute is supported.
  3561. } NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1;
  3562. //! \ingroup gpu
  3563. typedef NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM;
  3564. //! \ingroup gpu
  3565. #define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1,1)
  3566. //! \ingroup gpu
  3567. #define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1
  3568. //! \ingroup gpu
  3569. NVAPI_INTERFACE NvAPI_GPU_QueryIlluminationSupport(__inout NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo);
  3570. ///////////////////////////////////////////////////////////////////////////////
  3571. //!
  3572. //! FUNCTION NAME: NvAPI_GPU_GetIllumination
  3573. //!
  3574. //! \fn NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo)
  3575. //! DESCRIPTION: This function reports value of the specified illumination attribute.
  3576. //!
  3577. //! \note Only a single GPU can manage an given attribute on a given HW element,
  3578. //! regardless of how many are attatched. I.E. only one GPU will be used to control
  3579. //! the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached.
  3580. //! You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to
  3581. //! determine which GPU is managing the attribute.
  3582. //!
  3583. //! SUPPORTED OS: Windows 7 and higher
  3584. //!
  3585. //!
  3586. //! TCC_SUPPORTED
  3587. //!
  3588. //! \since Release: 300.05
  3589. //!
  3590. //! \param [in] hPhysicalGpu Physical GPU handle
  3591. //! \param Attribute An enumeration value specifying the Illumination attribute to be querried
  3592. //! \param [out] Value A DWORD containing the current value for the specified attribute.
  3593. //! This is specified as a percentage of the full range of the attribute
  3594. //! (0-100; 0 = off, 100 = full brightness)
  3595. //!
  3596. //! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are:
  3597. //! NVAPI_INVALID_ARGUMENT The specified attibute is not known to the driver.
  3598. //! NVAPI_NOT_SUPPORTED: The specified attribute is not supported on the specified GPU
  3599. //
  3600. //////////////////////////////////////////////////////////////////////////////
  3601. //! \ingroup gpu
  3602. typedef struct _NV_GPU_GET_ILLUMINATION_PARM_V1 {
  3603. // IN
  3604. NvU32 version; //!< Version of this structure
  3605. NvPhysicalGpuHandle hPhysicalGpu; //!< The handle of the GPU that you are checking for the specified attribute.
  3606. //!< Note that this is the GPU that is managing the attribute.
  3607. //!< Only a single GPU can manage an given attribute on a given HW element,
  3608. //!< regardless of how many are attatched.
  3609. //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,
  3610. //!< regardless of how many are physicaly attached.
  3611. //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
  3612. NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried.
  3613. //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB.
  3614. // OUT
  3615. NvU32 Value; //!< A DWORD that will contain the current value of the specified attribute.
  3616. //! This is specified as a percentage of the full range of the attribute
  3617. //! (0-100; 0 = off, 100 = full brightness)
  3618. } NV_GPU_GET_ILLUMINATION_PARM_V1;
  3619. //! \ingroup gpu
  3620. typedef NV_GPU_GET_ILLUMINATION_PARM_V1 NV_GPU_GET_ILLUMINATION_PARM;
  3621. //! \ingroup gpu
  3622. #define NV_GPU_GET_ILLUMINATION_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_GET_ILLUMINATION_PARM_V1,1)
  3623. //! \ingroup gpu
  3624. #define NV_GPU_GET_ILLUMINATION_PARM_VER NV_GPU_GET_ILLUMINATION_PARM_VER_1
  3625. //! \ingroup gpu
  3626. NVAPI_INTERFACE NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo);
  3627. ///////////////////////////////////////////////////////////////////////////////
  3628. //!
  3629. //! FUNCTION NAME: NvAPI_GPU_SetIllumination
  3630. //!
  3631. //! \fn NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo)
  3632. //! DESCRIPTION: This function sets the value of the specified illumination attribute.
  3633. //!
  3634. //! \note Only a single GPU can manage an given attribute on a given HW element,
  3635. //! regardless of how many are attatched. I.E. only one GPU will be used to control
  3636. //! the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached.
  3637. //! You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to
  3638. //! determine which GPU is managing the attribute.
  3639. //!
  3640. //! SUPPORTED OS: Windows 7 and higher
  3641. //!
  3642. //!
  3643. //! TCC_SUPPORTED
  3644. //!
  3645. //! \since Release: 300.05
  3646. //!
  3647. //! \param [in] hPhysicalGpu Physical GPU handle
  3648. //! \param Attribute An enumeration value specifying the Illumination attribute to be set
  3649. //! \param Value The new value for the specified attribute.
  3650. //! This should be specified as a percentage of the full range of the attribute
  3651. //! (0-100; 0 = off, 100 = full brightness)
  3652. //! If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned.
  3653. //!
  3654. //! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are:
  3655. //! NVAPI_INVALID_ARGUMENT The specified attibute is not known to the driver, or the specified value is out of range.
  3656. //! NVAPI_NOT_SUPPORTED The specified attribute is not supported on the specified GPU.
  3657. //
  3658. ///////////////////////////////////////////////////////////////////////////////
  3659. //! \ingroup gpu
  3660. typedef struct _NV_GPU_SET_ILLUMINATION_PARM_V1 {
  3661. // IN
  3662. NvU32 version; //!< Version of this structure
  3663. NvPhysicalGpuHandle hPhysicalGpu; //!< The handle of the GPU that you are checking for the specified attribute.
  3664. //!< Note that this is the GPU that is managing the attribute.
  3665. //!< Only a single GPU can manage an given attribute on a given HW element,
  3666. //!< regardless of how many are attatched.
  3667. //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,
  3668. //!< regardless of how many are physicaly attached.
  3669. //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
  3670. NV_GPU_ILLUMINATION_ATTRIB Attribute; //!< An enumeration value specifying the Illumination attribute to be querried.
  3671. //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB.
  3672. NvU32 Value; //!< A DWORD containing the new value for the specified attribute.
  3673. //!< This should be specified as a percentage of the full range of the attribute
  3674. //!< (0-100; 0 = off, 100 = full brightness)
  3675. //!< If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned.
  3676. // OUT
  3677. } NV_GPU_SET_ILLUMINATION_PARM_V1;
  3678. //! \ingroup gpu
  3679. typedef NV_GPU_SET_ILLUMINATION_PARM_V1 NV_GPU_SET_ILLUMINATION_PARM;
  3680. //! \ingroup gpu
  3681. #define NV_GPU_SET_ILLUMINATION_PARM_VER_1 MAKE_NVAPI_VERSION(NV_GPU_SET_ILLUMINATION_PARM_V1,1)
  3682. //! \ingroup gpu
  3683. #define NV_GPU_SET_ILLUMINATION_PARM_VER NV_GPU_SET_ILLUMINATION_PARM_VER_1
  3684. //! \ingroup gpu
  3685. NVAPI_INTERFACE NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo);
  3686. /*!
  3687. * Enumeration of control modes that can be applied to Illumination Zones.
  3688. */
  3689. typedef enum
  3690. {
  3691. NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB = 0,
  3692. NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB,
  3693. // Strictly add new control modes above this.
  3694. NV_GPU_CLIENT_ILLUM_CTRL_MODE_INVALID = 0xFF,
  3695. } NV_GPU_CLIENT_ILLUM_CTRL_MODE;
  3696. /*!
  3697. * Enumeration of locations where an Illumination Zone might be present.
  3698. * Encoding used -
  3699. * 1:0 - Number specifier (0)
  3700. * 4:2 - Location (TOP)
  3701. * 7:5 - Type (GPU/SLI)
  3702. */
  3703. typedef enum
  3704. {
  3705. NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_GPU_TOP_0 = 0x00,
  3706. NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_SLI_TOP_0 = 0x20,
  3707. NV_GPU_CLIENT_ILLUM_ZONE_LOCATION_INVALID = 0xFFFFFFFF,
  3708. } NV_GPU_CLIENT_ILLUM_ZONE_LOCATION;
  3709. /*!
  3710. * Enumeration of ILLUM_DEVICEs.
  3711. */
  3712. typedef enum
  3713. {
  3714. NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_INVALID = 0,
  3715. NV_GPU_CLIENT_ILLUM_DEVICE_TYPE_MCUV10,
  3716. } NV_GPU_CLIENT_ILLUM_DEVICE_TYPE;
  3717. /*!
  3718. * Enumeration of ILLUM_ZONEs.
  3719. */
  3720. typedef enum
  3721. {
  3722. NV_GPU_CLIENT_ILLUM_ZONE_TYPE_INVALID = 0,
  3723. NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB,
  3724. NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED,
  3725. } NV_GPU_CLIENT_ILLUM_ZONE_TYPE;
  3726. /*!
  3727. * Number of color points for the piecewise linear control mode.
  3728. */
  3729. #define NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS 2
  3730. /*!
  3731. * Enumeration of Cycle types for piecewise linear control mode.
  3732. */
  3733. typedef enum
  3734. {
  3735. NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_HALF_HALT = 0,
  3736. NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_HALT,
  3737. NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_FULL_REPEAT,
  3738. NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_INVALID = 0xFF,
  3739. } NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE;
  3740. #define NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX 32
  3741. /*!
  3742. * Used in \ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1
  3743. * Describes the static information of illumination device type MCUV10.
  3744. */
  3745. typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10
  3746. {
  3747. /*!
  3748. * I2C Device Index: Pointing to the illumination device in I2C Devices Table.
  3749. */
  3750. NvU8 i2cDevIdx;
  3751. } NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10;
  3752. /*!
  3753. */
  3754. typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1
  3755. {
  3756. /*!
  3757. * Type of the illumination device.
  3758. */
  3759. NV_GPU_CLIENT_ILLUM_DEVICE_TYPE type;
  3760. /*!
  3761. * Supported control modes for this illumination device.
  3762. */
  3763. NvU32 ctrlModeMask;
  3764. /*!
  3765. * Union of illumination device info data. Interpreted as per
  3766. * @ref NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1::type
  3767. */
  3768. union
  3769. {
  3770. //
  3771. // Need to be careful when add/expanding types in this union. If any type
  3772. // exceeds sizeof(rsvd) then rsvd has failed its purpose.
  3773. //
  3774. NV_GPU_CLIENT_ILLUM_DEVICE_INFO_DATA_MCUV10 mcuv10;
  3775. /*!
  3776. * Reserved bytes for possible future extension of this struct.
  3777. */
  3778. NvU8 rsvd[64];
  3779. } data;
  3780. /*!
  3781. * Reserved for future.
  3782. */
  3783. NvU8 rsvd[64];
  3784. } NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1;
  3785. /*!
  3786. */
  3787. typedef struct _NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1
  3788. {
  3789. /*!
  3790. * Version of structure. Must always be first member.
  3791. */
  3792. NvU32 version;
  3793. /*!
  3794. * Number of illumination devices present.
  3795. */
  3796. NvU32 numIllumDevices;
  3797. /*!
  3798. * Reserved bytes for possible future extension of this struct.
  3799. */
  3800. NvU8 rsvd[64];
  3801. /*!
  3802. */
  3803. NV_GPU_CLIENT_ILLUM_DEVICE_INFO_V1 devices[NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX];
  3804. } NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1;
  3805. #define NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1, 1)
  3806. #define NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_VER_1
  3807. typedef NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS_V1 NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS;
  3808. ///////////////////////////////////////////////////////////////////////////////
  3809. //!
  3810. //! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesGetInfo
  3811. //!
  3812. //! DESCRIPTION: This API returns static information about illumination devices on the
  3813. //! given GPU.
  3814. //
  3815. //! SUPPORTED OS: Windows 7 and higher
  3816. //!
  3817. //!
  3818. //! TCC_SUPPORTED
  3819. //!
  3820. //! \since Release: 400
  3821. //! \param [in] hPhysicalGpu The physical GPU handle
  3822. //! \param [out] pIllumDevicesInfo Pointer to structure containing static
  3823. //! information about illumination devices.
  3824. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  3825. //! If there are return error codes with specific meaning for this API,
  3826. //! they are listed below.
  3827. ///////////////////////////////////////////////////////////////////////////////
  3828. NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesGetInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_INFO_PARAMS *pIllumDevicesInfo);
  3829. /*!
  3830. * Structure representing the data required for synchronization.
  3831. */
  3832. typedef struct
  3833. {
  3834. /*!
  3835. * Boolean representing the need for synchronization.
  3836. */
  3837. NvBool bSync;
  3838. /*!
  3839. * Time stamp value required for synchronization.
  3840. */
  3841. NvU64 timeStampms;
  3842. /*!
  3843. * Reserved for future.
  3844. */
  3845. NvU8 rsvd[64];
  3846. } NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1;
  3847. /*!
  3848. * Structure representing the device control parameters of each ILLUM_DEVICE.
  3849. */
  3850. typedef struct
  3851. {
  3852. /*!
  3853. * Type of the illum device.
  3854. */
  3855. NV_GPU_CLIENT_ILLUM_DEVICE_TYPE type;
  3856. /*!
  3857. * Structure containing the synchronization data for the illumination device.
  3858. */
  3859. NV_GPU_CLIENT_ILLUM_DEVICE_SYNC_V1 syncData;
  3860. /*!
  3861. * Reserved for future.
  3862. */
  3863. NvU8 rsvd[64];
  3864. } NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1;
  3865. typedef NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1 NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL;
  3866. /*!
  3867. * Structure representing the control parameters of ILLUM_DEVICE-s.
  3868. */
  3869. typedef struct
  3870. {
  3871. /*!
  3872. * Version of structure. Must always be first member.
  3873. */
  3874. NvU32 version;
  3875. /*!
  3876. * Number of illumination devices present.
  3877. */
  3878. NvU32 numIllumDevices;
  3879. /*!
  3880. * Reserved bytes for possible future extension of this struct.
  3881. */
  3882. NvU8 rsvd[64];
  3883. /*!
  3884. */
  3885. NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_V1 devices[NV_GPU_CLIENT_ILLUM_DEVICE_NUM_DEVICES_MAX];
  3886. } NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1;
  3887. #define NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1, 1)
  3888. #define NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_VER_1
  3889. typedef NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS_V1 NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS;
  3890. ///////////////////////////////////////////////////////////////////////////////
  3891. //!
  3892. //! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesGetControl
  3893. //!
  3894. //! DESCRIPTION: This API gets control parameters about illumination devices on the
  3895. //! given GPU.
  3896. //
  3897. //! SUPPORTED OS: Windows 7 and higher
  3898. //!
  3899. //!
  3900. //! TCC_SUPPORTED
  3901. //!
  3902. //! \since Release: 400
  3903. //! \param [in] hPhysicalGpu The physical GPU handle
  3904. //! \param [inout] pIllumDevicesControl Pointer to structure containing control
  3905. //! information about illum devices.
  3906. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  3907. //! If there are return error codes with specific meaning for this API,
  3908. //! they are listed below.
  3909. ///////////////////////////////////////////////////////////////////////////////
  3910. NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesGetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS *pClientIllumDevicesControl);
  3911. ///////////////////////////////////////////////////////////////////////////////
  3912. //!
  3913. //! FUNCTION NAME: NvAPI_GPU_ClientIllumDevicesSetControl
  3914. //!
  3915. //! DESCRIPTION: This API sets control parameters about illumination devices on the
  3916. //! given GPU.
  3917. //
  3918. //! SUPPORTED OS: Windows 7 and higher
  3919. //!
  3920. //!
  3921. //! TCC_SUPPORTED
  3922. //!
  3923. //! \since Release: 400
  3924. //! \param [in] hPhysicalGpu The physical GPU handle
  3925. //! \param [inout] pClientIllumDevicesControl Pointer to structure containing control
  3926. //! information about illum devices.
  3927. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  3928. //! If there are return error codes with specific meaning for this API,
  3929. //! they are listed below.
  3930. ///////////////////////////////////////////////////////////////////////////////
  3931. NVAPI_INTERFACE NvAPI_GPU_ClientIllumDevicesSetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_DEVICE_CONTROL_PARAMS *pClientIllumDevicesControl);
  3932. #define NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX 32
  3933. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB
  3934. {
  3935. NvU8 rsvd;
  3936. } NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB;
  3937. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1
  3938. {
  3939. NV_GPU_CLIENT_ILLUM_ZONE_TYPE type;
  3940. /*!
  3941. * Index pointing to an Illumination Device that controls this zone.
  3942. */
  3943. NvU8 illumDeviceIdx;
  3944. /*!
  3945. * Provider index for representing logical to physical zone mapping.
  3946. */
  3947. NvU8 provIdx;
  3948. /*!
  3949. * Location of the zone on the board.
  3950. */
  3951. NV_GPU_CLIENT_ILLUM_ZONE_LOCATION zoneLocation;
  3952. union
  3953. {
  3954. //
  3955. // Need to be careful when add/expanding types in this union. If any type
  3956. // exceeds sizeof(rsvd) then rsvd has failed its purpose.
  3957. //
  3958. NV_GPU_CLIENT_ILLUM_ZONE_INFO_DATA_RGB rgb;
  3959. /*!
  3960. * Reserved bytes for possible future extension of this struct.
  3961. */
  3962. NvU8 rsvd[64];
  3963. } data;
  3964. NvU8 rsvd[64];
  3965. } NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1;
  3966. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1
  3967. {
  3968. /*!
  3969. * Version of structure. Must always be first member.
  3970. */
  3971. NvU32 version;
  3972. /*!
  3973. * Number of illumination zones present.
  3974. */
  3975. NvU32 numIllumZones;
  3976. /*!
  3977. * Reserved bytes for possible future extension of this struct.
  3978. */
  3979. NvU8 rsvd[64];
  3980. NV_GPU_CLIENT_ILLUM_ZONE_INFO_V1 zones[NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX];
  3981. } NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1;
  3982. #define NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1, 1)
  3983. #define NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_VER_1
  3984. typedef NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS_V1 NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS;
  3985. ///////////////////////////////////////////////////////////////////////////////
  3986. //!
  3987. //! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesGetInfo
  3988. //!
  3989. //! DESCRIPTION: This API returns static information about illumination zones on the
  3990. //! given GPU.
  3991. //
  3992. //! SUPPORTED OS: Windows 7 and higher
  3993. //!
  3994. //!
  3995. //! TCC_SUPPORTED
  3996. //!
  3997. //! \since Release: 400
  3998. //! \param [in] hPhysicalGpu The physical GPU handle
  3999. //! \param [out] pIllumZonesInfo Pointer to structure containing static
  4000. //! information about illumination devices.
  4001. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  4002. //! If there are return error codes with specific meaning for this API,
  4003. //! they are listed below.
  4004. ///////////////////////////////////////////////////////////////////////////////
  4005. NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesGetInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_INFO_PARAMS *pIllumZonesInfo);
  4006. /*!
  4007. * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB
  4008. * Parameters required to represent control mode of type
  4009. * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
  4010. */
  4011. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS
  4012. {
  4013. /*!
  4014. * Red compenent of color applied to the zone.
  4015. */
  4016. NvU8 colorR;
  4017. /*!
  4018. * Green compenent of color applied to the zone.
  4019. */
  4020. NvU8 colorG;
  4021. /*!
  4022. * Blue compenent of color applied to the zone.
  4023. */
  4024. NvU8 colorB;
  4025. /*!
  4026. * Brightness perecentage value of the zone.
  4027. */
  4028. NvU8 brightnessPct;
  4029. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS;
  4030. /*!
  4031. * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB
  4032. * Data required to represent control mode of type
  4033. * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
  4034. */
  4035. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB
  4036. {
  4037. /*!
  4038. * Parameters required to represent control mode of type
  4039. * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
  4040. */
  4041. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS rgbParams;
  4042. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB;
  4043. /*!
  4044. * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB
  4045. * Data required to represent control mode of type
  4046. * \ref NV_GPU_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
  4047. */
  4048. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR
  4049. {
  4050. /*!
  4051. * Type of cycle effect to apply.
  4052. */
  4053. NV_GPU_CLIENT_ILLUM_PIECEWISE_LINEAR_CYCLE_TYPE cycleType;
  4054. /*!
  4055. * Number of times to repeat function within group period.
  4056. */
  4057. NvU8 grpCount;
  4058. /*!
  4059. * Time in ms to transition from color A to color B.
  4060. */
  4061. NvU16 riseTimems;
  4062. /*!
  4063. * Time in ms to transition from color B to color A.
  4064. */
  4065. NvU16 fallTimems;
  4066. /*!
  4067. * Time in ms to remain at color A before color A to color B transition.
  4068. */
  4069. NvU16 ATimems;
  4070. /*!
  4071. * Time in ms to remain at color B before color B to color A transition.
  4072. */
  4073. NvU16 BTimems;
  4074. /*!
  4075. * Time in ms to remain idle before next group of repeated function cycles.
  4076. */
  4077. NvU16 grpIdleTimems;
  4078. /*!
  4079. * Time in ms to offset the cycle relative to other zones.
  4080. */
  4081. NvU16 phaseOffsetms;
  4082. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR;
  4083. /*!
  4084. * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB
  4085. * Data required to represent control mode of type
  4086. * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
  4087. */
  4088. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB
  4089. {
  4090. /*!
  4091. * Parameters required to represent control mode of type
  4092. * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
  4093. */
  4094. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB_PARAMS rgbParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS];
  4095. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData;
  4096. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB;
  4097. /*!
  4098. * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1
  4099. * Describes the control data for illumination zone of type
  4100. * \ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB.
  4101. */
  4102. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB
  4103. {
  4104. /*!
  4105. * Union of illumination zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_RGB.
  4106. * Interpreted as per ctrlMode.
  4107. */
  4108. union
  4109. {
  4110. //
  4111. // Need to be careful when add/expanding types in this union. If any type
  4112. // exceeds sizeof(rsvd) then rsvd has failed its purpose.
  4113. //
  4114. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_RGB manualRGB;
  4115. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_RGB piecewiseLinearRGB;
  4116. /*!
  4117. * Reserved bytes for possible future extension of this struct.
  4118. */
  4119. NvU8 rsvd[64];
  4120. } data;
  4121. /*!
  4122. * Reserved for future.
  4123. */
  4124. NvU8 rsvd[64];
  4125. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB;
  4126. /*!
  4127. * Used in \ref NV_GPU_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED
  4128. * Parameters required to represent control mode of type
  4129. * \ref NV_GPU_ILLUM_CTRL_MODE_MANUAL_RGB.
  4130. */
  4131. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS
  4132. {
  4133. /*!
  4134. * Brightness percentage value of the zone.
  4135. */
  4136. NvU8 brightnessPct;
  4137. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS;
  4138. /*!
  4139. * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED
  4140. * Data required to represent control mode of type
  4141. * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
  4142. */
  4143. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED
  4144. {
  4145. /*!
  4146. * Parameters required to represent control mode of type
  4147. * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_MANUAL_RGB.
  4148. */
  4149. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS colorFixedParams;
  4150. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED;
  4151. /*!
  4152. * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED
  4153. * Data required to represent control mode of type
  4154. * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
  4155. */
  4156. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED
  4157. {
  4158. /*!
  4159. * Parameters required to represent control mode of type
  4160. * \ref NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_RGB.
  4161. */
  4162. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED_PARAMS colorFixedParams[NV_GPU_CLIENT_ILLUM_CTRL_MODE_PIECEWISE_LINEAR_COLOR_ENDPOINTS];
  4163. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR piecewiseLinearData;
  4164. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED;
  4165. /*!
  4166. * Used in \ref NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1
  4167. * Describes the control data for illum zone of type
  4168. * \ref NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED.
  4169. */
  4170. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED
  4171. {
  4172. /*!
  4173. * Union of illum zone control data for zone of type NV_GPU_CLIENT_ILLUM_ZONE_TYPE_COLOR_FIXED.
  4174. * Interpreted as per ctrlMode.
  4175. */
  4176. union
  4177. {
  4178. //
  4179. // Need to be careful when add/expanding types in this union. If any type
  4180. // exceeds sizeof(rsvd) then rsvd has failed its purpose.
  4181. //
  4182. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_MANUAL_COLOR_FIXED manualColorFixed;
  4183. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_PIECEWISE_LINEAR_COLOR_FIXED piecewiseLinearColorFixed;
  4184. /*!
  4185. * Reserved bytes for possible future extension of this struct.
  4186. */
  4187. NvU8 rsvd[64];
  4188. } data;
  4189. /*!
  4190. * Reserved for future.
  4191. */
  4192. NvU8 rsvd[64];
  4193. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED;
  4194. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1
  4195. {
  4196. NV_GPU_CLIENT_ILLUM_ZONE_TYPE type;
  4197. NV_GPU_CLIENT_ILLUM_CTRL_MODE ctrlMode;
  4198. union
  4199. {
  4200. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_RGB rgb;
  4201. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_DATA_COLOR_FIXED colorFixed;
  4202. NvU8 rsvd[64];
  4203. } data;
  4204. NvU8 rsvd[64];
  4205. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1;
  4206. typedef struct _NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1
  4207. {
  4208. NvU32 version;
  4209. /*!
  4210. * Bit field specifying the set of values to retrieve or set
  4211. * - default (NV_TRUE)
  4212. * - currently active (NV_FALSE).
  4213. */
  4214. NvU32 bDefault : 1;
  4215. NvU32 rsvdField : 31;
  4216. /*!
  4217. * Number of illumination zones present.
  4218. */
  4219. NvU32 numIllumZonesControl;
  4220. /*!
  4221. * Reserved bytes for possible future extension of this struct.
  4222. */
  4223. NvU8 rsvd[64];
  4224. NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_V1 zones[NV_GPU_CLIENT_ILLUM_ZONE_NUM_ZONES_MAX];
  4225. } NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1;
  4226. #define NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1, 1)
  4227. #define NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_VER_1
  4228. typedef NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS_V1 NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS;
  4229. ///////////////////////////////////////////////////////////////////////////////
  4230. //!
  4231. //! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesGetControl
  4232. //!
  4233. //! DESCRIPTION: Accessor for control information about illumination zones on the
  4234. //! given GPU.
  4235. //
  4236. //! SUPPORTED OS: Windows 7 and higher
  4237. //!
  4238. //!
  4239. //! TCC_SUPPORTED
  4240. //!
  4241. //! \since Release: 400
  4242. //! \param [in] hPhysicalGpu The physical GPU handle
  4243. //! \param [out] pIllumZonesControl Pointer to structure containing control
  4244. //! information about illumination zones.
  4245. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  4246. //! If there are return error codes with specific meaning for this API,
  4247. //! they are listed below.
  4248. ///////////////////////////////////////////////////////////////////////////////
  4249. NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesGetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS *pIllumZonesControl);
  4250. ///////////////////////////////////////////////////////////////////////////////
  4251. //!
  4252. //! FUNCTION NAME: NvAPI_GPU_ClientIllumZonesSetControl
  4253. //!
  4254. //! DESCRIPTION: Mutator for control information about illumination zones on the
  4255. //! given GPU.
  4256. //
  4257. //! SUPPORTED OS: Windows 7 and higher
  4258. //!
  4259. //!
  4260. //! TCC_SUPPORTED
  4261. //!
  4262. //! \since Release: 400
  4263. //! \param [in] hPhysicalGpu The physical GPU handle
  4264. //! \param [out] pIllumZonesControl Pointer to structure containing control
  4265. //! information about illumination zones.
  4266. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  4267. //! If there are return error codes with specific meaning for this API,
  4268. //! they are listed below.
  4269. ///////////////////////////////////////////////////////////////////////////////
  4270. NVAPI_INTERFACE NvAPI_GPU_ClientIllumZonesSetControl(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_CLIENT_ILLUM_ZONE_CONTROL_PARAMS *pIllumZonesControl);
  4271. ///////////////////////////////////////////////////////////////////////////////
  4272. //
  4273. // FUNCTION NAME: NvAPI_EnumNvidiaDisplayHandle
  4274. //
  4275. //! This function returns the handle of the NVIDIA display specified by the enum
  4276. //! index (thisEnum). The client should keep enumerating until it
  4277. //! returns error.
  4278. //!
  4279. //! Note: Display handles can get invalidated on a modeset, so the calling applications need to
  4280. //! renum the handles after every modeset.
  4281. //!
  4282. //! SUPPORTED OS: Windows 7 and higher
  4283. //!
  4284. //!
  4285. //! \since Release: 80
  4286. //!
  4287. //! \param [in] thisEnum The index of the NVIDIA display.
  4288. //! \param [out] pNvDispHandle Pointer to the NVIDIA display handle.
  4289. //!
  4290. //! \retval NVAPI_INVALID_ARGUMENT Either the handle pointer is NULL or enum index too big
  4291. //! \retval NVAPI_OK Return a valid NvDisplayHandle based on the enum index
  4292. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device found in the system
  4293. //! \retval NVAPI_END_ENUMERATION No more display device to enumerate
  4294. //! \ingroup disphandle
  4295. ///////////////////////////////////////////////////////////////////////////////
  4296. NVAPI_INTERFACE NvAPI_EnumNvidiaDisplayHandle(NvU32 thisEnum, NvDisplayHandle *pNvDispHandle);
  4297. ///////////////////////////////////////////////////////////////////////////////
  4298. //
  4299. // FUNCTION NAME: NvAPI_EnumNvidiaUnAttachedDisplayHandle
  4300. //
  4301. //! This function returns the handle of the NVIDIA unattached display specified by the enum
  4302. //! index (thisEnum). The client should keep enumerating until it
  4303. //! returns error.
  4304. //! Note: Display handles can get invalidated on a modeset, so the calling applications need to
  4305. //! renum the handles after every modeset.
  4306. //!
  4307. //! SUPPORTED OS: Windows 7 and higher
  4308. //!
  4309. //!
  4310. //! \since Release: 80
  4311. //!
  4312. //! \param [in] thisEnum The index of the NVIDIA display.
  4313. //! \param [out] pNvUnAttachedDispHandle Pointer to the NVIDIA display handle of the unattached display.
  4314. //!
  4315. //! \retval NVAPI_INVALID_ARGUMENT Either the handle pointer is NULL or enum index too big
  4316. //! \retval NVAPI_OK Return a valid NvDisplayHandle based on the enum index
  4317. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device found in the system
  4318. //! \retval NVAPI_END_ENUMERATION No more display device to enumerate.
  4319. //! \ingroup disphandle
  4320. ///////////////////////////////////////////////////////////////////////////////
  4321. NVAPI_INTERFACE NvAPI_EnumNvidiaUnAttachedDisplayHandle(NvU32 thisEnum, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle);
  4322. ///////////////////////////////////////////////////////////////////////////////
  4323. //
  4324. // FUNCTION NAME: NvAPI_CreateDisplayFromUnAttachedDisplay
  4325. //
  4326. //! This function converts the unattached display handle to an active attached display handle.
  4327. //!
  4328. //! At least one GPU must be present in the system and running an NVIDIA display driver.
  4329. //!
  4330. //! SUPPORTED OS: Windows 7 and higher
  4331. //!
  4332. //!
  4333. //! \since Release: 80
  4334. //!
  4335. //! \retval NVAPI_INVALID_ARGUMENT hNvUnAttachedDisp is not valid or pNvDisplay is NULL.
  4336. //! \retval NVAPI_OK One or more handles were returned
  4337. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  4338. //! \ingroup dispcontrol
  4339. ///////////////////////////////////////////////////////////////////////////////
  4340. NVAPI_INTERFACE NvAPI_CreateDisplayFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvDisplayHandle *pNvDisplay);
  4341. ///////////////////////////////////////////////////////////////////////////////
  4342. //
  4343. // FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayHandle
  4344. //
  4345. //! This function returns the handle of the NVIDIA display that is associated
  4346. //! with the given display "name" (such as "\\.\DISPLAY1").
  4347. //!
  4348. //! SUPPORTED OS: Windows 7 and higher
  4349. //!
  4350. //!
  4351. //! \since Release: 80
  4352. //!
  4353. //! \retval NVAPI_INVALID_ARGUMENT Either argument is NULL
  4354. //! \retval NVAPI_OK *pNvDispHandle is now valid
  4355. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name
  4356. //! \ingroup disphandle
  4357. ///////////////////////////////////////////////////////////////////////////////
  4358. NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayHandle(const char *szDisplayName, NvDisplayHandle *pNvDispHandle);
  4359. ///////////////////////////////////////////////////////////////////////////////
  4360. //
  4361. // FUNCTION NAME: NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle
  4362. //
  4363. //! DESCRIPTION: This function returns the handle of an unattached NVIDIA display that is
  4364. //! associated with the given display name (such as "\\DISPLAY1").
  4365. //!
  4366. //! SUPPORTED OS: Windows 7 and higher
  4367. //!
  4368. //!
  4369. //! \since Release: 185
  4370. //!
  4371. //! \retval ::NVAPI_INVALID_ARGUMENT Either argument is NULL.
  4372. //! \retval ::NVAPI_OK *pNvUnAttachedDispHandle is now valid.
  4373. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name.
  4374. //!
  4375. //! \ingroup disphandle
  4376. ///////////////////////////////////////////////////////////////////////////////
  4377. NVAPI_INTERFACE NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle(const char *szDisplayName, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle);
  4378. ///////////////////////////////////////////////////////////////////////////////
  4379. //
  4380. // FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayName
  4381. //
  4382. //! For a given NVIDIA display handle, this function returns a string (such as "\\.\DISPLAY1") to identify the display.
  4383. //!
  4384. //! SUPPORTED OS: Windows 7 and higher
  4385. //!
  4386. //!
  4387. //! \since Release: 80
  4388. //!
  4389. //! \retval NVAPI_INVALID_ARGUMENT Either argument is NULL
  4390. //! \retval NVAPI_OK *pNvDispHandle is now valid
  4391. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name
  4392. //! \ingroup dispcontrol
  4393. ///////////////////////////////////////////////////////////////////////////////
  4394. NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayName(NvDisplayHandle NvDispHandle, NvAPI_ShortString szDisplayName);
  4395. ///////////////////////////////////////////////////////////////////////////////
  4396. //
  4397. // FUNCTION NAME: NvAPI_GetUnAttachedAssociatedDisplayName
  4398. //
  4399. //! This function returns the display name given, for example, "\\DISPLAY1", using the unattached NVIDIA display handle
  4400. //!
  4401. //! SUPPORTED OS: Windows 7 and higher
  4402. //!
  4403. //!
  4404. //! \since Release: 95
  4405. //!
  4406. //! \retval NVAPI_INVALID_ARGUMENT Either argument is NULL
  4407. //! \retval NVAPI_OK *pNvDispHandle is now valid
  4408. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device maps to that display name
  4409. //! \ingroup dispcontrol
  4410. ///////////////////////////////////////////////////////////////////////////////
  4411. NVAPI_INTERFACE NvAPI_GetUnAttachedAssociatedDisplayName(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvAPI_ShortString szDisplayName);
  4412. ///////////////////////////////////////////////////////////////////////////////
  4413. //
  4414. // FUNCTION NAME: NvAPI_EnableHWCursor
  4415. //
  4416. //! This function enables hardware cursor support
  4417. //!
  4418. //! SUPPORTED OS: Windows XP
  4419. //!
  4420. //!
  4421. //!
  4422. //! \since Release: 80
  4423. //!
  4424. //! \return NVAPI_ERROR or NVAPI_OK
  4425. //! \ingroup dispcontrol
  4426. ///////////////////////////////////////////////////////////////////////////////
  4427. NVAPI_INTERFACE NvAPI_EnableHWCursor(NvDisplayHandle hNvDisplay);
  4428. ///////////////////////////////////////////////////////////////////////////////
  4429. //
  4430. // FUNCTION NAME: NvAPI_DisableHWCursor
  4431. //
  4432. //! This function disables hardware cursor support
  4433. //!
  4434. //! SUPPORTED OS: Windows XP
  4435. //!
  4436. //!
  4437. //! \since Release: 80
  4438. //!
  4439. //! \return NVAPI_ERROR or NVAPI_OK
  4440. //! \ingroup dispcontrol
  4441. ///////////////////////////////////////////////////////////////////////////////
  4442. NVAPI_INTERFACE NvAPI_DisableHWCursor(NvDisplayHandle hNvDisplay);
  4443. ///////////////////////////////////////////////////////////////////////////////
  4444. //
  4445. // FUNCTION NAME: NvAPI_GetVBlankCounter
  4446. //
  4447. //! This function gets the V-blank counter
  4448. //!
  4449. //! SUPPORTED OS: Windows 7 and higher
  4450. //!
  4451. //!
  4452. //! \since Release: 80
  4453. //!
  4454. //! \return NVAPI_ERROR or NVAPI_OK
  4455. //! \ingroup dispcontrol
  4456. ///////////////////////////////////////////////////////////////////////////////
  4457. NVAPI_INTERFACE NvAPI_GetVBlankCounter(NvDisplayHandle hNvDisplay, NvU32 *pCounter);
  4458. ///////////////////////////////////////////////////////////////////////////////
  4459. // FUNCTION NAME: NvAPI_SetRefreshRateOverride
  4460. //
  4461. //! This function overrides the refresh rate on the given display/outputsMask.
  4462. //! The new refresh rate can be applied right away in this API call or deferred to be applied with the
  4463. //! next OS modeset. The override is good for only one modeset (regardless whether it's deferred or immediate).
  4464. //!
  4465. //!
  4466. //! SUPPORTED OS: Windows XP
  4467. //!
  4468. //!
  4469. //! \since Release: 80
  4470. //!
  4471. //! \param [in] hNvDisplay The NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle
  4472. //! enumerated from NvAPI_EnumNVidiaDisplayHandle().
  4473. //! \param [in] outputsMask A set of bits that identify all target outputs which are associated with the NVIDIA
  4474. //! display handle to apply the refresh rate override. When SLI is enabled, the
  4475. //! outputsMask only applies to the GPU that is driving the display output.
  4476. //! \param [in] refreshRate The override value. "0.0" means cancel the override.
  4477. //! \param [in] bSetDeferred
  4478. //! - "0": Apply the refresh rate override immediately in this API call.\p
  4479. //! - "1": Apply refresh rate at the next OS modeset.
  4480. //!
  4481. //! \retval NVAPI_INVALID_ARGUMENT hNvDisplay or outputsMask is invalid
  4482. //! \retval NVAPI_OK The refresh rate override is correct set
  4483. //! \retval NVAPI_ERROR The operation failed
  4484. //! \ingroup dispcontrol
  4485. ///////////////////////////////////////////////////////////////////////////////
  4486. NVAPI_INTERFACE NvAPI_SetRefreshRateOverride(NvDisplayHandle hNvDisplay, NvU32 outputsMask, float refreshRate, NvU32 bSetDeferred);
  4487. ///////////////////////////////////////////////////////////////////////////////
  4488. //
  4489. // FUNCTION NAME: NvAPI_GetAssociatedDisplayOutputId
  4490. //
  4491. //! This function gets the active outputId associated with the display handle.
  4492. //!
  4493. //! SUPPORTED OS: Windows 7 and higher
  4494. //!
  4495. //!
  4496. //! \since Release: 90
  4497. //!
  4498. //! \param [in] hNvDisplay NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  4499. //! \param [out] outputId The active display output ID associated with the selected display handle hNvDisplay.
  4500. //! The outputid will have only one bit set. In the case of Clone or Span mode, this will indicate the
  4501. //! display outputId of the primary display that the GPU is driving. See \ref handles.
  4502. //!
  4503. //! \retval NVAPI_OK Call successful.
  4504. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
  4505. //! \retval NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle.
  4506. //! \ingroup dispcontrol
  4507. ///////////////////////////////////////////////////////////////////////////////
  4508. NVAPI_INTERFACE NvAPI_GetAssociatedDisplayOutputId(NvDisplayHandle hNvDisplay, NvU32 *pOutputId);
  4509. //! \ingroup dispcontrol
  4510. //! Used in NvAPI_GetDisplayPortInfo().
  4511. typedef struct _NV_DISPLAY_PORT_INFO_V1
  4512. {
  4513. NvU32 version; //!< Structure version
  4514. NvU32 dpcd_ver; //!< DPCD version of the monitor
  4515. NV_DP_LINK_RATE maxLinkRate; //!< Maximum supported link rate
  4516. NV_DP_LANE_COUNT maxLaneCount; //!< Maximum supported lane count
  4517. NV_DP_LINK_RATE curLinkRate; //!< Current link rate
  4518. NV_DP_LANE_COUNT curLaneCount; //!< Current lane count
  4519. NV_DP_COLOR_FORMAT colorFormat; //!< Current color format
  4520. NV_DP_DYNAMIC_RANGE dynamicRange; //!< Dynamic range
  4521. NV_DP_COLORIMETRY colorimetry; //!< Ignored in RGB space
  4522. NV_DP_BPC bpc; //!< Current bit-per-component
  4523. NvU32 isDp : 1; //!< If the monitor is driven by a DisplayPort
  4524. NvU32 isInternalDp : 1; //!< If the monitor is driven by an NV Dp transmitter
  4525. NvU32 isColorCtrlSupported : 1; //!< If the color format change is supported
  4526. NvU32 is6BPCSupported : 1; //!< If 6 bpc is supported
  4527. NvU32 is8BPCSupported : 1; //!< If 8 bpc is supported
  4528. NvU32 is10BPCSupported : 1; //!< If 10 bpc is supported
  4529. NvU32 is12BPCSupported : 1; //!< If 12 bpc is supported
  4530. NvU32 is16BPCSupported : 1; //!< If 16 bpc is supported
  4531. NvU32 isYCrCb420Supported : 1; //!< If YCrCb420 is supported
  4532. NvU32 isYCrCb422Supported : 1; //!< If YCrCb422 is supported
  4533. NvU32 isYCrCb444Supported : 1; //!< If YCrCb444 is supported
  4534. NvU32 isRgb444SupportedOnCurrentMode : 1; //!< If Rgb444 is supported on the current mode
  4535. NvU32 isYCbCr444SupportedOnCurrentMode : 1; //!< If YCbCr444 is supported on the current mode
  4536. NvU32 isYCbCr422SupportedOnCurrentMode : 1; //!< If YCbCr422 is supported on the current mode
  4537. NvU32 isYCbCr420SupportedOnCurrentMode : 1; //!< If YCbCr420 is supported on the current mode
  4538. NvU32 is6BPCSupportedOnCurrentMode : 1; // if 6 bpc is supported On Current Mode
  4539. NvU32 is8BPCSupportedOnCurrentMode : 1; // if 8 bpc is supported On Current Mode
  4540. NvU32 is10BPCSupportedOnCurrentMode : 1; // if 10 bpc is supported On Current Mode
  4541. NvU32 is12BPCSupportedOnCurrentMode : 1; // if 12 bpc is supported On Current Mode
  4542. NvU32 is16BPCSupportedOnCurrentMode : 1; // if 16 bpc is supported On Current Mode
  4543. NvU32 isMonxvYCC601Capable : 1; // if xvYCC 601 extended colorimetry is supported
  4544. NvU32 isMonxvYCC709Capable : 1; // if xvYCC 709 extended colorimetry is supported
  4545. NvU32 isMonsYCC601Capable : 1; // if sYCC601 extended colorimetry is supported
  4546. NvU32 isMonAdobeYCC601Capable : 1; // if AdobeYCC601 extended colorimetry is supported
  4547. NvU32 isMonAdobeRGBCapable : 1; // if AdobeRGB extended colorimetry is supported
  4548. NvU32 isMonBT2020RGBCapable : 1; // if BT2020 RGB extended colorimetry is supported
  4549. NvU32 isMonBT2020YCCCapable : 1; // if BT2020 Y'CbCr extended colorimetry is supported
  4550. NvU32 isMonBT2020cYCCCapable : 1; // if BT2020 cYCbCr (constant luminance) extended colorimetry is supported
  4551. NvU32 reserved : 4; //!< reserved
  4552. } NV_DISPLAY_PORT_INFO_V1;
  4553. typedef NV_DISPLAY_PORT_INFO_V1 NV_DISPLAY_PORT_INFO;
  4554. //! Macro for constructing the version field of NV_DISPLAY_PORT_INFO.
  4555. #define NV_DISPLAY_PORT_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,1)
  4556. #define NV_DISPLAY_PORT_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,2)
  4557. #define NV_DISPLAY_PORT_INFO_VER NV_DISPLAY_PORT_INFO_VER2
  4558. ///////////////////////////////////////////////////////////////////////////////
  4559. // FUNCTION NAME: NvAPI_GetDisplayPortInfo
  4560. //
  4561. //! \fn NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo)
  4562. //! DESCRIPTION: This function returns the current DisplayPort-related information on the specified device (monitor).
  4563. //!
  4564. //! SUPPORTED OS: Windows 7 and higher
  4565. //!
  4566. //!
  4567. //! \since Release: 165
  4568. //!
  4569. //! \param [in] hvDisplay NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  4570. //! This parameter is ignored when the outputId is a NvAPI displayId.
  4571. //! \param [in] outputId This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed,
  4572. //! it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from
  4573. //! NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles.
  4574. //! \param [out] pInfo The DisplayPort information
  4575. //!
  4576. //! \retval NVAPI_OK Completed request
  4577. //! \retval NVAPI_ERROR Miscellaneous error occurred
  4578. //! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter.
  4579. //
  4580. ///////////////////////////////////////////////////////////////////////////////
  4581. //! \ingroup dispcontrol
  4582. NVAPI_INTERFACE NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo);
  4583. ///////////////////////////////////////////////////////////////////////////////
  4584. // FUNCTION NAME: NvAPI_SetDisplayPort
  4585. //
  4586. //! \fn NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg)
  4587. //! DESCRIPTION: This function sets up DisplayPort-related configurations.
  4588. //!
  4589. //! SUPPORTED OS: Windows 7 and higher
  4590. //!
  4591. //!
  4592. //! \since Release: 165
  4593. //!
  4594. //! \param [in] hNvDisplay NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from
  4595. //! NvAPI_EnumNVidiaDisplayHandle().
  4596. //! \param [in] outputId This display output ID, when it's "0" it means the default outputId generated from the return of
  4597. //! NvAPI_GetAssociatedDisplayOutputId(). See \ref handles.
  4598. //! \param [in] pCfg The display port config structure. If pCfg is NULL, it means to use the driver's default value to setup.
  4599. //!
  4600. //! \retval NVAPI_OK Completed request
  4601. //! \retval NVAPI_ERROR Miscellaneous error occurred
  4602. //! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter
  4603. ///////////////////////////////////////////////////////////////////////////////
  4604. //! \ingroup dispcontrol
  4605. //! DisplayPort configuration settings - used in NvAPI_SetDisplayPort().
  4606. typedef struct
  4607. {
  4608. NvU32 version; //!< Structure version - 2 is the latest
  4609. NV_DP_LINK_RATE linkRate; //!< Link rate
  4610. NV_DP_LANE_COUNT laneCount; //!< Lane count
  4611. NV_DP_COLOR_FORMAT colorFormat; //!< Color format to set
  4612. NV_DP_DYNAMIC_RANGE dynamicRange; //!< Dynamic range
  4613. NV_DP_COLORIMETRY colorimetry; //!< Ignored in RGB space
  4614. NV_DP_BPC bpc; //!< Bit-per-component
  4615. NvU32 isHPD : 1; //!< If the control panel is making this call due to HPD
  4616. NvU32 isSetDeferred : 1; //!< Requires an OS modeset to finalize the setup if set
  4617. NvU32 isChromaLpfOff : 1; //!< Force the chroma low_pass_filter to be off
  4618. NvU32 isDitherOff : 1; //!< Force to turn off dither
  4619. NvU32 testLinkTrain : 1; //!< If testing mode, skip validation
  4620. NvU32 testColorChange : 1; //!< If testing mode, skip validation
  4621. } NV_DISPLAY_PORT_CONFIG;
  4622. //! \addtogroup dispcontrol
  4623. //! @{
  4624. //! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG
  4625. #define NV_DISPLAY_PORT_CONFIG_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
  4626. //! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG
  4627. #define NV_DISPLAY_PORT_CONFIG_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,1)
  4628. //! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG
  4629. #define NV_DISPLAY_PORT_CONFIG_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
  4630. //! @}
  4631. //! \ingroup dispcontrol
  4632. NVAPI_INTERFACE NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg);
  4633. //! \ingroup dispcontrol
  4634. //! Used in NvAPI_GetHDMISupportInfo().
  4635. typedef struct _NV_HDMI_SUPPORT_INFO_V1
  4636. {
  4637. NvU32 version; //!< Structure version
  4638. NvU32 isGpuHDMICapable : 1; //!< If the GPU can handle HDMI
  4639. NvU32 isMonUnderscanCapable : 1; //!< If the monitor supports underscan
  4640. NvU32 isMonBasicAudioCapable : 1; //!< If the monitor supports basic audio
  4641. NvU32 isMonYCbCr444Capable : 1; //!< If YCbCr 4:4:4 is supported
  4642. NvU32 isMonYCbCr422Capable : 1; //!< If YCbCr 4:2:2 is supported
  4643. NvU32 isMonxvYCC601Capable : 1; //!< If xvYCC 601 is supported
  4644. NvU32 isMonxvYCC709Capable : 1; //!< If xvYCC 709 is supported
  4645. NvU32 isMonHDMI : 1; //!< If the monitor is HDMI (with IEEE's HDMI registry ID)
  4646. NvU32 reserved : 24; //!< Reserved.
  4647. NvU32 EDID861ExtRev; //!< Revision number of the EDID 861 extension
  4648. } NV_HDMI_SUPPORT_INFO_V1;
  4649. typedef struct _NV_HDMI_SUPPORT_INFO_V2
  4650. {
  4651. NvU32 version; //!< Structure version
  4652. NvU32 isGpuHDMICapable : 1; //!< If the GPU can handle HDMI
  4653. NvU32 isMonUnderscanCapable : 1; //!< If the monitor supports underscan
  4654. NvU32 isMonBasicAudioCapable : 1; //!< If the monitor supports basic audio
  4655. NvU32 isMonYCbCr444Capable : 1; //!< If YCbCr 4:4:4 is supported
  4656. NvU32 isMonYCbCr422Capable : 1; //!< If YCbCr 4:2:2 is supported
  4657. NvU32 isMonxvYCC601Capable : 1; //!< If xvYCC extended colorimetry 601 is supported
  4658. NvU32 isMonxvYCC709Capable : 1; //!< If xvYCC extended colorimetry 709 is supported
  4659. NvU32 isMonHDMI : 1; //!< If the monitor is HDMI (with IEEE's HDMI registry ID)
  4660. NvU32 isMonsYCC601Capable : 1; //!< if sYCC601 extended colorimetry is supported
  4661. NvU32 isMonAdobeYCC601Capable : 1; //!< if AdobeYCC601 extended colorimetry is supported
  4662. NvU32 isMonAdobeRGBCapable : 1; //!< if AdobeRGB extended colorimetry is supported
  4663. NvU32 reserved : 21; //!< Reserved.
  4664. NvU32 EDID861ExtRev; //!< Revision number of the EDID 861 extension
  4665. } NV_HDMI_SUPPORT_INFO_V2;
  4666. #define NV_HDMI_SUPPORT_INFO_VER1 MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO_V1, 1)
  4667. #define NV_HDMI_SUPPORT_INFO_VER2 MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO_V2, 2)
  4668. #ifndef NV_HDMI_SUPPORT_INFO_VER
  4669. typedef NV_HDMI_SUPPORT_INFO_V2 NV_HDMI_SUPPORT_INFO;
  4670. #define NV_HDMI_SUPPORT_INFO_VER NV_HDMI_SUPPORT_INFO_VER2
  4671. #endif
  4672. //! SUPPORTED OS: Windows 7 and higher
  4673. //!
  4674. ///////////////////////////////////////////////////////////////////////////////
  4675. // FUNCTION NAME: NvAPI_GetHDMISupportInfo
  4676. //
  4677. //! \fn NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo)
  4678. //! This API returns the current infoframe data on the specified device(monitor).
  4679. //!
  4680. //! \since Release: 95
  4681. //!
  4682. //! \param [in] hvDisplay NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  4683. //! This parameter is ignored when the outputId is a NvAPI displayId.
  4684. //! \param [in] outputId This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed,
  4685. //! it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from
  4686. //! NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles.
  4687. //! \param [out] pInfo The monitor and GPU's HDMI support info
  4688. //!
  4689. //! \retval NVAPI_OK Completed request
  4690. //! \retval NVAPI_ERROR Miscellaneous error occurred
  4691. //! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter.
  4692. ///////////////////////////////////////////////////////////////////////////////
  4693. //! \ingroup dispcontrol
  4694. NVAPI_INTERFACE NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo);
  4695. //! \ingroup dispcontrol
  4696. typedef enum
  4697. {
  4698. NV_INFOFRAME_CMD_GET_DEFAULT = 0, //!< Returns the fields in the infoframe with values set by the manufacturer - NVIDIA/OEM.
  4699. NV_INFOFRAME_CMD_RESET, //!< Sets the fields in the infoframe to auto, and infoframe to the default infoframe for use in a set.
  4700. NV_INFOFRAME_CMD_GET, //!< Get the current infoframe state.
  4701. NV_INFOFRAME_CMD_SET, //!< Set the current infoframe state (flushed to the monitor), the values are one time and do not persist.
  4702. 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.
  4703. 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
  4704. NV_INFOFRAME_CMD_GET_PROPERTY, //!< get properties associated with infoframe (each of the infoframe type will have properties)
  4705. NV_INFOFRAME_CMD_SET_PROPERTY, //!< set properties associated with infoframe
  4706. } NV_INFOFRAME_CMD;
  4707. typedef enum
  4708. {
  4709. NV_INFOFRAME_PROPERTY_MODE_AUTO = 0, //!< Driver determines whether to send infoframes.
  4710. NV_INFOFRAME_PROPERTY_MODE_ENABLE, //!< Driver always sends infoframe.
  4711. NV_INFOFRAME_PROPERTY_MODE_DISABLE, //!< Driver never sends infoframe.
  4712. NV_INFOFRAME_PROPERTY_MODE_ALLOW_OVERRIDE, //!< Driver only sends infoframe when client requests it via infoframe escape call.
  4713. } NV_INFOFRAME_PROPERTY_MODE;
  4714. //! Returns whether the current monitor is in blacklist or force this monitor to be in blacklist.
  4715. typedef enum
  4716. {
  4717. NV_INFOFRAME_PROPERTY_BLACKLIST_FALSE = 0,
  4718. NV_INFOFRAME_PROPERTY_BLACKLIST_TRUE,
  4719. } NV_INFOFRAME_PROPERTY_BLACKLIST;
  4720. typedef struct
  4721. {
  4722. NvU32 mode : 4;
  4723. NvU32 blackList : 2;
  4724. NvU32 reserved : 10;
  4725. NvU32 version : 8;
  4726. NvU32 length : 8;
  4727. } NV_INFOFRAME_PROPERTY;
  4728. //! Byte1 related
  4729. typedef enum
  4730. {
  4731. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NODATA = 0,
  4732. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_OVERSCAN,
  4733. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_UNDERSCAN,
  4734. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_FUTURE,
  4735. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_AUTO = 7
  4736. } NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO;
  4737. typedef enum
  4738. {
  4739. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NOT_PRESENT = 0,
  4740. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_VERTICAL_PRESENT,
  4741. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_HORIZONTAL_PRESENT,
  4742. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_BOTH_PRESENT,
  4743. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_AUTO = 7
  4744. } NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA;
  4745. typedef enum
  4746. {
  4747. NV_INFOFRAME_FIELD_VALUE_AVI_AFI_ABSENT = 0,
  4748. NV_INFOFRAME_FIELD_VALUE_AVI_AFI_PRESENT,
  4749. NV_INFOFRAME_FIELD_VALUE_AVI_AFI_AUTO = 3
  4750. } NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO;
  4751. typedef enum
  4752. {
  4753. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_RGB = 0,
  4754. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr422,
  4755. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr444,
  4756. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_FUTURE,
  4757. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_AUTO = 7
  4758. } NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT;
  4759. typedef enum
  4760. {
  4761. NV_INFOFRAME_FIELD_VALUE_AVI_F17_FALSE = 0,
  4762. NV_INFOFRAME_FIELD_VALUE_AVI_F17_TRUE,
  4763. NV_INFOFRAME_FIELD_VALUE_AVI_F17_AUTO = 3
  4764. } NV_INFOFRAME_FIELD_VALUE_AVI_F17;
  4765. //! Byte2 related
  4766. typedef enum
  4767. {
  4768. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NO_AFD = 0,
  4769. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE01,
  4770. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE02,
  4771. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE03,
  4772. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_LETTERBOX_GT16x9,
  4773. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE05,
  4774. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE06,
  4775. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE07,
  4776. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_EQUAL_CODEDFRAME = 8,
  4777. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_4x3,
  4778. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_16x9,
  4779. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_14x9,
  4780. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE12,
  4781. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_4x3_ON_14x9,
  4782. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_14x9,
  4783. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_4x3,
  4784. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_AUTO = 31,
  4785. } NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION;
  4786. typedef enum
  4787. {
  4788. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NO_DATA = 0,
  4789. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_4x3,
  4790. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_16x9,
  4791. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_FUTURE,
  4792. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_AUTO = 7
  4793. } NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME;
  4794. typedef enum
  4795. {
  4796. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NO_DATA = 0,
  4797. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_SMPTE_170M,
  4798. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_ITUR_BT709,
  4799. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_USE_EXTENDED_COLORIMETRY,
  4800. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_AUTO = 7
  4801. } NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY;
  4802. //! Byte 3 related
  4803. typedef enum
  4804. {
  4805. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NO_DATA = 0,
  4806. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_HORIZONTAL,
  4807. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_VERTICAL,
  4808. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_BOTH,
  4809. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_AUTO = 7
  4810. } NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING;
  4811. typedef enum
  4812. {
  4813. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_DEFAULT = 0,
  4814. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_LIMITED_RANGE,
  4815. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_FULL_RANGE,
  4816. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_RESERVED,
  4817. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_AUTO = 7
  4818. } NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION;
  4819. typedef enum
  4820. {
  4821. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC601 = 0,
  4822. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC709,
  4823. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_SYCC601,
  4824. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBEYCC601,
  4825. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBERGB,
  4826. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED05,
  4827. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED06,
  4828. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED07,
  4829. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_AUTO = 15
  4830. } NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY;
  4831. typedef enum
  4832. {
  4833. NV_INFOFRAME_FIELD_VALUE_AVI_ITC_VIDEO_CONTENT = 0,
  4834. NV_INFOFRAME_FIELD_VALUE_AVI_ITC_ITCONTENT,
  4835. NV_INFOFRAME_FIELD_VALUE_AVI_ITC_AUTO = 3
  4836. } NV_INFOFRAME_FIELD_VALUE_AVI_ITC;
  4837. //! Byte 4 related
  4838. typedef enum
  4839. {
  4840. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NONE = 0,
  4841. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X02,
  4842. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X03,
  4843. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X04,
  4844. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X05,
  4845. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X06,
  4846. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X07,
  4847. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X08,
  4848. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X09,
  4849. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X10,
  4850. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED10,
  4851. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED11,
  4852. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED12,
  4853. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED13,
  4854. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED14,
  4855. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED15,
  4856. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_AUTO = 31
  4857. } NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION;
  4858. typedef enum
  4859. {
  4860. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GRAPHICS = 0,
  4861. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_PHOTO,
  4862. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_CINEMA,
  4863. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GAME,
  4864. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_AUTO = 7
  4865. } NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE;
  4866. typedef enum
  4867. {
  4868. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_LIMITED_RANGE = 0,
  4869. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_FULL_RANGE,
  4870. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED02,
  4871. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED03,
  4872. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_AUTO = 7
  4873. } NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION;
  4874. //! Adding an Auto bit to each field
  4875. typedef struct
  4876. {
  4877. NvU32 vic : 8;
  4878. NvU32 pixelRepeat : 5;
  4879. NvU32 colorSpace : 3;
  4880. NvU32 colorimetry : 3;
  4881. NvU32 extendedColorimetry : 4;
  4882. NvU32 rgbQuantizationRange : 3;
  4883. NvU32 yccQuantizationRange : 3;
  4884. NvU32 itContent : 2;
  4885. NvU32 contentTypes : 3;
  4886. NvU32 scanInfo : 3;
  4887. NvU32 activeFormatInfoPresent : 2;
  4888. NvU32 activeFormatAspectRatio : 5;
  4889. NvU32 picAspectRatio : 3;
  4890. NvU32 nonuniformScaling : 3;
  4891. NvU32 barInfo : 3;
  4892. NvU32 top_bar : 17;
  4893. NvU32 bottom_bar : 17;
  4894. NvU32 left_bar : 17;
  4895. NvU32 right_bar : 17;
  4896. NvU32 Future17 : 2;
  4897. NvU32 Future47 : 2;
  4898. } NV_INFOFRAME_VIDEO;
  4899. //! Byte 1 related
  4900. typedef enum
  4901. {
  4902. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_IN_HEADER = 0,
  4903. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_2,
  4904. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_3,
  4905. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_4,
  4906. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_5,
  4907. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_6,
  4908. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_7,
  4909. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_8,
  4910. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_AUTO = 15
  4911. } NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT;
  4912. typedef enum
  4913. {
  4914. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_IN_HEADER = 0,
  4915. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_PCM,
  4916. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AC3,
  4917. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG1,
  4918. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MP3,
  4919. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG2,
  4920. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AACLC,
  4921. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTS,
  4922. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_ATRAC,
  4923. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DSD,
  4924. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_EAC3,
  4925. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTSHD,
  4926. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MLP,
  4927. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DST,
  4928. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_WMAPRO,
  4929. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_USE_CODING_EXTENSION_TYPE,
  4930. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AUTO = 31
  4931. } NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE;
  4932. //! Byte 2 related
  4933. typedef enum
  4934. {
  4935. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_IN_HEADER = 0,
  4936. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_16BITS,
  4937. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_20BITS,
  4938. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_24BITS,
  4939. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_AUTO = 7
  4940. } NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE;
  4941. typedef enum
  4942. {
  4943. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_IN_HEADER = 0,
  4944. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_32000HZ,
  4945. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_44100HZ,
  4946. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_48000HZ,
  4947. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_88200KHZ,
  4948. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_96000KHZ,
  4949. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_176400KHZ,
  4950. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_192000KHZ,
  4951. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_AUTO = 15
  4952. } NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY;
  4953. //! Byte 3 related
  4954. typedef enum
  4955. {
  4956. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_USE_CODING_TYPE = 0,
  4957. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAAC,
  4958. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAACV2,
  4959. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_MPEGSURROUND,
  4960. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE04,
  4961. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE05,
  4962. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE06,
  4963. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE07,
  4964. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE08,
  4965. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE09,
  4966. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE10,
  4967. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE11,
  4968. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE12,
  4969. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE13,
  4970. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE14,
  4971. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE15,
  4972. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE16,
  4973. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE17,
  4974. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE18,
  4975. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE19,
  4976. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE20,
  4977. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE21,
  4978. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE22,
  4979. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE23,
  4980. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE24,
  4981. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE25,
  4982. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE26,
  4983. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE27,
  4984. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE28,
  4985. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE29,
  4986. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE30,
  4987. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE31,
  4988. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_AUTO = 63
  4989. } NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE;
  4990. //! Byte 4 related
  4991. typedef enum
  4992. {
  4993. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_X_FR_FL =0,
  4994. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_LFE_FR_FL,
  4995. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_X_FR_FL,
  4996. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_LFE_FR_FL,
  4997. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_X_FR_FL,
  4998. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_LFE_FR_FL,
  4999. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_X_FR_FL,
  5000. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_LFE_FR_FL,
  5001. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_X_FR_FL,
  5002. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_LFE_FR_FL,
  5003. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_X_FR_FL,
  5004. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_LFE_FR_FL,
  5005. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_X_FR_FL,
  5006. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_LFE_FR_FL,
  5007. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_X_FR_FL,
  5008. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_LFE_FR_FL,
  5009. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_X_FR_FL,
  5010. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_LFE_FR_FL,
  5011. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_X_FR_FL,
  5012. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_LFE_FR_FL,
  5013. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_X_FR_FL,
  5014. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_LFE_FR_FL,
  5015. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_X_FR_FL,
  5016. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_LFE_FR_FL,
  5017. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_X_FR_FL,
  5018. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_LFE_FR_FL,
  5019. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_X_FR_FL,
  5020. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_LFE_FR_FL,
  5021. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_X_FR_FL,
  5022. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_LFE_FR_FL,
  5023. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_X_FR_FL,
  5024. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_LFE_FR_FL,
  5025. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_X_FR_FL,
  5026. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_LFE_FR_FL,
  5027. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_X_FR_FL,
  5028. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_LFE_FR_FL,
  5029. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_X_FR_FL,
  5030. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_LFE_FR_FL,
  5031. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_X_FR_FL,
  5032. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_LFE_FR_FL,
  5033. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_X_FR_FL,
  5034. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_LFE_FR_FL,
  5035. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_X_FR_FL,
  5036. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_LFE_FR_FL,
  5037. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_X_FR_FL,
  5038. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_LFE_FR_FL,
  5039. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_X_FR_FL,
  5040. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_LFE_FR_FL,
  5041. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_X_FR_FL,
  5042. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_LFE_FR_FL = 0X31,
  5043. // all other values should default to auto
  5044. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_AUTO = 0x1FF
  5045. } NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION;
  5046. //! Byte 5 related
  5047. typedef enum
  5048. {
  5049. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NO_DATA = 0,
  5050. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_0DB,
  5051. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_PLUS10DB,
  5052. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_RESERVED03,
  5053. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_AUTO = 7
  5054. } NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL;
  5055. typedef enum
  5056. {
  5057. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_0DB = 0,
  5058. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_1DB,
  5059. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_2DB,
  5060. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_3DB,
  5061. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_4DB,
  5062. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_5DB,
  5063. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_6DB,
  5064. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_7DB,
  5065. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_8DB,
  5066. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_9DB,
  5067. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_10DB,
  5068. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_11DB,
  5069. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_12DB,
  5070. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_13DB,
  5071. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_14DB,
  5072. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_15DB,
  5073. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_AUTO = 31
  5074. } NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES;
  5075. typedef enum
  5076. {
  5077. NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PERMITTED = 0,
  5078. NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PROHIBITED,
  5079. NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_AUTO = 3
  5080. } NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX;
  5081. typedef struct
  5082. {
  5083. NvU32 codingType : 5;
  5084. NvU32 codingExtensionType : 6;
  5085. NvU32 sampleSize : 3;
  5086. NvU32 sampleRate : 4;
  5087. NvU32 channelCount : 4;
  5088. NvU32 speakerPlacement : 9;
  5089. NvU32 downmixInhibit : 2;
  5090. NvU32 lfePlaybackLevel : 3;
  5091. NvU32 levelShift : 5;
  5092. NvU32 Future12 : 2;
  5093. NvU32 Future2x : 4;
  5094. NvU32 Future3x : 4;
  5095. NvU32 Future52 : 2;
  5096. NvU32 Future6 : 9;
  5097. NvU32 Future7 : 9;
  5098. NvU32 Future8 : 9;
  5099. NvU32 Future9 : 9;
  5100. NvU32 Future10 : 9;
  5101. } NV_INFOFRAME_AUDIO;
  5102. typedef struct
  5103. {
  5104. NvU32 version; //!< version of this structure
  5105. NvU16 size; //!< size of this structure
  5106. NvU8 cmd; //!< The actions to perform from NV_INFOFRAME_CMD
  5107. NvU8 type; //!< type of infoframe
  5108. union
  5109. {
  5110. NV_INFOFRAME_PROPERTY property; //!< This is NVIDIA-specific and corresponds to the property cmds and associated infoframe.
  5111. NV_INFOFRAME_AUDIO audio;
  5112. NV_INFOFRAME_VIDEO video;
  5113. } infoframe;
  5114. } NV_INFOFRAME_DATA;
  5115. //! Macro for constructing the version field of ::NV_INFOFRAME_DATA
  5116. #define NV_INFOFRAME_DATA_VER MAKE_NVAPI_VERSION(NV_INFOFRAME_DATA,1)
  5117. ///////////////////////////////////////////////////////////////////////////////
  5118. // FUNCTION NAME: NvAPI_Disp_InfoFrameControl
  5119. //
  5120. //! DESCRIPTION: This API controls the InfoFrame values.
  5121. //!
  5122. //! SUPPORTED OS: Windows 7 and higher
  5123. //!
  5124. //!
  5125. //! \param [in] displayId Monitor Identifier
  5126. //! \param [in,out] pInfoframeData Contains data corresponding to InfoFrame
  5127. //!
  5128. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5129. //! specific meaning for this API, they are listed below.
  5130. //!
  5131. //! \ingroup dispcontrol
  5132. ///////////////////////////////////////////////////////////////////////////////
  5133. NVAPI_INTERFACE NvAPI_Disp_InfoFrameControl(__in NvU32 displayId, __inout NV_INFOFRAME_DATA *pInfoframeData);
  5134. //! \ingroup dispcontrol
  5135. //! @{
  5136. ///////////////////////////////////////////////////////////////////////////////
  5137. // FUNCTION NAME: NvAPI_Disp_ColorControl
  5138. //
  5139. //! \fn NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData)
  5140. //! DESCRIPTION: This API controls the Color values.
  5141. //!
  5142. //! SUPPORTED OS: Windows 7 and higher
  5143. //!
  5144. //!
  5145. //! \param [in] displayId Monitor Identifier
  5146. //! \param [in,out] pColorData Contains data corresponding to color information
  5147. //!
  5148. //! \return RETURN STATUS:
  5149. //! ::NVAPI_OK,
  5150. //! ::NVAPI_ERROR,
  5151. //! ::NVAPI_INVALID_ARGUMENT
  5152. //
  5153. ///////////////////////////////////////////////////////////////////////////////
  5154. typedef enum
  5155. {
  5156. NV_COLOR_CMD_GET = 1,
  5157. NV_COLOR_CMD_SET,
  5158. NV_COLOR_CMD_IS_SUPPORTED_COLOR,
  5159. NV_COLOR_CMD_GET_DEFAULT
  5160. } NV_COLOR_CMD;
  5161. //! See Table 14 of CEA-861E. Not all of this is supported by the GPU.
  5162. typedef enum
  5163. {
  5164. NV_COLOR_FORMAT_RGB = 0,
  5165. NV_COLOR_FORMAT_YUV422,
  5166. NV_COLOR_FORMAT_YUV444,
  5167. NV_COLOR_FORMAT_YUV420,
  5168. NV_COLOR_FORMAT_DEFAULT = 0xFE,
  5169. NV_COLOR_FORMAT_AUTO = 0xFF
  5170. } NV_COLOR_FORMAT;
  5171. typedef enum
  5172. {
  5173. NV_COLOR_COLORIMETRY_RGB = 0,
  5174. NV_COLOR_COLORIMETRY_YCC601,
  5175. NV_COLOR_COLORIMETRY_YCC709,
  5176. NV_COLOR_COLORIMETRY_XVYCC601,
  5177. NV_COLOR_COLORIMETRY_XVYCC709,
  5178. NV_COLOR_COLORIMETRY_SYCC601,
  5179. NV_COLOR_COLORIMETRY_ADOBEYCC601,
  5180. NV_COLOR_COLORIMETRY_ADOBERGB,
  5181. NV_COLOR_COLORIMETRY_BT2020RGB,
  5182. NV_COLOR_COLORIMETRY_BT2020YCC,
  5183. NV_COLOR_COLORIMETRY_BT2020cYCC,
  5184. NV_COLOR_COLORIMETRY_DEFAULT = 0xFE,
  5185. NV_COLOR_COLORIMETRY_AUTO = 0xFF
  5186. } NV_COLOR_COLORIMETRY;
  5187. typedef enum _NV_DYNAMIC_RANGE
  5188. {
  5189. NV_DYNAMIC_RANGE_VESA = 0x0,
  5190. NV_DYNAMIC_RANGE_CEA = 0x1,
  5191. NV_DYNAMIC_RANGE_AUTO = 0xFF
  5192. } NV_DYNAMIC_RANGE;
  5193. typedef enum _NV_BPC
  5194. {
  5195. NV_BPC_DEFAULT = 0,
  5196. NV_BPC_6 = 1,
  5197. NV_BPC_8 = 2,
  5198. NV_BPC_10 = 3,
  5199. NV_BPC_12 = 4,
  5200. NV_BPC_16 = 5,
  5201. } NV_BPC;
  5202. typedef enum _NV_COLOR_SELECTION_POLICY
  5203. {
  5204. NV_COLOR_SELECTION_POLICY_USER = 0, //!< app/nvcpl make decision to select the desire color format
  5205. NV_COLOR_SELECTION_POLICY_BEST_QUALITY = 1, //!< driver/ OS make decision to select the best color format
  5206. NV_COLOR_SELECTION_POLICY_DEFAULT = NV_COLOR_SELECTION_POLICY_BEST_QUALITY,
  5207. NV_COLOR_SELECTION_POLICY_UNKNOWN = 0xFF,
  5208. } NV_COLOR_SELECTION_POLICY;
  5209. typedef enum _NV_DESKTOP_COLOR_DEPTH
  5210. {
  5211. NV_DESKTOP_COLOR_DEPTH_DEFAULT = 0x0, // set if the current setting should be kept
  5212. NV_DESKTOP_COLOR_DEPTH_8BPC = 0x1, //8 bit int per color component (8 bit int alpha)
  5213. NV_DESKTOP_COLOR_DEPTH_10BPC = 0x2, //10 bit int per color component (2 bit int alpha)
  5214. NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT = 0x3, //16 bit float per color component (16 bit float alpha)
  5215. NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_WCG = 0x4, //16 bit float per color component (16 bit float alpha) wide color gamut
  5216. NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_HDR = 0x5, //16 bit float per color component (16 bit float alpha) HDR
  5217. NV_DESKTOP_COLOR_DEPTH_MAX_VALUE = NV_DESKTOP_COLOR_DEPTH_16BPC_FLOAT_HDR, // must be set to highest enum value
  5218. } NV_DESKTOP_COLOR_DEPTH;
  5219. typedef struct _NV_COLOR_DATA_V1
  5220. {
  5221. NvU32 version; //!< Version of this structure
  5222. NvU16 size; //!< Size of this structure
  5223. NvU8 cmd;
  5224. struct
  5225. {
  5226. NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values.
  5227. NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values.
  5228. } data;
  5229. } NV_COLOR_DATA_V1;
  5230. typedef struct _NV_COLOR_DATA_V2
  5231. {
  5232. NvU32 version; //!< Version of this structure
  5233. NvU16 size; //!< Size of this structure
  5234. NvU8 cmd;
  5235. struct
  5236. {
  5237. NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values.
  5238. NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values.
  5239. NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values.
  5240. } data;
  5241. } NV_COLOR_DATA_V2;
  5242. typedef struct _NV_COLOR_DATA_V3
  5243. {
  5244. NvU32 version; //!< Version of this structure
  5245. NvU16 size; //!< Size of this structure
  5246. NvU8 cmd;
  5247. struct
  5248. {
  5249. NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values.
  5250. NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values.
  5251. NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values.
  5252. NV_BPC bpc; //!< One of NV_BPC enum values.
  5253. } data;
  5254. } NV_COLOR_DATA_V3;
  5255. typedef struct _NV_COLOR_DATA_V4
  5256. {
  5257. NvU32 version; //!< Version of this structure
  5258. NvU16 size; //!< Size of this structure
  5259. NvU8 cmd;
  5260. struct
  5261. {
  5262. NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values.
  5263. NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values.
  5264. NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values.
  5265. NV_BPC bpc; //!< One of NV_BPC enum values.
  5266. NV_COLOR_SELECTION_POLICY colorSelectionPolicy; //!< One of the color selection policy
  5267. } data;
  5268. } NV_COLOR_DATA_V4;
  5269. typedef struct _NV_COLOR_DATA_V5
  5270. {
  5271. NvU32 version; //!< Version of this structure
  5272. NvU16 size; //!< Size of this structure
  5273. NvU8 cmd;
  5274. struct
  5275. {
  5276. NvU8 colorFormat; //!< One of NV_COLOR_FORMAT enum values.
  5277. NvU8 colorimetry; //!< One of NV_COLOR_COLORIMETRY enum values.
  5278. NvU8 dynamicRange; //!< One of NV_DYNAMIC_RANGE enum values.
  5279. NV_BPC bpc; //!< One of NV_BPC enum values.
  5280. NV_COLOR_SELECTION_POLICY colorSelectionPolicy; //!< One of the color selection policy
  5281. NV_DESKTOP_COLOR_DEPTH depth; //!< One of NV_DESKTOP_COLOR_DEPTH enum values.
  5282. } data;
  5283. } NV_COLOR_DATA_V5;
  5284. typedef NV_COLOR_DATA_V5 NV_COLOR_DATA;
  5285. #define NV_COLOR_DATA_VER1 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V1, 1)
  5286. #define NV_COLOR_DATA_VER2 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V2, 2)
  5287. #define NV_COLOR_DATA_VER3 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V3, 3)
  5288. #define NV_COLOR_DATA_VER4 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V4, 4)
  5289. #define NV_COLOR_DATA_VER5 MAKE_NVAPI_VERSION(NV_COLOR_DATA_V5, 5)
  5290. #define NV_COLOR_DATA_VER NV_COLOR_DATA_VER5
  5291. NVAPI_INTERFACE NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData);
  5292. //! @}
  5293. typedef enum
  5294. {
  5295. NV_STATIC_METADATA_TYPE_1 = 0 //!< Tells the type of structure used to define the Static Metadata Descriptor block.
  5296. }NV_STATIC_METADATA_DESCRIPTOR_ID;
  5297. typedef struct _NV_HDR_CAPABILITIES_V1
  5298. {
  5299. NvU32 version; //!< Version of this structure
  5300. NvU32 isST2084EotfSupported :1; //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported;
  5301. NvU32 isTraditionalHdrGammaSupported :1; //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported;
  5302. NvU32 isEdrSupported :1; //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported;
  5303. NvU32 driverExpandDefaultHdrParameters :1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID.
  5304. //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters;
  5305. NvU32 isTraditionalSdrGammaSupported :1; //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported;
  5306. NvU32 reserved :27;
  5307. NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1)
  5308. struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086
  5309. {
  5310. NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5311. NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5312. NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5313. NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5314. NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5315. NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5316. NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5317. NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5318. NvU16 desired_content_max_luminance; //!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
  5319. NvU16 desired_content_min_luminance; //!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)
  5320. 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)
  5321. }display_data;
  5322. } NV_HDR_CAPABILITIES_V1;
  5323. typedef struct _NV_HDR_CAPABILITIES_V2
  5324. {
  5325. NvU32 version; //!< Version of this structure
  5326. NvU32 isST2084EotfSupported :1; //!< HDMI2.0a UHDA HDR with ST2084 EOTF (CEA861.3). Boolean: 0 = not supported, 1 = supported;
  5327. NvU32 isTraditionalHdrGammaSupported :1; //!< HDMI2.0a traditional HDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported;
  5328. NvU32 isEdrSupported :1; //!< Extended Dynamic Range on SDR displays. Boolean: 0 = not supported, 1 = supported;
  5329. NvU32 driverExpandDefaultHdrParameters :1; //!< If set, driver will expand default (=zero) HDR capabilities parameters contained in display's EDID.
  5330. //!< Boolean: 0 = report actual HDR parameters, 1 = expand default HDR parameters;
  5331. NvU32 isTraditionalSdrGammaSupported :1; //!< HDMI2.0a traditional SDR gamma (CEA861.3). Boolean: 0 = not supported, 1 = supported;
  5332. NvU32 isDolbyVisionSupported :1; //!< Dolby Vision Support. Boolean: 0 = not supported, 1 = supported;
  5333. NvU32 reserved :26;
  5334. NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1)
  5335. struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086
  5336. {
  5337. NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5338. NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5339. NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5340. NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5341. NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5342. NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5343. NvU16 displayWhitePoint_x; //!< x coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5344. NvU16 displayWhitePoint_y; //!< y coordinate of white point of the display ([0x0000-0xC350] = [0.0 - 1.0])
  5345. NvU16 desired_content_max_luminance; //!< Maximum display luminance = desired max luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
  5346. NvU16 desired_content_min_luminance; //!< Minimum display luminance = desired min luminance of HDR content ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)
  5347. 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)
  5348. }display_data;
  5349. struct
  5350. {
  5351. NvU32 VSVDB_version : 3; //!< Version of Vendor Data block,Version 0: 25 bytes Version 1: 14 bytes
  5352. NvU32 dm_version : 8; //!< Upper Nibble represents major version of Display Management(DM) while lower represents minor version of DM
  5353. NvU32 supports_2160p60hz : 1; //!< If set sink is capable of 4kx2k @ 60hz
  5354. NvU32 supports_YUV422_12bit : 1; //!< If set, sink is capable of YUV422-12 bit
  5355. NvU32 supports_global_dimming : 1; //!< Indicates if sink supports global dimming
  5356. NvU32 colorimetry : 1; //!< If set indicates sink supports DCI P3 colorimetry, REc709 otherwise
  5357. NvU32 supports_backlight_control : 2; //!< This is set when sink is using lowlatency interface and can control its backlight.
  5358. NvU32 backlt_min_luma : 2; //!< It is the level for Backlt min luminance value.
  5359. NvU32 interface_supported_by_sink : 2; //!< Indicates the interface (standard or low latency) supported by the sink.
  5360. 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.
  5361. NvU32 reserved : 9; //!< Should be set to zero
  5362. //!< All values below are encoded use DolbyVisionHDMITransmissionSpecification document to decode
  5363. NvU16 target_min_luminance; //!< Represents min luminance level of Sink
  5364. NvU16 target_max_luminance; //!< Represents max luminance level of sink
  5365. NvU16 cc_red_x; //!< Red primary chromaticity coordinate x
  5366. NvU16 cc_red_y; //!< Red primary chromaticity coordinate y
  5367. NvU16 cc_green_x; //!< Green primary chromaticity coordinate x
  5368. NvU16 cc_green_y; //!< Green primary chromaticity coordinate Y
  5369. NvU16 cc_blue_x; //!< Blue primary chromaticity coordinate x
  5370. NvU16 cc_blue_y; //!< Blue primary chromaticity coordinate y
  5371. NvU16 cc_white_x; //!< White primary chromaticity coordinate x
  5372. NvU16 cc_white_y; //!< White primary chromaticity coordinate y
  5373. }dv_static_metadata;
  5374. } NV_HDR_CAPABILITIES_V2;
  5375. #define NV_HDR_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V1, 1)
  5376. #define NV_HDR_CAPABILITIES_VER2 MAKE_NVAPI_VERSION(NV_HDR_CAPABILITIES_V2, 2)
  5377. #define NV_HDR_CAPABILITIES_VER NV_HDR_CAPABILITIES_VER2
  5378. typedef NV_HDR_CAPABILITIES_V2 NV_HDR_CAPABILITIES;
  5379. //! \ingroup dispcontrol
  5380. //! @{
  5381. ///////////////////////////////////////////////////////////////////////////////
  5382. // FUNCTION NAME: NvAPI_Disp_GetHdrCapabilities
  5383. //
  5384. //! \fn NvAPI_Disp_GetHdrCapabilities(NvU32 displayId, NV_HDR_CAPABILITIES *pHdrCapabilities)
  5385. //! DESCRIPTION: This API gets High Dynamic Range (HDR) capabilities of the display.
  5386. //!
  5387. //! SUPPORTED OS: Windows 7 and higher
  5388. //!
  5389. //!
  5390. //! \param [in] displayId Monitor Identifier
  5391. //! \param [in,out] pHdrCapabilities display's HDR capabilities
  5392. //!
  5393. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5394. //! specific meaning for this API, they are listed below.
  5395. //
  5396. ///////////////////////////////////////////////////////////////////////////////
  5397. NVAPI_INTERFACE NvAPI_Disp_GetHdrCapabilities(__in NvU32 displayId, __inout NV_HDR_CAPABILITIES *pHdrCapabilities);
  5398. //! @}
  5399. typedef enum
  5400. {
  5401. NV_HDR_CMD_GET = 0, //!< Get current HDR output configuration
  5402. NV_HDR_CMD_SET = 1 //!< Set HDR output configuration
  5403. } NV_HDR_CMD;
  5404. typedef enum
  5405. {
  5406. // Official production-ready HDR modes
  5407. NV_HDR_MODE_OFF = 0, //!< Turn off HDR
  5408. 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.
  5409. // Experimental
  5410. 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.
  5411. 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.
  5412. // Unsupported/obsolete HDR modes
  5413. 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 ).
  5414. 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.
  5415. 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
  5416. 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.
  5417. } NV_HDR_MODE;
  5418. typedef struct _NV_HDR_COLOR_DATA_V1
  5419. {
  5420. NvU32 version; //!< Version of this structure
  5421. NV_HDR_CMD cmd; //!< Command get/set
  5422. NV_HDR_MODE hdrMode; //!< HDR mode
  5423. NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1)
  5424. struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086
  5425. {
  5426. NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5427. NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5428. NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5429. NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5430. NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5431. NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5432. NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5433. NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5434. NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
  5435. NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)
  5436. NvU16 max_content_light_level; //!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
  5437. NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
  5438. } mastering_display_data;
  5439. } NV_HDR_COLOR_DATA_V1;
  5440. typedef struct _NV_HDR_COLOR_DATA_V2
  5441. {
  5442. NvU32 version; //!< Version of this structure
  5443. NV_HDR_CMD cmd; //!< Command get/set
  5444. NV_HDR_MODE hdrMode; //!< HDR mode
  5445. NV_STATIC_METADATA_DESCRIPTOR_ID static_metadata_descriptor_id; //!< Static Metadata Descriptor Id (0 for static metadata type 1)
  5446. struct //!< Static Metadata Descriptor Type 1, CEA-861.3, SMPTE ST2086
  5447. {
  5448. NvU16 displayPrimary_x0; //!< x coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5449. NvU16 displayPrimary_y0; //!< y coordinate of color primary 0 (e.g. Red) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5450. NvU16 displayPrimary_x1; //!< x coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5451. NvU16 displayPrimary_y1; //!< y coordinate of color primary 1 (e.g. Green) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5452. NvU16 displayPrimary_x2; //!< x coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5453. NvU16 displayPrimary_y2; //!< y coordinate of color primary 2 (e.g. Blue) of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5454. NvU16 displayWhitePoint_x; //!< x coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5455. NvU16 displayWhitePoint_y; //!< y coordinate of white point of mastering display ([0x0000-0xC350] = [0.0 - 1.0])
  5456. NvU16 max_display_mastering_luminance; //!< Maximum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
  5457. NvU16 min_display_mastering_luminance; //!< Minimum display mastering luminance ([0x0001-0xFFFF] = [1.0 - 6.55350] cd/m^2)
  5458. NvU16 max_content_light_level; //!< Maximum Content Light level (MaxCLL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
  5459. NvU16 max_frame_average_light_level; //!< Maximum Frame-Average Light Level (MaxFALL) ([0x0001-0xFFFF] = [1.0 - 65535.0] cd/m^2)
  5460. } mastering_display_data;
  5461. NV_COLOR_FORMAT hdrColorFormat; //!< Optional, One of NV_COLOR_FORMAT enum values, if set it will apply requested color format for HDR session
  5462. NV_DYNAMIC_RANGE hdrDynamicRange; //!< Optional, One of NV_DYNAMIC_RANGE enum values, if set it will apply requested dynamic range for HDR session
  5463. NV_BPC hdrBpc; //!< Optional, One of NV_BPC enum values, if set it will apply requested color depth
  5464. //!< Dolby Vision mode: DV supports specific combinations of colorformat, dynamic range and bpc. Please refer Dolby Vision specification.
  5465. //!< If invalid or no combination is passed driver will force default combination of RGB format + full range + 8bpc.
  5466. //!< HDR mode: These fields are ignored in hdr mode
  5467. } NV_HDR_COLOR_DATA_V2;
  5468. #define NV_HDR_COLOR_DATA_VER1 MAKE_NVAPI_VERSION(NV_HDR_COLOR_DATA_V1, 1)
  5469. #define NV_HDR_COLOR_DATA_VER2 MAKE_NVAPI_VERSION(NV_HDR_COLOR_DATA_V2, 2)
  5470. #ifndef NV_HDR_COLOR_DATA_VER
  5471. #define NV_HDR_COLOR_DATA_VER NV_HDR_COLOR_DATA_VER2
  5472. typedef NV_HDR_COLOR_DATA_V2 NV_HDR_COLOR_DATA;
  5473. #endif
  5474. //! \ingroup dispcontrol
  5475. //! @{
  5476. ///////////////////////////////////////////////////////////////////////////////
  5477. // FUNCTION NAME: NvAPI_Disp_HdrColorControl
  5478. //
  5479. //! \fn NvAPI_Disp_HdrColorControl(NvU32 displayId, NV_HDR_COLOR_DATA *pHdrColorData)
  5480. //! DESCRIPTION: This API configures High Dynamic Range (HDR) and Extended Dynamic Range (EDR) output.
  5481. //!
  5482. //! SUPPORTED OS: Windows 7 and higher
  5483. //!
  5484. //!
  5485. //! \param [in] displayId Monitor Identifier
  5486. //! \param [in,out] pHdrColorData HDR configuration data
  5487. //!
  5488. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5489. //! specific meaning for this API, they are listed below.
  5490. //
  5491. ///////////////////////////////////////////////////////////////////////////////
  5492. NVAPI_INTERFACE NvAPI_Disp_HdrColorControl(__in NvU32 displayId, __inout NV_HDR_COLOR_DATA *pHdrColorData);
  5493. //! @}
  5494. //! \ingroup dispcontrol
  5495. //! Used in NvAPI_DISP_GetTiming().
  5496. typedef struct
  5497. {
  5498. NvU32 isInterlaced : 4; //!< To retrieve interlaced/progressive timing
  5499. NvU32 reserved0 : 12;
  5500. union
  5501. {
  5502. NvU32 tvFormat : 8; //!< The actual analog HD/SDTV format. Used when the timing type is
  5503. //! NV_TIMING_OVERRIDE_ANALOG_TV and width==height==rr==0.
  5504. NvU32 ceaId : 8; //!< The EIA/CEA 861B/D predefined short timing descriptor ID.
  5505. //! Used when the timing type is NV_TIMING_OVERRIDE_EIA861
  5506. //! and width==height==rr==0.
  5507. NvU32 nvPsfId : 8; //!< The NV predefined PsF format Id.
  5508. //! Used when the timing type is NV_TIMING_OVERRIDE_NV_PREDEFINED.
  5509. };
  5510. NvU32 scaling : 8; //!< Define preferred scaling
  5511. }NV_TIMING_FLAG;
  5512. //! \ingroup dispcontrol
  5513. //! Used in NvAPI_DISP_GetTiming().
  5514. typedef struct _NV_TIMING_INPUT
  5515. {
  5516. NvU32 version; //!< (IN) structure version
  5517. NvU32 width; //!< Visible horizontal size
  5518. NvU32 height; //!< Visible vertical size
  5519. float rr; //!< Timing refresh rate
  5520. NV_TIMING_FLAG flag; //!< Flag containing additional info for timing calculation.
  5521. NV_TIMING_OVERRIDE type; //!< Timing type(formula) to use for calculating the timing
  5522. }NV_TIMING_INPUT;
  5523. #define NV_TIMING_INPUT_VER MAKE_NVAPI_VERSION(NV_TIMING_INPUT,1)
  5524. ///////////////////////////////////////////////////////////////////////////////
  5525. // FUNCTION NAME: NvAPI_DISP_GetTiming
  5526. //
  5527. //! DESCRIPTION: This function calculates the timing from the visible width/height/refresh-rate and timing type info.
  5528. //!
  5529. //! SUPPORTED OS: Windows 7 and higher
  5530. //!
  5531. //!
  5532. //! \since Release: 313
  5533. //!
  5534. //!
  5535. //! \param [in] displayId Display ID of the display.
  5536. //! \param [in] timingInput Inputs used for calculating the timing.
  5537. //! \param [out] pTiming Pointer to the NV_TIMING structure.
  5538. //!
  5539. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5540. //! specific meaning for this API, they are listed below.
  5541. //!
  5542. //! \ingroup dispcontrol
  5543. ///////////////////////////////////////////////////////////////////////////////
  5544. NVAPI_INTERFACE NvAPI_DISP_GetTiming( __in NvU32 displayId,__in NV_TIMING_INPUT *timingInput, __out NV_TIMING *pTiming);
  5545. ///////////////////////////////////////////////////////////////////////////////
  5546. // FUNCTION NAME: NvAPI_DISP_GetMonitorCapabilities
  5547. //
  5548. //! \fn NvAPI_DISP_GetMonitorCapabilities(NvU32 displayId, NV_MONITOR_CAPABILITIES *pMonitorCapabilities)
  5549. //! DESCRIPTION: This API returns the Monitor capabilities
  5550. //!
  5551. //! SUPPORTED OS: Windows 7 and higher
  5552. //!
  5553. //!
  5554. //! \param [in] displayId Monitor Identifier
  5555. //! \param [out] pMonitorCapabilities The monitor support info
  5556. //!
  5557. //! \return ::NVAPI_OK,
  5558. //! ::NVAPI_ERROR,
  5559. //! ::NVAPI_INVALID_ARGUMENT
  5560. //
  5561. ///////////////////////////////////////////////////////////////////////////////
  5562. //! \ingroup dispcontrol
  5563. //! @{
  5564. //! HDMI-related and extended CAPs
  5565. typedef enum
  5566. {
  5567. // hdmi related caps
  5568. NV_MONITOR_CAPS_TYPE_HDMI_VSDB = 0x1000,
  5569. NV_MONITOR_CAPS_TYPE_HDMI_VCDB = 0x1001,
  5570. } NV_MONITOR_CAPS_TYPE;
  5571. typedef struct _NV_MONITOR_CAPS_VCDB
  5572. {
  5573. NvU8 quantizationRangeYcc : 1;
  5574. NvU8 quantizationRangeRgb : 1;
  5575. NvU8 scanInfoPreferredVideoFormat : 2;
  5576. NvU8 scanInfoITVideoFormats : 2;
  5577. NvU8 scanInfoCEVideoFormats : 2;
  5578. } NV_MONITOR_CAPS_VCDB;
  5579. //! See NvAPI_DISP_GetMonitorCapabilities().
  5580. typedef struct _NV_MONITOR_CAPS_VSDB
  5581. {
  5582. // byte 1
  5583. NvU8 sourcePhysicalAddressB : 4; //!< Byte 1
  5584. NvU8 sourcePhysicalAddressA : 4; //!< Byte 1
  5585. // byte 2
  5586. NvU8 sourcePhysicalAddressD : 4; //!< Byte 2
  5587. NvU8 sourcePhysicalAddressC : 4; //!< Byte 2
  5588. // byte 3
  5589. NvU8 supportDualDviOperation : 1; //!< Byte 3
  5590. NvU8 reserved6 : 2; //!< Byte 3
  5591. NvU8 supportDeepColorYCbCr444 : 1; //!< Byte 3
  5592. NvU8 supportDeepColor30bits : 1; //!< Byte 3
  5593. NvU8 supportDeepColor36bits : 1; //!< Byte 3
  5594. NvU8 supportDeepColor48bits : 1; //!< Byte 3
  5595. NvU8 supportAI : 1; //!< Byte 3
  5596. // byte 4
  5597. NvU8 maxTmdsClock; //!< Bye 4
  5598. // byte 5
  5599. NvU8 cnc0SupportGraphicsTextContent : 1; //!< Byte 5
  5600. NvU8 cnc1SupportPhotoContent : 1; //!< Byte 5
  5601. NvU8 cnc2SupportCinemaContent : 1; //!< Byte 5
  5602. NvU8 cnc3SupportGameContent : 1; //!< Byte 5
  5603. NvU8 reserved8 : 1; //!< Byte 5
  5604. NvU8 hasVicEntries : 1; //!< Byte 5
  5605. NvU8 hasInterlacedLatencyField : 1; //!< Byte 5
  5606. NvU8 hasLatencyField : 1; //!< Byte 5
  5607. // byte 6
  5608. NvU8 videoLatency; //!< Byte 6
  5609. // byte 7
  5610. NvU8 audioLatency; //!< Byte 7
  5611. // byte 8
  5612. NvU8 interlacedVideoLatency; //!< Byte 8
  5613. // byte 9
  5614. NvU8 interlacedAudioLatency; //!< Byte 9
  5615. // byte 10
  5616. NvU8 reserved13 : 7; //!< Byte 10
  5617. NvU8 has3dEntries : 1; //!< Byte 10
  5618. // byte 11
  5619. NvU8 hdmi3dLength : 5; //!< Byte 11
  5620. NvU8 hdmiVicLength : 3; //!< Byte 11
  5621. // Remaining bytes
  5622. NvU8 hdmi_vic[7]; //!< Keeping maximum length for 3 bits
  5623. NvU8 hdmi_3d[31]; //!< Keeping maximum length for 5 bits
  5624. } NV_MONITOR_CAPS_VSDB;
  5625. //! See NvAPI_DISP_GetMonitorCapabilities().
  5626. typedef struct _NV_MONITOR_CAPABILITIES_V1
  5627. {
  5628. NvU32 version;
  5629. NvU16 size;
  5630. NvU32 infoType;
  5631. NvU32 connectorType; //!< Out: VGA, TV, DVI, HDMI, DP
  5632. NvU8 bIsValidInfo : 1; //!< Boolean : Returns invalid if requested info is not present such as VCDB not present
  5633. union {
  5634. NV_MONITOR_CAPS_VSDB vsdb;
  5635. NV_MONITOR_CAPS_VCDB vcdb;
  5636. } data;
  5637. } NV_MONITOR_CAPABILITIES_V1;
  5638. typedef NV_MONITOR_CAPABILITIES_V1 NV_MONITOR_CAPABILITIES;
  5639. //! Macro for constructing the version field of ::NV_MONITOR_CAPABILITIES_V1
  5640. #define NV_MONITOR_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_MONITOR_CAPABILITIES_V1,1)
  5641. #define NV_MONITOR_CAPABILITIES_VER NV_MONITOR_CAPABILITIES_VER1
  5642. //! @}
  5643. //! SUPPORTED OS: Windows 7 and higher
  5644. //!
  5645. //! \ingroup dispcontrol
  5646. NVAPI_INTERFACE NvAPI_DISP_GetMonitorCapabilities(__in NvU32 displayId, __inout NV_MONITOR_CAPABILITIES *pMonitorCapabilities);
  5647. //! \ingroup dispcontrol
  5648. typedef struct _NV_MONITOR_COLOR_DATA
  5649. {
  5650. NvU32 version;
  5651. // We are only supporting DP monitors for now. We need to extend this to HDMI panels as well
  5652. NV_DP_COLOR_FORMAT colorFormat; //!< One of the supported color formats
  5653. NV_DP_BPC backendBitDepths; //!< One of the supported bit depths
  5654. } NV_MONITOR_COLOR_CAPS_V1;
  5655. typedef NV_MONITOR_COLOR_CAPS_V1 NV_MONITOR_COLOR_CAPS;
  5656. //! \ingroup dispcontrol
  5657. #define NV_MONITOR_COLOR_CAPS_VER1 MAKE_NVAPI_VERSION(NV_MONITOR_COLOR_CAPS_V1,1)
  5658. #define NV_MONITOR_COLOR_CAPS_VER NV_MONITOR_COLOR_CAPS_VER1
  5659. ///////////////////////////////////////////////////////////////////////////////
  5660. // FUNCTION NAME: NvAPI_DISP_GetMonitorColorCapabilities
  5661. //
  5662. //! DESCRIPTION: This API returns all the color formats and bit depth values supported by a given DP monitor.
  5663. //!
  5664. //! USAGE: Sequence of calls which caller should make to get the information.
  5665. //! 1. First call NvAPI_DISP_GetMonitorColorCapabilities() with pMonitorColorCapabilities as NULL to get the count.
  5666. //! 2. Allocate memory for color caps(NV_MONITOR_COLOR_CAPS) array.
  5667. //! 3. Call NvAPI_DISP_GetMonitorColorCapabilities() again with the pointer to the memory allocated to get all the
  5668. //! color capabilities.
  5669. //!
  5670. //! Note :
  5671. //! 1. pColorCapsCount should never be NULL, else the API will fail with NVAPI_INVALID_ARGUMENT.
  5672. //! 2. *pColorCapsCount returned from the API will always be the actual count in any/every call.
  5673. //! 3. Memory size to be allocated should be (*pColorCapsCount * sizeof(NV_MONITOR_COLOR_CAPS)).
  5674. //! 4. If the memory allocated is less than what is required to return all the timings, this API will return the
  5675. //! amount of information which can fit in user provided buffer and API will return NVAPI_INSUFFICIENT_BUFFER.
  5676. //! 5. If the caller specifies a greater value for *pColorCapsCount in second call to NvAPI_DISP_GetMonitorColorCapabilities()
  5677. //! than what was returned from first call, the API will return only the actual number of elements in the color
  5678. //! capabilities array and the extra buffer will remain unused.
  5679. //!
  5680. //! SUPPORTED OS: Windows 7 and higher
  5681. //!
  5682. //!
  5683. //! \param [in] displayId Monitor Identifier
  5684. //! \param [in, out] pMonitorColorCapabilities The monitor color capabilities information
  5685. //! \param [in, out] pColorCapsCount - During input, the number of elements allocated for the pMonitorColorCapabilities pointer
  5686. //! - During output, the actual number of color data elements the monitor supports
  5687. //!
  5688. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5689. //! specific meaning for this API, they are listed below.
  5690. //!
  5691. //! \retval NVAPI_INSUFFICIENT_BUFFER The input buffer size is not sufficient to hold the total contents. In this case
  5692. //! *pColorCapsCount will hold the required amount of elements.
  5693. //! \retval NVAPI_INVALID_DISPLAY_ID The input monitor is either not connected or is not a DP panel.
  5694. //!
  5695. //! \ingroup dispcontrol
  5696. //!
  5697. ///////////////////////////////////////////////////////////////////////////////
  5698. NVAPI_INTERFACE NvAPI_DISP_GetMonitorColorCapabilities(__in NvU32 displayId, __inout_ecount_part_opt(*pColorCapsCount, *pColorCapsCount) NV_MONITOR_COLOR_CAPS *pMonitorColorCapabilities, __inout NvU32 *pColorCapsCount);
  5699. //! \ingroup dispcontrol
  5700. //! Used in NvAPI_DISP_EnumCustomDisplay() and NvAPI_DISP_TryCustomDisplay().
  5701. typedef struct
  5702. {
  5703. NvU32 version;
  5704. // the source mode information
  5705. NvU32 width; //!< Source surface(source mode) width
  5706. NvU32 height; //!< Source surface(source mode) height
  5707. NvU32 depth; //!< Source surface color depth."0" means all 8/16/32bpp
  5708. NV_FORMAT colorFormat; //!< Color format (optional)
  5709. NV_VIEWPORTF srcPartition; //!< For multimon support, should be set to (0,0,1.0,1.0) for now.
  5710. float xRatio; //!< Horizontal scaling ratio
  5711. float yRatio; //!< Vertical scaling ratio
  5712. NV_TIMING timing; //!< Timing used to program TMDS/DAC/LVDS/HDMI/TVEncoder, etc.
  5713. NvU32 hwModeSetOnly : 1; //!< If set, it means a hardware modeset without OS update
  5714. }NV_CUSTOM_DISPLAY;
  5715. //! \ingroup dispcontrol
  5716. //! Used in NV_CUSTOM_DISPLAY.
  5717. #define NV_CUSTOM_DISPLAY_VER MAKE_NVAPI_VERSION(NV_CUSTOM_DISPLAY,1)
  5718. ///////////////////////////////////////////////////////////////////////////////
  5719. // FUNCTION NAME: NvAPI_DISP_EnumCustomDisplay
  5720. //
  5721. //! DESCRIPTION: This API enumerates the custom timing specified by the enum index.
  5722. //! The client should keep enumerating until it returns NVAPI_END_ENUMERATION.
  5723. //!
  5724. //! SUPPORTED OS: Windows 7 and higher
  5725. //!
  5726. //!
  5727. //! \since Release: 313
  5728. //!
  5729. //! \param [in] displayId Dispaly ID of the display.
  5730. //! \param [in] index Enum index
  5731. //! \param [inout] pCustDisp Pointer to the NV_CUSTOM_DISPLAY structure
  5732. //!
  5733. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5734. //! specific meaning for this API, they are listed below.
  5735. //! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed
  5736. //!
  5737. //! \ingroup dispcontrol
  5738. ///////////////////////////////////////////////////////////////////////////////
  5739. NVAPI_INTERFACE NvAPI_DISP_EnumCustomDisplay( __in NvU32 displayId, __in NvU32 index, __inout NV_CUSTOM_DISPLAY *pCustDisp);
  5740. ///////////////////////////////////////////////////////////////////////////////
  5741. // FUNCTION NAME: NvAPI_DISP_TryCustomDisplay
  5742. //
  5743. //! DESCRIPTION: This API is used to set up a custom display without saving the configuration on multiple displays.
  5744. //!
  5745. //! \note
  5746. //! All the members of srcPartition, present in NV_CUSTOM_DISPLAY structure, should have their range in (0.0,1.0).
  5747. //! In clone mode the timings can applied to both the target monitors but only one target at a time. \n
  5748. //! For the secondary target the applied timings works under the following conditions:
  5749. //! - If the secondary monitor EDID supports the selected timing, OR
  5750. //! - If the selected custom timings can be scaled by the secondary monitor for the selected source resolution on the primary, OR
  5751. //! - If the selected custom timings matches the existing source resolution on the primary.
  5752. //! Setting up a custom display on non-active but connected monitors is supported only for Win7 and above.
  5753. //!
  5754. //! SUPPORTED OS: Windows 7 and higher
  5755. //!
  5756. //!
  5757. //! \since Release: 313
  5758. //!
  5759. //!
  5760. //! \param [in] pDisplayIds Array of the target display Dispaly IDs - See \ref handles.
  5761. //! \param [in] count Total number of the incoming Display IDs and corresponding NV_CUSTOM_DISPLAY structure. This is for the multi-head support.
  5762. //! \param [in] pCustDisp Pointer to the NV_CUSTOM_DISPLAY structure array.
  5763. //!
  5764. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5765. //! specific meaning for this API, they are listed below.
  5766. //! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed
  5767. //!
  5768. //! \ingroup dispcontrol
  5769. ///////////////////////////////////////////////////////////////////////////////
  5770. NVAPI_INTERFACE NvAPI_DISP_TryCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in_ecount(count) NV_CUSTOM_DISPLAY *pCustDisp);
  5771. ///////////////////////////////////////////////////////////////////////////////
  5772. // FUNCTION NAME: NvAPI_DISP_DeleteCustomDisplay
  5773. //
  5774. //! DESCRIPTION: This function deletes the custom display configuration, specified from the registry for all the displays whose display IDs are passed.
  5775. //!
  5776. //! SUPPORTED OS: Windows 7 and higher
  5777. //!
  5778. //!
  5779. //! \since Release: 313
  5780. //!
  5781. //!
  5782. //! \param [in] pDisplayIds Array of Dispaly IDs on which custom display configuration is to be saved.
  5783. //! \param [in] count Total number of the incoming Dispaly IDs. This is for the multi-head support.
  5784. //! \param [in] pCustDisp Pointer to the NV_CUSTOM_DISPLAY structure
  5785. //!
  5786. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5787. //! specific meaning for this API, they are listed below.
  5788. //! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed
  5789. //!
  5790. //! \ingroup dispcontrol
  5791. ///////////////////////////////////////////////////////////////////////////////
  5792. NVAPI_INTERFACE NvAPI_DISP_DeleteCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NV_CUSTOM_DISPLAY *pCustDisp);
  5793. ///////////////////////////////////////////////////////////////////////////////
  5794. // FUNCTION NAME: NvAPI_DISP_SaveCustomDisplay
  5795. //
  5796. //! DESCRIPTION: This function saves the current hardware display configuration on the specified Display IDs as a custom display configuration.
  5797. //! This function should be called right after NvAPI_DISP_TryCustomDisplay() to save the custom display from the current
  5798. //! hardware context. This function will not do anything if the custom display configuration is not tested on the hardware.
  5799. //!
  5800. //! SUPPORTED OS: Windows 7 and higher
  5801. //!
  5802. //!
  5803. //! \since Release: 313
  5804. //!
  5805. //!
  5806. //! \param [in] pDisplayIds Array of Dispaly IDs on which custom display configuration is to be saved.
  5807. //! \param [in] count Total number of the incoming Dispaly IDs. This is for the multi-head support.
  5808. //! \param [in] isThisOutputIdOnly If set, the saved custom display will only be applied on the monitor with the same outputId (see \ref handles).
  5809. //! \param [in] isThisMonitorIdOnly If set, the saved custom display will only be applied on the monitor with the same EDID ID or
  5810. //! the same TV connector in case of analog TV.
  5811. //!
  5812. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5813. //! specific meaning for this API, they are listed below.
  5814. //! \retval NVAPI_INVALID_DISPLAY_ID: Custom Timing is not supported on the Display, whose display id is passed
  5815. //!
  5816. //! \ingroup dispcontrol
  5817. ///////////////////////////////////////////////////////////////////////////////
  5818. NVAPI_INTERFACE NvAPI_DISP_SaveCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NvU32 isThisOutputIdOnly, __in NvU32 isThisMonitorIdOnly);
  5819. ///////////////////////////////////////////////////////////////////////////////
  5820. // FUNCTION NAME: NvAPI_DISP_RevertCustomDisplayTrial
  5821. //
  5822. //! DESCRIPTION: This API is used to restore the display configuration, that was changed by calling NvAPI_DISP_TryCustomDisplay(). This function
  5823. //! must be called only after a custom display configuration is tested on the hardware, using NvAPI_DISP_TryCustomDisplay(),
  5824. //! otherwise no action is taken. On Vista, NvAPI_DISP_RevertCustomDisplayTrial should be called with an active display that
  5825. //! was affected during the NvAPI_DISP_TryCustomDisplay() call, per GPU.
  5826. //!
  5827. //! SUPPORTED OS: Windows 7 and higher
  5828. //!
  5829. //!
  5830. //! \since Release: 313
  5831. //!
  5832. //!
  5833. //! \param [in] pDisplayIds Pointer to display Id, of an active display.
  5834. //! \param [in] count Total number of incoming Display IDs. For future use only. Currently it is expected to be passed as 1.
  5835. //!
  5836. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5837. //! specific meaning for this API, they are listed below.
  5838. //!
  5839. //! \ingroup dispcontrol
  5840. ///////////////////////////////////////////////////////////////////////////////
  5841. NVAPI_INTERFACE NvAPI_DISP_RevertCustomDisplayTrial( __in_ecount(count) NvU32* pDisplayIds, __in NvU32 count);
  5842. ///////////////////////////////////////////////////////////////////////////////
  5843. // FUNCTION NAME: NvAPI_GetView
  5844. //
  5845. //! This API lets caller retrieve the target display arrangement for selected source display handle.
  5846. //! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW.
  5847. //! Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs.
  5848. //!
  5849. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.
  5850. //! SUPPORTED OS: Windows 7 and higher
  5851. //!
  5852. //!
  5853. //! \since Release: 85
  5854. //!
  5855. //! \param [in] hNvDisplay NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from
  5856. //! NvAPI_EnumNVidiaDisplayHandle().
  5857. //! \param [out] pTargets User allocated storage to retrieve an array of NV_VIEW_TARGET_INFO. Can be NULL to retrieve
  5858. //! the targetCount.
  5859. //! \param [in,out] targetMaskCount Count of target device mask specified in pTargetMask.
  5860. //! \param [out] targetView Target view selected from NV_TARGET_VIEW_MODE.
  5861. //!
  5862. //! \retval NVAPI_OK Completed request
  5863. //! \retval NVAPI_ERROR Miscellaneous error occurred
  5864. //! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter.
  5865. //! \ingroup dispcontrol
  5866. ///////////////////////////////////////////////////////////////////////////////
  5867. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.")
  5868. NVAPI_INTERFACE NvAPI_GetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargets, NvU32 *pTargetMaskCount, NV_TARGET_VIEW_MODE *pTargetView);
  5869. ///////////////////////////////////////////////////////////////////////////////
  5870. // FUNCTION NAME: NvAPI_GetViewEx
  5871. //
  5872. //! DESCRIPTION: This API lets caller retrieve the target display arrangement for selected source display handle.
  5873. //! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW.
  5874. //! Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs.
  5875. //!
  5876. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.
  5877. //! SUPPORTED OS: Windows 7 and higher
  5878. //!
  5879. //!
  5880. //! \since Release: 165
  5881. //!
  5882. //! \param [in] hNvDisplay NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with
  5883. //! NvAPI_EnumNVidiaDisplayHandle().
  5884. //! \param [in,out] pPathInfo Count field should be set to NVAPI_MAX_DISPLAY_PATH. Can be NULL to retrieve just the pathCount.
  5885. //! \param [in,out] pPathCount Number of elements in array pPathInfo->path.
  5886. //! \param [out] pTargetViewMode Display view selected from NV_TARGET_VIEW_MODE.
  5887. //!
  5888. //! \retval NVAPI_OK Completed request
  5889. //! \retval NVAPI_API_NOT_INTIALIZED NVAPI not initialized
  5890. //! \retval NVAPI_ERROR Miscellaneous error occurred
  5891. //! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter.
  5892. //! \retval NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle.
  5893. //!
  5894. //! \ingroup dispcontrol
  5895. ///////////////////////////////////////////////////////////////////////////////
  5896. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.")
  5897. NVAPI_INTERFACE NvAPI_GetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NvU32 *pPathCount, NV_TARGET_VIEW_MODE *pTargetViewMode);
  5898. ///////////////////////////////////////////////////////////////////////////////
  5899. // FUNCTION NAME: NvAPI_GetSupportedViews
  5900. //
  5901. //! This API lets caller enumerate all the supported NVIDIA display views - nView and Dualview modes.
  5902. //!
  5903. //! SUPPORTED OS: Windows 7 and higher
  5904. //!
  5905. //!
  5906. //! \since Release: 85
  5907. //!
  5908. //! \param [in] hNvDisplay NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from
  5909. //! NvAPI_EnumNVidiaDisplayHandle().
  5910. //! \param [out] pTargetViews Array of supported views. Can be NULL to retrieve the pViewCount first.
  5911. //! \param [in,out] pViewCount Count of supported views.
  5912. //!
  5913. //! \retval NVAPI_OK Completed request
  5914. //! \retval NVAPI_ERROR Miscellaneous error occurred
  5915. //! \retval NVAPI_INVALID_ARGUMENT Invalid input parameter.
  5916. //! \ingroup dispcontrol
  5917. ///////////////////////////////////////////////////////////////////////////////
  5918. NVAPI_INTERFACE NvAPI_GetSupportedViews(NvDisplayHandle hNvDisplay, NV_TARGET_VIEW_MODE *pTargetViews, NvU32 *pViewCount);
  5919. //! SUPPORTED OS: Windows 7 and higher
  5920. //!
  5921. ///////////////////////////////////////////////////////////////////////////////
  5922. //
  5923. // FUNCTION NAME: NvAPI_DISP_GetDisplayIdByDisplayName
  5924. //
  5925. //! DESCRIPTION: This API retrieves the Display Id of a given display by
  5926. //! display name. The display must be active to retrieve the
  5927. //! displayId. In the case of clone mode or Surround gaming,
  5928. //! the primary or top-left display will be returned.
  5929. //!
  5930. //! \param [in] displayName Name of display (Eg: "\\DISPLAY1" to
  5931. //! retrieve the displayId for.
  5932. //! \param [out] displayId Display ID of the requested display.
  5933. //!
  5934. //! retval ::NVAPI_OK: Capabilties have been returned.
  5935. //! retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid.
  5936. //! retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
  5937. //! retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available
  5938. //! retval ::NVAPI_ERROR: Miscellaneous error occurred
  5939. //!
  5940. //! \ingroup dispcontrol
  5941. ///////////////////////////////////////////////////////////////////////////////
  5942. NVAPI_INTERFACE NvAPI_DISP_GetDisplayIdByDisplayName(const char *displayName, NvU32* displayId);
  5943. ///////////////////////////////////////////////////////////////////////////////
  5944. // FUNCTION NAME: NvAPI_DISP_GetDisplayConfig
  5945. //
  5946. //! DESCRIPTION: This API lets caller retrieve the current global display
  5947. //! configuration.
  5948. //! USAGE: The caller might have to call this three times to fetch all the required configuration details as follows:
  5949. //! First Pass: Caller should Call NvAPI_DISP_GetDisplayConfig() with pathInfo set to NULL to fetch pathInfoCount.
  5950. //! Second Pass: Allocate memory for pathInfo with respect to the number of pathInfoCount(from First Pass) to fetch
  5951. //! targetInfoCount. If sourceModeInfo is needed allocate memory or it can be initialized to NULL.
  5952. //! Third Pass(Optional, only required if target information is required): Allocate memory for targetInfo with respect
  5953. //! to number of targetInfoCount(from Second Pass).
  5954. //! SUPPORTED OS: Windows 7 and higher
  5955. //!
  5956. //!
  5957. //! \param [in,out] pathInfoCount Number of elements in pathInfo array, returns number of valid topologies, this cannot be null.
  5958. //! \param [in,out] pathInfo Array of path information
  5959. //!
  5960. //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
  5961. //! specific meaning for this API, they are listed below.
  5962. //!
  5963. //! \retval NVAPI_INVALID_ARGUMENT - Invalid input parameter. Following can be the reason for this return value:
  5964. //! -# pathInfoCount is NULL.
  5965. //! -# *pathInfoCount is 0 and pathInfo is not NULL.
  5966. //! -# *pathInfoCount is not 0 and pathInfo is NULL.
  5967. //! \retval NVAPI_DEVICE_BUSY - ModeSet has not yet completed. Please wait and call it again.
  5968. //!
  5969. //! \ingroup dispcontrol
  5970. ///////////////////////////////////////////////////////////////////////////////
  5971. NVAPI_INTERFACE NvAPI_DISP_GetDisplayConfig(__inout NvU32 *pathInfoCount, __out_ecount_full_opt(*pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO *pathInfo);
  5972. ///////////////////////////////////////////////////////////////////////////////
  5973. // FUNCTION NAME: NvAPI_DISP_SetDisplayConfig
  5974. //
  5975. //
  5976. //! DESCRIPTION: This API lets caller apply a global display configuration
  5977. //! across multiple GPUs.
  5978. //!
  5979. //! If all sourceIds are zero, then NvAPI will pick up sourceId's based on the following criteria :
  5980. //! - If user provides sourceModeInfo then we are trying to assign 0th sourceId always to GDIPrimary.
  5981. //! This is needed since active windows always moves along with 0th sourceId.
  5982. //! - For rest of the paths, we are incrementally assigning the sourceId per adapter basis.
  5983. //! - If user doesn't provide sourceModeInfo then NVAPI just picks up some default sourceId's in incremental order.
  5984. //! Note : NVAPI will not intelligently choose the sourceIDs for any configs that does not need a modeset.
  5985. //!
  5986. //! SUPPORTED OS: Windows 7 and higher
  5987. //!
  5988. //!
  5989. //! \param [in] pathInfoCount Number of supplied elements in pathInfo
  5990. //! \param [in] pathInfo Array of path information
  5991. //! \param [in] flags Flags for applying settings
  5992. //!
  5993. //! \retval ::NVAPI_OK - completed request
  5994. //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
  5995. //! \retval ::NVAPI_ERROR - miscellaneous error occurred
  5996. //! \retval ::NVAPI_INVALID_ARGUMENT - Invalid input parameter.
  5997. //!
  5998. //! \ingroup dispcontrol
  5999. ///////////////////////////////////////////////////////////////////////////////
  6000. NVAPI_INTERFACE NvAPI_DISP_SetDisplayConfig(__in NvU32 pathInfoCount, __in_ecount(pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO* pathInfo, __in NvU32 flags);
  6001. ////////////////////////////////////////////////////////////////////////////////////////
  6002. //
  6003. // MOSAIC allows a multi display target output scanout on a single source.
  6004. //
  6005. // SAMPLE of MOSAIC 1x4 topo with 8 pixel horizontal overlap
  6006. //
  6007. //+-------------------------++-------------------------++-------------------------++-------------------------+
  6008. //| || || || |
  6009. //| || || || |
  6010. //| || || || |
  6011. //| DVI1 || DVI2 || DVI3 || DVI4 |
  6012. //| || || || |
  6013. //| || || || |
  6014. //| || || || |
  6015. //| || || || |
  6016. //+-------------------------++-------------------------++-------------------------++-------------------------+
  6017. //! \addtogroup mosaicapi
  6018. //! @{
  6019. #define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8
  6020. #define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8
  6021. //
  6022. // These bits are used to describe the validity of a topo.
  6023. //
  6024. #define NV_MOSAIC_TOPO_VALIDITY_VALID 0x00000000 //!< The topology is valid
  6025. #define NV_MOSAIC_TOPO_VALIDITY_MISSING_GPU 0x00000001 //!< Not enough SLI GPUs were found to fill the entire
  6026. //! topology. hPhysicalGPU will be 0 for these.
  6027. #define NV_MOSAIC_TOPO_VALIDITY_MISSING_DISPLAY 0x00000002 //!< Not enough displays were found to fill the entire
  6028. //! topology. displayOutputId will be 0 for these.
  6029. #define NV_MOSAIC_TOPO_VALIDITY_MIXED_DISPLAY_TYPES 0x00000004 //!< The topoogy is only possible with displays of the same
  6030. //! NV_GPU_OUTPUT_TYPE. Check displayOutputIds to make
  6031. //! sure they are all CRTs, or all DFPs.
  6032. //
  6033. //! This structure defines the topology details.
  6034. typedef struct
  6035. {
  6036. NvU32 version; //!< Version of this structure
  6037. NvLogicalGpuHandle hLogicalGPU; //!< Logical GPU for this topology
  6038. NvU32 validityMask; //!< 0 means topology is valid with the current hardware.
  6039. //! If not 0, inspect bits against NV_MOSAIC_TOPO_VALIDITY_*.
  6040. NvU32 rowCount; //!< Number of displays in a row
  6041. NvU32 colCount; //!< Number of displays in a column
  6042. struct
  6043. {
  6044. NvPhysicalGpuHandle hPhysicalGPU; //!< Physical GPU to be used in the topology (0 if GPU missing)
  6045. NvU32 displayOutputId; //!< Connected display target (0 if no display connected)
  6046. NvS32 overlapX; //!< Pixels of overlap on left of target: (+overlap, -gap)
  6047. NvS32 overlapY; //!< Pixels of overlap on top of target: (+overlap, -gap)
  6048. } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS];
  6049. } NV_MOSAIC_TOPO_DETAILS;
  6050. //! Macro for constructing te vesion field of NV_MOSAIC_TOPO_DETAILS
  6051. #define NVAPI_MOSAIC_TOPO_DETAILS_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_DETAILS,1)
  6052. //
  6053. //! These values refer to the different types of Mosaic topologies that are possible. When
  6054. //! getting the supported Mosaic topologies, you can specify one of these types to narrow down
  6055. //! the returned list to only those that match the given type.
  6056. typedef enum
  6057. {
  6058. NV_MOSAIC_TOPO_TYPE_ALL, //!< All mosaic topologies
  6059. NV_MOSAIC_TOPO_TYPE_BASIC, //!< Basic Mosaic topologies
  6060. NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO, //!< Passive Stereo topologies
  6061. NV_MOSAIC_TOPO_TYPE_SCALED_CLONE, //!< Not supported at this time
  6062. NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO_SCALED_CLONE, //!< Not supported at this time
  6063. NV_MOSAIC_TOPO_TYPE_MAX, //!< Always leave this at end of the enum
  6064. } NV_MOSAIC_TOPO_TYPE;
  6065. //
  6066. //! This is a complete list of supported Mosaic topologies.
  6067. //!
  6068. //! Using a "Basic" topology combines multiple monitors to create a single desktop.
  6069. //!
  6070. //! Using a "Passive" topology combines multiples monitors to create a passive stereo desktop.
  6071. //! 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
  6072. //! NOTE: common\inc\nvEscDef.h shadows a couple PASSIVE_STEREO enums. If this
  6073. //! enum list changes and effects the value of NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO
  6074. //! please update the corresponding value in nvEscDef.h
  6075. typedef enum
  6076. {
  6077. NV_MOSAIC_TOPO_NONE,
  6078. // 'BASIC' topos start here
  6079. //
  6080. // The result of using one of these Mosaic topos is that multiple monitors
  6081. // will combine to create a single desktop.
  6082. //
  6083. NV_MOSAIC_TOPO_BEGIN_BASIC,
  6084. NV_MOSAIC_TOPO_1x2_BASIC = NV_MOSAIC_TOPO_BEGIN_BASIC,
  6085. NV_MOSAIC_TOPO_2x1_BASIC,
  6086. NV_MOSAIC_TOPO_1x3_BASIC,
  6087. NV_MOSAIC_TOPO_3x1_BASIC,
  6088. NV_MOSAIC_TOPO_1x4_BASIC,
  6089. NV_MOSAIC_TOPO_4x1_BASIC,
  6090. NV_MOSAIC_TOPO_2x2_BASIC,
  6091. NV_MOSAIC_TOPO_2x3_BASIC,
  6092. NV_MOSAIC_TOPO_2x4_BASIC,
  6093. NV_MOSAIC_TOPO_3x2_BASIC,
  6094. NV_MOSAIC_TOPO_4x2_BASIC,
  6095. NV_MOSAIC_TOPO_1x5_BASIC,
  6096. NV_MOSAIC_TOPO_1x6_BASIC,
  6097. NV_MOSAIC_TOPO_7x1_BASIC,
  6098. // Add padding for 10 more entries. 6 will be enough room to specify every
  6099. // possible topology with 8 or fewer displays, so this gives us a little
  6100. // extra should we need it.
  6101. NV_MOSAIC_TOPO_END_BASIC = NV_MOSAIC_TOPO_7x1_BASIC + 9,
  6102. // 'PASSIVE_STEREO' topos start here
  6103. //
  6104. // The result of using one of these Mosaic topos is that multiple monitors
  6105. // will combine to create a single PASSIVE STEREO desktop. What this means is
  6106. // that there will be two topos that combine to create the overall desktop.
  6107. // One topo will be used for the left eye, and the other topo (of the
  6108. // same rows x cols), will be used for the right eye. The difference between
  6109. // the two topos is that different GPUs and displays will be used.
  6110. //
  6111. NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO, // value shadowed in nvEscDef.h
  6112. NV_MOSAIC_TOPO_1x2_PASSIVE_STEREO = NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO,
  6113. NV_MOSAIC_TOPO_2x1_PASSIVE_STEREO,
  6114. NV_MOSAIC_TOPO_1x3_PASSIVE_STEREO,
  6115. NV_MOSAIC_TOPO_3x1_PASSIVE_STEREO,
  6116. NV_MOSAIC_TOPO_1x4_PASSIVE_STEREO,
  6117. NV_MOSAIC_TOPO_4x1_PASSIVE_STEREO,
  6118. NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO,
  6119. NV_MOSAIC_TOPO_END_PASSIVE_STEREO = NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO + 4,
  6120. //
  6121. // Total number of topos. Always leave this at the end of the enumeration.
  6122. //
  6123. NV_MOSAIC_TOPO_MAX //! Total number of topologies.
  6124. } NV_MOSAIC_TOPO;
  6125. //
  6126. //! This is a "topology brief" structure. It tells you what you need to know about
  6127. //! a topology at a high level. A list of these is returned when you query for the
  6128. //! supported Mosaic information.
  6129. //!
  6130. //! If you need more detailed information about the topology, call
  6131. //! NvAPI_Mosaic_GetTopoGroup() with the topology value from this structure.
  6132. typedef struct
  6133. {
  6134. NvU32 version; //!< Version of this structure
  6135. NV_MOSAIC_TOPO topo; //!< The topology
  6136. NvU32 enabled; //!< 1 if topo is enabled, else 0
  6137. NvU32 isPossible; //!< 1 if topo *can* be enabled, else 0
  6138. } NV_MOSAIC_TOPO_BRIEF;
  6139. //! Macro for constructing the version field of NV_MOSAIC_TOPO_BRIEF
  6140. #define NVAPI_MOSAIC_TOPO_BRIEF_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_BRIEF,1)
  6141. //
  6142. //! Basic per-display settings that are used in setting/getting the Mosaic mode
  6143. typedef struct _NV_MOSAIC_DISPLAY_SETTING_V1
  6144. {
  6145. NvU32 version; //!< Version of this structure
  6146. NvU32 width; //!< Per-display width
  6147. NvU32 height; //!< Per-display height
  6148. NvU32 bpp; //!< Bits per pixel
  6149. NvU32 freq; //!< Display frequency
  6150. } NV_MOSAIC_DISPLAY_SETTING_V1;
  6151. typedef struct NV_MOSAIC_DISPLAY_SETTING_V2
  6152. {
  6153. NvU32 version; //!< Version of this structure
  6154. NvU32 width; //!< Per-display width
  6155. NvU32 height; //!< Per-display height
  6156. NvU32 bpp; //!< Bits per pixel
  6157. NvU32 freq; //!< Display frequency
  6158. NvU32 rrx1k; //!< Display frequency in x1k
  6159. } NV_MOSAIC_DISPLAY_SETTING_V2;
  6160. typedef NV_MOSAIC_DISPLAY_SETTING_V2 NV_MOSAIC_DISPLAY_SETTING;
  6161. //! Macro for constructing the version field of NV_MOSAIC_DISPLAY_SETTING
  6162. #define NVAPI_MOSAIC_DISPLAY_SETTING_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING_V1,1)
  6163. #define NVAPI_MOSAIC_DISPLAY_SETTING_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING_V2,2)
  6164. #define NVAPI_MOSAIC_DISPLAY_SETTING_VER NVAPI_MOSAIC_DISPLAY_SETTING_VER2
  6165. //
  6166. // Set a reasonable max number of display settings to support
  6167. // so arrays are bound.
  6168. //
  6169. #define NV_MOSAIC_DISPLAY_SETTINGS_MAX 40 //!< Set a reasonable maximum number of display settings to support
  6170. //! so arrays are bound.
  6171. //
  6172. //! This structure is used to contain a list of supported Mosaic topologies
  6173. //! along with the display settings that can be used.
  6174. typedef struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V1
  6175. {
  6176. NvU32 version; //!< Version of this structure
  6177. NvU32 topoBriefsCount; //!< Number of topologies in below array
  6178. NV_MOSAIC_TOPO_BRIEF topoBriefs[NV_MOSAIC_TOPO_MAX]; //!< List of supported topologies with only brief details
  6179. NvU32 displaySettingsCount; //!< Number of display settings in below array
  6180. NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; //!< List of per display settings possible
  6181. } NV_MOSAIC_SUPPORTED_TOPO_INFO_V1;
  6182. typedef struct _NV_MOSAIC_SUPPORTED_TOPO_INFO_V2
  6183. {
  6184. NvU32 version; //!< Version of this structure
  6185. NvU32 topoBriefsCount; //!< Number of topologies in below array
  6186. NV_MOSAIC_TOPO_BRIEF topoBriefs[NV_MOSAIC_TOPO_MAX]; //!< List of supported topologies with only brief details
  6187. NvU32 displaySettingsCount; //!< Number of display settings in below array
  6188. NV_MOSAIC_DISPLAY_SETTING_V2 displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; //!< List of per display settings possible
  6189. } NV_MOSAIC_SUPPORTED_TOPO_INFO_V2;
  6190. typedef NV_MOSAIC_SUPPORTED_TOPO_INFO_V2 NV_MOSAIC_SUPPORTED_TOPO_INFO;
  6191. //! Macro forconstructing the version field of NV_MOSAIC_SUPPORTED_TOPO_INFO
  6192. #define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO_V1,1)
  6193. #define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO_V2,2)
  6194. #define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER2
  6195. //
  6196. // Indices to use to access the topos array within the mosaic topology
  6197. #define NV_MOSAIC_TOPO_IDX_DEFAULT 0
  6198. #define NV_MOSAIC_TOPO_IDX_LEFT_EYE 0
  6199. #define NV_MOSAIC_TOPO_IDX_RIGHT_EYE 1
  6200. #define NV_MOSAIC_TOPO_NUM_EYES 2
  6201. //
  6202. //! This defines the maximum number of topos that can be in a topo group.
  6203. //! At this time, it is set to 2 because our largest topo group (passive
  6204. //! stereo) only needs 2 topos (left eye and right eye).
  6205. //!
  6206. //! If a new topo group with more than 2 topos is added above, then this
  6207. //! number will also have to be incremented.
  6208. #define NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP 2
  6209. //
  6210. //! This structure defines a group of topologies that work together to create one
  6211. //! overall layout. All of the supported topologies are represented with this
  6212. //! structure.
  6213. //!
  6214. //! For example, a 'Passive Stereo' topology would be represented with this
  6215. //! structure, and would have separate topology details for the left and right eyes.
  6216. //! The count would be 2. A 'Basic' topology is also represented by this structure,
  6217. //! with a count of 1.
  6218. //!
  6219. //! The structure is primarily used internally, but is exposed to applications in a
  6220. //! read-only fashion because there are some details in it that might be useful
  6221. //! (like the number of rows/cols, or connected display information). A user can
  6222. //! get the filled-in structure by calling NvAPI_Mosaic_GetTopoGroup().
  6223. //!
  6224. //! You can then look at the detailed values within the structure. There are no
  6225. //! entrypoints which take this structure as input (effectively making it read-only).
  6226. typedef struct
  6227. {
  6228. NvU32 version; //!< Version of this structure
  6229. NV_MOSAIC_TOPO_BRIEF brief; //!< The brief details of this topo
  6230. NvU32 count; //!< Number of topos in array below
  6231. NV_MOSAIC_TOPO_DETAILS topos[NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP];
  6232. } NV_MOSAIC_TOPO_GROUP;
  6233. //! Macro for constructing the version field of NV_MOSAIC_TOPO_GROUP
  6234. #define NVAPI_MOSAIC_TOPO_GROUP_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_GROUP,1)
  6235. //! @}
  6236. ///////////////////////////////////////////////////////////////////////////////
  6237. //
  6238. // FUNCTION NAME: NvAPI_Mosaic_GetSupportedTopoInfo
  6239. //
  6240. //! DESCRIPTION: This API returns information on the topologies and display resolutions
  6241. //! supported by Mosaic mode.
  6242. //!
  6243. //! NOTE: Not all topologies returned can be set immediately.
  6244. //! See 'OUT' Notes below.
  6245. //!
  6246. //! Once you get the list of supported topologies, you can call
  6247. //! NvAPI_Mosaic_GetTopoGroup() with one of the Mosaic topologies if you need
  6248. //! more information about it.
  6249. //!
  6250. //! <b>'IN' Notes:</b> pSupportedTopoInfo->version must be set before calling this function.
  6251. //! If the specified version is not supported by this implementation,
  6252. //! an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION).
  6253. //!
  6254. //! <b>'OUT' Notes:</b> Some of the topologies returned might not be valid for one reason or
  6255. //! another. It could be due to mismatched or missing displays. It
  6256. //! could also be because the required number of GPUs is not found.
  6257. //! At a high level, you can see if the topology is valid and can be enabled
  6258. //! by looking at the pSupportedTopoInfo->topoBriefs[xxx].isPossible flag.
  6259. //! If this is true, the topology can be enabled. If it
  6260. //! is false, you can find out why it cannot be enabled by getting the
  6261. //! details of the topology via NvAPI_Mosaic_GetTopoGroup(). From there,
  6262. //! look at the validityMask of the individual topologies. The bits can
  6263. //! be tested against the NV_MOSAIC_TOPO_VALIDITY_* bits.
  6264. //!
  6265. //! It is possible for this function to return NVAPI_OK with no topologies
  6266. //! listed in the return structure. If this is the case, it means that
  6267. //! the current hardware DOES support Mosaic, but with the given configuration
  6268. //! no valid topologies were found. This most likely means that SLI was not
  6269. //! enabled for the hardware. Once enabled, you should see valid topologies
  6270. //! returned from this function.
  6271. //!
  6272. //! SUPPORTED OS: Windows 7 and higher
  6273. //!
  6274. //!
  6275. //! \since Release: 185
  6276. //!
  6277. //!
  6278. //! \param [in,out] pSupportedTopoInfo Information about what topologies and display resolutions
  6279. //! are supported for Mosaic.
  6280. //! \param [in] type The type of topologies the caller is interested in
  6281. //! getting. See NV_MOSAIC_TOPO_TYPE for possible values.
  6282. //!
  6283. //! \retval ::NVAPI_OK No errors in returning supported topologies.
  6284. //! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware.
  6285. //! \retval ::NVAPI_INVALID_ARGUMENT One or more arguments passed in are invalid.
  6286. //! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first.
  6287. //! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available.
  6288. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
  6289. // compatible with this entry point.
  6290. //! \retval ::NVAPI_ERROR: Miscellaneous error occurred.
  6291. //!
  6292. //! \ingroup mosaicapi
  6293. ///////////////////////////////////////////////////////////////////////////////
  6294. NVAPI_INTERFACE NvAPI_Mosaic_GetSupportedTopoInfo(NV_MOSAIC_SUPPORTED_TOPO_INFO *pSupportedTopoInfo, NV_MOSAIC_TOPO_TYPE type);
  6295. ///////////////////////////////////////////////////////////////////////////////
  6296. //
  6297. // FUNCTION NAME: NvAPI_Mosaic_GetTopoGroup
  6298. //
  6299. //! DESCRIPTION: This API returns a structure filled with the details
  6300. //! of the specified Mosaic topology.
  6301. //!
  6302. //! If the pTopoBrief passed in matches the current topology,
  6303. //! then information in the brief and group structures
  6304. //! will reflect what is current. Thus the brief would have
  6305. //! the current 'enable' status, and the group would have the
  6306. //! current overlap values. If there is no match, then the
  6307. //! returned brief has an 'enable' status of FALSE (since it
  6308. //! is obviously not enabled), and the overlap values will be 0.
  6309. //!
  6310. //! <b>'IN' Notes:</b> pTopoGroup->version must be set before calling this function.
  6311. //! If the specified version is not supported by this implementation,
  6312. //! an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION).
  6313. //!
  6314. //!
  6315. //! SUPPORTED OS: Windows 7 and higher
  6316. //!
  6317. //!
  6318. //! \since Release: 185
  6319. //!
  6320. //! \param [in] pTopoBrief The topology for getting the details
  6321. //! This must be one of the topology briefs
  6322. //! returned from NvAPI_Mosaic_GetSupportedTopoInfo().
  6323. //! \param [in,out] pTopoGroup The topology details matching the brief
  6324. //!
  6325. //! \retval ::NVAPI_OK Details were retrieved successfully.
  6326. //! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware.
  6327. //! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid.
  6328. //! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first.
  6329. //! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available.
  6330. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
  6331. // compatible with this entry point.
  6332. //! \retval ::NVAPI_ERROR: Miscellaneous error occurred.
  6333. //!
  6334. //! \ingroup mosaicapi
  6335. ///////////////////////////////////////////////////////////////////////////////
  6336. NVAPI_INTERFACE NvAPI_Mosaic_GetTopoGroup(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_TOPO_GROUP *pTopoGroup);
  6337. ///////////////////////////////////////////////////////////////////////////////
  6338. //
  6339. // FUNCTION NAME: NvAPI_Mosaic_GetOverlapLimits
  6340. //
  6341. //! DESCRIPTION: This API returns the X and Y overlap limits required if
  6342. //! the given Mosaic topology and display settings are to be used.
  6343. //!
  6344. //! SUPPORTED OS: Windows 7 and higher
  6345. //!
  6346. //!
  6347. //! \since Release: 185
  6348. //!
  6349. //! \param [in] pTopoBrief The topology for getting limits
  6350. //! This must be one of the topo briefs
  6351. //! returned from NvAPI_Mosaic_GetSupportedTopoInfo().
  6352. //! \param [in] pDisplaySetting The display settings for getting the limits.
  6353. //! This must be one of the settings
  6354. //! returned from NvAPI_Mosaic_GetSupportedTopoInfo().
  6355. //! \param [out] pMinOverlapX X overlap minimum
  6356. //! \param [out] pMaxOverlapX X overlap maximum
  6357. //! \param [out] pMinOverlapY Y overlap minimum
  6358. //! \param [out] pMaxOverlapY Y overlap maximum
  6359. //!
  6360. //! \retval ::NVAPI_OK Details were retrieved successfully.
  6361. //! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware.
  6362. //! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid.
  6363. //! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first.
  6364. //! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available.
  6365. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
  6366. //! compatible with this entry point.
  6367. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  6368. //!
  6369. //! \ingroup mosaicapi
  6370. ///////////////////////////////////////////////////////////////////////////////
  6371. NVAPI_INTERFACE NvAPI_Mosaic_GetOverlapLimits(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pMinOverlapX, NvS32 *pMaxOverlapX, NvS32 *pMinOverlapY, NvS32 *pMaxOverlapY);
  6372. ///////////////////////////////////////////////////////////////////////////////
  6373. //
  6374. // FUNCTION NAME: NvAPI_Mosaic_SetCurrentTopo
  6375. //
  6376. //! DESCRIPTION: This API sets the Mosaic topology and performs a mode switch
  6377. //! using the given display settings.
  6378. //!
  6379. //! If NVAPI_OK is returned, the current Mosaic topology was set
  6380. //! correctly. Any other status returned means the
  6381. //! topology was not set, and remains what it was before this
  6382. //! function was called.
  6383. //!
  6384. //! SUPPORTED OS: Windows 7 and higher
  6385. //!
  6386. //!
  6387. //! \since Release: 185
  6388. //!
  6389. //! \param [in] pTopoBrief The topology to set. This must be one of the topologies returned from
  6390. //! NvAPI_Mosaic_GetSupportedTopoInfo(), and it must have an isPossible value of 1.
  6391. //! \param [in] pDisplaySetting The per display settings to be used in the Mosaic mode. This must be one of the
  6392. //! settings returned from NvAPI_Mosaic_GetSupportedTopoInfo().
  6393. //! \param [in] overlapX The pixel overlap to use between horizontal displays (use positive a number for
  6394. //! overlap, or a negative number to create a gap.) If the overlap is out of bounds
  6395. //! for what is possible given the topo and display setting, the overlap will be clamped.
  6396. //! \param [in] overlapY The pixel overlap to use between vertical displays (use positive a number for
  6397. //! overlap, or a negative number to create a gap.) If the overlap is out of bounds for
  6398. //! what is possible given the topo and display setting, the overlap will be clamped.
  6399. //! \param [in] enable If 1, the topology being set will also be enabled, meaning that the mode set will
  6400. //! occur. \n
  6401. //! If 0, you don't want to be in Mosaic mode right now, but want to set the current
  6402. //! Mosaic topology so you can enable it later with NvAPI_Mosaic_EnableCurrentTopo().
  6403. //!
  6404. //! \retval ::NVAPI_OK The Mosaic topology was set.
  6405. //! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware.
  6406. //! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid.
  6407. //! \retval ::NVAPI_TOPO_NOT_POSSIBLE The topology passed in is not currently possible.
  6408. //! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first.
  6409. //! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available.
  6410. //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
  6411. //! compatible with this entrypoint.
  6412. //! \retval ::NVAPI_MODE_CHANGE_FAILED There was an error changing the display mode.
  6413. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  6414. //!
  6415. //! \ingroup mosaicapi
  6416. ///////////////////////////////////////////////////////////////////////////////
  6417. NVAPI_INTERFACE NvAPI_Mosaic_SetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 overlapX, NvS32 overlapY, NvU32 enable);
  6418. ///////////////////////////////////////////////////////////////////////////////
  6419. //
  6420. // FUNCTION NAME: NvAPI_Mosaic_GetCurrentTopo
  6421. //
  6422. //! DESCRIPTION: This API returns information for the current Mosaic topology.
  6423. //! This includes topology, display settings, and overlap values.
  6424. //!
  6425. //! You can call NvAPI_Mosaic_GetTopoGroup() with the topology
  6426. //! if you require more information.
  6427. //!
  6428. //! If there isn't a current topology, then pTopoBrief->topo will
  6429. //! be NV_MOSAIC_TOPO_NONE.
  6430. //!
  6431. //! SUPPORTED OS: Windows 7 and higher
  6432. //!
  6433. //!
  6434. //! \since Release: 185
  6435. //!
  6436. //! \param [out] pTopoBrief The current Mosaic topology
  6437. //! \param [out] pDisplaySetting The current per-display settings
  6438. //! \param [out] pOverlapX The pixel overlap between horizontal displays
  6439. //! \param [out] pOverlapY The pixel overlap between vertical displays
  6440. //!
  6441. //! \retval ::NVAPI_OK Success getting current info.
  6442. //! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware.
  6443. //! \retval ::NVAPI_INVALID_ARGUMENT One or more argumentss passed in are invalid.
  6444. //! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first.
  6445. //! \retval ::NVAPI_NO_IMPLEMENTATION This entry point not available.
  6446. //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
  6447. //!
  6448. //! \ingroup mosaicapi
  6449. ///////////////////////////////////////////////////////////////////////////////
  6450. NVAPI_INTERFACE NvAPI_Mosaic_GetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pOverlapX, NvS32 *pOverlapY);
  6451. ///////////////////////////////////////////////////////////////////////////////
  6452. //
  6453. // FUNCTION NAME: NvAPI_Mosaic_EnableCurrentTopo
  6454. //
  6455. //! DESCRIPTION: This API enables or disables the current Mosaic topology
  6456. //! based on the setting of the incoming 'enable' parameter.
  6457. //!
  6458. //! An "enable" setting enables the current (previously set) Mosaic topology.
  6459. //! Note that when the current Mosaic topology is retrieved, it must have an isPossible value of 1 or
  6460. //! an error will occur.
  6461. //!
  6462. //! A "disable" setting disables the current Mosaic topology.
  6463. //! The topology information will persist, even across reboots.
  6464. //! To re-enable the Mosaic topology, call this function
  6465. //! again with the enable parameter set to 1.
  6466. //!
  6467. //! SUPPORTED OS: Windows 7 and higher
  6468. //!
  6469. //!
  6470. //! \since Release: 185
  6471. //!
  6472. //! \param [in] enable 1 to enable the current Mosaic topo, 0 to disable it.
  6473. //!
  6474. //! \retval ::NVAPI_OK The Mosaic topo was enabled/disabled.
  6475. //! \retval ::NVAPI_NOT_SUPPORTED Mosaic is not supported with the existing hardware.
  6476. //! \retval ::NVAPI_INVALID_ARGUMENT One or more arguments passed in are invalid.
  6477. //! \retval ::NVAPI_TOPO_NOT_POSSIBLE The current topology is not currently possible.
  6478. //! \retval ::NVAPI_MODE_CHANGE_FAILED There was an error changing the display mode.
  6479. //! \retval ::NVAPI_ERROR: Miscellaneous error occurred.
  6480. //!
  6481. //! \ingroup mosaicapi
  6482. ///////////////////////////////////////////////////////////////////////////////
  6483. NVAPI_INTERFACE NvAPI_Mosaic_EnableCurrentTopo(NvU32 enable);
  6484. //! \ingroup mosaicapi
  6485. //! @{
  6486. typedef struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V1
  6487. {
  6488. NvU32 displayId; //!< DisplayID of the display
  6489. NvS32 overlapX; //!< (+overlap, -gap)
  6490. NvS32 overlapY; //!< (+overlap, -gap)
  6491. NV_ROTATE rotation; //!< Rotation of display
  6492. NvU32 cloneGroup; //!< Reserved, must be 0
  6493. } NV_MOSAIC_GRID_TOPO_DISPLAY_V1;
  6494. typedef enum _NV_PIXEL_SHIFT_TYPE
  6495. {
  6496. NV_PIXEL_SHIFT_TYPE_NO_PIXEL_SHIFT = 0, //!< No pixel shift will be applied to this display.
  6497. NV_PIXEL_SHIFT_TYPE_2x2_TOP_LEFT_PIXELS = 1, //!< This display will be used to scanout top left pixels in 2x2 PixelShift configuration
  6498. NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_RIGHT_PIXELS = 2, //!< This display will be used to scanout bottom right pixels in 2x2 PixelShift configuration
  6499. NV_PIXEL_SHIFT_TYPE_2x2_TOP_RIGHT_PIXELS = 4, //!< This display will be used to scanout top right pixels in 2x2 PixelShift configuration
  6500. NV_PIXEL_SHIFT_TYPE_2x2_BOTTOM_LEFT_PIXELS = 8, //!< This display will be used to scanout bottom left pixels in 2x2 PixelShift configuration
  6501. } NV_PIXEL_SHIFT_TYPE;
  6502. typedef struct _NV_MOSAIC_GRID_TOPO_DISPLAY_V2
  6503. {
  6504. NvU32 version; //!< Version of this structure
  6505. NvU32 displayId; //!< DisplayID of the display
  6506. NvS32 overlapX; //!< (+overlap, -gap)
  6507. NvS32 overlapY; //!< (+overlap, -gap)
  6508. NV_ROTATE rotation; //!< Rotation of display
  6509. NvU32 cloneGroup; //!< Reserved, must be 0
  6510. NV_PIXEL_SHIFT_TYPE pixelShiftType; //!< Type of the pixel shift enabled display
  6511. } NV_MOSAIC_GRID_TOPO_DISPLAY_V2;
  6512. #ifndef NV_MOSAIC_GRID_TOPO_DISPLAY_VER
  6513. typedef NV_MOSAIC_GRID_TOPO_DISPLAY_V1 NV_MOSAIC_GRID_TOPO_DISPLAY;
  6514. #endif
  6515. typedef struct _NV_MOSAIC_GRID_TOPO_V1
  6516. {
  6517. NvU32 version; //!< Version of this structure
  6518. NvU32 rows; //!< Number of rows
  6519. NvU32 columns; //!< Number of columns
  6520. NvU32 displayCount; //!< Number of display details
  6521. NvU32 applyWithBezelCorrect : 1; //!< When enabling and doing the modeset, do we switch to the bezel-corrected resolution
  6522. NvU32 immersiveGaming : 1; //!< Enable as immersive gaming instead of Mosaic SLI (for Quadro-boards only)
  6523. NvU32 baseMosaic : 1; //!< Enable as Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards only)
  6524. NvU32 driverReloadAllowed : 1; //!< If necessary, reloading the driver is permitted (for Vista and above only). Will not be persisted. Value undefined on get.
  6525. 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.
  6526. NvU32 reserved : 27; //!< Reserved, must be 0
  6527. NV_MOSAIC_GRID_TOPO_DISPLAY_V1 displays[NV_MOSAIC_MAX_DISPLAYS]; //!< Displays are done as [(row * columns) + column]
  6528. NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings; //!< Display settings
  6529. } NV_MOSAIC_GRID_TOPO_V1;
  6530. typedef struct _NV_MOSAIC_GRID_TOPO_V2
  6531. {
  6532. NvU32 version; //!< Version of this structure
  6533. NvU32 rows; //!< Number of rows
  6534. NvU32 columns; //!< Number of columns
  6535. NvU32 displayCount; //!< Number of display details
  6536. NvU32 applyWithBezelCorrect : 1; //!< When enabling and doing the modeset, do we switch to the bezel-corrected resolution
  6537. NvU32 immersiveGaming : 1; //!< Enable as immersive gaming instead of Mosaic SLI (for Quadro-boards only)
  6538. NvU32 baseMosaic : 1; //!< Enable as Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards only)
  6539. NvU32 driverReloadAllowed : 1; //!< If necessary, reloading the driver is permitted (for Vista and above only). Will not be persisted. Value undefined on get.
  6540. 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.
  6541. NvU32 pixelShift : 1; //!< Enable Pixel shift
  6542. NvU32 reserved : 26; //!< Reserved, must be 0
  6543. NV_MOSAIC_GRID_TOPO_DISPLAY_V2 displays[NV_MOSAIC_MAX_DISPLAYS]; //!< Displays are done as [(row * columns) + column]
  6544. NV_MOSAIC_DISPLAY_SETTING_V1 displaySettings; //!< Display settings
  6545. } NV_MOSAIC_GRID_TOPO_V2;
  6546. //! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO
  6547. #define NV_MOSAIC_GRID_TOPO_VER1 MAKE_NVAPI_VERSION(NV_MOSAIC_GRID_TOPO_V1,1)
  6548. #define NV_MOSAIC_GRID_TOPO_VER2 MAKE_NVAPI_VERSION(NV_MOSAIC_GRID_TOPO_V2,2)
  6549. #ifndef NV_MOSAIC_GRID_TOPO_VER
  6550. typedef NV_MOSAIC_GRID_TOPO_V2 NV_MOSAIC_GRID_TOPO;
  6551. //! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO
  6552. #define NV_MOSAIC_GRID_TOPO_VER NV_MOSAIC_GRID_TOPO_VER2
  6553. #endif
  6554. //! @}
  6555. //! since Release R290
  6556. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_DISPLAY_ON_INVALID_GPU NV_BIT(0)
  6557. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_DISPLAY_ON_WRONG_CONNECTOR NV_BIT(1)
  6558. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_COMMON_TIMINGS NV_BIT(2)
  6559. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_EDID_AVAILABLE NV_BIT(3)
  6560. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_MISMATCHED_OUTPUT_TYPE NV_BIT(4)
  6561. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_DISPLAY_CONNECTED NV_BIT(5)
  6562. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_GPU_TOPOLOGY NV_BIT(6)
  6563. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NOT_SUPPORTED NV_BIT(7)
  6564. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_NO_SLI_BRIDGE NV_BIT(8)
  6565. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_ECC_ENABLED NV_BIT(9)
  6566. #define NV_MOSAIC_DISPLAYCAPS_PROBLEM_GPU_TOPOLOGY_NOT_SUPPORTED NV_BIT(10)
  6567. ///////////////////////////////////////////////////////////////////////////////
  6568. //
  6569. // FUNCTION NAME: NvAPI_Mosaic_SetDisplayGrids
  6570. //
  6571. //! DESCRIPTION: Sets a new display topology, replacing any existing topologies
  6572. //! that use the same displays.
  6573. //!
  6574. //! This function will look for an SLI configuration that will
  6575. //! allow the display topology to work.
  6576. //!
  6577. //! To revert to a single display, specify that display as a 1x1
  6578. //! grid.
  6579. //!
  6580. //! SUPPORTED OS: Windows 7 and higher
  6581. //!
  6582. //!
  6583. //! \param [in] pGridTopologies The topology details to set.
  6584. //! \param [in] gridCount The number of elements in the pGridTopologies array.
  6585. //! \param [in] setTopoFlags Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_*
  6586. //! flags.
  6587. //!
  6588. //!
  6589. //! \retval ::NVAPI_OK Capabilities have been returned.
  6590. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  6591. //! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first
  6592. //! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available
  6593. //! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY No matching GPU topologies could be found.
  6594. //! \retval ::NVAPI_TOPO_NOT_POSSIBLE One or more of the display grids are not valid.
  6595. //! \retval ::NVAPI_ERROR Miscellaneous error occurred
  6596. //! \ingroup mosaicapi
  6597. ///////////////////////////////////////////////////////////////////////////////
  6598. //! Do not change the current GPU topology. If the NO_DRIVER_RELOAD bit is not
  6599. //! specified, then it may still require a driver reload.
  6600. #define NV_MOSAIC_SETDISPLAYTOPO_FLAG_CURRENT_GPU_TOPOLOGY NV_BIT(0)
  6601. //! Do not allow a driver reload. That is, stick with the same master GPU as well as the
  6602. //! same SLI configuration.
  6603. #define NV_MOSAIC_SETDISPLAYTOPO_FLAG_NO_DRIVER_RELOAD NV_BIT(1)
  6604. //! When choosing a GPU topology, choose the topology with the best performance.
  6605. //! Without this flag, it will choose the topology that uses the smallest number
  6606. //! of GPU's.
  6607. #define NV_MOSAIC_SETDISPLAYTOPO_FLAG_MAXIMIZE_PERFORMANCE NV_BIT(2)
  6608. //! Do not return an error if no configuration will work with all of the grids.
  6609. #define NV_MOSAIC_SETDISPLAYTOPO_FLAG_ALLOW_INVALID NV_BIT(3)
  6610. NVAPI_INTERFACE NvAPI_Mosaic_SetDisplayGrids(__in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies, __in NvU32 gridCount, __in NvU32 setTopoFlags);
  6611. //! \ingroup mosaicapi
  6612. //! Indicates that a display's position in the grid is sub-optimal.
  6613. #define NV_MOSAIC_DISPLAYTOPO_WARNING_DISPLAY_POSITION NV_BIT(0)
  6614. //! \ingroup mosaicapi
  6615. //! Indicates that SetDisplaySettings would need to perform a driver reload.
  6616. #define NV_MOSAIC_DISPLAYTOPO_WARNING_DRIVER_RELOAD_REQUIRED NV_BIT(1)
  6617. //! \ingroup mosaicapi
  6618. typedef struct
  6619. {
  6620. NvU32 version;
  6621. NvU32 errorFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_ERROR_* flags.
  6622. NvU32 warningFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags.
  6623. NvU32 displayCount; //!< (OUT) The number of valid entries in the displays array.
  6624. struct
  6625. {
  6626. NvU32 displayId; //!< (OUT) The DisplayID of this display.
  6627. NvU32 errorFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYCAPS_PROBLEM_* flags.
  6628. NvU32 warningFlags; //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags.
  6629. NvU32 supportsRotation : 1; //!< (OUT) This display can be rotated
  6630. NvU32 reserved : 31; //!< (OUT) reserved
  6631. } displays[NVAPI_MAX_DISPLAYS];
  6632. } NV_MOSAIC_DISPLAY_TOPO_STATUS;
  6633. //! \ingroup mosaicapi
  6634. #define NV_MOSAIC_DISPLAY_TOPO_STATUS_VER MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_TOPO_STATUS,1)
  6635. ///////////////////////////////////////////////////////////////////////////////
  6636. //
  6637. // FUNCTION NAME: NvAPI_Mosaic_ValidateDisplayGrids
  6638. //
  6639. //! DESCRIPTION: Determines if a list of grid topologies is valid. It will choose an SLI
  6640. //! configuration in the same way that NvAPI_Mosaic_SetDisplayGrids() does.
  6641. //!
  6642. //! On return, each element in the pTopoStatus array will contain any errors or
  6643. //! warnings about each grid topology. If any error flags are set, then the topology
  6644. //! is not valid. If any warning flags are set, then the topology is valid, but
  6645. //! sub-optimal.
  6646. //!
  6647. //! If the ALLOW_INVALID flag is set, then it will continue to validate the grids
  6648. //! even if no SLI configuration will allow all of the grids. In this case, a grid
  6649. //! grid with no matching GPU topology will have the error
  6650. //! flags NO_GPU_TOPOLOGY or NOT_SUPPORTED set.
  6651. //!
  6652. //! If the ALLOW_INVALID flag is not set and no matching SLI configuration is
  6653. //! found, then it will skip the rest of the validation and return
  6654. //! NVAPI_NO_ACTIVE_SLI_TOPOLOGY.
  6655. //!
  6656. //! SUPPORTED OS: Windows 7 and higher
  6657. //!
  6658. //!
  6659. //! \param [in] setTopoFlags Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_*
  6660. //! flags.
  6661. //! \param [in] pGridTopologies The array of grid topologies to verify.
  6662. //! \param [in,out] pTopoStatus The array of problems and warnings with each grid topology.
  6663. //! \param [in] gridCount The number of elements in the pGridTopologies and
  6664. //! pTopoStatus arrays.
  6665. //!
  6666. //!
  6667. //! \retval ::NVAPI_OK: Capabilities have been returned.
  6668. //! \retval ::NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid.
  6669. //! \retval ::NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
  6670. //! \retval ::NVAPI_NO_IMPLEMENTATION: This entrypoint not available
  6671. //! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY: No matching GPU topologies could be found.
  6672. //! \retval ::NVAPI_ERROR: Miscellaneous error occurred
  6673. //!
  6674. //! \ingroup mosaicapi
  6675. ///////////////////////////////////////////////////////////////////////////////
  6676. NVAPI_INTERFACE NvAPI_Mosaic_ValidateDisplayGrids(__in NvU32 setTopoFlags,
  6677. __in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies,
  6678. __inout_ecount_full(gridCount) NV_MOSAIC_DISPLAY_TOPO_STATUS *pTopoStatus,
  6679. __in NvU32 gridCount);
  6680. ///////////////////////////////////////////////////////////////////////////////
  6681. //
  6682. // FUNCTION NAME: NvAPI_Mosaic_EnumDisplayModes
  6683. //
  6684. //! DESCRIPTION: Determines the set of available display modes for a given grid topology.
  6685. //!
  6686. //! SUPPORTED OS: Windows 7 and higher
  6687. //!
  6688. //!
  6689. //! \param [in] pGridTopology The grid topology to use.
  6690. //! \param [in,out] pDisplaySettings A pointer to an array of display settings to populate,
  6691. //! or NULL to find out the total number of available modes.
  6692. //! \param [in,out] pDisplayCount If pDisplaySettings is not NULL, then pDisplayCount
  6693. //! should point to the number of elements in the
  6694. //! pDisplaySettings array. On return, it will contain the
  6695. //! number of modes that were actually returned. If
  6696. //! pDisplaySettings is NULL, then pDisplayCount will receive
  6697. //! the total number of modes that are available.
  6698. //!
  6699. //!
  6700. //! \retval ::NVAPI_OK Capabilities have been returned.
  6701. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  6702. //! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first
  6703. //! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available
  6704. //! \retval ::NVAPI_ERROR Miscellaneous error occurred
  6705. //!
  6706. //! \ingroup mosaciapi
  6707. ///////////////////////////////////////////////////////////////////////////////
  6708. NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayModes(__in NV_MOSAIC_GRID_TOPO *pGridTopology,
  6709. __inout_ecount_part_opt(*pDisplayCount, *pDisplayCount) NV_MOSAIC_DISPLAY_SETTING *pDisplaySettings,
  6710. __inout NvU32 *pDisplayCount);
  6711. //! SUPPORTED OS: Windows 7 and higher
  6712. //!
  6713. ///////////////////////////////////////////////////////////////////////////////
  6714. //
  6715. // FUNCTION NAME: NvAPI_Mosaic_EnumDisplayGrids
  6716. //
  6717. //! DESCRIPTION: Enumerates the current active grid topologies. This includes Mosaic, IG, and
  6718. //! Panoramic topologies, as well as single displays.
  6719. //!
  6720. //! If pGridTopologies is NULL, then pGridCount will be set to the number of active
  6721. //! grid topologies.
  6722. //!
  6723. //! If pGridTopologies is not NULL, then pGridCount contains the maximum number of
  6724. //! grid topologies to return. On return, pGridCount will be set to the number of
  6725. //! grid topologies that were returned.
  6726. //!
  6727. //! \param [out] pGridTopologies The list of active grid topologies.
  6728. //! \param [in,out] pGridCount A pointer to the number of grid topologies returned.
  6729. //!
  6730. //! \retval ::NVAPI_OK Capabilties have been returned.
  6731. //! \retval ::NVAPI_END_ENUMERATION There are no more topologies to return.
  6732. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  6733. //! \retval ::NVAPI_API_NOT_INTIALIZED The NvAPI API needs to be initialized first
  6734. //! \retval ::NVAPI_NO_IMPLEMENTATION This entrypoint not available
  6735. //! \retval ::NVAPI_ERROR Miscellaneous error occurred
  6736. //!
  6737. //! \ingroup mosaicapi
  6738. ///////////////////////////////////////////////////////////////////////////////
  6739. NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayGrids(__inout_ecount_part_opt(*pGridCount, *pGridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies,
  6740. __inout NvU32 *pGridCount);
  6741. ////////////////////////////////////////////////////////////////////////////////////////
  6742. //
  6743. // ###########################################################################
  6744. // DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
  6745. //
  6746. // Below is the Phase 1 Mosaic stuff, the Phase 2 stuff above is what will remain
  6747. // once Phase 2 is complete. For a small amount of time, the two will co-exist. As
  6748. // soon as apps (nvapichk, NvAPITestMosaic, and CPL) are updated to use the Phase 2
  6749. // entrypoints, the code below will be deleted.
  6750. //
  6751. // DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
  6752. // ###########################################################################
  6753. //
  6754. // Supported topos 1x4, 4x1 and 2x2 to start with.
  6755. //
  6756. // Selected scan out targets can be one per GPU or more than one on the same GPU.
  6757. //
  6758. // SAMPLE of MOSAIC 1x4 SCAN OUT TOPO with 8 pixel horizontal overlap
  6759. //
  6760. //+-------------------------++-------------------------++-------------------------++-------------------------+
  6761. //| || || || |
  6762. //| || || || |
  6763. //| || || || |
  6764. //| DVI1 || DVI2 || DVI3 || DVI4 |
  6765. //| || || || |
  6766. //| || || || |
  6767. //| || || || |
  6768. //| || || || |
  6769. //+-------------------------++-------------------------++-------------------------++-------------------------+
  6770. //! \addtogroup mosaicapi
  6771. //! @{
  6772. //! Used in NV_MOSAIC_TOPOLOGY.
  6773. #define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8
  6774. //! Used in NV_MOSAIC_TOPOLOGY.
  6775. #define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8
  6776. //! Used in NV_MOSAIC_TOPOLOGY.
  6777. #define NVAPI_MAX_MOSAIC_TOPOS 16
  6778. //! Used in NvAPI_GetCurrentMosaicTopology() and NvAPI_SetCurrentMosaicTopology().
  6779. typedef struct
  6780. {
  6781. NvU32 version; //!< Version number of the mosaic topology
  6782. NvU32 rowCount; //!< Horizontal display count
  6783. NvU32 colCount; //!< Vertical display count
  6784. struct
  6785. {
  6786. NvPhysicalGpuHandle hPhysicalGPU; //!< Physical GPU to be used in the topology
  6787. NvU32 displayOutputId; //!< Connected display target
  6788. NvS32 overlapX; //!< Pixels of overlap on the left of target: (+overlap, -gap)
  6789. NvS32 overlapY; //!< Pixels of overlap on the top of target: (+overlap, -gap)
  6790. } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS];
  6791. } NV_MOSAIC_TOPOLOGY;
  6792. //! Used in NV_MOSAIC_TOPOLOGY.
  6793. #define NVAPI_MOSAIC_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPOLOGY,1)
  6794. //! Used in NvAPI_GetSupportedMosaicTopologies().
  6795. typedef struct
  6796. {
  6797. NvU32 version;
  6798. NvU32 totalCount; //!< Count of valid topologies
  6799. NV_MOSAIC_TOPOLOGY topos[NVAPI_MAX_MOSAIC_TOPOS]; //!< Maximum number of topologies
  6800. } NV_MOSAIC_SUPPORTED_TOPOLOGIES;
  6801. //! Used in NV_MOSAIC_SUPPORTED_TOPOLOGIES.
  6802. #define NVAPI_MOSAIC_SUPPORTED_TOPOLOGIES_VER MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPOLOGIES,1)
  6803. //!@}
  6804. ///////////////////////////////////////////////////////////////////////////////
  6805. //
  6806. // FUNCTION NAME: NvAPI_GetSupportedMosaicTopologies
  6807. //
  6808. //! DESCRIPTION: This API returns all valid Mosaic topologies.
  6809. //!
  6810. //! SUPPORTED OS: Windows XP
  6811. //!
  6812. //!
  6813. //! \since Release: 177
  6814. //!
  6815. //! \param [out] pMosaicTopos An array of valid Mosaic topologies.
  6816. //!
  6817. //! \retval NVAPI_OK Call succeeded; 1 or more topologies were returned
  6818. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid
  6819. //! \retval NVAPI_MIXED_TARGET_TYPES Mosaic topology is only possible with all targets of the same NV_GPU_OUTPUT_TYPE.
  6820. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  6821. //! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system.
  6822. //! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed.
  6823. //!
  6824. //! \ingroup mosaicapi
  6825. ///////////////////////////////////////////////////////////////////////////////
  6826. NVAPI_INTERFACE NvAPI_GetSupportedMosaicTopologies(NV_MOSAIC_SUPPORTED_TOPOLOGIES *pMosaicTopos);
  6827. ///////////////////////////////////////////////////////////////////////////////
  6828. //
  6829. // FUNCTION NAME: NvAPI_GetCurrentMosaicTopology
  6830. //
  6831. //! DESCRIPTION: This API gets the current Mosaic topology.
  6832. //!
  6833. //! SUPPORTED OS: Windows XP
  6834. //!
  6835. //!
  6836. //! \since Release: 177
  6837. //!
  6838. //! \param [out] pMosaicTopo The current Mosaic topology
  6839. //! \param [out] pEnabled TRUE if returned topology is currently enabled, else FALSE
  6840. //!
  6841. //! \retval NVAPI_OK Call succeeded
  6842. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid
  6843. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  6844. //! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system.
  6845. //! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed.
  6846. //!
  6847. //! \ingroup mosaicapi
  6848. ///////////////////////////////////////////////////////////////////////////////
  6849. NVAPI_INTERFACE NvAPI_GetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo, NvU32 *pEnabled);
  6850. ///////////////////////////////////////////////////////////////////////////////
  6851. //
  6852. // FUNCTION NAME: NvAPI_SetCurrentMosaicTopology
  6853. //
  6854. //! DESCRIPTION: This API sets the Mosaic topology, and enables it so that the
  6855. //! Mosaic display settings are enumerated upon request.
  6856. //!
  6857. //! SUPPORTED OS: Windows XP
  6858. //!
  6859. //!
  6860. //! \since Release: 177
  6861. //!
  6862. //! \param [in] pMosaicTopo A valid Mosaic topology
  6863. //!
  6864. //! \retval NVAPI_OK Call succeeded
  6865. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid
  6866. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  6867. //! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system.
  6868. //! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed.
  6869. //!
  6870. //! \ingroup mosaicapi
  6871. ///////////////////////////////////////////////////////////////////////////////
  6872. NVAPI_INTERFACE NvAPI_SetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo);
  6873. ///////////////////////////////////////////////////////////////////////////////
  6874. //
  6875. // FUNCTION NAME: NvAPI_EnableCurrentMosaicTopology
  6876. //
  6877. //! DESCRIPTION: This API enables or disables the current Mosaic topology.
  6878. //! When enabling, the last Mosaic topology will be set.
  6879. //!
  6880. //! - If enabled, enumeration of display settings will include valid Mosaic resolutions.
  6881. //! - If disabled, enumeration of display settings will not include Mosaic resolutions.
  6882. //!
  6883. //! SUPPORTED OS: Windows XP
  6884. //!
  6885. //!
  6886. //! \since Release: 177
  6887. //!
  6888. //! \param [in] enable TRUE to enable the Mosaic Topology, FALSE to disable it.
  6889. //!
  6890. //! \retval NVAPI_OK Call succeeded
  6891. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid
  6892. //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found
  6893. //! \retval NVAPI_NOT_SUPPORTED Mosaic is not supported with GPUs on this system.
  6894. //! \retval NVAPI_NO_ACTIVE_SLI_TOPOLOGY SLI is not enabled, yet needs to be, in order for this function to succeed.
  6895. //!
  6896. //! \ingroup mosaicapi
  6897. ///////////////////////////////////////////////////////////////////////////////
  6898. NVAPI_INTERFACE NvAPI_EnableCurrentMosaicTopology(NvU32 enable);
  6899. #define NVAPI_MAX_GSYNC_DEVICES 4
  6900. // Sync Display APIs
  6901. ///////////////////////////////////////////////////////////////////////////////
  6902. //
  6903. // FUNCTION NAME: NvAPI_GSync_EnumSyncDevices
  6904. //
  6905. //! DESCRIPTION: This API returns an array of Sync device handles. A Sync device handle represents a
  6906. //! single Sync device on the system.
  6907. //!
  6908. //! SUPPORTED OS: Windows 7 and higher
  6909. //!
  6910. //!
  6911. //! \since Release: 313
  6912. //!
  6913. //! \param [out] nvGSyncHandles- The caller provides an array of handles, which must contain at least
  6914. //! NVAPI_MAX_GSYNC_DEVICES elements. The API will zero out the entire array and then fill in one
  6915. //! or more handles. If an error occurs, the array is invalid.
  6916. //! \param [out] *gsyncCount- The caller provides the storage space. NvAPI_GSync_EnumSyncDevices
  6917. //! sets *gsyncCount to indicate how many of the elements in the nvGSyncHandles[] array are valid.
  6918. //! If an error occurs, *gsyncCount will be set to zero.
  6919. //!
  6920. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  6921. //! If there are return error codes with specific meaning for this API, they are listed below.
  6922. //! \retval ::NVAPI_INVALID_ARGUMENT nvGSyncHandles or gsyncCount is NULL.
  6923. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device.
  6924. //!
  6925. //! \ingroup gsyncapi
  6926. ///////////////////////////////////////////////////////////////////////////////
  6927. NVAPI_INTERFACE NvAPI_GSync_EnumSyncDevices(__out NvGSyncDeviceHandle nvGSyncHandles[NVAPI_MAX_GSYNC_DEVICES], __out NvU32 *gsyncCount);
  6928. // GSync boardId values
  6929. #define NVAPI_GSYNC_BOARD_ID_P358 856 //!< GSync board ID 0x358, see NV_GSYNC_CAPABILITIES
  6930. #define NVAPI_GSYNC_BOARD_ID_P2060 8288 //!< GSync board ID 0x2060, see NV_GSYNC_CAPABILITIES
  6931. //! \since Release: 375
  6932. #define NVAPI_GSYNC_BOARD_ID_P2061 8289 //!< GSync board ID 0x2061, see NV_GSYNC_CAPABILITIES
  6933. //! Used in NvAPI_GSync_QueryCapabilities().
  6934. typedef struct _NV_GSYNC_CAPABILITIES_V1
  6935. {
  6936. NvU32 version; //!< Version of the structure
  6937. NvU32 boardId; //!< Board ID
  6938. NvU32 revision; //!< FPGA Revision
  6939. NvU32 capFlags; //!< Capabilities of the Sync board. Reserved for future use
  6940. } NV_GSYNC_CAPABILITIES_V1;
  6941. typedef struct _NV_GSYNC_CAPABILITIES_V2
  6942. {
  6943. NvU32 version; //!< Version of the structure
  6944. NvU32 boardId; //!< Board ID
  6945. NvU32 revision; //!< FPGA major revision
  6946. NvU32 capFlags; //!< Capabilities of the Sync board. Reserved for future use
  6947. NvU32 extendedRevision; //!< FPGA minor revision
  6948. } NV_GSYNC_CAPABILITIES_V2;
  6949. typedef NV_GSYNC_CAPABILITIES_V2 NV_GSYNC_CAPABILITIES;
  6950. //! \ingroup gsyncapi
  6951. //! Macro for constructing the version field of NV_GSYNC_CAPABILITIES.
  6952. #define NV_GSYNC_CAPABILITIES_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V1,1)
  6953. #define NV_GSYNC_CAPABILITIES_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES_V2,2)
  6954. #define NV_GSYNC_CAPABILITIES_VER NV_GSYNC_CAPABILITIES_VER2
  6955. ///////////////////////////////////////////////////////////////////////////////
  6956. //
  6957. // FUNCTION NAME: NvAPI_GSync_QueryCapabilities
  6958. //
  6959. //! DESCRIPTION: This API returns the capabilities of the Sync device.
  6960. //!
  6961. //!
  6962. //! SUPPORTED OS: Windows 7 and higher
  6963. //!
  6964. //!
  6965. //! \since Release: 313
  6966. //!
  6967. //! \param [in] hNvGSyncDevice- The handle for a Sync device for which the capabilities will be queried.
  6968. //! \param [inout] *pNvGSyncCapabilities- The caller provides the storage space. NvAPI_GSync_QueryCapabilities() sets
  6969. //! *pNvGSyncCapabilities to the version and capabilities details of the Sync device
  6970. //! If an error occurs, *pNvGSyncCapabilities will be set to NULL.
  6971. //!
  6972. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  6973. //! If there are return error codes with specific meaning for this API, they are listed below.
  6974. //! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL.
  6975. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device.
  6976. //!
  6977. //! \ingroup gsyncapi
  6978. ///////////////////////////////////////////////////////////////////////////////
  6979. NVAPI_INTERFACE NvAPI_GSync_QueryCapabilities(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CAPABILITIES *pNvGSyncCapabilities);
  6980. //! Connector values for a GPU. Used in NV_GSYNC_GPU.
  6981. typedef enum _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR
  6982. {
  6983. NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NONE = 0,
  6984. NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_PRIMARY = 1,
  6985. NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_SECONDARY = 2,
  6986. NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_TERTIARY = 3,
  6987. NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_QUARTERNARY = 4,
  6988. } NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR;
  6989. //! Display sync states. Used in NV_GSYNC_DISPLAY.
  6990. typedef enum _NVAPI_GSYNC_DISPLAY_SYNC_STATE
  6991. {
  6992. NVAPI_GSYNC_DISPLAY_SYNC_STATE_UNSYNCED = 0,
  6993. NVAPI_GSYNC_DISPLAY_SYNC_STATE_SLAVE = 1,
  6994. NVAPI_GSYNC_DISPLAY_SYNC_STATE_MASTER = 2,
  6995. } NVAPI_GSYNC_DISPLAY_SYNC_STATE;
  6996. typedef struct _NV_GSYNC_GPU
  6997. {
  6998. NvU32 version; //!< Version of the structure
  6999. NvPhysicalGpuHandle hPhysicalGpu; //!< GPU handle
  7000. NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR connector; //!< Indicates which connector on the device the GPU is connected to.
  7001. NvPhysicalGpuHandle hProxyPhysicalGpu; //!< GPU through which hPhysicalGpu is connected to the Sync device (if not directly connected)
  7002. //!< - this is NULL otherwise
  7003. NvU32 isSynced : 1; //!< Whether this GPU is sync'd or not.
  7004. NvU32 reserved : 31; //!< Should be set to ZERO
  7005. } NV_GSYNC_GPU;
  7006. typedef struct _NV_GSYNC_DISPLAY
  7007. {
  7008. NvU32 version; //!< Version of the structure
  7009. NvU32 displayId; //!< display identifier for displays.The GPU to which it is connected, can be retireved from NvAPI_SYS_GetPhysicalGpuFromDisplayId
  7010. NvU32 isMasterable : 1; //!< Can this display be the master? (Read only)
  7011. NvU32 reserved : 31; //!< Should be set to ZERO
  7012. NVAPI_GSYNC_DISPLAY_SYNC_STATE syncState; //!< Is this display slave/master
  7013. //!< (Retrieved with topology or set by caller for enable/disable sync)
  7014. } NV_GSYNC_DISPLAY;
  7015. #define NV_GSYNC_DISPLAY_VER MAKE_NVAPI_VERSION(NV_GSYNC_DISPLAY,1)
  7016. #define NV_GSYNC_GPU_VER MAKE_NVAPI_VERSION(NV_GSYNC_GPU,1)
  7017. ///////////////////////////////////////////////////////////////////////////////
  7018. //
  7019. // FUNCTION NAME: NvAPI_GSync_GetTopology
  7020. //
  7021. //! DESCRIPTION: This API returns the topology for the specified Sync device.
  7022. //!
  7023. //!
  7024. //! SUPPORTED OS: Windows 7 and higher
  7025. //!
  7026. //!
  7027. //! \since Release: 313
  7028. //!
  7029. //! \param [in] hNvGSyncDevice- The caller provides the handle for a Sync device for which the topology will be queried.
  7030. //! \param [in, out] gsyncGpuCount- It returns number of GPUs connected to Sync device
  7031. //! \param [in, out] gsyncGPUs- It returns info about GPUs connected to Sync device
  7032. //! \param [in, out] gsyncDisplayCount- It returns number of active displays that belongs to Sync device
  7033. //! \param [in, out] gsyncDisplays- It returns info about all active displays that belongs to Sync device
  7034. //!
  7035. //! HOW TO USE: 1) make a call to get the number of GPUs connected OR displays synced through Sync device
  7036. //! by passing the gsyncGPUs OR gsyncDisplays as NULL respectively. Both gsyncGpuCount and gsyncDisplayCount can be retrieved in same call by passing
  7037. //! both gsyncGPUs and gsyncDisplays as NULL
  7038. //! On call success:
  7039. //! 2) Allocate memory based on gsyncGpuCount(for gsyncGPUs) and/or gsyncDisplayCount(for gsyncDisplays) then make a call to populate gsyncGPUs and/or gsyncDisplays respectively.
  7040. //!
  7041. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  7042. //! If there are return error codes with specific meaning for this API, they are listed below.
  7043. //! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL.
  7044. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device.
  7045. //! \retval ::NVAPI_INSUFFICIENT_BUFFER When the actual number of GPUs/displays in the topology exceed the number of elements allocated for SyncGPUs/SyncDisplays respectively.
  7046. //!
  7047. //! \ingroup gsyncapi
  7048. ///////////////////////////////////////////////////////////////////////////////
  7049. NVAPI_INTERFACE NvAPI_GSync_GetTopology(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout_opt NvU32 *gsyncGpuCount, __inout_ecount_part_opt(*gsyncGpuCount, *gsyncGpuCount) NV_GSYNC_GPU *gsyncGPUs,
  7050. __inout_opt NvU32 *gsyncDisplayCount, __inout_ecount_part_opt(*gsyncDisplayCount, *gsyncDisplayCount) NV_GSYNC_DISPLAY *gsyncDisplays);
  7051. ///////////////////////////////////////////////////////////////////////////////
  7052. //
  7053. // FUNCTION NAME: NvAPI_GSync_SetSyncStateSettings
  7054. //
  7055. //! DESCRIPTION: Sets a new sync state for the displays in system.
  7056. //!
  7057. //!
  7058. //! SUPPORTED OS: Windows 7 and higher
  7059. //!
  7060. //!
  7061. //! \since Release: 313
  7062. //!
  7063. //! \param [in] gsyncDisplayCount- The number of displays in gsyncDisplays.
  7064. //! \param [in] pGsyncDisplays- The caller provides the structure containing all displays that need to be synchronized in the system.
  7065. //! The displays that are not part of pGsyncDisplays, will be un-synchronized.
  7066. //! \param [in] flags- Reserved for future use.
  7067. //!
  7068. //!
  7069. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  7070. //! If there are return error codes with specific meaning for this API, they are listed below.
  7071. //!
  7072. //! \retval ::NVAPI_INVALID_ARGUMENT If the display topology or count not valid.
  7073. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device.
  7074. //! \retval ::NVAPI_INVALID_SYNC_TOPOLOGY 1.If any mosaic grid is partial.
  7075. //! 2.If timing(HVisible/VVisible/refreshRate) applied of any display is different.
  7076. //! 3.If There is a across GPU mosaic grid in system and that is not a part of pGsyncDisplays.
  7077. //!
  7078. //! \ingroup gsyncapi
  7079. ///////////////////////////////////////////////////////////////////////////////
  7080. NVAPI_INTERFACE NvAPI_GSync_SetSyncStateSettings(__in NvU32 gsyncDisplayCount, __in_ecount(gsyncDisplayCount) NV_GSYNC_DISPLAY *pGsyncDisplays, __in NvU32 flags);
  7081. //! \ingroup gsyncapi
  7082. //! Source signal edge to be used for output pulse. See NV_GSYNC_CONTROL_PARAMS.
  7083. typedef enum _NVAPI_GSYNC_POLARITY
  7084. {
  7085. NVAPI_GSYNC_POLARITY_RISING_EDGE = 0,
  7086. NVAPI_GSYNC_POLARITY_FALLING_EDGE = 1,
  7087. NVAPI_GSYNC_POLARITY_BOTH_EDGES = 2,
  7088. } NVAPI_GSYNC_POLARITY;
  7089. //! Used in NV_GSYNC_CONTROL_PARAMS.
  7090. typedef enum _NVAPI_GSYNC_VIDEO_MODE
  7091. {
  7092. NVAPI_GSYNC_VIDEO_MODE_NONE = 0,
  7093. NVAPI_GSYNC_VIDEO_MODE_TTL = 1,
  7094. NVAPI_GSYNC_VIDEO_MODE_NTSCPALSECAM = 2,
  7095. NVAPI_GSYNC_VIDEO_MODE_HDTV = 3,
  7096. NVAPI_GSYNC_VIDEO_MODE_COMPOSITE = 4,
  7097. } NVAPI_GSYNC_VIDEO_MODE;
  7098. //! Used in NV_GSYNC_CONTROL_PARAMS.
  7099. typedef enum _NVAPI_GSYNC_SYNC_SOURCE
  7100. {
  7101. NVAPI_GSYNC_SYNC_SOURCE_VSYNC = 0,
  7102. NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC = 1,
  7103. } NVAPI_GSYNC_SYNC_SOURCE;
  7104. //! Used in NV_GSYNC_CONTROL_PARAMS.
  7105. typedef struct _NV_GSYNC_DELAY
  7106. {
  7107. NvU32 version; //!< Version of the structure
  7108. NvU32 numLines; //!< delay to be induced in number of horizontal lines.
  7109. NvU32 numPixels; //!< delay to be induced in number of pixels.
  7110. NvU32 maxLines; //!< maximum number of lines supported at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only.
  7111. NvU32 minPixels; //!< minimum number of pixels required at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only.
  7112. } NV_GSYNC_DELAY;
  7113. #define NV_GSYNC_DELAY_VER MAKE_NVAPI_VERSION(NV_GSYNC_DELAY,1)
  7114. //! Used in NvAPI_GSync_GetControlParameters() and NvAPI_GSync_SetControlParameters().
  7115. typedef struct _NV_GSYNC_CONTROL_PARAMS
  7116. {
  7117. NvU32 version; //!< Version of the structure
  7118. NVAPI_GSYNC_POLARITY polarity; //!< Leading edge / Falling edge / both
  7119. NVAPI_GSYNC_VIDEO_MODE vmode; //!< None, TTL, NTSCPALSECAM, HDTV
  7120. NvU32 interval; //!< Number of pulses to wait between framelock signal generation
  7121. NVAPI_GSYNC_SYNC_SOURCE source; //!< VSync/House sync
  7122. NvU32 interlaceMode:1; //!< interlace mode for a Sync device
  7123. 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.
  7124. //!< 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.
  7125. NvU32 reserved:30; //!< should be set zero
  7126. NV_GSYNC_DELAY syncSkew; //!< The time delay between the frame sync signal and the GPUs signal.
  7127. NV_GSYNC_DELAY startupDelay; //!< Sync start delay for master.
  7128. } NV_GSYNC_CONTROL_PARAMS;
  7129. #define NV_GSYNC_CONTROL_PARAMS_VER MAKE_NVAPI_VERSION(NV_GSYNC_CONTROL_PARAMS,1)
  7130. ///////////////////////////////////////////////////////////////////////////////
  7131. //
  7132. // FUNCTION NAME: NvAPI_GSync_GetControlParameters
  7133. //
  7134. //! DESCRIPTION: This API queries for sync control parameters as defined in NV_GSYNC_CONTROL_PARAMS.
  7135. //!
  7136. //! SUPPORTED OS: Windows 7 and higher
  7137. //!
  7138. //!
  7139. //! \since Release: 313
  7140. //!
  7141. //! \param [in] hNvGSyncDevice- The caller provides the handle of the Sync device for which to get parameters
  7142. //! \param [inout] *pGsyncControls- The caller provides the storage space. NvAPI_GSync_GetControlParameters() populates *pGsyncControls with values.
  7143. //!
  7144. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  7145. //! If there are return error codes with specific meaning for this API, they are listed below.
  7146. //! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL.
  7147. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device.
  7148. //!
  7149. //! \ingroup gsyncapi
  7150. ///////////////////////////////////////////////////////////////////////////////
  7151. NVAPI_INTERFACE NvAPI_GSync_GetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls);
  7152. //////////////////////////////////////////////////////////////////////////////
  7153. //
  7154. // FUNCTION NAME: NvAPI_GSync_SetControlParameters
  7155. //
  7156. //! DESCRIPTION: This API sets control parameters as defined in NV_SYNC_CONTROL_PARAMS.
  7157. //!
  7158. //! SUPPORTED OS: Windows 7 and higher
  7159. //!
  7160. //!
  7161. //! \since Release: 313
  7162. //!
  7163. //! \param [in] hNvGSyncDevice- The caller provides the handle of the Sync device for which to get parameters
  7164. //! \param [inout] *pGsyncControls- The caller provides NV_GSYNC_CONTROL_PARAMS. skew and startDelay will be updated to the applied values.
  7165. //!
  7166. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  7167. //! If there are return error codes with specific meaning for this API, they are listed below.
  7168. //! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL.
  7169. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any Sync Device.
  7170. //! \retval ::NVAPI_SYNC_MASTER_NOT_FOUND Control Parameters can only be set if there is a Sync Master enabled on the Gsync card.
  7171. //!
  7172. //! \ingroup gsyncapi
  7173. ///////////////////////////////////////////////////////////////////////////////
  7174. NVAPI_INTERFACE NvAPI_GSync_SetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls);
  7175. //! Used in NvAPI_GSync_AdjustSyncDelay()
  7176. typedef enum _NVAPI_GSYNC_DELAY_TYPE
  7177. {
  7178. NVAPI_GSYNC_DELAY_TYPE_UNKNOWN = 0,
  7179. NVAPI_GSYNC_DELAY_TYPE_SYNC_SKEW = 1,
  7180. NVAPI_GSYNC_DELAY_TYPE_STARTUP = 2
  7181. } NVAPI_GSYNC_DELAY_TYPE;
  7182. //////////////////////////////////////////////////////////////////////////////
  7183. //
  7184. // FUNCTION NAME: NvAPI_GSync_AdjustSyncDelay
  7185. //
  7186. //! 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.
  7187. //!
  7188. //! SUPPORTED OS: Windows 7 and higher
  7189. //!
  7190. //!
  7191. //! \since Release: 319
  7192. //!
  7193. //! \param [in] hNvGSyncDevice- The caller provides the handle of the Sync device for which to get parameters
  7194. //! \param [in] delayType- Specifies whether the delay is syncSkew or startupDelay.
  7195. //! \param [inout] *pGsyncDelay- The caller provides NV_GSYNC_DELAY. skew and startDelay will be adjusted and updated to the closest values.
  7196. //! \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.
  7197. //!
  7198. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  7199. //! If there are return error codes with specific meaning for this API, they are listed below.
  7200. //!
  7201. //! \ingroup gsyncapi
  7202. ///////////////////////////////////////////////////////////////////////////////
  7203. NVAPI_INTERFACE NvAPI_GSync_AdjustSyncDelay(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NVAPI_GSYNC_DELAY_TYPE delayType, __inout NV_GSYNC_DELAY *pGsyncDelay, __out_opt NvU32* syncSteps);
  7204. //! Used in NvAPI_GSync_GetSyncStatus().
  7205. typedef struct _NV_GSYNC_STATUS
  7206. {
  7207. NvU32 version; //!< Version of the structure
  7208. NvU32 bIsSynced; //!< Is timing in sync?
  7209. NvU32 bIsStereoSynced; //!< Does the phase of the timing signal from the GPU = the phase of the master sync signal?
  7210. NvU32 bIsSyncSignalAvailable; //!< Is the sync signal available?
  7211. } NV_GSYNC_STATUS;
  7212. //! Macro for constructing the version field for NV_GSYNC_STATUS.
  7213. #define NV_GSYNC_STATUS_VER MAKE_NVAPI_VERSION(NV_GSYNC_STATUS,1)
  7214. ///////////////////////////////////////////////////////////////////////////////
  7215. //
  7216. // FUNCTION NAME: NvAPI_GSync_GetSyncStatus
  7217. //
  7218. //! DESCRIPTION: This API queries the sync status of a GPU - timing, stereosync and sync signal availability.
  7219. //!
  7220. //! SUPPORTED OS: Windows 7 and higher
  7221. //!
  7222. //!
  7223. //! \since Release: 313
  7224. //!
  7225. //! \param [in] hNvGSyncDevice- Handle of the Sync device
  7226. //! \param [in] hPhysicalGpu- GPU to be queried for sync status.
  7227. //! \param [out] *status- The caller provides the storage space. NvAPI_GSync_GetSyncStatus() populates *status with
  7228. //! values - timing, stereosync and signal availability. On error, *status is set to NULL.
  7229. //!
  7230. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  7231. //! If there are return error codes with specific meaning for this API, they are listed below.
  7232. //! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL / SyncTarget is NULL.
  7233. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any G-Sync Device.
  7234. //!
  7235. //! \ingroup gsyncapi
  7236. ///////////////////////////////////////////////////////////////////////////////
  7237. NVAPI_INTERFACE NvAPI_GSync_GetSyncStatus(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GSYNC_STATUS *status);
  7238. //! \ingroup gsyncapi
  7239. #define NVAPI_MAX_RJ45_PER_GSYNC 2
  7240. //! Used in NV_GSYNC_STATUS_PARAMS.
  7241. typedef enum _NVAPI_GSYNC_RJ45_IO
  7242. {
  7243. NVAPI_GSYNC_RJ45_OUTPUT = 0,
  7244. NVAPI_GSYNC_RJ45_INPUT = 1,
  7245. NVAPI_GSYNC_RJ45_UNUSED = 2 //!< This field is used to notify that the framelock is not actually present.
  7246. } NVAPI_GSYNC_RJ45_IO;
  7247. //! \ingroup gsyncapi
  7248. //! Used in NvAPI_GSync_GetStatusParameters().
  7249. typedef struct _NV_GSYNC_STATUS_PARAMS_V1
  7250. {
  7251. NvU32 version;
  7252. NvU32 refreshRate; //!< The refresh rate
  7253. NVAPI_GSYNC_RJ45_IO RJ45_IO[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Configured as input / output
  7254. NvU32 RJ45_Ethernet[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!]
  7255. NvU32 houseSyncIncoming; //!< Incoming house sync frequency in Hz
  7256. NvU32 bHouseSync; //!< Is house sync connected?
  7257. } NV_GSYNC_STATUS_PARAMS_V1;
  7258. typedef struct _NV_GSYNC_STATUS_PARAMS_V2
  7259. {
  7260. NvU32 version;
  7261. NvU32 refreshRate; //!< The refresh rate
  7262. NVAPI_GSYNC_RJ45_IO RJ45_IO[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Configured as input / output
  7263. NvU32 RJ45_Ethernet[NVAPI_MAX_RJ45_PER_GSYNC]; //!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!]
  7264. NvU32 houseSyncIncoming; //!< Incoming house sync frequency in Hz
  7265. NvU32 bHouseSync; //!< Is house sync connected?
  7266. NvU32 bInternalSlave : 1; //!< Valid only for P2061 board.
  7267. //!< If set to 1, it means that this P2061 board receives input from another P2061 board.
  7268. NvU32 reserved : 31; //!< Reserved for future use.
  7269. } NV_GSYNC_STATUS_PARAMS_V2;
  7270. typedef NV_GSYNC_STATUS_PARAMS_V2 NV_GSYNC_STATUS_PARAMS;
  7271. //! \ingroup gsyncapi
  7272. //! Macro for constructing the version field of NV_GSYNC_STATUS_PARAMS
  7273. #define NV_GSYNC_STATUS_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GSYNC_STATUS_PARAMS_V1,1)
  7274. #define NV_GSYNC_STATUS_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_GSYNC_STATUS_PARAMS_V2,2)
  7275. #define NV_GSYNC_STATUS_PARAMS_VER NV_GSYNC_STATUS_PARAMS_VER2
  7276. ///////////////////////////////////////////////////////////////////////////////
  7277. //
  7278. // FUNCTION NAME: NvAPI_GSync_GetStatusParameters
  7279. //
  7280. //! DESCRIPTION: This API queries for sync status parameters as defined in NV_GSYNC_STATUS_PARAMS.
  7281. //!
  7282. //! SUPPORTED OS: Windows 7 and higher
  7283. //!
  7284. //!
  7285. //! \since Release: 313
  7286. //!
  7287. //! \param [in] hNvGSyncDevice The caller provides the handle of the GSync device for which to get parameters
  7288. //! \param [out] *pStatusParams The caller provides the storage space. NvAPI_GSync_GetStatusParameters populates *pStatusParams with
  7289. //! values.
  7290. //!
  7291. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  7292. //! If there are return error codes with specific meaning for this API, they are listed below.
  7293. //! \retval ::NVAPI_INVALID_ARGUMENT hNvGSyncDevice is NULL / pStatusParams is NULL.
  7294. //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND The queried Graphics system does not have any GSync Device.
  7295. //!
  7296. //! \ingroup gsyncapi
  7297. ///////////////////////////////////////////////////////////////////////////////
  7298. NVAPI_INTERFACE NvAPI_GSync_GetStatusParameters(NvGSyncDeviceHandle hNvGSyncDevice, NV_GSYNC_STATUS_PARAMS *pStatusParams);
  7299. //! @}
  7300. #if defined(_D3D9_H_)
  7301. ///////////////////////////////////////////////////////////////////////////////
  7302. //
  7303. // FUNCTION NAME: NvAPI_D3D9_RegisterResource
  7304. //
  7305. //! DESCRIPTION: This API binds a resource (surface/texture) so that it can be retrieved
  7306. //! internally by NVAPI.
  7307. //!
  7308. //! SUPPORTED OS: Windows 7 and higher
  7309. //!
  7310. //! \param [in] pResource surface/texture
  7311. //!
  7312. //! \return ::NVAPI_OK, ::NVAPI_ERROR
  7313. //!
  7314. //! \ingroup dx
  7315. ///////////////////////////////////////////////////////////////////////////////
  7316. NVAPI_INTERFACE NvAPI_D3D9_RegisterResource(IDirect3DResource9* pResource);
  7317. #endif //defined(_D3D9_H_)
  7318. #if defined(_D3D9_H_)
  7319. ///////////////////////////////////////////////////////////////////////////////
  7320. //
  7321. // FUNCTION NAME: NvAPI_D3D9_UnregisterResource
  7322. //
  7323. //! DESCRIPTION: This API unbinds a resource (surface/texture) after use.
  7324. //!
  7325. //! SUPPORTED OS: Windows 7 and higher
  7326. //!
  7327. //!
  7328. //! \param [in] pResource surface/texture
  7329. //!
  7330. //! \return ::NVAPI_OK, ::NVAPI_ERROR
  7331. //!
  7332. //! \ingroup dx
  7333. ///////////////////////////////////////////////////////////////////////////////
  7334. NVAPI_INTERFACE NvAPI_D3D9_UnregisterResource(IDirect3DResource9* pResource);
  7335. #endif //defined(_D3D9_H_)
  7336. #if defined(_D3D9_H_)
  7337. ///////////////////////////////////////////////////////////////////////////////
  7338. //
  7339. // FUNCTION NAME: NvAPI_D3D9_AliasSurfaceAsTexture
  7340. //
  7341. //! \fn NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev,
  7342. //! IDirect3DSurface9* pSurface,
  7343. //! IDirect3DTexture9 **ppTexture,
  7344. //! DWORD dwFlag);
  7345. //! DESCRIPTION: Create a texture that is an alias of a surface registered with NvAPI. The
  7346. //! new texture can be bound with IDirect3DDevice9::SetTexture(). Note that the texture must
  7347. //! be unbound before drawing to the surface again.
  7348. //! Unless the USE_SUPER flag is passed, MSAA surfaces will be resolved before
  7349. //! being used as a texture. MSAA depth buffers are resolved with a point filter,
  7350. //! and non-depth MSAA surfaces are resolved with a linear filter.
  7351. //!
  7352. //! SUPPORTED OS: Windows 7 and higher
  7353. //!
  7354. //!
  7355. //! \param [in] pDev The D3D device that owns the objects
  7356. //! \param [in] pSurface Pointer to a surface that has been registered with NvAPI
  7357. //! to which a texture alias is to be provided
  7358. //! \param [out] ppTexture Fill with the texture created
  7359. //! \param [in] dwFlag NVAPI_ALIAS_SURFACE_FLAG to describe how to handle the texture
  7360. //!
  7361. //! \retval ::NVAPI_OK completed request
  7362. //! \retval ::NVAPI_INVALID_POINTER A null pointer was passed as an argument
  7363. //! \retval ::NVAPI_INVALID_ARGUMENT One of the arguments was invalid, probably dwFlag.
  7364. //! \retval ::NVAPI_UNREGISTERED_RESOURCE pSurface has not been registered with NvAPI
  7365. //! \retval ::NVAPI_ERROR error occurred
  7366. //
  7367. ///////////////////////////////////////////////////////////////////////////////
  7368. //! \ingroup dx
  7369. //! See NvAPI_D3D9_AliasSurfaceAsTexture().
  7370. typedef enum {
  7371. NVAPI_ALIAS_SURFACE_FLAG_NONE = 0x00000000,
  7372. 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.)
  7373. NVAPI_ALIAS_SURFACE_FLAG_MASK = 0x00000001
  7374. } NVAPI_ALIAS_SURFACE_FLAG;
  7375. //! \ingroup dx
  7376. NVAPI_INTERFACE NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev,
  7377. IDirect3DSurface9* pSurface,
  7378. IDirect3DTexture9 **ppTexture,
  7379. DWORD dwFlag);
  7380. #endif //defined(_D3D9_H_)
  7381. #if defined(_D3D9_H_)
  7382. ///////////////////////////////////////////////////////////////////////////////
  7383. //
  7384. // FUNCTION NAME: NvAPI_D3D9_StretchRectEx
  7385. //
  7386. //! DESCRIPTION: This API copies the contents of the source resource to the destination
  7387. //! resource. This function can convert
  7388. //! between a wider range of surfaces than
  7389. //! IDirect3DDevice9::StretchRect. For example, it can copy
  7390. //! from a depth/stencil surface to a texture.
  7391. //!
  7392. //! The source and destination resources *must* be registered
  7393. //! with NvAPI before being used with NvAPI_D3D9_StretchRectEx().
  7394. //!
  7395. //! SUPPORTED OS: Windows 7 and higher
  7396. //!
  7397. //!
  7398. //! \param [in] pDevice The D3D device that owns the objects.
  7399. //! \param [in] pSourceResource Pointer to the source resource.
  7400. //! \param [in] pSrcRect Defines the rectangle on the source to copy from. If NULL, copy from the entire resource.
  7401. //! \param [in] pDestResource Pointer to the destination resource.
  7402. //! \param [in] pDstRect Defines the rectangle on the destination to copy to. If NULL, copy to the entire resource.
  7403. //! \param [in] Filter Choose a filtering method: D3DTEXF_NONE, D3DTEXF_POINT, D3DTEXF_LINEAR.
  7404. //!
  7405. //! \retval ::NVAPI_OK completed request
  7406. //! \retval ::NVAPI_INVALID_POINTER An invalid pointer was passed as an argument (probably NULL)
  7407. //! \retval ::NVAPI_INVALID_ARGUMENT One of the arguments was invalid
  7408. //! \retval ::NVAPI_UNREGISTERED_RESOURCE a resource was passed in without being registered
  7409. //! \retval ::NVAPI_ERROR error occurred
  7410. //!
  7411. //! \ingroup dx
  7412. ///////////////////////////////////////////////////////////////////////////////
  7413. NVAPI_INTERFACE NvAPI_D3D9_StretchRectEx(IDirect3DDevice9 * pDevice,
  7414. IDirect3DResource9 * pSourceResource,
  7415. CONST RECT * pSourceRect,
  7416. IDirect3DResource9 * pDestResource,
  7417. CONST RECT * pDestRect,
  7418. D3DTEXTUREFILTERTYPE Filter);
  7419. #endif //defined(_D3D9_H_)
  7420. #if defined(_D3D9_H_)
  7421. ///////////////////////////////////////////////////////////////////////////////
  7422. //
  7423. // FUNCTION NAME: NvAPI_D3D9_ClearRT
  7424. //
  7425. //! DESCRIPTION: This API Clears the currently bound render target(s) with the
  7426. //! given color
  7427. //!
  7428. //!
  7429. //! SUPPORTED OS: Windows 7 and higher
  7430. //!
  7431. //!
  7432. //! \param [in] pDevice The D3D device that owns the objects.
  7433. //! \param [in] dwNumRects The no of rectangles to clear. If 0, clear the entire surface (clipped to viewport)
  7434. //! \param [in] pRects Defines the rectangles to clear. Should be NULL if dwNumRects == 0
  7435. //! \param [in] r red component of the clear color
  7436. //! \param [in] g green component of the clear color
  7437. //! \param [in] b blue component of the clear color
  7438. //! \param [in] a alpha component of the clear color
  7439. //!
  7440. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  7441. //!
  7442. //! \ingroup dx
  7443. ///////////////////////////////////////////////////////////////////////////////
  7444. NVAPI_INTERFACE NvAPI_D3D9_ClearRT(IDirect3DDevice9 * pDevice,
  7445. NvU32 dwNumRects,
  7446. CONST RECT * pRects,
  7447. float r, float g, float b, float a);
  7448. #endif //if defined(_D3D9_H_)
  7449. #if defined(_D3D9_H_) && defined(__cplusplus)
  7450. //! SUPPORTED OS: Windows 7 and higher
  7451. //!
  7452. ///////////////////////////////////////////////////////////////////////////////
  7453. //
  7454. // FUNCTION NAME: NvAPI_D3D9_GetSurfaceHandle
  7455. //
  7456. //! This function gets the handle of a given surface. This handle uniquely
  7457. //! identifies the surface through all NvAPI entries.
  7458. //!
  7459. //!
  7460. //! \since Release: 313
  7461. //!
  7462. //! \param [in] pSurface Surface to be identified
  7463. //! \param [out] pHandle Will be filled by the return handle
  7464. //!
  7465. //! \return An int which could be an NvAPI status or DX HRESULT code
  7466. //! \ingroup dx
  7467. ///////////////////////////////////////////////////////////////////////////////
  7468. NVAPI_INTERFACE NvAPI_D3D9_GetSurfaceHandle(IDirect3DSurface9 *pSurface,
  7469. NVDX_ObjectHandle *pHandle);
  7470. #endif //defined(_D3D9_H_) && defined(__cplusplus)
  7471. #if defined(_D3D9_H_) && defined(__cplusplus)
  7472. //! SUPPORTED OS: Windows 7 and higher
  7473. //!
  7474. //! \addtogroup dxvidcontrol
  7475. //! @{
  7476. ///////////////////////////////////////////////////////////////////////////////
  7477. //
  7478. // FUNCTION_NAME: NvAPI_D3D9_VideoSetStereoInfo
  7479. //
  7480. //! \fn NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev,
  7481. //! NV_DX_VIDEO_STEREO_INFO *pStereoInfo);
  7482. //! \code
  7483. //! DESCRIPTION: This api specifies the stereo format of a surface, so that the
  7484. //! surface could be used for stereo video processing or compositing.
  7485. //! In particular, this api could be used to link the left and right
  7486. //! views of a decoded picture.
  7487. //!
  7488. //! \since Release: 313
  7489. //!
  7490. //! INPUT: pDev - The device on which the stereo surface will be used
  7491. //! pStereoInfo - The stereo format of the surface
  7492. //!
  7493. //! RETURN STATUS: an int which could be an NvAPI status or DX HRESULT code
  7494. //! \endcode
  7495. ///////////////////////////////////////////////////////////////////////////////
  7496. #ifndef NV_STEREO_VIDEO_FORMAT_DEFINE
  7497. #define NV_STEREO_VIDEO_FORMAT_DEFINE
  7498. typedef enum _NV_STEREO_VIDEO_FORMAT
  7499. {
  7500. NV_STEREO_VIDEO_FORMAT_NOT_STEREO = 0,
  7501. NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_LR = 1,
  7502. NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_RL = 2,
  7503. NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_LR = 3,
  7504. NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_RL = 4,
  7505. NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_LR = 5,
  7506. NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_RL = 6,
  7507. NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR = 7,
  7508. NV_STEREO_VIDEO_FORMAT_MONO_PLUS_OFFSET = 8,
  7509. NV_STEREO_VIDEO_FORMAT_LAST = 9,
  7510. } NV_STEREO_VIDEO_FORMAT;
  7511. #endif // NV_STEREO_VIDEO_FORMAT_DEFINE
  7512. typedef struct _NV_DX_VIDEO_STEREO_INFO {
  7513. NvU32 dwVersion; //!< Must be NV_DX_VIDEO_STEREO_INFO_VER
  7514. NVDX_ObjectHandle hSurface; //!< The surface whose stereo format is to be set
  7515. NVDX_ObjectHandle hLinkedSurface; //!< The linked surface (must be valid when eFormat==NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR)
  7516. NV_STEREO_VIDEO_FORMAT eFormat; //!< Stereo format of the surface
  7517. NvS32 sViewOffset; //!< Signed offset of each view (positive offset indicating left view is shifted left)
  7518. BOOL bStereoEnable; //!< Whether stereo rendering should be enabled (if FALSE, only left view will be used)
  7519. } NV_DX_VIDEO_STEREO_INFO;
  7520. //! Macro for constructing the version field of ::NV_DX_VIDEO_STEREO_INFO
  7521. #define NV_DX_VIDEO_STEREO_INFO_VER MAKE_NVAPI_VERSION(NV_DX_VIDEO_STEREO_INFO,1)
  7522. NVAPI_INTERFACE NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev,
  7523. NV_DX_VIDEO_STEREO_INFO *pStereoInfo);
  7524. //! @}
  7525. #endif //defined(_D3D9_H_) && defined(__cplusplus)
  7526. #if defined(__cplusplus) && defined(__d3d10_h__)
  7527. ///////////////////////////////////////////////////////////////////////////////
  7528. //
  7529. // FUNCTION NAME: NvAPI_D3D10_SetDepthBoundsTest
  7530. //
  7531. //! DESCRIPTION: This function enables/disables the depth bounds test.
  7532. //!
  7533. //!
  7534. //! SUPPORTED OS: Windows 7 and higher
  7535. //!
  7536. //!
  7537. //! \param [in] pDev The device to set the depth bounds test
  7538. //! \param [in] bEnable Enable(non-zero)/disable(zero) the depth bounds test
  7539. //! \param [in] fMinDepth The minimum depth for the depth bounds test
  7540. //! \param [in] fMaxDepth The maximum depth for the depth bounds test \n
  7541. //! The valid values for fMinDepth and fMaxDepth
  7542. //! are such that 0 <= fMinDepth <= fMaxDepth <= 1
  7543. //!
  7544. //! \return NVAPI_OK if the depth bounds test was correctly enabled or disabled
  7545. //!
  7546. //! \ingroup dx
  7547. ///////////////////////////////////////////////////////////////////////////////
  7548. NVAPI_INTERFACE NvAPI_D3D10_SetDepthBoundsTest(ID3D10Device *pDev,
  7549. NvU32 bEnable,
  7550. float fMinDepth,
  7551. float fMaxDepth);
  7552. #endif //defined(__cplusplus) && defined(__d3d10_h__)
  7553. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7554. ///////////////////////////////////////////////////////////////////////////////
  7555. //
  7556. // FUNCTION NAME: NvAPI_D3D11_IsNvShaderExtnOpCodeSupported
  7557. //
  7558. //! DESCRIPTION: This function checks if a nv HLSL shader extension opcode is
  7559. //! supported on current hardware. List of opcodes is in nvShaderExtnEnums.h
  7560. //! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
  7561. //! in the hlsl shader code. See nvHLSLExtns.h for more details on supported opcodes.
  7562. //!
  7563. //! This function can be called from a different thread than the one calling immediate device setstate functions.
  7564. //!
  7565. //! SUPPORTED OS: Windows 7 and higher
  7566. //!
  7567. //!
  7568. //! \param [in] pDev The device on which to query for support,
  7569. //! should be a ID3D11Device+ device
  7570. //! \param [in] opCode the opcode to check
  7571. //! \param [out] pSupported true if supported, false otherwise
  7572. //!
  7573. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  7574. //! If there are return error codes with specific meaning for this API, they are listed below.
  7575. //! \retval :: NVAPI_OK if the call succeeded
  7576. //!
  7577. //! \ingroup dx
  7578. ///////////////////////////////////////////////////////////////////////////////
  7579. NVAPI_INTERFACE NvAPI_D3D11_IsNvShaderExtnOpCodeSupported(__in IUnknown *pDev,
  7580. __in NvU32 opCode,
  7581. __out bool *pSupported);
  7582. #endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7583. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7584. ///////////////////////////////////////////////////////////////////////////////
  7585. //
  7586. // FUNCTION NAME: NvAPI_D3D11_SetNvShaderExtnSlot
  7587. //
  7588. //! DESCRIPTION: This function sets the fake UAV slot that is used by Nvidia HLSL
  7589. //! shader extensions globally. All createShader calls made to the driver after
  7590. //! setting this slot would treat writes/reads to this UAV in a
  7591. //! different way. Applications are expected to bind null UAV to this slot.
  7592. //! The same slot is used for all shader stages.
  7593. //! To disable shader extensions the app need to set this uav slot to 0xFFFFFFFF.
  7594. //! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
  7595. //! in the hlsl shader code. See nvHLSLExtns.h for more details.
  7596. //!
  7597. //! This function can be called from a different thread than the one calling immediate device setstate functions.
  7598. //!
  7599. //! SUPPORTED OS: Windows 7 and higher
  7600. //!
  7601. //!
  7602. //! \param [in] pDev The device for which to set the extension slot
  7603. //! should be a ID3D11Device+ device
  7604. //! \param [in] uavSlot the uav slot to use
  7605. //!
  7606. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  7607. //! If there are return error codes with specific meaning for this API, they are listed below.
  7608. //! \retval :: NVAPI_OK : success, the uavSlot was set sucessfully
  7609. //!
  7610. //! \ingroup dx
  7611. ///////////////////////////////////////////////////////////////////////////////
  7612. NVAPI_INTERFACE NvAPI_D3D11_SetNvShaderExtnSlot(__in IUnknown *pDev,
  7613. __in NvU32 uavSlot);
  7614. #endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7615. #if defined (__cplusplus) && defined (__d3d12_h__)
  7616. ///////////////////////////////////////////////////////////////////////////////
  7617. //
  7618. // FUNCTION NAME: NvAPI_D3D12_SetNvShaderExtnSlotSpace
  7619. //
  7620. //! DESCRIPTION: This function is specifically created for ray tracing since we do not
  7621. //! currently support PSOs with DXR.
  7622. //! This function sets the device's fake UAV slot and space that is used by Nvidia HLSL
  7623. //! shader extensions globally. All state objects created by the driver after
  7624. //! setting this slot would treat writes/reads to this UAV in a
  7625. //! different way. Applications are expected to bind null UAV to this slot.
  7626. //! The same slot is used for all shader stages.
  7627. //! To disable shader extensions the app need to set this uav slot to 0xFFFFFFFF.
  7628. //! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
  7629. //! in the hlsl shader code. See nvHLSLExtns.h for more details.
  7630. //!
  7631. //! This function can be called from a different thread than the one calling immediate device setstate functions.
  7632. //!
  7633. //! SUPPORTED OS: Windows 7 and higher
  7634. //!
  7635. //!
  7636. //! \param [in] pDev The device for which to set the extension slot
  7637. //! should be a ID3D12Device+ device
  7638. //! \param [in] uavSlot The uav slot to use
  7639. //! \param [in] uavSpace The uav space to use
  7640. //!
  7641. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  7642. //! If there are return error codes with specific meaning for this API, they are listed below.
  7643. //! \retval :: NVAPI_OK : success, the uavSlot and uavSpace were set sucessfully
  7644. //!
  7645. //! \ingroup dx
  7646. ///////////////////////////////////////////////////////////////////////////////
  7647. NVAPI_INTERFACE NvAPI_D3D12_SetNvShaderExtnSlotSpace(__in IUnknown *pDev,
  7648. __in NvU32 uavSlot,
  7649. __in NvU32 uavSpace);
  7650. ///////////////////////////////////////////////////////////////////////////////
  7651. //
  7652. // FUNCTION NAME: NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread
  7653. //
  7654. //! DESCRIPTION: This function is specifically created for ray tracing shaders since we do not
  7655. //! currently support PSOs with DXR.
  7656. //! This function sets the device's fake UAV slot that is used by Nvidia HLSL
  7657. //! shader extensions on local thread. All state objects created by the driver
  7658. //! on the same thread that call this function after setting this slot would treat writes/reads
  7659. //! to this UAV in a different way.
  7660. //! Applications are expected to bind null UAV to this slot.
  7661. //! The same slot is used for all shader stages for the device.
  7662. //! To disable shader extensions the app may set this uav slot to 0xFFFFFFFF.
  7663. //! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
  7664. //! in the hlsl shader code. See nvHLSLExtns.h for more details.
  7665. //!
  7666. //! This function can be called from a different thread than the one calling immediate device setstate functions.
  7667. //!
  7668. //! SUPPORTED OS: Windows 7 and higher
  7669. //!
  7670. //!
  7671. //!
  7672. //! \since Release: 387
  7673. //!
  7674. //! \param [in] pDev The device for which to set the extension slot
  7675. //! should be a ID3D12Device+ device
  7676. //! \param [in] uavSlot the uav slot to use
  7677. //! \param [in] uavSpace the uav space to use
  7678. //!
  7679. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  7680. //! If there are return error codes with specific meaning for this API, they are listed below.
  7681. //! \retval :: NVAPI_OK : success, the uavSlot and uavSpace were set sucessfully
  7682. //!
  7683. //! \ingroup dx
  7684. ///////////////////////////////////////////////////////////////////////////////
  7685. NVAPI_INTERFACE NvAPI_D3D12_SetNvShaderExtnSlotSpaceLocalThread(__in IUnknown *pDev,
  7686. __in NvU32 uavSlot,
  7687. __in NvU32 uavSpace);
  7688. #endif //defined (__cplusplus) && defined (__d3d12_h__)
  7689. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7690. ///////////////////////////////////////////////////////////////////////////////
  7691. //
  7692. // FUNCTION NAME: NvAPI_D3D11_SetNvShaderExtnSlotLocalThread
  7693. //
  7694. //! DESCRIPTION: This function sets the fake UAV slot that is used by Nvidia HLSL
  7695. //! shader extensions on local thread. All createShader calls on the same thread
  7696. //! that calls this function after setting this slot would treat writes/reads
  7697. //! to this UAV in a different way.
  7698. //! Applications are expected to bind null UAV to this slot.
  7699. //! The same slot is used for all shader stages.
  7700. //! To disable shader extensions the app may set this uav slot to 0xFFFFFFFF.
  7701. //! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
  7702. //! in the hlsl shader code. See nvHLSLExtns.h for more details.
  7703. //!
  7704. //! This function can be called from a different thread than the one calling immediate device setstate functions.
  7705. //!
  7706. //! SUPPORTED OS: Windows 7 and higher
  7707. //!
  7708. //!
  7709. //! \since Release: 387
  7710. //!
  7711. //! \param [in] pDev The device for which to set the extension slot
  7712. //! should be a ID3D11Device+ device
  7713. //! \param [in] uavSlot the uav slot to use
  7714. //!
  7715. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  7716. //! If there are return error codes with specific meaning for this API, they are listed below.
  7717. //! \retval :: NVAPI_OK : success, the uavSlot was set sucessfully
  7718. //!
  7719. //! \ingroup dx
  7720. ///////////////////////////////////////////////////////////////////////////////
  7721. NVAPI_INTERFACE NvAPI_D3D11_SetNvShaderExtnSlotLocalThread(__in IUnknown *pDev,
  7722. __in NvU32 uavSlot);
  7723. #endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7724. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7725. ///////////////////////////////////////////////////////////////////////////////
  7726. //
  7727. // FUNCTION NAME: NvAPI_D3D11_BeginUAVOverlapEx
  7728. //
  7729. //! DESCRIPTION: Causes the driver to skip synchronization that is normally needed when accessing UAVs.
  7730. //! Applications must use this with caution otherwise this might cause data hazards when
  7731. //! multiple draw calls/compute shader launches are accessing same memory locations
  7732. //!
  7733. //! SUPPORTED OS: Windows 7 and higher
  7734. //!
  7735. //!
  7736. //! \param [in] *pDeviceOrContext pointer to D3D11 device, or D3D11 device context
  7737. //! \param [in] insertWFIFlags bit fields to indicate which WFI would be inserted (gfx / compute / both).
  7738. //!
  7739. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  7740. //! If there are return error codes with specific meaning for this API, they are listed below.
  7741. //!
  7742. //! \ingroup dx
  7743. ///////////////////////////////////////////////////////////////////////////////
  7744. typedef enum _NVAPI_D3D11_INSERTWFI_FLAG
  7745. {
  7746. NVAPI_D3D_BEGIN_UAV_OVERLAP_NO_WFI = 0x00000000, //!< no WFI
  7747. NVAPI_D3D_BEGIN_UAV_OVERLAP_GFX_WFI = 0x00000001, //!< (bit 0) force graphics WFI
  7748. NVAPI_D3D_BEGIN_UAV_OVERLAP_COMP_WFI = 0x00000002, //!< (bit 1) force compute WFI
  7749. } NVAPI_D3D11_INSERTWFI_FLAG;
  7750. NVAPI_INTERFACE NvAPI_D3D11_BeginUAVOverlapEx(__in IUnknown *pDeviceOrContext, __in NvU32 insertWFIFlags);
  7751. #endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7752. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7753. ///////////////////////////////////////////////////////////////////////////////
  7754. //
  7755. // FUNCTION NAME: NvAPI_D3D11_BeginUAVOverlap
  7756. //
  7757. //! DESCRIPTION: Causes the driver to skip synchronization that is normally needed when accessing UAVs.
  7758. //! Applications must use this with caution otherwise this might cause data hazards when
  7759. //! multiple draw calls/compute shader launches are accessing same memory locations
  7760. //!
  7761. //! SUPPORTED OS: Windows 7 and higher
  7762. //!
  7763. //!
  7764. //! \param [in] *pDeviceOrContext pointer to D3D11 device, or D3D11 device context
  7765. //!
  7766. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  7767. //! If there are return error codes with specific meaning for this API, they are listed below.
  7768. //!
  7769. //! \ingroup dx
  7770. ///////////////////////////////////////////////////////////////////////////////
  7771. NVAPI_INTERFACE NvAPI_D3D11_BeginUAVOverlap(__in IUnknown *pDeviceOrContext);
  7772. #endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7773. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7774. ///////////////////////////////////////////////////////////////////////////////
  7775. //
  7776. // FUNCTION NAME: NvAPI_D3D11_EndUAVOverlap
  7777. //
  7778. //! DESCRIPTION: Re-enables driver synchronization between calls that access same UAVs
  7779. //! See NvAPI_D3D_BeginUAVOverlap for more details.
  7780. //!
  7781. //! SUPPORTED OS: Windows 7 and higher
  7782. //!
  7783. //!
  7784. //! \param [in] *pDeviceOrContext pointer to D3D11 device, or D3D11 device context
  7785. //!
  7786. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  7787. //! If there are return error codes with specific meaning for this API, they are listed below.
  7788. //!
  7789. //! \ingroup dx
  7790. ///////////////////////////////////////////////////////////////////////////////
  7791. NVAPI_INTERFACE NvAPI_D3D11_EndUAVOverlap(__in IUnknown *pDeviceOrContext);
  7792. #endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  7793. #if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
  7794. ///////////////////////////////////////////////////////////////////////////////
  7795. //
  7796. // FUNCTION NAME: NvAPI_D3D_SetFPSIndicatorState
  7797. //
  7798. //! DESCRIPTION: Display an overlay that tracks the number of times the app presents per second, or,
  7799. //! the number of frames-per-second (FPS)
  7800. //!
  7801. //! SUPPORTED OS: Windows 7 and higher
  7802. //!
  7803. //!
  7804. //! \param [in] bool Whether or not to enable the fps indicator.
  7805. //!
  7806. //! \return ::NVAPI_OK,
  7807. //! ::NVAPI_ERROR
  7808. //!
  7809. //! \ingroup dx
  7810. ///////////////////////////////////////////////////////////////////////////////
  7811. NVAPI_INTERFACE NvAPI_D3D_SetFPSIndicatorState(IUnknown *pDev, NvU8 doEnable);
  7812. #endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
  7813. #if defined(_D3D9_H_)
  7814. ///////////////////////////////////////////////////////////////////////////////
  7815. //
  7816. // FUNCTION NAME: NvAPI_D3D9_Present
  7817. //
  7818. //! DESCRIPTION: This API presents the contents of the next buffer in the sequence of back buffers
  7819. //! owned by a IDirect3DDevice9 device.
  7820. //! This Present operation supports using a SwapGroup and SwapBarrier on the SwapChain
  7821. //! that owns the back buffer to be presented.
  7822. //!
  7823. //! NOTE: NvAPI_D3D9_Present is a wrapper of the method IDirect3DDevice9::Present which
  7824. //! additionally notifies the D3D driver of the SwapChain used by the runtime for
  7825. //! presentation, thus allowing the D3D driver to apply SwapGroup and SwapBarrier
  7826. //! functionality to that SwapChain.
  7827. //!
  7828. //! SUPPORTED OS: Windows 7 and higher
  7829. //!
  7830. //!
  7831. //! \param [in] pDevice The IDirect3DDevice9 interface that is used to issue the Present,
  7832. //! using the following IDirect3DDevice9::Present input parameters
  7833. //! \param [in] pSwapChain Optional pointer to a IDirect3DSwapChain9 interface. If provided, the presentation is executed
  7834. //! using this interface (i.e. pSwapChain->Present()) for the given swapchain only.
  7835. //! If NULL, the presentation is executed on the device for all swapchains as in pDevice->Present()
  7836. //! \param [in] pSourceRect A pointer to a RECT structure containing the source rectangle.
  7837. //! If NULL, the entire source surface is presented.
  7838. //! \param [in] pDestRect A pointer to a RECT structure containing the destination rectangle, in window client coordinates.
  7839. //! If NULL, the entire client area is filled.
  7840. //! \param [in] hDestWindowOverride A pointer to a destination window whose client area is taken as the target for this presentation.
  7841. //! If this value is NULL, then the hWndDeviceWindow member of D3DPRESENT_PARAMTERS is taken.
  7842. //! \param [in] pDirtyRegion (IN) A pointer to a region to be presented. It must be NULL unless the swap chain was reated with
  7843. //! D3DSWAPEFFECT_COPY. If this value is non-NULL, the contained region is expressed in back buffer coordinates.
  7844. //!
  7845. //! \retval ::NVAPI_OK the Present operation was successfully executed
  7846. //! \retval ::NVAPI_D3D_DEVICE_LOST D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET, the caller has to reset device
  7847. //! \retval ::NVAPI_DEVICE_BUSY the Present operation failed with an error other than D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET
  7848. //! \retval ::NVAPI_ERROR the communication with the D3D driver failed, SwapGroup/SwapBarrier may not be possible.
  7849. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  7850. //!
  7851. //!\ingroup dx
  7852. ///////////////////////////////////////////////////////////////////////////////
  7853. NVAPI_INTERFACE NvAPI_D3D9_Present(IDirect3DDevice9 *pDevice,
  7854. IDirect3DSwapChain9 *pSwapChain,
  7855. const RECT *pSourceRect,
  7856. const RECT *pDestRect,
  7857. HWND hDestWindowOverride,
  7858. const RGNDATA *pDirtyRegion);
  7859. #endif //if defined(_D3D9_H_)
  7860. #if defined(_D3D9_H_)
  7861. ///////////////////////////////////////////////////////////////////////////////
  7862. //
  7863. // FUNCTION NAME: NvAPI_D3D9_QueryFrameCount
  7864. //
  7865. //! DESCRIPTION: This API queries the universal framecounter of the Quadro-Sync master device.
  7866. //!
  7867. //! \param [in] pDevice The caller provides the DX9 device that has access to the Quadro-Sync device
  7868. //! \param [out] pFrameCount The caller provides the storage space where the framecount is stored.
  7869. //!
  7870. //! SUPPORTED OS: Windows 7 and higher
  7871. //!
  7872. //!
  7873. //! \retval ::NVAPI_OK *pFrameCount populated with framecount value.
  7874. //! \retval ::NVAPI_ERROR The operation failed.
  7875. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  7876. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  7877. //!
  7878. //! \ingroup dx
  7879. ///////////////////////////////////////////////////////////////////////////////
  7880. NVAPI_INTERFACE NvAPI_D3D9_QueryFrameCount(IDirect3DDevice9 *pDevice,
  7881. NvU32 *pFrameCount);
  7882. #endif //if defined(_D3D9_H_)
  7883. #if defined(_D3D9_H_)
  7884. ///////////////////////////////////////////////////////////////////////////////
  7885. //
  7886. // FUNCTION NAME: NvAPI_D3D9_ResetFrameCount
  7887. //
  7888. //! DESCRIPTION: This API resets the universal framecounter on the Quadro-Sync master device.
  7889. //!
  7890. //! \param [in] pDevice The caller provides the DX9 device that has access to the Quadro-Sync device
  7891. //!
  7892. //! SUPPORTED OS: Windows 7 and higher
  7893. //!
  7894. //!
  7895. //! \retval ::NVAPI_OK framecounter has been reset
  7896. //! \retval ::NVAPI_ERROR The operation failed.
  7897. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  7898. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  7899. //!
  7900. //! \ingroup dx
  7901. ///////////////////////////////////////////////////////////////////////////////
  7902. NVAPI_INTERFACE NvAPI_D3D9_ResetFrameCount(IDirect3DDevice9 *pDevice);
  7903. #endif //if defined(_D3D9_H_)
  7904. #if defined(_D3D9_H_)
  7905. ///////////////////////////////////////////////////////////////////////////////
  7906. //
  7907. // FUNCTION NAME: NvAPI_D3D9_QueryMaxSwapGroup
  7908. //
  7909. //! DESCRIPTION: This API queries the number of supported SwapGroups and SwapBarriers in the graphics system.
  7910. //!
  7911. //! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client
  7912. //! \param [out] pMaxGroups The caller provides the storage space where the number of available SwapGroups is stored.
  7913. //! \param [out] pMaxBarriers The caller provides the storage space where the number of available SwapBarriers is stored.
  7914. //!
  7915. //! SUPPORTED OS: Windows 7 and higher
  7916. //!
  7917. //!
  7918. //! \retval ::NVAPI_OK the number of SwapGroups and SwapBarriers has been stored
  7919. //! \retval ::NVAPI_ERROR The operation failed.
  7920. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  7921. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  7922. //!
  7923. //! \ingroup dx
  7924. ///////////////////////////////////////////////////////////////////////////////
  7925. NVAPI_INTERFACE NvAPI_D3D9_QueryMaxSwapGroup(IDirect3DDevice9 *pDevice,
  7926. NvU32 *pMaxGroups,
  7927. NvU32 *pMaxBarriers);
  7928. #endif //if defined(_D3D9_H_)
  7929. #if defined(_D3D9_H_)
  7930. ///////////////////////////////////////////////////////////////////////////////
  7931. //
  7932. // FUNCTION NAME: NvAPI_D3D9_QuerySwapGroup
  7933. //
  7934. //! DESCRIPTION: This API queries the current SwapGroup and SwapBarrier that a SwapChain of a specific client device is bound to.
  7935. //!
  7936. //! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client
  7937. //! \param [in] pSwapChain The caller provides the IDirect3DSwapChain9 interface as a handle to the SwapChain
  7938. //! that belongs to the swapgroup client device
  7939. //! \param [out] pSwapGroup The caller provides the storage space where the current SwapGroup is stored.
  7940. //! \param [out] pSwapBarrier The caller provides the storage space where the current SwapBarrier is stored.
  7941. //!
  7942. //! SUPPORTED OS: Windows 7 and higher
  7943. //!
  7944. //!
  7945. //! \retval ::NVAPI_OK the current SwapGroup and SwapBarrier has been stored
  7946. //! \retval ::NVAPI_ERROR The operation failed.
  7947. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  7948. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  7949. //!
  7950. //! \ingroup dx
  7951. ///////////////////////////////////////////////////////////////////////////////
  7952. NVAPI_INTERFACE NvAPI_D3D9_QuerySwapGroup(IDirect3DDevice9 *pDevice,
  7953. IDirect3DSwapChain9 *pSwapChain,
  7954. NvU32 *pSwapGroup,
  7955. NvU32 *pSwapBarrier);
  7956. #endif //if defined(_D3D9_H_)
  7957. #if defined(_D3D9_H_)
  7958. ///////////////////////////////////////////////////////////////////////////////
  7959. //
  7960. // FUNCTION NAME: NvAPI_D3D9_JoinSwapGroup
  7961. //
  7962. //! DESCRIPTION: This API causes the SwapChain of a SwapGroup client to join or leave the specified SwapGroup.
  7963. //!
  7964. //! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client
  7965. //! \param [in] pSwapChain The caller provides the IDirect3DSwapChain9 interface as a handle to the SwapChain
  7966. //! that belongs to the swapgroup client device
  7967. //! \param [in] group The caller specifies the SwapGroup which the SwapChain should join.
  7968. //! - If the value of group is zero, the SwapChain leaves the SwapGroup.
  7969. //! - The SwapChain joins a SwapGroup if the SwapGroup number is a positive integer less than or
  7970. //! equal to the maximum number of SwapGroups queried by NvAPI_SwapGroup_QueryMaxSwapGroup.
  7971. //! \param [in] blocking The caller specifies that a presentation of this SwapChain should return immediately or block
  7972. //! until all members of the SwapGroup are ready and the presentation was actually executed.
  7973. //! A boolean value of false means the Present operation returns immediately and a value of true
  7974. //! means the Present operation is blocking.
  7975. //!
  7976. //! SUPPORTED OS: Windows 7 and higher
  7977. //!
  7978. //!
  7979. //! \retval ::NVAPI_OK the SwapChain joined/left the SwapGroup accordingly
  7980. //! \retval ::NVAPI_ERROR The operation failed.
  7981. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  7982. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  7983. //!
  7984. //! \ingroup dx
  7985. ///////////////////////////////////////////////////////////////////////////////
  7986. NVAPI_INTERFACE NvAPI_D3D9_JoinSwapGroup(IDirect3DDevice9 *pDevice,
  7987. IDirect3DSwapChain9 *pSwapChain,
  7988. NvU32 group,
  7989. BOOL blocking);
  7990. #endif //if defined(_D3D9_H_)
  7991. #if defined(_D3D9_H_)
  7992. ///////////////////////////////////////////////////////////////////////////////
  7993. //
  7994. // FUNCTION NAME: NvAPI_D3D9_BindSwapBarrier
  7995. //
  7996. //! DESCRIPTION: This API causes a SwapGroup to be bound to or released from the specified SwapBarrier.
  7997. //!
  7998. //! \param [in] pDevice The caller provides the DirectX 9 device that is used as a swapgroup client
  7999. //! \param [in] group The caller specifies the SwapGroup to be bound to the SwapBarrier.
  8000. //! \param [in] barrier The caller specifies the SwapBarrier that the SwapGroup should be bound to.
  8001. //! - If the value of barrier is zero, the SwapGroup will be released from the SwapBarrier.
  8002. //! - The SwapGroup will be bound to the SwapBarrier if the value of barrier is a positive
  8003. //! integer less than or equal to the maximum number of SwapBarriers queried by NvAPI_SwapGroup_QueryMaxSwapGroup.
  8004. //!
  8005. //! SUPPORTED OS: Windows 7 and higher
  8006. //!
  8007. //!
  8008. //! \retval ::NVAPI_OK the SwapGroup is bound to or released from the specified SwapBarrier
  8009. //! \retval ::NVAPI_ERROR The operation failed.
  8010. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  8011. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  8012. //!
  8013. //! \ingroup dx
  8014. ///////////////////////////////////////////////////////////////////////////////
  8015. NVAPI_INTERFACE NvAPI_D3D9_BindSwapBarrier(IDirect3DDevice9 *pDevice,
  8016. NvU32 group,
  8017. NvU32 barrier);
  8018. #endif //if defined(_D3D9_H_)
  8019. #if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8020. ///////////////////////////////////////////////////////////////////////////////
  8021. //
  8022. // FUNCTION NAME: NvAPI_D3D1x_Present
  8023. //
  8024. //! DESCRIPTION: Presents the contents of the next buffer in the sequence of back buffers
  8025. //! owned by a D3D device.
  8026. //! This Present operation supports using a SwapGroup and SwapBarrier on the SwapChain
  8027. //! that owns the back buffer to be presented.
  8028. //!
  8029. //! NOTE: NvAPI_D3D1x_Present is a wrapper of the method IDXGISwapChain::Present which
  8030. //! additionally notifies the D3D driver of the SwapChain used by the runtime for
  8031. //! presentation, thus allowing the D3D driver to apply SwapGroup and SwapBarrier
  8032. //! functionality to that SwapChain.
  8033. //!
  8034. //! SUPPORTED OS: Windows 7 and higher
  8035. //!
  8036. //!
  8037. //! \param [in] pDevice The D3D device interface that is used to issue the Present operation,
  8038. //! using the following IDirect3DDevice9::Present input parameters.
  8039. //! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
  8040. //! \param [in] pSwapChain The IDXGISwapChain interface that is intended to present
  8041. //! \param [in] SyncInterval An integer that specifies the how to synchronize presentation of a frame with the vertical blank.
  8042. //! Values are:
  8043. //! - 0: The presentation occurs immediately, there is no synchronization.
  8044. //! - 1,2,3,4 : Synchronize presentation after the n'th vertical blank.
  8045. //! \param [in] Flags An integer value that contains swap-chain presentation options as defined in DXGI_PRESENT.
  8046. //!
  8047. //! \retval ::NVAPI_OK the Present operation was successfully executed
  8048. //! \retval ::NVAPI_DEVICE_BUSY the Present operation failed with an error DXGI_ERROR_DEVICE_RESET or DXGI_ERROR_DEVICE_REMOVED,
  8049. // DXGI_STATUS_OCCLUDED, or D3DDDIERR_DEVICEREMOVED.
  8050. //! \retval ::NVAPI_ERROR the communication with the D3D driver failed, SwapGroup/SwapBarrier may not be possible.
  8051. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  8052. //!
  8053. //! \ingroup dx
  8054. ///////////////////////////////////////////////////////////////////////////////
  8055. NVAPI_INTERFACE NvAPI_D3D1x_Present(IUnknown *pDevice,
  8056. IDXGISwapChain *pSwapChain,
  8057. UINT SyncInterval,
  8058. UINT Flags);
  8059. #endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8060. #if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8061. ///////////////////////////////////////////////////////////////////////////////
  8062. //
  8063. // FUNCTION NAME: NvAPI_D3D1x_QueryFrameCount
  8064. //
  8065. //! DESCRIPTION: This API queries the universal framecounter of the Quadro-Sync master device.
  8066. //!
  8067. //! \param [in] pDevice The caller provides the D3D device that has access to the Quadro-Sync device,
  8068. //! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
  8069. //! \param [out] pFrameCount The caller provides the storage space where the framecount is stored.
  8070. //!
  8071. //! SUPPORTED OS: Windows 7 and higher
  8072. //!
  8073. //!
  8074. //! \retval ::NVAPI_OK *pFrameCount populated with framecount value.
  8075. //! \retval ::NVAPI_ERROR The operation failed.
  8076. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  8077. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  8078. //!
  8079. //! \ingroup dx
  8080. ///////////////////////////////////////////////////////////////////////////////
  8081. NVAPI_INTERFACE NvAPI_D3D1x_QueryFrameCount(IUnknown *pDevice,
  8082. NvU32 *pFrameCount);
  8083. #endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8084. #if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8085. ///////////////////////////////////////////////////////////////////////////////
  8086. //
  8087. // FUNCTION NAME: NvAPI_D3D1x_ResetFrameCount
  8088. //
  8089. //! DESCRIPTION: This API resets the universal framecounter on the Quadro-Sync master device.
  8090. //!
  8091. //! \param [in] pDevice The caller provides the D3D device that has access to the Quadro-Sync device,
  8092. //! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
  8093. //!
  8094. //! SUPPORTED OS: Windows 7 and higher
  8095. //!
  8096. //!
  8097. //! \retval ::NVAPI_OK framecounter has been reset
  8098. //! \retval ::NVAPI_ERROR The operation failed.
  8099. //! \retval ::NVAPI_INVALID_ARGUMENT pDevice arg passed in is invalid.
  8100. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  8101. //!
  8102. //! \ingroup dx
  8103. ///////////////////////////////////////////////////////////////////////////////
  8104. NVAPI_INTERFACE NvAPI_D3D1x_ResetFrameCount(IUnknown *pDevice);
  8105. #endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8106. #if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8107. ///////////////////////////////////////////////////////////////////////////////
  8108. //
  8109. // FUNCTION NAME: NvAPI_D3D1x_QueryMaxSwapGroup
  8110. //
  8111. //! DESCRIPTION: This API queries the number of supported SwapGroups and SwapBarriers in the graphics system.
  8112. //!
  8113. //! \param [in] pDevice The caller provides the D3D device that is intended to use SwapGroup functionality.
  8114. //! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
  8115. //! \param [out] pMaxGroups The caller provides the storage space where the number of available SwapGroups is stored.
  8116. //! \param [out] pMaxBarriers The caller provides the storage space where the number of available SwapBarriers is stored.
  8117. //!
  8118. //! SUPPORTED OS: Windows 7 and higher
  8119. //!
  8120. //!
  8121. //! \retval ::NVAPI_OK the number of SwapGroups and SwapBarriers has been stored
  8122. //! \retval ::NVAPI_ERROR The operation failed.
  8123. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  8124. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  8125. //!
  8126. //! \ingroup dx
  8127. ///////////////////////////////////////////////////////////////////////////////
  8128. NVAPI_INTERFACE NvAPI_D3D1x_QueryMaxSwapGroup(IUnknown *pDevice,
  8129. NvU32 *pMaxGroups,
  8130. NvU32 *pMaxBarriers);
  8131. #endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8132. #if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8133. ///////////////////////////////////////////////////////////////////////////////
  8134. //
  8135. // FUNCTION NAME: NvAPI_D3D1x_QuerySwapGroup
  8136. //
  8137. //! DESCRIPTION: This API queries the current SwapGroup and SwapBarrier that a SwapChain of a specific client device is bound to.
  8138. //!
  8139. //! \param [in] pDevice The caller provides the D3D device that owns the SwapChain used as a SwapGroup client.
  8140. //! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
  8141. //! \param [in] pSwapChain The IDXGISwapChain interface that is used as the SwapGroup client.
  8142. //!
  8143. //! \param [out] pSwapGroup The caller provides the storage space where the current SwapGroup is stored.
  8144. //! \param [out] pSwapBarrier The caller provides the storage space where the current SwapBarrier is stored.
  8145. //!
  8146. //! SUPPORTED OS: Windows 7 and higher
  8147. //!
  8148. //!
  8149. //! \retval ::NVAPI_OK the current SwapGroup and SwapBarrier has been stored
  8150. //! \retval ::NVAPI_ERROR The operation failed.
  8151. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  8152. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  8153. //!
  8154. //! \ingroup dx
  8155. ///////////////////////////////////////////////////////////////////////////////
  8156. NVAPI_INTERFACE NvAPI_D3D1x_QuerySwapGroup(IUnknown *pDevice,
  8157. IDXGISwapChain *pSwapChain,
  8158. NvU32 *pSwapGroup,
  8159. NvU32 *pSwapBarrier);
  8160. #endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8161. #if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8162. ///////////////////////////////////////////////////////////////////////////////
  8163. //
  8164. // FUNCTION NAME: NvAPI_D3D1x_JoinSwapGroup
  8165. //
  8166. //! DESCRIPTION: This API causes the SwapChain of a SwapGroup client to join or leave the specified SwapGroup.
  8167. //!
  8168. //! \param [in] pDevice The caller provides the D3D device that owns the SwapChain used as a SwapGroup client.
  8169. //! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
  8170. //! \param [in] pSwapChain The IDXGISwapChain interface that is used as the SwapGroup client.
  8171. //! \param [in] group The caller specifies the SwapGroup which the SwapChain should join.
  8172. //! - If the value of group is zero, the SwapChain leaves the SwapGroup.
  8173. //! - The SwapChain joins a SwapGroup if the SwapGroup number is a positive integer less than or
  8174. //! equal to the maximum number of SwapGroups queried by NvAPI_SwapGroup_QueryMaxSwapGroup.
  8175. //! \param [in] blocking The caller specifies that a presentation of this SwapChain should return immediately or block
  8176. //! until all members of the SwapGroup are ready and the presentation was actually executed.
  8177. //! A boolean value of false means the Present operation returns immediately and a value of true
  8178. //! means the Present operation is blocking.
  8179. //!
  8180. //! SUPPORTED OS: Windows 7 and higher
  8181. //!
  8182. //!
  8183. //! \retval ::NVAPI_OK the SwapChain joined/left the SwapGroup accordingly
  8184. //! \retval ::NVAPI_ERROR The operation failed.
  8185. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  8186. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  8187. //!
  8188. //! \ingroup dx
  8189. ///////////////////////////////////////////////////////////////////////////////
  8190. NVAPI_INTERFACE NvAPI_D3D1x_JoinSwapGroup(IUnknown *pDevice,
  8191. IDXGISwapChain *pSwapChain,
  8192. NvU32 group,
  8193. BOOL blocking);
  8194. #endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8195. #if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8196. ///////////////////////////////////////////////////////////////////////////////
  8197. //
  8198. // FUNCTION NAME: NvAPI_D3D1x_BindSwapBarrier
  8199. //
  8200. //! DESCRIPTION: This API causes a SwapGroup to be bound to or released from the specified SwapBarrier.
  8201. //!
  8202. //! \param [in] pDevice The caller provides the D3D device that owns the SwapChain used as a SwapGroup client.
  8203. //! pDevice can be either ID3D10Device or ID3D10Device1 or ID3D11Device or ID3D12Device.
  8204. //! \param [in] group The caller specifies the SwapGroup to be bound to the SwapBarrier.
  8205. //! \param [in] barrier The caller specifies the SwapBarrier that the SwapGroup should be bound to.
  8206. //! - If the value of barrier is zero, the SwapGroup releases the SwapBarrier.
  8207. //! - The SwapGroup will be bound to the SwapBarrier if the value of barrier is a positive
  8208. //! integer less than or equal to the maximum number of SwapBarriers queried by NvAPI_D3D1x_QueryMaxSwapGroup.
  8209. //! SUPPORTED OS: Windows 7 and higher
  8210. //!
  8211. //!
  8212. //! \retval ::NVAPI_OK the SwapGroup is bound to the specified SwapBarrier
  8213. //! \retval ::NVAPI_ERROR The operation failed.
  8214. //! \retval ::NVAPI_INVALID_ARGUMENT One or more args passed in are invalid.
  8215. //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI was not yet initialized.
  8216. //!
  8217. //! \ingroup dx
  8218. ///////////////////////////////////////////////////////////////////////////////
  8219. NVAPI_INTERFACE NvAPI_D3D1x_BindSwapBarrier(IUnknown *pDevice,
  8220. NvU32 group,
  8221. NvU32 barrier);
  8222. #endif // defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__) || defined(__d3d12_h__)
  8223. //! SUPPORTED OS: Windows 7 and higher
  8224. //!
  8225. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__))
  8226. enum NVAPI_QUAD_FILLMODE
  8227. {
  8228. NVAPI_QUAD_FILLMODE_DISABLED = 0,
  8229. NVAPI_QUAD_FILLMODE_BBOX = 1,
  8230. NVAPI_QUAD_FILLMODE_FULL_VIEWPORT = 2,
  8231. };
  8232. #endif //defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__))
  8233. //! SUPPORTED OS: Windows 7 and higher
  8234. //!
  8235. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  8236. typedef struct NvAPI_D3D11_RASTERIZER_DESC_EX
  8237. {
  8238. // D3D11_RASTERIZER_DESC member variables
  8239. D3D11_FILL_MODE FillMode;
  8240. D3D11_CULL_MODE CullMode;
  8241. BOOL FrontCounterClockwise;
  8242. INT DepthBias;
  8243. FLOAT DepthBiasClamp;
  8244. FLOAT SlopeScaledDepthBias;
  8245. BOOL DepthClipEnable;
  8246. BOOL ScissorEnable;
  8247. BOOL MultisampleEnable;
  8248. BOOL AntialiasedLineEnable;
  8249. // NvAPI_D3D11_RASTERIZER_DESC_EX specific member variables
  8250. NvU32 ForcedSampleCount; //<! Added DX 11.1, part of _DESC1 version of this struct.
  8251. bool ProgrammableSamplePositionsEnable; //<! enable Programmable Samples feature
  8252. bool InterleavedSamplingEnable; //<! when jitter is enabled, an app need to fill the whole arrays below, otherwise only as much entries as samples
  8253. 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
  8254. NvU8 SamplePositionsX[16]; //<! x positions in API sample order
  8255. NvU8 SamplePositionsY[16]; //<! y positions in API sample order
  8256. bool ConservativeRasterEnable; //<! rasterize all pixels a primitive touches in any way instead of just those with the centroid covered.
  8257. 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.
  8258. bool PostZCoverageEnable; //<! Enable pixel-shader input SV_COVERAGE to account for z-test in early-z mode.
  8259. bool CoverageToColorEnable; //<! Enable output of coverage to a color render-target.
  8260. NvU8 CoverageToColorRTIndex; //<! Index of RT for coverage-to-color.
  8261. 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.
  8262. NvU8 reserved[63]; //<! reserved for expansion, set to zero.
  8263. } NvAPI_D3D11_RASTERIZER_DESC_EX;
  8264. ///////////////////////////////////////////////////////////////////////////////
  8265. //
  8266. // FUNCTION NAME: NvAPI_D3D11_CreateRasterizerState
  8267. //
  8268. //! \code
  8269. //! DESCRIPTION: This function is an extension of ID3D11Device::CreateRasterizerState with additional raster states
  8270. //!
  8271. //! If programmable sample positions is used, to decompress the surface using the currently bound
  8272. //! programmable sample positions, use function NvAPI_D3D11_DecompressView.
  8273. //!
  8274. //! This function is free-threaded create compatible i.e. it can be called from a different thread
  8275. //! than the one calling immediate device setstate functions.
  8276. //!
  8277. //! \param [in] pDevice current d3d device
  8278. //! \param [in] pRasterizerDesc Rasterizer state description of type NVAPI_D3D11_RASTERIZER_DESC_EX
  8279. //! \param [out] ppRasterizerState ID3D11RasterizerState
  8280. //!
  8281. //!
  8282. //! \return ::NVAPI_OK if the call succeeds.
  8283. //! \endcode
  8284. //! \ingroup dx
  8285. ///////////////////////////////////////////////////////////////////////////////
  8286. NVAPI_INTERFACE NvAPI_D3D11_CreateRasterizerState(__in ID3D11Device *pDevice,
  8287. __in const NvAPI_D3D11_RASTERIZER_DESC_EX *pRasterizerDesc,
  8288. __out ID3D11RasterizerState **ppRasterizerState);
  8289. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  8290. //! SUPPORTED OS: Windows 7 and higher
  8291. //!
  8292. #if defined (__cplusplus) && (defined(_D3D9_H_) || defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__))
  8293. ///////////////////////////////////////////////////////////////////////////////
  8294. //
  8295. // FUNCTION NAME: NvAPI_D3D_ConfigureAnsel
  8296. //
  8297. //! \code
  8298. //! DESCRIPTION: This function configure the setting of AnselShim, including hotkey.
  8299. //!
  8300. //! \param [in] pDevice current d3d device (should be ID3D11Device, ID3D10Device, or ID3D12Device)
  8301. //! \param [in] pAnselConfig configuration of Ansel to be set, including hotkey setting
  8302. //!
  8303. //!
  8304. //! \return ::NVAPI_OK if the call succeeds.
  8305. //! \endcode
  8306. //! \ingroup dx
  8307. ///////////////////////////////////////////////////////////////////////////////
  8308. typedef enum _NVAPI_ANSEL_FEATURE
  8309. {
  8310. NVAPI_ANSEL_FEATURE_UNKNOWN = 0,
  8311. NVAPI_ANSEL_FEATURE_BLACK_AND_WHITE = 1,
  8312. NVAPI_ANSEL_FEATURE_HUDLESS = 2
  8313. } NVAPI_ANSEL_FEATURE;
  8314. typedef enum _NVAPI_ANSEL_FEATURE_STATE
  8315. {
  8316. NVAPI_ANSEL_FEATURE_STATE_UNKNOWN = 0,
  8317. NVAPI_ANSEL_FEATURE_STATE_ENABLE = 1, //!< Toggle feature on
  8318. NVAPI_ANSEL_FEATURE_STATE_DISABLE = 2 //!< Toggle feature off
  8319. } NVAPI_ANSEL_FEATURE_STATE;
  8320. typedef enum _NVAPI_ANSEL_HOTKEY_MODIFIER
  8321. {
  8322. NVAPI_ANSEL_HOTKEY_MODIFIER_UNKNOWN = 0,
  8323. NVAPI_ANSEL_HOTKEY_MODIFIER_CTRL = 1, //!< Use control in the hotkey combination
  8324. NVAPI_ANSEL_HOTKEY_MODIFIER_SHIFT = 2, //!< Use shift in the hotkey combination
  8325. NVAPI_ANSEL_HOTKEY_MODIFIER_ALT = 3 //!< Use alternate in the hotkey combination
  8326. } NVAPI_ANSEL_HOTKEY_MODIFIER;
  8327. typedef struct NVAPI_ANSEL_FEATURE_CONFIGURATION_STRUCT {
  8328. NVAPI_ANSEL_FEATURE featureId; //!< Id of the feature
  8329. NVAPI_ANSEL_FEATURE_STATE featureState; //!< Whether the feature is enabled or not
  8330. UINT hotkey; //!< An optional virtual key associated with this feature
  8331. } NVAPI_ANSEL_FEATURE_CONFIGURATION_STRUCT;
  8332. typedef struct NVAPI_ANSEL_CONFIGURATION_STRUCT_V1 {
  8333. NvU32 version; //!< Structure version
  8334. NVAPI_ANSEL_HOTKEY_MODIFIER hotkeyModifier; //!< Modifier key to use in hotkey combination
  8335. UINT keyEnable; //!< VKEY to enable/disable Ansel
  8336. UINT numAnselFeatures; //!< Number of features in pAnselFeatures
  8337. NVAPI_ANSEL_FEATURE_CONFIGURATION_STRUCT * pAnselFeatures; //!< Array of features configurations
  8338. } NVAPI_ANSEL_CONFIGURATION_STRUCT_V1;
  8339. typedef NVAPI_ANSEL_CONFIGURATION_STRUCT_V1 NVAPI_ANSEL_CONFIGURATION_STRUCT;
  8340. #define NVAPI_ANSEL_CONFIGURATION_STRUCT_VER1 MAKE_NVAPI_VERSION(NVAPI_ANSEL_CONFIGURATION_STRUCT_V1,1)
  8341. #define NVAPI_ANSEL_CONFIGURATION_STRUCT_VER NVAPI_ANSEL_CONFIGURATION_STRUCT_VER1
  8342. NVAPI_INTERFACE NvAPI_D3D_ConfigureAnsel(__in IUnknown *pDevice,
  8343. __in NVAPI_ANSEL_CONFIGURATION_STRUCT *pNLSConfig);
  8344. #endif //defined (__cplusplus) && (defined(_D3D9_H_) || defined(__d3d11_h__) || defined(__d3d11_1_h__) || defined(__d3d12_h__))
  8345. //! SUPPORTED OS: Windows 8 and higher
  8346. //!
  8347. #if defined (__cplusplus) && defined(__d3d11_2_h__)
  8348. ///////////////////////////////////////////////////////////////////////////////
  8349. //
  8350. // FUNCTION NAME: NvAPI_D3D11_CreateTiledTexture2DArray
  8351. //
  8352. //! \since Release: 375
  8353. //
  8354. //! \code
  8355. //! DESCRIPTION: Tiled resource is supported for Texture2D Array, however, but only when mip packing is not triggered.
  8356. //! So any mip level cannot be smaller than a single tile size(64KB).
  8357. //! This set of API is an extension of D3D11 support for tiled resource to allow a tiled texture2D array with mip packing.
  8358. //! If any of API from this set is used, using all of them is highly recommended.
  8359. //! It includes NvAPI_D3D11_CreateTiledTexture2DArray, NvAPI_D3D11_TiledTexture2DArrayGetDesc,
  8360. //! NvAPI_D3D11_UpdateTileMappings, NvAPI_D3D11_CopyTileMappings, NvAPI_D3D11_TiledResourceBarrier.
  8361. //! Reminder: all API in this set other than NvAPI_D3D11_CreateTiledTexture2DArray won't has D3D Debug Layer information.
  8362. //!
  8363. //! NvAPI_D3D11_CreateTiledTexture2DArray is an extension of ID3D11Device::CreateTexutre2D.
  8364. //! Use this function to create a tiled Texture2D array with mip packing.
  8365. //! Runtime doesn't know the created resource is actually a tiled resource.
  8366. //! Any other D3D11 API where runtime will check whether resource is tiled or not has a corresponding NVAPI version and they should be used.
  8367. //! Different from DX12 implementation, this API should only be called when creating a tiled texture2D array with mip packing.
  8368. //! Other normal tiled resource following D3D spec must use the standard ID3D11Device::CreateTexutre2D to create.
  8369. //!
  8370. //! \param [in] pDevice current d3d device
  8371. //! \param [in] pDesc The Texture2D Array descriptor, ArraySize > 1 && (pDesc->MiscFlags&D3D11_RESOURCE_MISC_TILED)
  8372. //! \param [in] pInitialData A pointer to an array of D3D11_SUBRESOURCE_DATA structures that describe subresources for the 2D texture resource.
  8373. //! \param [out] ppTexture2D A pointer to a buffer that receives a pointer to a ID3D11Texture2D interface for the created texture.
  8374. //!
  8375. //!
  8376. //! \return This API can return any of the error codes enumerated in
  8377. //! #NvAPI_Status. If there are return error codes with specific
  8378. //! meaning for this API, they are listed below.
  8379. //!
  8380. //! \endcode
  8381. //! \ingroup dx
  8382. ///////////////////////////////////////////////////////////////////////////////
  8383. NVAPI_INTERFACE NvAPI_D3D11_CreateTiledTexture2DArray(__in ID3D11Device *pDevice,
  8384. __in const D3D11_TEXTURE2D_DESC *pDesc,
  8385. __in const D3D11_SUBRESOURCE_DATA *pInitialData,
  8386. __out ID3D11Texture2D **ppTexture2D);
  8387. #endif //defined(__cplusplus) && defined(__d3d11_2_h__)
  8388. //! SUPPORTED OS: Windows 10 and higher
  8389. //!
  8390. #if defined (__cplusplus) && defined(__d3d11_h__)
  8391. typedef enum _NV_D3D11_FEATURE
  8392. {
  8393. NV_D3D11_FEATURE_RASTERIZER,
  8394. } NV_D3D11_FEATURE;
  8395. typedef struct _NV_D3D11_FEATURE_DATA_RASTERIZER_SUPPORT
  8396. {
  8397. BOOL TargetIndependentRasterWithDepth;
  8398. BOOL ProgrammableSamplePositions;
  8399. BOOL InterleavedSampling;
  8400. BOOL ConservativeRaster;
  8401. BOOL PostZCoverage;
  8402. BOOL CoverageToColor;
  8403. } NV_D3D11_FEATURE_DATA_RASTERIZER_SUPPORT;
  8404. ///////////////////////////////////////////////////////////////////////////////
  8405. //
  8406. // FUNCTION NAME: NvAPI_D3D11_CheckFeatureSupport
  8407. //
  8408. //! DESCRIPTION: This function gets information about the features that are supported by the current graphics driver.
  8409. //!
  8410. //!
  8411. //!
  8412. //! \param [in] pDevice The device on which to query for support.
  8413. //! \param [in] Feature A member of the NvAPI_D3D11_FEATURE enumerated type that describes which feature to query for suppor.
  8414. //! \param [in] pFeatureSupportData Upon completion of the method, the passed structure is filled with data that describes the feature support.
  8415. //! \param [out] FeatureSupportDataSize The size of the structure passed to the pFeatureSupportData parameter.
  8416. //!
  8417. //! \since Release: 410
  8418. //!
  8419. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  8420. //! \retval :: Returns NVAPI_OK if successful; returns NVAPI_INVALID_ARGUMENT if an unsupported data type is passed to the pFeatureSupportData parameter
  8421. //! or a size mismatch is detected for the FeatureSupportDataSize parameter;
  8422. //!
  8423. //! \ingroup dx
  8424. ///////////////////////////////////////////////////////////////////////////////
  8425. NVAPI_INTERFACE NvAPI_D3D11_CheckFeatureSupport(__in ID3D11Device *pDevice,
  8426. __in NV_D3D11_FEATURE Feature,
  8427. __out void *pFeatureSupportData,
  8428. __in UINT FeatureSupportDataSize);
  8429. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  8430. //! SUPPORTED OS: Windows 10 and higher
  8431. //!
  8432. #if defined (__cplusplus) && defined(__d3d11_h__)
  8433. ///////////////////////////////////////////////////////////////////////////////
  8434. //
  8435. // FUNCTION NAME: NvAPI_D3D11_CreateImplicitMSAATexture2D
  8436. //
  8437. //! \since Release: 410
  8438. //
  8439. //! \code
  8440. //! DESCRIPTION: NvAPI_D3D11_CreateImplicitMSAATexture2D is a simple wrapper of ID3D11Device::CreateTexture2D
  8441. //! which allows to create multisampled 2D texture that is exposed to DX runtime as non-multisampled texture.
  8442. //!
  8443. //! \param [in] pDevice Current d3d device
  8444. //! \param [in] pDesc A pointer to a D3D11_TEXTURE2D_DESC structure that describes a 2D texture resource.
  8445. //! To create a typeless resource that can be interpreted at runtime into different,
  8446. //! compatible formats, specify a typeless format in the texture description.
  8447. //! To generatemipmap levels automatically, set the number of mipmap levels to 0.
  8448. //! SampleDesc.SampleCount specifies actual resource sample count, while D3D runtime object
  8449. //! sees resource as non-multisampled.
  8450. //!
  8451. //! \param [out] ppTexture2D A pointer to a buffer that receives a pointer to a ID3D11Texture2D interface for the
  8452. //! created texture.
  8453. //!
  8454. //! \return This API can return any of the error codes enumerated in
  8455. //! #NvAPI_Status. See MSDN for the API specific error codes.
  8456. //!
  8457. //! \endcode
  8458. //! \ingroup dx
  8459. ///////////////////////////////////////////////////////////////////////////////
  8460. NVAPI_INTERFACE NvAPI_D3D11_CreateImplicitMSAATexture2D(__in ID3D11Device *pDevice,
  8461. __in const D3D11_TEXTURE2D_DESC *pDesc,
  8462. __out ID3D11Texture2D **ppTexture2D);
  8463. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  8464. //! SUPPORTED OS: Windows 10 and higher
  8465. //!
  8466. #if defined (__cplusplus) && defined(__d3d12_h__)
  8467. ///////////////////////////////////////////////////////////////////////////////
  8468. //
  8469. // FUNCTION NAME: NvAPI_D3D12_CreateImplicitMSAATexture2D
  8470. //
  8471. //! \since Release: 410
  8472. //
  8473. //! \code
  8474. //! DESCRIPTION: NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D is a simple wrapper of ID3D12Device::CreateCommittedResource
  8475. //! which allows to create multisampled 2D texture that is exposed to DX runtime as non-multisampled texture.
  8476. //!
  8477. //! \param [in] pDevice Current d3d device
  8478. //! \param [in] pDesc A pointer to a D3D12_RESOURCE_DESC structure that describes a 2D texture resource.
  8479. //! To create a typeless resource that can be interpreted at runtime into different,
  8480. //! compatible formats, specify a typeless format in the texture description.
  8481. //! To generatemipmap levels automatically, set the number of mipmap levels to 0.
  8482. //! SampleDesc.SampleCount specifies actual resource sample count, while D3D runtime object
  8483. //! sees resource as non-multisampled.
  8484. //! \param [in] pHeapProperties, HeapFlags, InitialResourceState, pOptimizedClearValue, riidResource See D3D12 docs
  8485. //!
  8486. //! \param [out] ppResource Same ID3D12Device::CreateCommittedResource
  8487. //!
  8488. //! \return This API can return any of the error codes enumerated in
  8489. //! #NvAPI_Status. See MSDN for the API specific error codes.
  8490. //!
  8491. //! \endcode
  8492. //! \ingroup dx
  8493. ///////////////////////////////////////////////////////////////////////////////
  8494. NVAPI_INTERFACE NvAPI_D3D12_CreateCommittedImplicitMSAATexture2D(
  8495. __in ID3D12Device* pDevice,
  8496. __in const D3D12_HEAP_PROPERTIES *pHeapProperties,
  8497. D3D12_HEAP_FLAGS HeapFlags,
  8498. __in const D3D12_RESOURCE_DESC *pDesc,
  8499. D3D12_RESOURCE_STATES InitialResourceState,
  8500. __in_opt const D3D12_CLEAR_VALUE *pOptimizedClearValue,
  8501. REFIID riidResource,
  8502. __out void **ppvResource);
  8503. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  8504. //! SUPPORTED OS: Windows 10 and higher
  8505. //!
  8506. //! \ingroup dx
  8507. //! Valid modes for NvAPI_D3D11_ResolveSubresourceRegion() and NvAPI_D3D12_ResolveSubresourceRegion
  8508. typedef enum _NV_RESOLVE_MODE {
  8509. NV_RESOLVE_MODE_SAMPLE_0,
  8510. } NV_RESOLVE_MODE;
  8511. #if defined (__cplusplus) && defined(__d3d11_h__)
  8512. ///////////////////////////////////////////////////////////////////////////////
  8513. //
  8514. // FUNCTION NAME: NvAPI_D3D11_ResolveSubresourceRegion
  8515. //
  8516. //! \since Release: 410
  8517. //
  8518. //! \code
  8519. //! DESCRIPTION: NvAPI_D3D11_ResolveSubresourceRegion is D3D11 an analog of D3D12 ResolveSubresourceRegion.
  8520. //!
  8521. //! \param [in] pDstResource Destination resource. Must be a created with the D3D11_USAGE_DEFAULT flag and be single-sampled.
  8522. //! \param [in] DstSubresource A zero-based index, that identifies the destination subresource. Use D3D11CalcSubresource to calculate the index.
  8523. //! \param [in] DstX The X coordinate of the left-most edge of the destination region.
  8524. //! The width of the destination region is the same as the width of the source rect.
  8525. //!
  8526. //! \param [in] DstY The Y coordinate of the top-most edge of the destination region.
  8527. //! The height of the destination region is the same as the height of the source rect.
  8528. //!
  8529. //! \param [in] pSrcResource Source resource. Must be multisampled.
  8530. //! \param [in] SrcSubresource The source subresource of the source resource.
  8531. //! \param [in] pSrcRect Specifies the rectangular region of the source resource to be resolved.
  8532. //! Passing NULL for pSrcRect specifies that the entire subresource is to be resolved.
  8533. //!
  8534. //! \param [in] Format A DXGI_FORMAT that indicates how the multisampled resource will be resolved to a single-sampled resource.
  8535. //! \param [in] ResolveMode Specifies the operation used to resolve the source samples. NV_RESOLVE_MODE_SAMPLE_0 is the only supported mode.
  8536. //! NV_RESOLVE_MODE_SAMPLE_0 outputs sample 0 and discards all other samples.
  8537. //!
  8538. //! \return This API can return any of the error codes enumerated in
  8539. //! #NvAPI_Status. See MSDN for the API specific error codes.
  8540. //!
  8541. //! \endcode
  8542. //! \ingroup dx
  8543. ///////////////////////////////////////////////////////////////////////////////
  8544. NVAPI_INTERFACE NvAPI_D3D11_ResolveSubresourceRegion(
  8545. __in ID3D11Device *pDevice,
  8546. __in ID3D11Texture2D *pDstResource,
  8547. __in UINT DstSubresource,
  8548. __in UINT DstX,
  8549. __in UINT DstY,
  8550. __in ID3D11Texture2D *pSrcResource,
  8551. __in UINT SrcSubresource,
  8552. __in_opt const RECT *pSrcRect,
  8553. __in DXGI_FORMAT Format,
  8554. __in NV_RESOLVE_MODE ResolveMode);
  8555. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  8556. //! SUPPORTED OS: Windows 10 and higher
  8557. //!
  8558. #if defined (__cplusplus) && defined(__d3d12_h__)
  8559. ///////////////////////////////////////////////////////////////////////////////
  8560. //
  8561. // FUNCTION NAME: NvAPI_D3D12_ResolveSubresourceRegion
  8562. //
  8563. //! \since Release: 410
  8564. //
  8565. //! \code
  8566. //! DESCRIPTION: NvAPI_D3D12_ResolveSubresourceRegion is D3D11 an analog of D3D12 ResolveSubresourceRegion.
  8567. //!
  8568. //! \param [in] pDstResource Destination resource. Must be a created with the D3D11_USAGE_DEFAULT flag and be single-sampled.
  8569. //! \param [in] DstSubresource A zero-based index, that identifies the destination subresource. Use D3D11CalcSubresource to calculate the index.
  8570. //! \param [in] DstX The X coordinate of the left-most edge of the destination region.
  8571. //! The width of the destination region is the same as the width of the source rect.
  8572. //!
  8573. //! \param [in] DstY The Y coordinate of the top-most edge of the destination region.
  8574. //! The height of the destination region is the same as the height of the source rect.
  8575. //!
  8576. //! \param [in] pSrcResource Source resource. Must be multisampled.
  8577. //! \param [in] SrcSubresource The source subresource of the source resource.
  8578. //! \param [in] pSrcRect Specifies the rectangular region of the source resource to be resolved.
  8579. //! Passing NULL for pSrcRect specifies that the entire subresource is to be resolved.
  8580. //!
  8581. //! \param [in] Format A DXGI_FORMAT that indicates how the multisampled resource will be resolved to a single-sampled resource.
  8582. //! \param [in] ResolveMode Specifies the operation used to resolve the source samples. NV_RESOLVE_MODE_SAMPLE_0 is the only supported mode.
  8583. //! NV_RESOLVE_MODE_SAMPLE_0 outputs sample 0 and discards all other samples.
  8584. //!
  8585. //! \return This API can return any of the error codes enumerated in
  8586. //! #NvAPI_Status. See MSDN for the API specific error codes.
  8587. //!
  8588. //! \endcode
  8589. //! \ingroup dx
  8590. ///////////////////////////////////////////////////////////////////////////////
  8591. NVAPI_INTERFACE NvAPI_D3D12_ResolveSubresourceRegion(
  8592. __in ID3D12GraphicsCommandList1*pCommandList,
  8593. __in ID3D12Resource *pDstResource,
  8594. __in UINT DstSubresource,
  8595. __in UINT DstX,
  8596. __in UINT DstY,
  8597. __in ID3D12Resource *pSrcResource,
  8598. __in UINT SrcSubresource,
  8599. __in_opt RECT *pSrcRect,
  8600. __in DXGI_FORMAT Format,
  8601. __in NV_RESOLVE_MODE ResolveMode);
  8602. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  8603. //! SUPPORTED OS: Windows 8 and higher
  8604. //!
  8605. #if defined (__cplusplus) && defined(__d3d11_2_h__)
  8606. ///////////////////////////////////////////////////////////////////////////////
  8607. //
  8608. // FUNCTION NAME: NvAPI_D3D11_TiledTexture2DArrayGetDesc
  8609. //
  8610. //! \since Release: 375
  8611. //
  8612. //! \code
  8613. //! DESCRIPTION: NvAPI_D3D11_TiledTexture2DArrayGetDesc is an simple wrapper of ID3D11Texture2D::GetDesc
  8614. //! when pTiledTexture2DArray is created with NvAPI_D3D11_CreateTiledTexture2DArray.
  8615. //! Runtime doesn't know the created resource is actually a tiled resource.
  8616. //! So calling ID3D11Texture2D::GetDesc will get a desc without D3D11_RESOURCE_MISC_TILED in MiscFlags.
  8617. //! This wrapper API just adds D3D11_RESOURCE_MISC_TILED back.
  8618. //!
  8619. //! \param [in] pTiledTexture2DArray Pointer of tiled texture2D array to get resource desc from.
  8620. //! \param [out] pDesc Pointer to a resource description.
  8621. //!
  8622. //!
  8623. //! \return This API can return any of the error codes enumerated in
  8624. //! #NvAPI_Status. If there are return error codes with specific
  8625. //! meaning for this API, they are listed below.
  8626. //!
  8627. //! \endcode
  8628. //! \ingroup dx
  8629. ///////////////////////////////////////////////////////////////////////////////
  8630. NVAPI_INTERFACE NvAPI_D3D11_TiledTexture2DArrayGetDesc(__in ID3D11Texture2D *pTiledTexture2DArray,
  8631. __out D3D11_TEXTURE2D_DESC *pDesc);
  8632. #endif //defined(__cplusplus) && defined(__d3d11_2_h__)
  8633. //! SUPPORTED OS: Windows 8 and higher
  8634. //!
  8635. #if defined (__cplusplus) && defined(__d3d11_2_h__)
  8636. ///////////////////////////////////////////////////////////////////////////////
  8637. //
  8638. // FUNCTION NAME: NvAPI_D3D11_UpdateTileMappings
  8639. //
  8640. //! \since Release: 375
  8641. //
  8642. //! \code
  8643. //! DESCRIPTION: NvAPI_D3D11_UpdateTileMappings is an extension of ID3D11DeviceContext2::UpdateTileMappings.
  8644. //! It allows pTiledResource to be a resource created with NvAPI_D3D11_CreateTiledTexture2DArray, and should be used only in such case.
  8645. //!
  8646. //! \param [in] pDeviceContext Must be Immediate DeviceContext.
  8647. //! \param [in] pTiledResource A pointer to the tiled texture 2D array resource created by NvAPI_D3D11_CreateTiledTexture2DArray.
  8648. //! \param [in] NumTiledResourceRegions The number of tiled resource regions.
  8649. //! \param [in] pTiledResourceRegionStartCoordinates An array of D3D11_TILED_RESOURCE_COORDINATE structures that describe the starting coordinates of the tiled resource regions. Cannot be NULL.
  8650. //! \param [in] pTiledResourceRegionSizes An array of D3D11_TILE_REGION_SIZE structures that describe the sizes of the tiled resource regions. Cannot be NULL.
  8651. //! \param [in] pTilePool A pointer to the tile pool. This resource should be created by standard API.
  8652. //! \param [in] NumRanges The number of tile-pool ranges.
  8653. //! \param [in] pRangeFlags An array of D3D11_TILE_RANGE_FLAG values that describe each tile-pool range.
  8654. //! \param [in] pTilePoolStartOffsets An array of offsets into the tile pool. These are 0-based tile offsets, counting in tiles (not bytes).
  8655. //! \param [in] pRangeTileCounts An array of values that specify the number of tiles in each tile-pool range.
  8656. //! \param [in] Flags A combination of D3D11_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation.
  8657. //!
  8658. //!
  8659. //! \return This API can return any of the error codes enumerated in
  8660. //! #NvAPI_Status. If there are return error codes with specific
  8661. //! meaning for this API, they are listed below.
  8662. //!
  8663. //! \endcode
  8664. //! \ingroup dx
  8665. ///////////////////////////////////////////////////////////////////////////////
  8666. NVAPI_INTERFACE NvAPI_D3D11_UpdateTileMappings(
  8667. __in ID3D11DeviceContext2 *pDeviceContext,
  8668. __in ID3D11Resource *pTiledResource,
  8669. __in UINT NumTiledResourceRegions,
  8670. __in const D3D11_TILED_RESOURCE_COORDINATE *pTiledResourceRegionStartCoordinates,
  8671. __in const D3D11_TILE_REGION_SIZE *pTiledResourceRegionSizes,
  8672. __in ID3D11Buffer *pTilePool,
  8673. __in UINT NumRanges,
  8674. __in const UINT *pRangeFlags,
  8675. __in const UINT *pTilePoolStartOffsets,
  8676. __in const UINT *pRangeTileCounts,
  8677. __in UINT Flags);
  8678. #endif //defined(__cplusplus) && defined(__d3d11_2_h__)
  8679. //! SUPPORTED OS: Windows 8 and higher
  8680. //!
  8681. #if defined (__cplusplus) && defined(__d3d11_2_h__)
  8682. ///////////////////////////////////////////////////////////////////////////////
  8683. //
  8684. // FUNCTION NAME: NvAPI_D3D11_CopyTileMappings
  8685. //
  8686. //! \since Release: 375
  8687. //
  8688. //! \code
  8689. //! DESCRIPTION: NvAPI_D3D11_CopyTileMappings is an extension of ID3D11DeviceContext2::CopyTileMappings
  8690. //! It allows pDestTiledResource or pSourceTiledResource or both to be created with NvAPI_D3D11_CreateTiledTexture2DArray.
  8691. //! It should be used only in such case.
  8692. //!
  8693. //! \param [in] pDeviceContext Must be Immediate DeviceContext.
  8694. //! \param [in] pDestTiledResource Tiled resource created by NvAPI_D3D11_CreateTiledTexture2DArray to copy tile mappings into.
  8695. //! \param [in] pDestRegionStartCoordinate A pointer to a D3D11_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the destination tiled resource.
  8696. //! \param [in] pSourceTiledResource Tiled resource created by NvAPI_D3D11_CreateTiledTexture2DArray to copy tile mappings from.
  8697. //! \param [in] pSourceRegionStartCoordinate A pointer to a D3D11_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the source tiled resource.
  8698. //! \param [in] pTileRegionSize A pointer to a D3D11_TILE_REGION_SIZE structure that describes the size of the tiled region.
  8699. //! \param [in] Flags A combination of D3D11_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation.
  8700. //!
  8701. //!
  8702. //! \return This API can return any of the error codes enumerated in
  8703. //! #NvAPI_Status. If there are return error codes with specific
  8704. //! meaning for this API, they are listed below.
  8705. //!
  8706. //! \endcode
  8707. //! \ingroup dx
  8708. ///////////////////////////////////////////////////////////////////////////////
  8709. NVAPI_INTERFACE NvAPI_D3D11_CopyTileMappings(
  8710. __in ID3D11DeviceContext *pDeviceContext,
  8711. __in ID3D11Resource *pDestTiledResource,
  8712. __in const D3D11_TILED_RESOURCE_COORDINATE *pDestRegionStartCoordinate,
  8713. __in ID3D11Resource *pSourceTiledResource,
  8714. __in const D3D11_TILED_RESOURCE_COORDINATE *pSourceRegionStartCoordinate,
  8715. __in const D3D11_TILE_REGION_SIZE *pTileRegionSize,
  8716. __in UINT Flags);
  8717. #endif //defined(__cplusplus) && defined(__d3d11_2_h__)
  8718. //! SUPPORTED OS: Windows 8 and higher
  8719. //!
  8720. #if defined (__cplusplus) && defined(__d3d11_2_h__)
  8721. ///////////////////////////////////////////////////////////////////////////////
  8722. //
  8723. // FUNCTION NAME: NvAPI_D3D11_TiledResourceBarrier
  8724. //
  8725. //! \since Release: 375
  8726. //
  8727. //! \code
  8728. //! DESCRIPTION: NvAPI_D3D11_TiledResourceBarrier is an extension of ID3D11DeviceContext2::TiledResourceBarrier, but only works on ID3D11Resource(no support for ID3D11View).
  8729. //! If pTiledResourceAccessBeforeBarrier or pTiledResourceAccessAfterBarrier or both are created by NvAPI_D3D11_CreateTiledTexture2DArray,
  8730. //! NvAPI_D3D11_TiledResourceBarrier must be used instead of ID3D11DeviceContext2::TiledResourceBarrier.
  8731. //!
  8732. //! \param [in] pDeviceContext Must be Immediate DeviceContext.
  8733. //! \param [in] pTiledResourceAccessBeforeBarrier Access operations on this resource must complete before the access operations on the object that pTiledResourceAccessAfterBarrier specifies.
  8734. //! \param [in] pTiledResourceAccessAfterBarrier Access operations on this resource must begin after the access operations on the object that pTiledResourceAccessBeforeBarrier specifies.
  8735. //!
  8736. //!
  8737. //! \return This API can return any of the error codes enumerated in
  8738. //! #NvAPI_Status. If there are return error codes with specific
  8739. //! meaning for this API, they are listed below.
  8740. //!
  8741. //! \endcode
  8742. //! \ingroup dx
  8743. ///////////////////////////////////////////////////////////////////////////////
  8744. NVAPI_INTERFACE NvAPI_D3D11_TiledResourceBarrier(
  8745. __in ID3D11DeviceContext *pDeviceContext,
  8746. __in ID3D11Resource *pTiledResourceAccessBeforeBarrier,
  8747. __in ID3D11Resource *pTiledResourceAccessAfterBarrier);
  8748. #endif //defined(__cplusplus) && defined(__d3d11_2_h__)
  8749. //! SUPPORTED OS: Windows 7 and higher
  8750. //!
  8751. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  8752. ///////////////////////////////////////////////////////////////////////////////
  8753. //
  8754. // FUNCTION NAME: NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA
  8755. //
  8756. //! \code
  8757. //! DESCRIPTION: This function allows creating (aliasing) a non-MSAA Texture2D object using the same memory as the given multi-sampled
  8758. //! texture (pInputTex). The surface created would be bloated in width and height but it will have SampleCount = 1
  8759. //! For 2X MSAA: OutTex.Width = InputTex.Width * 2, outTex.Height = InputTex.Height
  8760. //! For 4X MSAA: OutTex.Width = InputTex.Width * 2, outTex.Height = InputTex.Height * 2
  8761. //! For 8X MSAA: OutTex.Width = InputTex.Width * 4, outTex.Height = InputTex.Height * 2
  8762. //! Only textures SampleQuality = 0 can be aliased as Non MSAA
  8763. //! The app should ensure that original texture is released only after the aliased copy is released.
  8764. //!
  8765. //! This function is free-threaded create compatible i.e. it can be called from a different thread
  8766. //! than the one calling immediate device setstate functions.
  8767. //!
  8768. //! \param [in] pDevice current d3d device
  8769. //! \param [in] pInputTex The MultiSampled Texture2D resource that is being aliased
  8770. //! \param [out] ppOutTex The aliased non AA copy MultiSampled Texture2D resource
  8771. //!
  8772. //!
  8773. //! \return :: NVAPI_OK if the call succeeds.
  8774. //! \endcode
  8775. //! \ingroup dx
  8776. ///////////////////////////////////////////////////////////////////////////////
  8777. NVAPI_INTERFACE NvAPI_D3D11_AliasMSAATexture2DAsNonMSAA(__in ID3D11Device *pDevice,
  8778. __in ID3D11Texture2D *pInputTex,
  8779. __out ID3D11Texture2D **ppOutTex);
  8780. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  8781. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))
  8782. typedef UINT NvAPI_D3D11_SWIZZLE_MODE;
  8783. typedef enum _NV_SWIZZLE_MODE
  8784. {
  8785. NV_SWIZZLE_POS_X = 0,
  8786. NV_SWIZZLE_NEG_X = 1,
  8787. NV_SWIZZLE_POS_Y = 2,
  8788. NV_SWIZZLE_NEG_Y = 3,
  8789. NV_SWIZZLE_POS_Z = 4,
  8790. NV_SWIZZLE_NEG_Z = 5,
  8791. NV_SWIZZLE_POS_W = 6,
  8792. NV_SWIZZLE_NEG_W = 7
  8793. }NV_SWIZZLE_MODE;
  8794. typedef enum _NV_SWIZZLE_OFFSET
  8795. {
  8796. NV_SWIZZLE_OFFSET_X = 0,
  8797. NV_SWIZZLE_OFFSET_Y = 4,
  8798. NV_SWIZZLE_OFFSET_Z = 8,
  8799. NV_SWIZZLE_OFFSET_W = 12
  8800. }NV_SWIZZLE_OFFSET;
  8801. #endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))
  8802. //! SUPPORTED OS: Windows 7 and higher
  8803. //!
  8804. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))
  8805. #define NV_CUSTOM_SEMANTIC_MAX_LIMIT 32
  8806. typedef enum NV_CUSTOM_SEMANTIC_TYPE
  8807. {
  8808. NV_NONE_SEMANTIC = 0,
  8809. NV_X_RIGHT_SEMANTIC = 1,
  8810. NV_VIEWPORT_MASK_SEMANTIC = 2,
  8811. NV_XYZW_RIGHT_SEMANTIC = 3,
  8812. NV_VIEWPORT_MASK_2_SEMANTIC = 4,
  8813. NV_POSITION_SEMANTIC = 5,
  8814. NV_CLIP_DISTANCE_0_SEMANTIC = 6, // MultiView can accept upto two vec4 values. So the application should not use
  8815. NV_CLIP_DISTANCE_1_SEMANTIC = 7, // more than 2 of the below Clip / Cull semantics in a single shader.
  8816. NV_CULL_DISTANCE_0_SEMANTIC = 8,
  8817. NV_CULL_DISTANCE_1_SEMANTIC = 9,
  8818. NV_GENERIC_ATTRIBUTE_SEMANTIC = 10,
  8819. NV_PACKED_EYE_INDEX_SEMANTIC = 17,
  8820. NV_CUSTOM_SEMANTIC_MAX = NV_CUSTOM_SEMANTIC_MAX_LIMIT,
  8821. } NV_CUSTOM_SEMANTIC_TYPE;
  8822. typedef struct _NV_CUSTOM_SEMANTIC
  8823. {
  8824. UINT version; // NV_CUSTOM_SEMANTIC_VERSION
  8825. NV_CUSTOM_SEMANTIC_TYPE NVCustomSemanticType; // type of custom semantic (NV_CUSTOM_SEMANTIC_TYPE)
  8826. NvAPI_LongString NVCustomSemanticNameString; // name of custom semantic e.g. "NV_X_RIGHT", "NV_VIEWPORT_MASK"
  8827. BOOL RegisterSpecified; // (optional) set to TRUE to explicitly provide register number and mask as below
  8828. NvU32 RegisterNum; // (optional) output register which has the custom semantic.
  8829. NvU32 RegisterMask; // (optional) output register component mask which has the custom semantic (X:1, Y:2, Z:4)
  8830. NvU32 Reserved; // reserved
  8831. } NV_CUSTOM_SEMANTIC;
  8832. #define NV_CUSTOM_SEMANTIC_VERSION MAKE_NVAPI_VERSION(NV_CUSTOM_SEMANTIC, 1)
  8833. #endif //defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))
  8834. #if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
  8835. typedef struct NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5
  8836. {
  8837. UINT version;
  8838. BOOL UseViewportMask;
  8839. BOOL OffsetRtIndexByVpIndex;
  8840. BOOL ForceFastGS;
  8841. BOOL DontUseViewportOrder;
  8842. BOOL UseAttributeSkipMask;
  8843. BOOL UseCoordinateSwizzle;
  8844. NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling;
  8845. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  8846. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  8847. BOOL ConvertToFastGS; // reserved
  8848. BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions
  8849. } NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5;
  8850. typedef NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5 NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX;
  8851. #define NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VER_5 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX_V5, 5)
  8852. #define NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VERSION NVAPI_D3D11_CREATEGEOMETRYSHADEREX_2_VER_5
  8853. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  8854. //
  8855. // FUNCTION NAME: NvAPI_D3D11_CreateGeometryShaderEx
  8856. //
  8857. //! \fn NvAPI_D3D11_CreateGeometryShaderEx
  8858. //!
  8859. //! DESCRIPTION: This function allows us to extend the creation of geometry shaders with extra bits
  8860. //! of functionality.
  8861. //!
  8862. //! The first parameters are identical to ID3D11Device::CreateGeometryShader()
  8863. //! so please refer to its documentation for their usage.
  8864. //!
  8865. //! The new parameter is UseViewportMask which is to tell the driver to create a shader
  8866. //! that outputs a viewport mask instead when a viewport index is indicated.
  8867. //! Outputting a viewport mask allows a single primitive to land on many different viewports
  8868. //! as specified by the bits set in the mask, rather than to rely on a single number that tells it
  8869. //! which unique viewport it would be drawn on.
  8870. //! This can be used for example in conjunction with the setting of coordinates swizzling (see XXX_NVAPI function)
  8871. //! to generates multiple adjacent views of the same primitive in a more efficient fashion
  8872. //! (outputting the primitive only once).
  8873. //!
  8874. //! This function is free-threaded create compatible i.e. it can be called from a different
  8875. //! thread than the one calling immediate device setstate functions.
  8876. //!
  8877. //! \since Release:
  8878. //!
  8879. //! \param [in] pDevice The device pointer
  8880. //! \param [in] pShaderBytecode A pointer to the compiled shader.
  8881. //! \param [in] BytecodeLength Size of the compiled geometry shader.
  8882. //! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL.
  8883. //! \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.
  8884. //! \param [in] OffsetRtIndexByVpIndex Set to FALSE for custom semantic shaders. The Rendertarget index is offset by the viewport index
  8885. //! \param [in] ForceFastGS If TRUE, GS must be written with maxvertexcount(1) and must pass-through input vertex 0 to the output without modification
  8886. //! \param [in] DontUseViewportOrder Default FALSE for Primitives batched per viewport to improve performance. Set TRUE for API order (slow).
  8887. //! \param [in] UseAttributeSkipMask reserved
  8888. //! \param [in] UseCoordinateSwizzle reserved
  8889. //! \param [in] pCoordinateSwizzling reserved
  8890. //! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  8891. //! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC
  8892. //! \param [in] ConvertToFastGS reserved
  8893. //! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions
  8894. //! \param [out] ppGeometryShader Address of a pointer to a ID3D11GeometryShader interface.
  8895. //!
  8896. //! \return This API can return any of the error codes enumerated in
  8897. //! #NvAPI_Status. If there are return error codes with specific
  8898. //! meaning for this API, they are listed below.
  8899. //
  8900. ///////////////////////////////////////////////////////////////////////////////
  8901. NVAPI_INTERFACE NvAPI_D3D11_CreateGeometryShaderEx_2(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
  8902. __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
  8903. __in const NvAPI_D3D11_CREATE_GEOMETRY_SHADER_EX *pCreateGeometryShaderExArgs,
  8904. __out ID3D11GeometryShader **ppGeometryShader);
  8905. #endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
  8906. //! SUPPORTED OS: Windows 7 and higher
  8907. //!
  8908. #if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) )
  8909. typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1
  8910. {
  8911. UINT version;
  8912. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  8913. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  8914. } NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1;
  8915. typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2
  8916. {
  8917. UINT version;
  8918. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  8919. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  8920. BOOL UseWithFastGS; // reserved
  8921. } NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2;
  8922. typedef struct NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3
  8923. {
  8924. UINT version;
  8925. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  8926. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  8927. BOOL UseWithFastGS; // reserved
  8928. BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions
  8929. } NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3;
  8930. typedef NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V3 NvAPI_D3D11_CREATE_VERTEX_SHADER_EX;
  8931. #define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V1, 1)
  8932. #define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2, 2)
  8933. #define NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_3 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_VERTEX_SHADER_EX_V2, 3)
  8934. #define NVAPI_D3D11_CREATEVERTEXSHADEREX_VERSION NVAPI_D3D11_CREATEVERTEXSHADEREX_VER_3
  8935. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  8936. //
  8937. // FUNCTION NAME: NvAPI_D3D11_CreateVertexShaderEx
  8938. //
  8939. //! \fn NvAPI_D3D11_CreateVertexShaderEx
  8940. //!
  8941. //! DESCRIPTION: This function allows us to extend the creation of vertex shaders with extra bits
  8942. //! of functionality.
  8943. //!
  8944. //! The first parameters are identical to ID3D11Device::CreateVertexShader()
  8945. //! so please refer to its documentation for their usage.
  8946. //!
  8947. //! The new parameter are custom semantics which allow setting of custom semantic variables
  8948. //! in the shader
  8949. //!
  8950. //! This function is free-threaded create compatible i.e. it can be called from a different thread
  8951. //! than the one calling immediate device setstate functions.
  8952. //!
  8953. //! \since Release:
  8954. //!
  8955. //! \param [in] pDevice The device pointer
  8956. //! \param [in] pShaderBytecode A pointer to the compiled shader.
  8957. //! \param [in] BytecodeLength Size of the compiled vertex shader.
  8958. //! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL.
  8959. //! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  8960. //! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC
  8961. //! \param [in] UseWithFastGS reserved
  8962. //! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions
  8963. //! \param [out] ppVertexShader Address of a pointer to a ID3D11VertexShader interface.
  8964. //!
  8965. //! \return This API can return any of the error codes enumerated in
  8966. //! #NvAPI_Status. If there are return error codes with specific
  8967. //! meaning for this API, they are listed below.
  8968. //
  8969. ///////////////////////////////////////////////////////////////////////////////
  8970. NVAPI_INTERFACE NvAPI_D3D11_CreateVertexShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
  8971. __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
  8972. __in const NvAPI_D3D11_CREATE_VERTEX_SHADER_EX *pCreateVertexShaderExArgs,
  8973. __out ID3D11VertexShader **ppVertexShader);
  8974. #endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
  8975. //! SUPPORTED OS: Windows 7 and higher
  8976. //!
  8977. #if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) )
  8978. typedef struct NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1
  8979. {
  8980. UINT version;
  8981. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  8982. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  8983. BOOL UseWithFastGS; // reserved
  8984. } NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1;
  8985. typedef struct NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2
  8986. {
  8987. UINT version;
  8988. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  8989. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  8990. BOOL UseWithFastGS; // reserved
  8991. BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions
  8992. } NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2;
  8993. typedef NvAPI_D3D11_CREATE_HULL_SHADER_EX_V2 NvAPI_D3D11_CREATE_HULL_SHADER_EX;
  8994. #define NVAPI_D3D11_CREATEHULLSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1, 1)
  8995. #define NVAPI_D3D11_CREATEHULLSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_HULL_SHADER_EX_V1, 2)
  8996. #define NVAPI_D3D11_CREATEHULLSHADEREX_VERSION NVAPI_D3D11_CREATEHULLSHADEREX_VER_2
  8997. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  8998. //
  8999. // FUNCTION NAME: NvAPI_D3D11_CreateHullShaderEx
  9000. //
  9001. //! \fn NvAPI_D3D11_CreateHullShaderEx
  9002. //!
  9003. //! DESCRIPTION: This function allows us to extend the creation of hull shaders with extra bits
  9004. //! of functionality.
  9005. //!
  9006. //! The first parameters are identical to ID3D11Device::CreateHullShader()
  9007. //! so please refer to its documentation for their usage.
  9008. //!
  9009. //! The new parameter are custom semantics which allow setting of custom semantic variables
  9010. //! in the shader
  9011. //!
  9012. //! This function is free-threaded create compatible i.e. it can be called from a different thread
  9013. //! than the one calling immediate device setstate functions.
  9014. //!
  9015. //! \since Release:
  9016. //!
  9017. //! \param [in] pDevice The device pointer
  9018. //! \param [in] pShaderBytecode A pointer to the compiled shader.
  9019. //! \param [in] BytecodeLength Size of the compiled hull shader.
  9020. //! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL.
  9021. //! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9022. //! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC
  9023. //! \param [in] UseWithFastGS reserved
  9024. //! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions
  9025. //! \param [out] ppHullShader Address of a pointer to a ID3D11HullShader interface.
  9026. //!
  9027. //! \return This API can return any of the error codes enumerated in
  9028. //! #NvAPI_Status. If there are return error codes with specific
  9029. //! meaning for this API, they are listed below.
  9030. //
  9031. ///////////////////////////////////////////////////////////////////////////////
  9032. NVAPI_INTERFACE NvAPI_D3D11_CreateHullShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
  9033. __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
  9034. __in const NvAPI_D3D11_CREATE_HULL_SHADER_EX *pCreateHullShaderExArgs,
  9035. __out ID3D11HullShader **ppHullShader);
  9036. #endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
  9037. //! SUPPORTED OS: Windows 7 and higher
  9038. //!
  9039. #if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) )
  9040. typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1
  9041. {
  9042. UINT version;
  9043. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9044. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  9045. } NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1;
  9046. typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2
  9047. {
  9048. UINT version;
  9049. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9050. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  9051. BOOL UseWithFastGS; // reserved
  9052. } NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2;
  9053. typedef struct NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3
  9054. {
  9055. UINT version;
  9056. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9057. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  9058. BOOL UseWithFastGS; // reserved
  9059. BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions
  9060. } NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3;
  9061. typedef NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3 NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX;
  9062. #define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V1, 1)
  9063. #define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V2, 2)
  9064. #define NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_3 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX_V3, 3)
  9065. #define NVAPI_D3D11_CREATEDOMAINSHADEREX_VERSION NVAPI_D3D11_CREATEDOMAINSHADEREX_VER_3
  9066. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9067. //
  9068. // FUNCTION NAME: NvAPI_D3D11_CreateDomainShaderEx
  9069. //
  9070. //! \fn NvAPI_D3D11_CreateDomainShaderEx
  9071. //!
  9072. //! DESCRIPTION: This function allows us to extend the creation of domain shaders with extra bits
  9073. //! of functionality.
  9074. //!
  9075. //! The first parameters are identical to ID3D11Device::CreateDomainShader()
  9076. //! so please refer to its documentation for their usage.
  9077. //!
  9078. //! The new parameter are custom semantics which allow setting of custom semantic variables
  9079. //! in the shader
  9080. //!
  9081. //! This function is free-threaded create compatible i.e. it can be called from a different thread
  9082. //! than the one calling immediate device setstate functions.
  9083. //!
  9084. //! \since Release:
  9085. //!
  9086. //! \param [in] pDevice The device pointer
  9087. //! \param [in] pShaderBytecode A pointer to the compiled shader.
  9088. //! \param [in] BytecodeLength Size of the compiled domain shader.
  9089. //! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL.
  9090. //! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9091. //! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC
  9092. //! \param [in] UseWithFastGS reserved
  9093. //! \param [in] UseSpecificShaderExt TRUE if creating minimal specific shaders with nvapi shader extensions
  9094. //! \param [out] ppDomainShader Address of a pointer to a ID3D11DomainShader interface.
  9095. //!
  9096. //! \return This API can return any of the error codes enumerated in
  9097. //! #NvAPI_Status. If there are return error codes with specific
  9098. //! meaning for this API, they are listed below.
  9099. //
  9100. ///////////////////////////////////////////////////////////////////////////////
  9101. NVAPI_INTERFACE NvAPI_D3D11_CreateDomainShaderEx(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
  9102. __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
  9103. __in const NvAPI_D3D11_CREATE_DOMAIN_SHADER_EX *pCreateDomainShaderExArgs,
  9104. __out ID3D11DomainShader **ppDomainShader);
  9105. #endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
  9106. //! SUPPORTED OS: Windows 7 and higher
  9107. //!
  9108. #if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) )
  9109. typedef struct NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1
  9110. {
  9111. UINT version;
  9112. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9113. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  9114. } NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1;
  9115. #define NVAPI_D3D11_CREATEPIXELSHADEREX_VER_1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V1, 1)
  9116. typedef struct NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2
  9117. {
  9118. UINT version; // Always use NVAPI_D3D11_CREATEPIXELSHADEREX_VERSION
  9119. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9120. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  9121. NvU32 bEnableSuperSamplingPredicationForVRS : 1; // This enables sampling within a pixel for SuperSampling mode of Variable Rate Shading for relevant attributes tagged with "sample" modifier
  9122. NvU32 bEnableSuperSamplingPredicationForVRSAllAttributes : 1; // This enables sampling within a pixel for SuperSampling mode of Variable Rate Shading for all relevant attributes
  9123. NvU32 reserved : 30; // Reserved for further use
  9124. } NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2;
  9125. typedef NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2 NvAPI_D3D11_CREATE_PIXEL_SHADER_EX;
  9126. #define NVAPI_D3D11_CREATEPIXELSHADEREX_VER_2 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_PIXEL_SHADER_EX_V2, 2)
  9127. #define NVAPI_D3D11_CREATEPIXELSHADEREX_VERSION NVAPI_D3D11_CREATEPIXELSHADEREX_VER_2
  9128. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9129. //
  9130. // FUNCTION NAME: NvAPI_D3D11_CreatePixelShaderEx_2
  9131. //
  9132. //! \fn NvAPI_D3D11_CreatePixelShaderEx_2
  9133. //!
  9134. //! DESCRIPTION: This function allows us to extend the creation of pixel shaders with extra bits
  9135. //! of functionality.
  9136. //!
  9137. //! The first parameters are identical to ID3D11Device::CreatePixelShader()
  9138. //! so please refer to its documentation for their usage.
  9139. //!
  9140. //! The new parameter are custom semantics which allow setting of custom semantic variables
  9141. //! in the shader
  9142. //!
  9143. //! This function is free-threaded create compatible i.e. it can be called from a different thread
  9144. //! than the one calling immediate device setstate functions.
  9145. //!
  9146. //! \since Release: 410
  9147. //!
  9148. //! \param [in] pDevice The device pointer
  9149. //! \param [in] pShaderBytecode A pointer to the compiled shader.
  9150. //! \param [in] BytecodeLength Size of the compiled domain shader.
  9151. //! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL.
  9152. //! \param [in] NumCustomSemantics Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9153. //! \param [in] pCustomSemantics pointer to array of NV_CUSTOM_SEMANTIC
  9154. //! \param [out] ppPixelShader Address of a pointer to a ID3D11PixelShader interface.
  9155. //!
  9156. //! \return This API can return any of the error codes enumerated in
  9157. //! #NvAPI_Status. If there are return error codes with specific
  9158. //! meaning for this API, they are listed below.
  9159. //
  9160. ///////////////////////////////////////////////////////////////////////////////
  9161. NVAPI_INTERFACE NvAPI_D3D11_CreatePixelShaderEx_2(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
  9162. __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
  9163. __in const NvAPI_D3D11_CREATE_PIXEL_SHADER_EX *pCreatePixelShaderExArgs,
  9164. __out ID3D11PixelShader **ppPixelShader);
  9165. #endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
  9166. //! SUPPORTED OS: Windows 7 and higher
  9167. //!
  9168. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))
  9169. typedef enum _NV_FASTGS_FLAGS
  9170. {
  9171. NV_FASTGS_USE_VIEWPORT_MASK = 0x01, // Causes SV_ViewportArrayIndex value to be interpreted as a bitmask of viewports to broadcast to.
  9172. NV_FASTGS_OFFSET_RT_INDEX_BY_VP_INDEX = 0x02, // Causes SV_RenderTargetArrayIndex value to be offset by the viewport index when broadcasting.
  9173. NV_FASTGS_STRICT_API_ORDER = 0x04, // Causes broadcast primitives to be rendered strictly in API order (slow).
  9174. // By default, primitives may be batched per viewport to improve performance.
  9175. } NV_FASTGS_FLAGS;
  9176. #endif //defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__)) && (!defined(CINTERFACE))
  9177. #if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
  9178. struct NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1
  9179. {
  9180. NvU32 version; // ALWAYS == NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER
  9181. NvU32 flags; // A combination of flags from NV_FASTGS_FLAGS
  9182. NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; // [optional] Array of 16 coordinate swizzle modes, one per viewport. NULL if not used.
  9183. // The output x, y, z, and w coordinates of all vertices can be set to any of the coordinates or their
  9184. // negated versions i.e. {x, y, z, w, -x, -y, -z, -w}. Coordinates are swizzled before any viewport
  9185. // operation occurs i.e. before frustum clipping, scaling, and viewport clipping. And after
  9186. // last of vertex/tesselation/geometry shader stage, stream-out and viewport broadcast expansion (see NV_FASTGS_USE_VIEWPORT_MASK)
  9187. // pCoordinateSwizzling[i] sets the swizzle-mode of each component for viewport i.
  9188. // See NV_SWIZZLE_MODE for values of allowed swizzle modes.
  9189. // See NV_SWIZZLE_OFFSET for bit offset from where NV_SWIZZLE_MODE to be set for each component.
  9190. // For example :
  9191. // 1. To set swizzle for viewport 0 such that - w and z are unchanged and values of x and y are swapped :
  9192. // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) |
  9193. // (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) |
  9194. // (NV_SWIZZLE_POS_X << NV_SWIZZLE_OFFSET_Y) |
  9195. // (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_X);
  9196. // 2. To set swizzle for viewport 0 such that - w, z and y are unchanged and value of x is negated :
  9197. // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) |
  9198. // (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) |
  9199. // (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_Y) |
  9200. // (NV_SWIZZLE_NEG_X << NV_SWIZZLE_OFFSET_X);
  9201. // Need to set some valid combination of swizzle-modes for all viewports, irrespective of whether that viewport is set.
  9202. // Invalid swizzle-mode for any viewport (even if that viewport is not set) may result in removal of device.
  9203. };
  9204. #define NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER1 MAKE_NVAPI_VERSION(NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1, 1)
  9205. #define NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER NVAPI_D3D11_CREATEFASTGSEXPLICIT_VER1
  9206. typedef NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC_V1 NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC;
  9207. ////////////////////////////////////////////////////////////////////////////////////////////////////
  9208. //
  9209. // FUNCTION NAME: NvAPI_D3D11_CreateFastGeometryShaderExplicit
  9210. //
  9211. //! \fn NvAPI_D3D11_CreateFastGeometryShaderExplicit
  9212. //!
  9213. //! DESCRIPTION: This function will create a fast geometry shader written using an "explicit"
  9214. //! coding style, rather than converting a standard GS. For the explicit coding
  9215. //! style, the GS must be written with maxvertexcount(1), and must pass-through
  9216. //! input vertex 0 to the output without modification.
  9217. //!
  9218. //! Additional per-primitive outputs may also be computed and written to the single
  9219. //! output vertex. If these outputs are read by the pixel shader, they must be
  9220. //! declared with the "nointerpolation" attribute in the PS input signature;
  9221. //! otherwise, visual corruption may occur. Also, unlike D3D API, there is no guarantee
  9222. //! that pixel shader will get the default value of an attribute if that attribute is not written
  9223. //! by the earlier shader stage in the pipeline.
  9224. //!
  9225. //! The first four parameters are identical to ID3D11Device::CreateGeometryShader(),
  9226. //! so please refer to its documentation for their usage.
  9227. //!
  9228. //! This function is free-threaded create compatible i.e. it can be called from a different thread
  9229. //! than the one calling immediate device setstate functions.
  9230. //!
  9231. //! \since Release:
  9232. //!
  9233. //! \param [in] pDevice The device pointer
  9234. //! \param [in] pShaderBytecode A pointer to the compiled shader.
  9235. //! \param [in] BytecodeLength Size of the compiled geometry shader.
  9236. //! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL.
  9237. //! \param [in] pCreateFastGSArgs A pointer to a NvAPI_D3D11_CREATE_FASTGS_EXPLICIT struct.
  9238. //! \param [out] ppGeometryShader Address of a pointer to a ID3D11GeometryShader interface.
  9239. //!
  9240. //! \return This API can return any of the error codes enumerated in
  9241. //! #NvAPI_Status. If there are return error codes with specific
  9242. //! meaning for this API, they are listed below.
  9243. //
  9244. ////////////////////////////////////////////////////////////////////////////////////////////////////
  9245. NVAPI_INTERFACE NvAPI_D3D11_CreateFastGeometryShaderExplicit(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
  9246. __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
  9247. __in const NvAPI_D3D11_CREATE_FASTGS_EXPLICIT_DESC *pCreateFastGSArgs,
  9248. __out ID3D11GeometryShader **ppGeometryShader);
  9249. #endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
  9250. //! SUPPORTED OS: Windows 7 and higher
  9251. //!
  9252. #if defined (__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE) )
  9253. ////////////////////////////////////////
  9254. //
  9255. // FUNCTION NAME: NvAPI_D3D11_CreateFastGeometryShader
  9256. //
  9257. //! \fn NvAPI_D3D11_CreateFastGeometryShader
  9258. //!
  9259. //! DESCRIPTION: This function will convert a regular geometry shader into a fast GS variant if possible.
  9260. //! It will not do any validation regarding the compatibility of the resulting fast GS with any
  9261. //! Pixel shader. The validation has to be done by the application manually.
  9262. //!
  9263. //! The parameters are identical to ID3D11Device::CreateGeometryShader()
  9264. //! so please refer to its documentation for their usage.
  9265. //!
  9266. //! If the shader is too complex or is not in adequate form to be converted to fast GS
  9267. //! this function will simply fail. You should then call ID3D11Device::CreateGeometryShader()
  9268. //! to create the regular geometry shader.
  9269. //!
  9270. //! This function is free-threaded create compatible i.e. it can be called from a different thread
  9271. //! than the one calling immediate device setstate functions.
  9272. //!
  9273. //! \since Release:
  9274. //!
  9275. //! \param [in] pDevice The device pointer
  9276. //! \param [in] pShaderBytecode A pointer to the compiled shader.
  9277. //! \param [in] BytecodeLength Size of the compiled geometry shader.
  9278. //! \param [in] pClassLinkage A pointer to a class linkage interface. Can be NULL.
  9279. //! \param [out] ppGeometryShader Address of a pointer to a ID3D11GeometryShader interface.
  9280. //!
  9281. //! \return This API can return any of the error codes enumerated in
  9282. //! #NvAPI_Status. If there are return error codes with specific
  9283. //! meaning for this API, they are listed below.
  9284. //
  9285. ///////////////////////////////////////////////////////////////////////////////
  9286. NVAPI_INTERFACE NvAPI_D3D11_CreateFastGeometryShader(__in ID3D11Device *pDevice, __in const void *pShaderBytecode,
  9287. __in SIZE_T BytecodeLength, __in_opt ID3D11ClassLinkage *pClassLinkage,
  9288. __out ID3D11GeometryShader **ppGeometryShader);
  9289. #endif //defined(__cplusplus) && defined(__d3d11_h__) && (!defined(CINTERFACE))
  9290. //! SUPPORTED OS: Windows 7 and higher
  9291. //!
  9292. #if defined (__cplusplus) && defined(__d3d11_h__)
  9293. ///////////////////////////////////////////////////////////////////////////////
  9294. //
  9295. // FUNCTION NAME: NvAPI_D3D11_DecompressView
  9296. //
  9297. //! \code
  9298. //! DESCRIPTION: This function is used to decompress a surface using the currently bound programmable sample positions.
  9299. //!
  9300. //! This is needed:
  9301. //! - When writing to a surface in a region previously rendered by different sample positions and no clear was done.
  9302. //! - When reading a surface in a shader that was rendered using non-standard sample positions.
  9303. //! - When copying from a surface that was rendered using non-standard sample positions.
  9304. //!
  9305. //! \param [in] pDevice Current d3d11 device
  9306. //! \param [in] pDeviceContext Current d3d11 device context
  9307. //! \param [in] pView Current view to decompress
  9308. //!
  9309. //!
  9310. //! \return ::NVAPI_OK if the call succeeds.
  9311. //! \endcode
  9312. //! \ingroup dx
  9313. ///////////////////////////////////////////////////////////////////////////////
  9314. NVAPI_INTERFACE NvAPI_D3D11_DecompressView(__in ID3D11Device* pDevice, __in ID3D11DeviceContext *pDeviceContext, __in ID3D11View* pView);
  9315. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  9316. #if defined (__cplusplus) && defined(__d3d12_h__)
  9317. //! Enum for CreatePSO extensions.
  9318. //! \ingroup dx
  9319. typedef enum _NV_PSO_EXTENSION
  9320. {
  9321. NV_PSO_RASTER_EXTENSION = 0,
  9322. NV_PSO_REQUEST_FASTGS_EXTENSION = 1,
  9323. NV_PSO_GEOMETRY_SHADER_EXTENSION = 2,
  9324. NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION = 3,
  9325. NV_PSO_EXPLICIT_FASTGS_EXTENSION = 4,
  9326. NV_PSO_SET_SHADER_EXTNENSION_SLOT_AND_SPACE = 5,
  9327. NV_PSO_VERTEX_SHADER_EXTENSION = 6,
  9328. NV_PSO_DOMAIN_SHADER_EXTENSION = 7,
  9329. NV_PSO_HULL_SHADER_EXTENSION = 9,
  9330. }NV_PSO_EXTENSION;
  9331. struct NVAPI_D3D12_PSO_EXTENSION_DESC_V1
  9332. {
  9333. NvU32 baseVersion; //<! Always use NV_PSO_EXTENSION_DESC_VER
  9334. NV_PSO_EXTENSION psoExtension;
  9335. };
  9336. #define NV_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_EXTENSION_DESC_V1, 1)
  9337. #define NV_PSO_EXTENSION_DESC_VER NV_PSO_EXTENSION_DESC_VER_1
  9338. typedef NVAPI_D3D12_PSO_EXTENSION_DESC_V1 NVAPI_D3D12_PSO_EXTENSION_DESC;
  9339. struct NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
  9340. {
  9341. NvU32 version; //<! Always use NV_RASTERIZER_PSO_EXTENSION_DESC_VER
  9342. // These are additional parameters on the top of D3D12_RASTERIZER_DESC
  9343. bool ProgrammableSamplePositionsEnable; //<! enable Programmable Samples feature
  9344. bool InterleavedSamplingEnable; //<! when jitter is enabled, an app need to fill the whole arrays below, otherwise only as much entries as samples
  9345. 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
  9346. NvU8 SamplePositionsX[16]; //<! x positions in API sample order
  9347. NvU8 SamplePositionsY[16]; //<! y positions in API sample order
  9348. 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.
  9349. bool PostZCoverageEnable; //<! Enable pixel-shader input SV_COVERAGE to account for z-test in early-z mode.
  9350. bool CoverageToColorEnable; //<! Enable output of coverage to a color render-target.
  9351. NvU8 CoverageToColorRTIndex; //<! Index of RT for coverage-to-color.
  9352. //Added with NV_RASTERIZER_PSO_EXTENSION_DESC_VER_2
  9353. 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.
  9354. NvU8 ForcedSampleCount; //<! Must be set when TargetIndepentRasterWithDepth is true - refers to SampleDesc.Count for the DSV
  9355. //Reserved
  9356. NvU8 reserved[62]; //<! reserved for expansion, set to zero.
  9357. };
  9358. #define NV_RASTERIZER_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC_V1, 1)
  9359. #define NV_RASTERIZER_PSO_EXTENSION_DESC_VER_2 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC_V1, 2)
  9360. #define NV_RASTERIZER_PSO_EXTENSION_DESC_VER NV_RASTERIZER_PSO_EXTENSION_DESC_VER_2
  9361. typedef NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC_V1 NVAPI_D3D12_PSO_RASTERIZER_STATE_DESC;
  9362. struct NVAPI_D3D12_PSO_CREATE_FASTGS_EXPLICIT_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
  9363. {
  9364. NvU32 version; // ALWAYS == NV_FASTGS_EXPLICIT_PSO_EXTENSION_VER
  9365. NvU32 flags; // A combination of flags from NV_FASTGS_FLAGS
  9366. NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; // [optional] Array of 16 coordinate swizzle modes, one per viewport. NULL if not used.
  9367. // The output x, y, z, and w coordinates of all vertices can be set to any of the coordinates or their
  9368. // negated versions i.e. {x, y, z, w, -x, -y, -z, -w}. Coordinates are swizzled before any viewport
  9369. // operation occurs i.e. before frustum clipping, scaling, and viewport clipping. And after
  9370. // last of vertex/tesselation/geometry shader stage, stream-out and viewport broadcast expansion (see NV_FASTGS_USE_VIEWPORT_MASK)
  9371. // pCoordinateSwizzling[i] sets the swizzle-mode of each component for viewport i.
  9372. // See NV_SWIZZLE_MODE for values of allowed swizzle modes.
  9373. // See NV_SWIZZLE_OFFSET for bit offset from where NV_SWIZZLE_MODE to be set for each component.
  9374. // For example :
  9375. // 1. To set swizzle for viewport 0 such that - w and z are unchanged and values of x and y are swapped :
  9376. // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) |
  9377. // (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) |
  9378. // (NV_SWIZZLE_POS_X << NV_SWIZZLE_OFFSET_Y) |
  9379. // (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_X);
  9380. // 2. To set swizzle for viewport 0 such that - w, z and y are unchanged and value of x is negated :
  9381. // pCoordinateSwizzling[0] = (NV_SWIZZLE_POS_W << NV_SWIZZLE_OFFSET_W) |
  9382. // (NV_SWIZZLE_POS_Z << NV_SWIZZLE_OFFSET_Z) |
  9383. // (NV_SWIZZLE_POS_Y << NV_SWIZZLE_OFFSET_Y) |
  9384. // (NV_SWIZZLE_NEG_X << NV_SWIZZLE_OFFSET_X);
  9385. // Need to set some valid combination of swizzle-modes for all viewports, irrespective of whether that viewport is set.
  9386. // Invalid swizzle-mode for any viewport (even if that viewport is not set) may result in removal of device.
  9387. };
  9388. #define NV_FASTGS_EXPLICIT_PSO_EXTENSION_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_CREATE_FASTGS_EXPLICIT_DESC_V1, 1)
  9389. #define NV_FASTGS_EXPLICIT_PSO_EXTENSION_VER NV_FASTGS_EXPLICIT_PSO_EXTENSION_VER_1
  9390. typedef NVAPI_D3D12_PSO_CREATE_FASTGS_EXPLICIT_DESC_V1 NVAPI_D3D12_PSO_CREATE_FASTGS_EXPLICIT_DESC;
  9391. struct NVAPI_D3D12_PSO_REQUEST_FAST_GEOMETRY_SHADER_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
  9392. {
  9393. NvU32 version; //<! Always use NV_FAST_GEOMETRY_SHADER_PSO_EXTENSION_VER
  9394. };
  9395. #define NV_FAST_GEOMETRY_SHADER_PSO_EXTENSION_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_REQUEST_FAST_GEOMETRY_SHADER_DESC_V1, 1)
  9396. #define NV_FAST_GEOMETRY_SHADER_PSO_EXTENSION_VER NV_FAST_GEOMETRY_SHADER_PSO_EXTENSION_VER_1
  9397. typedef NVAPI_D3D12_PSO_REQUEST_FAST_GEOMETRY_SHADER_DESC_V1 NVAPI_D3D12_PSO_REQUEST_FAST_GEOMETRY_SHADER_DESC;
  9398. struct NVAPI_D3D12_PSO_GEOMETRY_SHADER_DESC_V5 : public NVAPI_D3D12_PSO_EXTENSION_DESC
  9399. {
  9400. NvU32 version; //<! Always use NV_GEOMETRY_SHADER_PSO_EXTENSION_DESC_VER
  9401. 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.
  9402. BOOL OffsetRtIndexByVpIndex; // Set to FALSE for custom semantic shaders. The Rendertarget index is offset by the viewport index
  9403. BOOL ForceFastGS; // If TRUE, GS must be written with maxvertexcount(1) and must pass-through input vertex 0 to the output without modification
  9404. BOOL DontUseViewportOrder; // Default FALSE for Primitives batched per viewport to improve performance. Set TRUE for API order (slow).
  9405. BOOL UseAttributeSkipMask; // Reserved
  9406. BOOL UseCoordinateSwizzle; // Reserved
  9407. NvAPI_D3D11_SWIZZLE_MODE *pCoordinateSwizzling; // Reserved
  9408. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9409. NV_CUSTOM_SEMANTIC *pCustomSemantics; // pointer to array of NV_CUSTOM_SEMANTIC
  9410. BOOL ConvertToFastGS; // Tell the driver to attempt to create a fast geometry shader
  9411. BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions
  9412. };
  9413. #define NV_GEOMETRY_SHADER_PSO_EXTENSION_DESC_VER_5 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_GEOMETRY_SHADER_DESC_V5, 5)
  9414. #define NV_GEOMETRY_SHADER_PSO_EXTENSION_DESC_VER NV_GEOMETRY_SHADER_PSO_EXTENSION_DESC_VER_5
  9415. typedef NVAPI_D3D12_PSO_GEOMETRY_SHADER_DESC_V5 NVAPI_D3D12_PSO_GEOMETRY_SHADER_DESC;
  9416. struct NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
  9417. {
  9418. NvU32 version; //<! Always use NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER
  9419. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9420. NV_CUSTOM_SEMANTIC *pCustomSemantics; // Pointer to array of NV_CUSTOM_SEMANTIC
  9421. };
  9422. struct NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V2 : public NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V1
  9423. {
  9424. BOOL UseWithFastGS; // Reserved
  9425. };
  9426. struct NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V3 : public NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V2
  9427. {
  9428. BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with NvAPI shader extensions
  9429. };
  9430. #define NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V1, 1)
  9431. #define NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER_2 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V2, 2)
  9432. #define NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER_3 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V3, 3)
  9433. #define NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER NV_VERTEX_SHADER_PSO_EXTENSION_DESC_VER_3
  9434. typedef NVAPI_D3D12_PSO_VERTEX_SHADER_DESC_V3 NVAPI_D3D12_PSO_VERTEX_SHADER_DESC;
  9435. struct NVAPI_D3D12_PSO_HULL_SHADER_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
  9436. {
  9437. NvU32 version; //<! Always use NV_HULL_SHADER_PSO_EXTENSION_DESC_VER
  9438. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9439. NV_CUSTOM_SEMANTIC *pCustomSemantics; // Pointer to array of NV_CUSTOM_SEMANTIC
  9440. BOOL UseWithFastGS; // Reserved
  9441. };
  9442. struct NVAPI_D3D12_PSO_HULL_SHADER_DESC_V2 : public NVAPI_D3D12_PSO_HULL_SHADER_DESC_V1
  9443. {
  9444. BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with nvapi shader extensions
  9445. };
  9446. #define NV_HULL_SHADER_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_HULL_SHADER_DESC_V1, 1)
  9447. #define NV_HULL_SHADER_PSO_EXTENSION_DESC_VER_2 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_HULL_SHADER_DESC_V2, 2)
  9448. #define NV_HULL_SHADER_PSO_EXTENSION_DESC_VER NV_HULL_SHADER_PSO_EXTENSION_DESC_VER_2
  9449. typedef NVAPI_D3D12_PSO_HULL_SHADER_DESC_V2 NVAPI_D3D12_PSO_HULL_SHADER_DESC;
  9450. struct NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
  9451. {
  9452. NvU32 version; //<! Always use NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER
  9453. NvU32 NumCustomSemantics; // Number of custom semantics elements (upto NV_CUSTOM_SEMANTIC_MAX) provided in array pointer pCustomSemantics
  9454. NV_CUSTOM_SEMANTIC *pCustomSemantics; // Pointer to array of NV_CUSTOM_SEMANTIC
  9455. };
  9456. struct NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V2 : public NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V1
  9457. {
  9458. BOOL UseWithFastGS; // Reserved
  9459. };
  9460. struct NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V3 : public NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V2
  9461. {
  9462. BOOL UseSpecificShaderExt; // TRUE if creating minimal specific shaders with NvAPI shader extensions
  9463. };
  9464. #define NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V1, 1)
  9465. #define NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER_2 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V2, 2)
  9466. #define NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER_3 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V3, 3)
  9467. #define NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER NV_DOMAIN_SHADER_PSO_EXTENSION_DESC_VER_3
  9468. typedef NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC_V3 NVAPI_D3D12_PSO_DOMAIN_SHADER_DESC;
  9469. struct NVAPI_D3D12_PSO_ENABLE_DEPTH_BOUND_TEST_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
  9470. {
  9471. NvU32 version; //<! Always use NV_ENABLE_DEPTH_BOUND_TEST_PSO_EXTENSION_DESC_VER
  9472. bool EnableDBT;
  9473. };
  9474. #define NV_ENABLE_DEPTH_BOUND_TEST_PSO_EXTENSION_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_ENABLE_DEPTH_BOUND_TEST_DESC_V1, 1)
  9475. #define NV_ENABLE_DEPTH_BOUND_TEST_PSO_EXTENSION_DESC_VER NV_ENABLE_DEPTH_BOUND_TEST_PSO_EXTENSION_DESC_VER_1
  9476. typedef NVAPI_D3D12_PSO_ENABLE_DEPTH_BOUND_TEST_DESC_V1 NVAPI_D3D12_PSO_ENABLE_DEPTH_BOUND_TEST_DESC;
  9477. struct NVAPI_D3D12_PSO_SET_SHADER_EXTENSION_SLOT_DESC_V1 : public NVAPI_D3D12_PSO_EXTENSION_DESC
  9478. {
  9479. NvU32 version; //<! Always use NV_SET_SHADER_EXTENSION_SLOT_DESC_VER
  9480. NvU32 uavSlot;
  9481. NvU32 registerSpace;
  9482. };
  9483. #define NV_SET_SHADER_EXTENSION_SLOT_DESC_VER_1 MAKE_NVAPI_VERSION(NVAPI_D3D12_PSO_SET_SHADER_EXTENSION_SLOT_DESC_V1, 1)
  9484. #define NV_SET_SHADER_EXTENSION_SLOT_DESC_VER NV_SET_SHADER_EXTENSION_SLOT_DESC_VER_1
  9485. typedef NVAPI_D3D12_PSO_SET_SHADER_EXTENSION_SLOT_DESC_V1 NVAPI_D3D12_PSO_SET_SHADER_EXTENSION_SLOT_DESC;
  9486. //! \ingroup dx
  9487. //! Enum for compute shader derivative modes
  9488. typedef enum _NV_COMPUTE_SHADER_DERIVATIVES
  9489. {
  9490. NV_COMPUTE_SHADER_DERIVATIVE_NONE = 0, // No support for compute derivatives
  9491. 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
  9492. 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
  9493. // the app must ensure that width and height of the CTA dimension are both multiples of 2
  9494. } NV_COMPUTE_SHADER_DERIVATIVES;
  9495. ///////////////////////////////////////////////////////////////////////////////
  9496. //
  9497. // FUNCTION NAME: NvAPI_D3D12_CreateGraphicsPipelineState
  9498. //
  9499. //! \code
  9500. //! DESCRIPTION: This function will create PSO with provided extensions
  9501. //!
  9502. //! \note Note that "Cached PSO" functionality is not supported with the Pipeline State Object created using
  9503. //! this NvAPI. GetCachedBlob() should not be called with such a PSO.
  9504. //!
  9505. //! \param [in] pDevice Current d3d device
  9506. //! \param [in] pPSODesc PSO description of type D3D12_GRAPHICS_PIPELINE_STATE_DESC
  9507. //! \param [in] numExtensions Number of extensions
  9508. //! \param [in] ppExtensions Array of PSO extensions (see NV_PSO_EXTENSION for possible extensions)
  9509. //! \param [out] ppPSO Output PSO object of type ID3D12PipelineState
  9510. //!
  9511. //! SUPPORTED OS: Windows 10
  9512. //!
  9513. //! \return ::NVAPI_OK if the call succeeds.
  9514. //! \endcode
  9515. //! \ingroup dx
  9516. ///////////////////////////////////////////////////////////////////////////////
  9517. NVAPI_INTERFACE NvAPI_D3D12_CreateGraphicsPipelineState(__in ID3D12Device *pDevice,
  9518. __in const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pPSODesc,
  9519. NvU32 numExtensions,
  9520. __in const NVAPI_D3D12_PSO_EXTENSION_DESC** ppExtensions,
  9521. __out ID3D12PipelineState **ppPSO);
  9522. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  9523. #if defined (__cplusplus) && defined(__d3d12_h__)
  9524. ///////////////////////////////////////////////////////////////////////////////
  9525. //
  9526. // FUNCTION NAME: NvAPI_D3D12_CreateComputePipelineState
  9527. //
  9528. //! \code
  9529. //! DESCRIPTION: This function will create PSO with provided extensions
  9530. //!
  9531. //! \param [in] pDevice Current d3d device
  9532. //! \param [in] pPSODesc PSO description of type D3D12_COMPUTE_PIPELINE_STATE_DESC
  9533. //! \param [in] numExtensions Number of extensions
  9534. //! \param [in] ppExtensions Array of PSO extensions (see NV_PSO_EXTENSION for possible extensions)
  9535. //! \param [out] ppPSO Output PSO object of type ID3D12PipelineState
  9536. //!
  9537. //! \since Release: 364
  9538. //!
  9539. //! SUPPORTED OS: Windows 10
  9540. //!
  9541. //! \return ::NVAPI_OK if the call succeeds.
  9542. //! \endcode
  9543. //! \ingroup dx
  9544. ///////////////////////////////////////////////////////////////////////////////
  9545. NVAPI_INTERFACE NvAPI_D3D12_CreateComputePipelineState(__in ID3D12Device *pDevice,
  9546. __in const D3D12_COMPUTE_PIPELINE_STATE_DESC *pPSODesc,
  9547. NvU32 numExtensions,
  9548. __in const NVAPI_D3D12_PSO_EXTENSION_DESC** ppExtensions,
  9549. __out ID3D12PipelineState **ppPSO);
  9550. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  9551. #if defined (__cplusplus) && defined(__d3d12_h__)
  9552. ///////////////////////////////////////////////////////////////////////////////
  9553. //
  9554. // FUNCTION NAME: NvAPI_D3D12_SetDepthBoundsTestValues
  9555. //
  9556. //! \code
  9557. //! DESCRIPTION: This function will set the minDepth and maxDepth values for depth bounds test
  9558. //! To enable/ disable depth bounds test use PSO extension NV_PSO_ENABLE_DEPTH_BOUND_TEST_EXTENSION
  9559. //! in the nvapi NvAPI_D3D12_CreateGraphicsPipelineState
  9560. //!
  9561. //! \param [in] pCommandList Command List to set depth bounds test
  9562. //! \param [in] minDepth min value for depth bound test
  9563. //! \param [in] maxDepth max value for depth bound test
  9564. //!
  9565. //! The valid values for minDepth and maxDepth are such that 0 <= minDepth <= maxDepth <= 1
  9566. //!
  9567. //! SUPPORTED OS: Windows 10
  9568. //!
  9569. //! \return ::NVAPI_OK if the call succeeds.
  9570. //! \endcode
  9571. //! \ingroup dx
  9572. ///////////////////////////////////////////////////////////////////////////////
  9573. NVAPI_INTERFACE NvAPI_D3D12_SetDepthBoundsTestValues(__in ID3D12GraphicsCommandList *pCommandList,
  9574. __in const float minDepth,
  9575. __in const float maxDepth);
  9576. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  9577. #if defined (__cplusplus) && defined(__d3d12_h__)
  9578. ///////////////////////////////////////////////////////////////////////////////
  9579. //
  9580. // FUNCTION NAME: NvAPI_D3D12_CreateReservedResource
  9581. //
  9582. //! \since Release: 375
  9583. //
  9584. //! \code
  9585. //! DESCRIPTION: Tiled resource is supported for Texture2D Array, however, but only when mip packing is not triggered.
  9586. //! So any mip level cannot be smaller than a single tile size(64KB).
  9587. //! This set of API is an extension of D3D12 support for tiled resource to allow a tiled texture2D array with mip packing.
  9588. //! If any of API from this set is used, using all of them is highly recommended.
  9589. //! It includes NvAPI_D3D12_CreateReservedResource, NvAPI_D3D12_CreateHeap, NvAPI_D3D12_ReservedResourceGetDesc,
  9590. //! NvAPI_D3D12_UpdateTileMappings, NvAPI_D3D12_CopyTileMappings, NvAPI_D3D12_ResourceAliasingBarrier.
  9591. //! Reminder: all API in this set other than NvAPI_D3D12_CreateReservedResource won't has D3D Debug Layer information.
  9592. //!
  9593. //! NvAPI_D3D12_CreateReservedResource is an extension of ID3D12Device::CreateReservedResource.
  9594. //! Use this function to create a tiled Texture2D array with mip packing.
  9595. //! Runtime doesn't know the created resource is actually a tiled resource.
  9596. //! Any other D3D12 API where runtime will check whether resource is tiled or not, has a corresponding NVAPI version and they should be used.
  9597. //! Different from DX11 implementation, we highly recommend replace all ID3D12Device::CreateReservedResource with NvAPI_D3D12_CreateReservedResource,
  9598. //! and use bTexture2DArrayMipPack to control which creation to use.
  9599. //! Otherwise, NvAPI_D3D12_ResourceAliasingBarrier will fail if any resource is not created by NvAPI_D3D12_CreateReservedResource.
  9600. //! DX11 implementation doesn't have this restriction and resource created by NVAPI and D3D API can be used together.
  9601. //! pHeap is necessary when bTexture2DArrayMipPack is true. pHeap can be any heap and this API doens't change anything to it.
  9602. //!
  9603. //! \param [in] pDevice A pointer to D3D12 device.
  9604. //! \param [in] pDesc A pointer to a D3D12_RESOURCE_DESC structure that describes the resource.
  9605. //! \param [in] InitialState The initial state of the resource, as a bitwise-OR'd combination of D3D12_RESOURCE_STATES enumeration constants.
  9606. //! \param [in] pOptimizedClearValue Specifies a D3D12_CLEAR_VALUE that describes the default value for a clear color.
  9607. //! \param [in] riid The globally unique identifier (GUID) for the resource interface.
  9608. //! \param [out] ppvResource A pointer to a memory block that receives a pointer to the resource. Cannot be NULL.
  9609. //! \param [in] bTexture2DArrayMipPack Whether pDesc indicates it's a texture2D array resource with mip packing.
  9610. //! TRUE: Use NVAPI to create. Will check pHeap to be not NULL.
  9611. //! FALSE: Standard D3D12 API will be used, use DebugDevice to check any runtime ERROR. Won't check pHeap
  9612. //! \param [in] pHeap A pointer to ID3D12Heap. Cannot be NULL when bTexture2DArrayMipPack is true.
  9613. //!
  9614. //! SUPPORTED OS: Windows 10
  9615. //!
  9616. //! \return This API can return any of the error codes enumerated in
  9617. //! #NvAPI_Status. If there are return error codes with specific
  9618. //! meaning for this API, they are listed below.
  9619. //!
  9620. //! \endcode
  9621. //! \ingroup dx
  9622. ///////////////////////////////////////////////////////////////////////////////
  9623. NVAPI_INTERFACE NvAPI_D3D12_CreateReservedResource(__in ID3D12Device *pDevice,
  9624. __in const D3D12_RESOURCE_DESC *pDesc,
  9625. __in D3D12_RESOURCE_STATES InitialState,
  9626. __in const D3D12_CLEAR_VALUE *pOptimizedClearValue,
  9627. __in REFIID riid,
  9628. __out void **ppvResource,
  9629. __in bool bTexture2DArrayMipPack,
  9630. __in ID3D12Heap *pHeap);
  9631. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  9632. #if defined (__cplusplus) && defined(__d3d12_h__)
  9633. ///////////////////////////////////////////////////////////////////////////////
  9634. //
  9635. // FUNCTION NAME: NvAPI_D3D12_CreateHeap
  9636. //
  9637. //! \since Release: 375
  9638. //
  9639. //! \code
  9640. //! DESCRIPTION: NvAPI_D3D12_CreateHeap is a safe replacement of ID3D12Device::CreateHeap with no functionality change and overhead.
  9641. //! In NvAPI_D3D12_UpdateTileMappings, pTilePool must be created with NvAPI_D3D12_CreateHeap and otherwise NvAPI_D3D12_UpdateTileMappings will fail.
  9642. //! In other word, any tile pool used in NvAPI_D3D12_UpdateTileMappings must be created by NvAPI_D3D12_CreateHeap.
  9643. //!
  9644. //! \param [in] pDevice A pointer to D3D12 device.
  9645. //! \param [in] pDesc A pointer to a D3D12_HEAP_DESC structure that describes the heap.
  9646. //! \param [in] riid The globally unique identifier (GUID) for the resource interface.
  9647. //! \param [out] ppvHeap A pointer to a memory block that receives a pointer to the heap. Cannot be NULL.
  9648. //!
  9649. //! SUPPORTED OS: Windows 10
  9650. //!
  9651. //! \return This API can return any of the error codes enumerated in
  9652. //! #NvAPI_Status. If there are return error codes with specific
  9653. //! meaning for this API, they are listed below.
  9654. //!
  9655. //! \endcode
  9656. //! \ingroup dx
  9657. ///////////////////////////////////////////////////////////////////////////////
  9658. NVAPI_INTERFACE NvAPI_D3D12_CreateHeap(__in ID3D12Device *pDevice,
  9659. __in const D3D12_HEAP_DESC *pDesc,
  9660. __in REFIID riid,
  9661. __out void **ppvHeap);
  9662. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  9663. #if defined (__cplusplus) && defined(__d3d12_h__)
  9664. ///////////////////////////////////////////////////////////////////////////////
  9665. //
  9666. // FUNCTION NAME: NvAPI_D3D12_ReservedResourceGetDesc
  9667. //
  9668. //! \since Release: 375
  9669. //
  9670. //! \code
  9671. //! DESCRIPTION: NvAPI_D3D12_ReservedResourceGetDesc is an simple wrapper of ID3D12Resource::GetDesc when pReservedResource is created by NvAPI_D3D12_CreateReservedResource.
  9672. //! Runtime doesn't know the created resource is actually a tiled resource if bTexture2DArrayMipPack = true in NvAPI_D3D12_CreateReservedResource.
  9673. //! 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.
  9674. //! This wrapper API just set Layout to D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE if Layout is D3D12_TEXTURE_LAYOUT_UNKNOWN.
  9675. //!
  9676. //! \param [in] pReservedResource Pointer of reserved resource to get resource desc from.
  9677. //! \param [out] pDesc Pointer to a resource description.
  9678. //! SUPPORTED OS: Windows 10
  9679. //!
  9680. //!
  9681. //!
  9682. //! \return This API can return any of the error codes enumerated in
  9683. //! #NvAPI_Status. If there are return error codes with specific
  9684. //! meaning for this API, they are listed below.
  9685. //!
  9686. //! \endcode
  9687. //! \ingroup dx
  9688. ///////////////////////////////////////////////////////////////////////////////
  9689. NVAPI_INTERFACE NvAPI_D3D12_ReservedResourceGetDesc(__in ID3D12Resource *pReservedResource,
  9690. __out D3D12_RESOURCE_DESC *pDesc);
  9691. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  9692. #if defined (__cplusplus) && defined(__d3d12_h__)
  9693. ///////////////////////////////////////////////////////////////////////////////
  9694. //
  9695. // FUNCTION NAME: NvAPI_D3D12_UpdateTileMappings
  9696. //
  9697. //! \since Release: 375
  9698. //
  9699. //! \code
  9700. //! DESCRIPTION: NvAPI_D3D12_UpdateTileMappings is an extension of ID3D12CommandQueue::UpdateTileMappings.
  9701. //! pTiledResource must be created by NvAPI_D3D12_CreateReservedResource.
  9702. //! pTilePool must be created by NvAPI_D3D12_CreateHeap.
  9703. //!
  9704. //! \param [in] pCommandQueue A pointer to ID3D12CommandQueue.
  9705. //! \param [in] pTiledResource A pointer to the tiled resource created by NvAPI_D3D12_CreateReservedResource.
  9706. //! \param [in] NumTiledResourceRegions The number of tiled resource regions.
  9707. //! \param [in] pTiledResourceRegionStartCoordinates An array of D3D12_TILED_RESOURCE_COORDINATE structures that describe the starting coordinates of the tiled resource regions. Cannot be NULL.
  9708. //! \param [in] pTiledResourceRegionSizes An array of D3D12_TILE_REGION_SIZE structures that describe the sizes of the tiled resource regions. Cannot be NULL.
  9709. //! \param [in] pTilePool A pointer to the resource heap created by NvAPI_D3D12_CreateHeap.
  9710. //! \param [in] NumRanges The number of tile-pool ranges.
  9711. //! \param [in] pRangeFlags A pointer to an array of D3D12_TILE_RANGE_FLAGS values that describes each tile range.
  9712. //! \param [in] pTilePoolStartOffsets An array of offsets into the tile pool. These are 0-based tile offsets, counting in tiles (not bytes).
  9713. //! \param [in] pRangeTileCounts An array of values that specify the number of tiles in each tile-pool range.
  9714. //! \param [in] Flags A combination of D3D12_TILE_MAPPING_FLAGS values that are combined by using a bitwise OR operation.
  9715. //! SUPPORTED OS: Windows 10
  9716. //!
  9717. //!
  9718. //!
  9719. //! \return This API can return any of the error codes enumerated in
  9720. //! #NvAPI_Status. If there are return error codes with specific
  9721. //! meaning for this API, they are listed below.
  9722. //!
  9723. //! \endcode
  9724. //! \ingroup dx
  9725. ///////////////////////////////////////////////////////////////////////////////
  9726. NVAPI_INTERFACE NvAPI_D3D12_UpdateTileMappings(
  9727. __in ID3D12CommandQueue *pCommandQueue,
  9728. __in ID3D12Resource *pResource,
  9729. __in UINT NumResourceRegions,
  9730. __in const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates,
  9731. __in const D3D12_TILE_REGION_SIZE *pResourceRegionSizes,
  9732. __in ID3D12Heap *pHeap,
  9733. __in UINT NumRanges,
  9734. __in const D3D12_TILE_RANGE_FLAGS *pRangeFlags,
  9735. __in const UINT *pHeapRangeStartOffsets,
  9736. __in const UINT *pRangeTileCounts,
  9737. __in D3D12_TILE_MAPPING_FLAGS Flags);
  9738. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  9739. #if defined (__cplusplus) && defined(__d3d12_h__)
  9740. ///////////////////////////////////////////////////////////////////////////////
  9741. //
  9742. // FUNCTION NAME: NvAPI_D3D12_CopyTileMappings
  9743. //
  9744. //! \since Release: 375
  9745. //
  9746. //! \code
  9747. //! DESCRIPTION: NvAPI_D3D12_CopyTileMappings is an extension of ID3D12CommandQueue::CopyTileMappings
  9748. //! pDstResource and pSrcResource must be created by NvAPI_D3D12_CreateReservedResource.
  9749. //!
  9750. //! \param [in] pCommandQueue A pointer to ID3D12CommandQueue.
  9751. //! \param [in] pDstResource Tiled resource created by NvAPI_D3D12_CreateReservedResource to copy tile mappings into.
  9752. //! \param [in] pDstRegionStartCoordinate A pointer to a D3D12_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the destination reserved resource.
  9753. //! \param [in] pSrcResource Tiled resource created by NvAPI_D3D12_CreateReservedResource to copy tile mappings from.
  9754. //! \param [in] pSourceRegionStartCoordinate A pointer to a D3D12_TILED_RESOURCE_COORDINATE structure that describes the starting coordinates of the source reserved resource.
  9755. //! \param [in] pTileRegionSize A pointer to a D3D12_TILE_REGION_SIZE structure that describes the size of the reserved region.
  9756. //! \param [in] Flags One member of D3D12_TILE_MAPPING_FLAGS.
  9757. //! SUPPORTED OS: Windows 10
  9758. //!
  9759. //!
  9760. //!
  9761. //! \return This API can return any of the error codes enumerated in
  9762. //! #NvAPI_Status. If there are return error codes with specific
  9763. //! meaning for this API, they are listed below.
  9764. //!
  9765. //! \endcode
  9766. //! \ingroup dx
  9767. ///////////////////////////////////////////////////////////////////////////////
  9768. NVAPI_INTERFACE NvAPI_D3D12_CopyTileMappings(
  9769. __in ID3D12CommandQueue *pCommandQueue,
  9770. __in ID3D12Resource *pDstResource,
  9771. __in const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate,
  9772. __in ID3D12Resource *pSrcResource,
  9773. __in const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate,
  9774. __in const D3D12_TILE_REGION_SIZE *pRegionSize,
  9775. __in D3D12_TILE_MAPPING_FLAGS Flags);
  9776. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  9777. #if defined (__cplusplus) && defined(__d3d12_h__)
  9778. ///////////////////////////////////////////////////////////////////////////////
  9779. //
  9780. // FUNCTION NAME: NvAPI_D3D12_ResourceAliasingBarrier
  9781. //
  9782. //! \since Release: 375
  9783. //
  9784. //! \code
  9785. //! DESCRIPTION: NvAPI_D3D12_ResourceAliasingBarrier is an extension of ID3D12GraphicsCommandList::ResourceBarrier, but only for D3D12_RESOURCE_ALIASING_BARRIER.
  9786. //! Both resource in pBarriers must be created by NvAPI_D3D12_CreateReservedTexture2DArray.
  9787. //!
  9788. //! \param [in] pCommandList A pointer to ID3D12GraphicsCommandList.
  9789. //! \param [in] NumBarriers The number of submitted barrier descriptions.
  9790. //! \param [in] pBarriers Pointer to an array of barrier descriptions with D3D12_RESOURCE_ALIASING_BARRIER type only.
  9791. //! SUPPORTED OS: Windows 10
  9792. //!
  9793. //!
  9794. //!
  9795. //! \return This API can return any of the error codes enumerated in
  9796. //! #NvAPI_Status. If there are return error codes with specific
  9797. //! meaning for this API, they are listed below.
  9798. //!
  9799. //! \endcode
  9800. //! \ingroup dx
  9801. ///////////////////////////////////////////////////////////////////////////////
  9802. NVAPI_INTERFACE NvAPI_D3D12_ResourceAliasingBarrier(
  9803. __in ID3D12GraphicsCommandList *pCommandList,
  9804. __in UINT NumBarriers,
  9805. __in const D3D12_RESOURCE_BARRIER *pBarriers);
  9806. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  9807. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  9808. ///////////////////////////////////////////////////////////////////////////////
  9809. //
  9810. // MetaCommands common defines
  9811. //
  9812. //! \since Release: 400
  9813. //
  9814. ///////////////////////////////////////////////////////////////////////////////
  9815. #pragma pack(push, 4)
  9816. enum NV_D3D_GRAPHICS_STATES
  9817. {
  9818. NV_D3D_GRAPHICS_STATE_NONE = 0 ,
  9819. NV_D3D_GRAPHICS_STATE_IA_VERTEX_BUFFERS = (1 << 0),
  9820. NV_D3D_GRAPHICS_STATE_IA_INDEX_BUFFER = (1 << 1),
  9821. NV_D3D_GRAPHICS_STATE_IA_PRIMITIVE_TOPOLOGY = (1 << 2),
  9822. NV_D3D_GRAPHICS_STATE_DESCRIPTOR_HEAP = (1 << 3),
  9823. NV_D3D_GRAPHICS_STATE_GRAPHICS_ROOT_SIGNATURE = (1 << 4),
  9824. NV_D3D_GRAPHICS_STATE_COMPUTE_ROOT_SIGNATURE = (1 << 5),
  9825. NV_D3D_GRAPHICS_STATE_RS_VIEWPORTS = (1 << 6),
  9826. NV_D3D_GRAPHICS_STATE_RS_SCISSOR_RECTS = (1 << 7),
  9827. NV_D3D_GRAPHICS_STATE_PREDICATION = (1 << 8),
  9828. NV_D3D_GRAPHICS_STATE_OM_RENDER_TARGETS = (1 << 9),
  9829. NV_D3D_GRAPHICS_STATE_OM_STENCIL_REF = (1 << 10),
  9830. NV_D3D_GRAPHICS_STATE_OM_BLEND_FACTOR = (1 << 11),
  9831. NV_D3D_GRAPHICS_STATE_PIPELINE_STATE = (1 << 12),
  9832. NV_D3D_GRAPHICS_STATE_SO_TARGETS = (1 << 13),
  9833. NV_D3D_GRAPHICS_STATE_OM_DEPTH_BOUNDS = (1 << 14),
  9834. NV_D3D_GRAPHICS_STATE_SAMPLE_POSITIONS = (1 << 15),
  9835. NV_D3D_GRAPHICS_STATE_VIEW_INSTANCE_MASK = (1 << 16),
  9836. };
  9837. struct NVAPI_META_COMMAND_DESC
  9838. {
  9839. GUID Id;
  9840. LPCWSTR Name;
  9841. // states that the initialization and execution of the metacommand will dirty
  9842. NV_D3D_GRAPHICS_STATES InitializationDirtyState;
  9843. NV_D3D_GRAPHICS_STATES ExecutionDirtyState;
  9844. };
  9845. typedef NvU64 NV_META_COMMAND_BOOL;
  9846. #define NV_META_COMMAND_MAX_TENSOR_DIM 5
  9847. // dimensions (Size and Stride) are always indexed this way, irrespective of NV_META_COMMAND_LAYOUT
  9848. // For DimensionCount = 5: N, C, D, H, W
  9849. // For DimensionCount = 4: N, C, H, W
  9850. #define NV_META_COMMAND_ACTIVATION_MAX_PARAMS 2
  9851. #if __cplusplus >= 201103L
  9852. #define compile_time_assert(b) static_assert((b), "Compile time assertion failed: "#b)
  9853. enum NV_META_COMMAND_TENSOR_DATA_TYPE : NvU64
  9854. {
  9855. NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT32,
  9856. NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT16,
  9857. NV_META_COMMAND_TENSOR_DATA_TYPE_UINT32,
  9858. NV_META_COMMAND_TENSOR_DATA_TYPE_COUNT,
  9859. };
  9860. enum NV_META_COMMAND_TENSOR_LAYOUT : NvU64
  9861. {
  9862. NV_META_COMMAND_TENSOR_LAYOUT_UNKNOWN, // opaque HW-native layout
  9863. NV_META_COMMAND_TENSOR_LAYOUT_STANDARD, // NCDHW - planar / row major layout (width is inner-most dimension, batch-size N is the outermost)
  9864. NV_META_COMMAND_TENSOR_LAYOUT_COUNT,
  9865. };
  9866. enum NV_META_COMMAND_TENSOR_FLAGS : NvU64
  9867. {
  9868. NV_META_COMMAND_TENSOR_FLAG_NONE = 0,
  9869. 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)
  9870. };
  9871. enum NV_META_COMMAND_PRECISION : NvU64
  9872. {
  9873. NV_META_COMMAND_PRECISION_FLOAT32,
  9874. NV_META_COMMAND_PRECISION_FLOAT16,
  9875. NV_META_COMMAND_PRECISION_MUL_FLOAT16_ADD_FLOAT32,
  9876. NV_META_COMMAND_PRECISION_COUNT,
  9877. };
  9878. struct NV_META_COMMAND_TENSOR_DESC
  9879. {
  9880. NV_META_COMMAND_TENSOR_DATA_TYPE DataType;
  9881. NV_META_COMMAND_TENSOR_LAYOUT Layout;
  9882. NV_META_COMMAND_TENSOR_FLAGS Flags;
  9883. NvU64 DimensionCount; // 4 or 5
  9884. NvU64 Size[NV_META_COMMAND_MAX_TENSOR_DIM];
  9885. NvU64 Stride[NV_META_COMMAND_MAX_TENSOR_DIM]; // only used with NV_META_COMMAND_TENSOR_LAYOUT_STANDARD
  9886. };
  9887. enum NV_META_COMMAND_ACTIVATION_FUNCTION : NvU64
  9888. {
  9889. NV_META_COMMAND_ACTIVATION_FUNCTION_ELU,
  9890. NV_META_COMMAND_ACTIVATION_FUNCTION_HARDMAX,
  9891. NV_META_COMMAND_ACTIVATION_FUNCTION_HARD_SIGMOID,
  9892. NV_META_COMMAND_ACTIVATION_FUNCTION_IDENTITY,
  9893. NV_META_COMMAND_ACTIVATION_FUNCTION_LEAKY_RELU,
  9894. NV_META_COMMAND_ACTIVATION_FUNCTION_LINEAR,
  9895. NV_META_COMMAND_ACTIVATION_FUNCTION_LOG_SOFTMAX,
  9896. NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETERIZED_RELU,
  9897. NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETRIC_SOFTPLUS,
  9898. NV_META_COMMAND_ACTIVATION_FUNCTION_RELU,
  9899. NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_ELU,
  9900. NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_TANH,
  9901. NV_META_COMMAND_ACTIVATION_FUNCTION_SIGMOID,
  9902. NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTMAX,
  9903. NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTPLUS,
  9904. NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTSIGN,
  9905. NV_META_COMMAND_ACTIVATION_FUNCTION_TANH,
  9906. NV_META_COMMAND_ACTIVATION_FUNCTION_THRESHOLDED_RELU,
  9907. NV_META_COMMAND_ACTIVATION_FUNCTION_COUNT,
  9908. };
  9909. struct NV_META_COMMAND_ACTIVATION_DESC
  9910. {
  9911. NV_META_COMMAND_ACTIVATION_FUNCTION Function;
  9912. float Params[NV_META_COMMAND_ACTIVATION_MAX_PARAMS];
  9913. };
  9914. #else
  9915. #define compile_time_assert(b) typedef char compile_time_assertion_failed_in_line_##__LINE__[(b)?1:-1]
  9916. enum NV_META_COMMAND_TENSOR_DATA_TYPE
  9917. {
  9918. NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT32,
  9919. NV_META_COMMAND_TENSOR_DATA_TYPE_FLOAT16,
  9920. NV_META_COMMAND_TENSOR_DATA_TYPE_UINT32,
  9921. NV_META_COMMAND_TENSOR_DATA_TYPE_COUNT,
  9922. };
  9923. enum NV_META_COMMAND_TENSOR_LAYOUT
  9924. {
  9925. NV_META_COMMAND_TENSOR_LAYOUT_UNKNOWN, // opaque HW-native layout
  9926. NV_META_COMMAND_TENSOR_LAYOUT_STANDARD, // NCDHW - planar / row major layout (width is inner-most dimension, batch-size N is the outermost)
  9927. NV_META_COMMAND_TENSOR_LAYOUT_COUNT,
  9928. };
  9929. enum NV_META_COMMAND_TENSOR_FLAGS
  9930. {
  9931. NV_META_COMMAND_TENSOR_FLAG_NONE = 0,
  9932. 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)
  9933. };
  9934. enum NV_META_COMMAND_PRECISION
  9935. {
  9936. NV_META_COMMAND_PRECISION_FLOAT32,
  9937. NV_META_COMMAND_PRECISION_FLOAT16,
  9938. NV_META_COMMAND_PRECISION_MUL_FLOAT16_ADD_FLOAT32,
  9939. NV_META_COMMAND_PRECISION_COUNT,
  9940. };
  9941. struct NV_META_COMMAND_TENSOR_DESC
  9942. {
  9943. NvU64 DataType; // NV_META_COMMAND_TENSOR_DATA_TYPE
  9944. NvU64 Layout; // NV_META_COMMAND_TENSOR_LAYOUT
  9945. NvU64 Flags; // NV_META_COMMAND_TENSOR_FLAGS
  9946. NvU64 DimensionCount; // 4 or 5
  9947. NvU64 Size[NV_META_COMMAND_MAX_TENSOR_DIM];
  9948. NvU64 Stride[NV_META_COMMAND_MAX_TENSOR_DIM]; // only used with NV_META_COMMAND_TENSOR_LAYOUT_STANDARD
  9949. };
  9950. enum NV_META_COMMAND_ACTIVATION_FUNCTION
  9951. {
  9952. NV_META_COMMAND_ACTIVATION_FUNCTION_ELU,
  9953. NV_META_COMMAND_ACTIVATION_FUNCTION_HARDMAX,
  9954. NV_META_COMMAND_ACTIVATION_FUNCTION_HARD_SIGMOID,
  9955. NV_META_COMMAND_ACTIVATION_FUNCTION_IDENTITY,
  9956. NV_META_COMMAND_ACTIVATION_FUNCTION_LEAKY_RELU,
  9957. NV_META_COMMAND_ACTIVATION_FUNCTION_LINEAR,
  9958. NV_META_COMMAND_ACTIVATION_FUNCTION_LOG_SOFTMAX,
  9959. NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETERIZED_RELU,
  9960. NV_META_COMMAND_ACTIVATION_FUNCTION_PARAMETRIC_SOFTPLUS,
  9961. NV_META_COMMAND_ACTIVATION_FUNCTION_RELU,
  9962. NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_ELU,
  9963. NV_META_COMMAND_ACTIVATION_FUNCTION_SCALED_TANH,
  9964. NV_META_COMMAND_ACTIVATION_FUNCTION_SIGMOID,
  9965. NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTMAX,
  9966. NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTPLUS,
  9967. NV_META_COMMAND_ACTIVATION_FUNCTION_SOFTSIGN,
  9968. NV_META_COMMAND_ACTIVATION_FUNCTION_TANH,
  9969. NV_META_COMMAND_ACTIVATION_FUNCTION_THRESHOLDED_RELU,
  9970. NV_META_COMMAND_ACTIVATION_FUNCTION_COUNT,
  9971. };
  9972. struct NV_META_COMMAND_ACTIVATION_DESC
  9973. {
  9974. NvU64 Function; // NV_META_COMMAND_ACTIVATION_FUNCTION
  9975. float Params[NV_META_COMMAND_ACTIVATION_MAX_PARAMS];
  9976. };
  9977. #endif
  9978. struct NV_META_COMMAND_OPTIONAL_TENSOR_DESC : NV_META_COMMAND_TENSOR_DESC
  9979. {
  9980. // true when the tensor isn't needed (e.g, bias is optional)
  9981. NV_META_COMMAND_BOOL IsNull;
  9982. };
  9983. struct NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC : NV_META_COMMAND_ACTIVATION_DESC
  9984. {
  9985. // true when activation isn't needed
  9986. NV_META_COMMAND_BOOL IsNull;
  9987. };
  9988. enum NV_META_COMMAND_PADDING_MODE
  9989. {
  9990. NV_META_COMMAND_PADDING_ZEROS,
  9991. NV_META_COMMAND_PADDING_MIRROR,
  9992. NV_META_COMMAND_PADDING_CLAMP,
  9993. NV_META_COMMAND_PADDING_CONSTANT,
  9994. NV_META_COMMAND_PADDING_COUNT,
  9995. };
  9996. struct NV_META_COMMAND_PADDING_DESC
  9997. {
  9998. NV_META_COMMAND_PADDING_MODE Mode;
  9999. // used with NV_META_COMMAND_PADDING_CONSTANT
  10000. float ConstantPadVal;
  10001. };
  10002. // use this enum to query resource sizes using GetRequiredParameterResourceSize() call
  10003. enum NV_META_COMMAND_RESOURCE_TYPE
  10004. {
  10005. NV_META_COMMAND_RESOURCE_TYPE_INPUT = 0,
  10006. NV_META_COMMAND_RESOURCE_TYPE_OUTPUT = 1,
  10007. NV_META_COMMAND_RESOURCE_TYPE_FILTER = 2,
  10008. NV_META_COMMAND_RESOURCE_TYPE_WEIGHT = 2,
  10009. NV_META_COMMAND_RESOURCE_TYPE_BIAS = 3,
  10010. NV_META_COMMAND_RESOURCE_TYPE_MATRIX_A = 0,
  10011. NV_META_COMMAND_RESOURCE_TYPE_MATRIX_B = 2,
  10012. NV_META_COMMAND_RESOURCE_TYPE_MATRIX_C = 3,
  10013. NV_META_COMMAND_RESOURCE_TYPE_PERSISTENT = 4,
  10014. NV_META_COMMAND_RESOURCE_TYPE_TEMPORARY = 5,
  10015. };
  10016. // Extended version of convolution operation that performs:
  10017. //
  10018. // y = act ( alpha1 * conv(x) + alpha2 * z + bias )
  10019. //
  10020. // alpha1 and alpha2 are either scalars or if PerChannelScaling is TRUE, they are vectors of
  10021. // same dimension as the bias tensor (vector of size equal to number of output channels)
  10022. //
  10023. // z (SkipConnectionResource) has same dimension as output tensor y (OutputResource).
  10024. static const GUID MetaCommand_ConvolutionEx =
  10025. { 0xa7666f1e, 0x9c55, 0x47ee, { 0x9e, 0xb3, 0xe1, 0x62, 0x0, 0x92, 0xd1, 0xe9 } };
  10026. #define NV_META_COMMAND_NUM_SPATIAL_DIM 3
  10027. // D, H, W when DimensionCount is 3
  10028. // H, W when DimensionCount is 2
  10029. #if __cplusplus >= 201103L
  10030. enum NV_META_COMMAND_CONVOLUTION_DIRECTION : NvU64
  10031. {
  10032. NV_META_COMMAND_CONVOLUTION_DIRECTION_FORWARD, // Corresponds to regular Convolution
  10033. NV_META_COMMAND_CONVOLUTION_DIRECTION_BACKWARD, // Corresponds to ConvolutionTranspose
  10034. NV_META_COMMAND_CONVOLUTION_DIRECTION_COUNT,
  10035. };
  10036. enum NV_META_COMMAND_CONVOLUTION_MODE : NvU64
  10037. {
  10038. NV_META_COMMAND_CONVOLUTION_MODE_CONVOLUTION,
  10039. NV_META_COMMAND_CONVOLUTION_MODE_CROSS_CORRELATION,
  10040. NV_META_COMMAND_CONVOLUTION_MODE_COUNT,
  10041. };
  10042. struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC
  10043. {
  10044. // Descriptor of the input tensor
  10045. NV_META_COMMAND_TENSOR_DESC DescIn;
  10046. // Descriptor of the tensor acting as the filter kernel
  10047. NV_META_COMMAND_TENSOR_DESC DescFilter;
  10048. // Descriptor of the optional bias tensor
  10049. NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescBias;
  10050. // Descriptor of the output tensor
  10051. NV_META_COMMAND_TENSOR_DESC DescOut;
  10052. // Convolution mode (CROSS_CORRELATION or CONVOLUTION)
  10053. NV_META_COMMAND_CONVOLUTION_MODE Mode;
  10054. // Convolution direction (FORWARD or BACKWARD)
  10055. NV_META_COMMAND_CONVOLUTION_DIRECTION Direction;
  10056. // Precision at which convolution is done
  10057. NV_META_COMMAND_PRECISION Precision;
  10058. // Optional activation function
  10059. NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation;
  10060. // Padding mode (only used when output tensor dimensions are different from input tensor dimensions)
  10061. NV_META_COMMAND_PADDING_DESC Padding;
  10062. // enables per channel scaling i.e, use Alpha1Resource and Alpha2Resource
  10063. // instead of Alpha1 and Alpha2 below
  10064. NV_META_COMMAND_BOOL PerChannelScaling;
  10065. // scaling factors used when PerChannelScaling is FALSE
  10066. // set Alpha1 = 1.0f, Alpha2 = 0.0f for simple convolutions
  10067. // that don't need scaling or skip connection
  10068. float Alpha1;
  10069. float Alpha2;
  10070. // Strides for the filter kernel position
  10071. NvU64 Stride[NV_META_COMMAND_NUM_SPATIAL_DIM];
  10072. // The distance per dimension between elements that are multiplied
  10073. NvU64 Dilation[NV_META_COMMAND_NUM_SPATIAL_DIM];
  10074. // Padding at the start of each dimension
  10075. NvU64 StartPadding[NV_META_COMMAND_NUM_SPATIAL_DIM];
  10076. // Padding at the end of each dimension
  10077. NvU64 EndPadding[NV_META_COMMAND_NUM_SPATIAL_DIM];
  10078. // Number of dimensions to which convolution occurs (2 or 3)
  10079. NvU64 DimensionCount;
  10080. // Number of channel groups convolved independently
  10081. NvU64 GroupCount;
  10082. };
  10083. #else
  10084. enum NV_META_COMMAND_CONVOLUTION_DIRECTION
  10085. {
  10086. NV_META_COMMAND_CONVOLUTION_DIRECTION_FORWARD, // Corresponds to regular Convolution
  10087. NV_META_COMMAND_CONVOLUTION_DIRECTION_BACKWARD, // Corresponds to ConvolutionTranspose
  10088. NV_META_COMMAND_CONVOLUTION_DIRECTION_COUNT,
  10089. };
  10090. enum NV_META_COMMAND_CONVOLUTION_MODE
  10091. {
  10092. NV_META_COMMAND_CONVOLUTION_MODE_CONVOLUTION,
  10093. NV_META_COMMAND_CONVOLUTION_MODE_CROSS_CORRELATION,
  10094. NV_META_COMMAND_CONVOLUTION_MODE_COUNT,
  10095. };
  10096. struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC
  10097. {
  10098. // Descriptor of the input tensor
  10099. NV_META_COMMAND_TENSOR_DESC DescIn;
  10100. // Descriptor of the tensor acting as the filter kernel
  10101. NV_META_COMMAND_TENSOR_DESC DescFilter;
  10102. // Descriptor of the optional bias tensor
  10103. NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescBias;
  10104. // Descriptor of the output tensor
  10105. NV_META_COMMAND_TENSOR_DESC DescOut;
  10106. // Convolution mode (CROSS_CORRELATION or CONVOLUTION)
  10107. NvU64 Mode; // NV_META_COMMAND_CONVOLUTION_MODE
  10108. // Convolution direction (FORWARD or BACKWARD)
  10109. NvU64 Direction; // NV_META_COMMAND_CONVOLUTION_DIRECTION
  10110. // Precision at which convolution is done
  10111. NvU64 Precision; // NV_META_COMMAND_PRECISION
  10112. // Optional activation function
  10113. NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation;
  10114. // Padding mode (only used when output tensor dimensions are different from input tensor dimensions)
  10115. NV_META_COMMAND_PADDING_DESC Padding;
  10116. // enables per channel scaling i.e, use Alpha1Resource and Alpha2Resource
  10117. // instead of Alpha1 and Alpha2 below
  10118. NV_META_COMMAND_BOOL PerChannelScaling;
  10119. // scaling factors used when PerChannelScaling is FALSE
  10120. // set Alpha1 = 1.0f, Alpha2 = 0.0f for simple convolutions
  10121. // that don't need scaling or skip connection
  10122. float Alpha1;
  10123. float Alpha2;
  10124. // Strides for the filter kernel position
  10125. NvU64 Stride[NV_META_COMMAND_NUM_SPATIAL_DIM];
  10126. // The distance per dimension between elements that are multiplied
  10127. NvU64 Dilation[NV_META_COMMAND_NUM_SPATIAL_DIM];
  10128. // Padding at the start of each dimension
  10129. NvU64 StartPadding[NV_META_COMMAND_NUM_SPATIAL_DIM];
  10130. // Padding at the end of each dimension
  10131. NvU64 EndPadding[NV_META_COMMAND_NUM_SPATIAL_DIM];
  10132. // Number of dimensions to which convolution occurs (2 or 3)
  10133. NvU64 DimensionCount;
  10134. // Number of channel groups convolved independently
  10135. NvU64 GroupCount;
  10136. };
  10137. #endif
  10138. // Fused Convolution variants
  10139. // supported combinations right now are:
  10140. // - Convolution + Max Pooling (also optionally outputs pre-pool data)
  10141. // - 2x2 upsample + (optional) residual add + Convolution
  10142. //
  10143. // other combinations may be exposed in future
  10144. static const GUID MetaCommand_ConvolutionExFused =
  10145. { 0xe1b112eb, 0xdecd, 0x4ff6,{ 0x85, 0xbb, 0x1f, 0xe, 0x3a, 0xb0, 0x4, 0x14 } };
  10146. enum NV_META_COMMAND_CONVOLUTION_POOL_MODE
  10147. {
  10148. NV_META_COMMAND_CONVOLUTION_POOL_MODE_NONE,
  10149. NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_MAX,
  10150. NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_AVG,
  10151. NV_META_COMMAND_CONVOLUTION_POOL_MODE_REDUCTION_MIN,
  10152. NV_META_COMMAND_CONVOLUTION_POOL_MODE_COUNT,
  10153. };
  10154. enum NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE
  10155. {
  10156. NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_NONE,
  10157. NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_REPLICATE,
  10158. NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_BILINEAR,
  10159. NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE_COUNT,
  10160. };
  10161. enum NV_META_COMMAND_CONVOLUTION_SKIP_MODE
  10162. {
  10163. NV_META_COMMAND_CONVOLUTION_SKIP_MODE_NONE,
  10164. NV_META_COMMAND_CONVOLUTION_SKIP_MODE_ADD,
  10165. NV_META_COMMAND_CONVOLUTION_SKIP_MODE_CONCAT,
  10166. NV_META_COMMAND_CONVOLUTION_SKIP_MODE_COUNT,
  10167. };
  10168. struct NV_META_COMMAND_CONVOLUTION_FUSE_DESC
  10169. {
  10170. NV_META_COMMAND_CONVOLUTION_POOL_MODE PoolMode;
  10171. NV_META_COMMAND_CONVOLUTION_UPSAMPLE_MODE UpsampleMode;
  10172. NV_META_COMMAND_CONVOLUTION_SKIP_MODE SkipMode;
  10173. NV_META_COMMAND_BOOL OutputPrepool; // used with NV_META_COMMAND_CONVOLUTION_POOL_MODE
  10174. };
  10175. // uses same structures for init and execute descriptors
  10176. // SkipConnectionResource is used to specify the resource for pre-pool data or residual add
  10177. struct NV_META_COMMAND_CREATE_CONVOLUTION_EX_FUSED_DESC : NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC
  10178. {
  10179. NV_META_COMMAND_CONVOLUTION_FUSE_DESC FuseDesc;
  10180. };
  10181. // make sure structure sizes match what the driver assumes
  10182. compile_time_assert(sizeof(NV_META_COMMAND_TENSOR_DESC) == 112);
  10183. compile_time_assert(sizeof(NV_META_COMMAND_CREATE_CONVOLUTION_EX_DESC) == 640);
  10184. compile_time_assert(sizeof(NV_META_COMMAND_CONVOLUTION_FUSE_DESC) == 20);
  10185. compile_time_assert(sizeof(NV_META_COMMAND_CREATE_CONVOLUTION_EX_FUSED_DESC) == 660);
  10186. // GEMM (General matrix multiply)
  10187. //
  10188. // Y = alpha * t(A) * t(B) + beta * C,
  10189. //
  10190. // where t is a matrix transform option
  10191. //
  10192. // If C is null, and beta is non-zero, the output
  10193. // matrix is used as C matrix. i.e, the operation performed is:
  10194. // Y = alpha * t(A) * t(B) + beta * Y
  10195. //
  10196. static const GUID MetaCommand_Gemm =
  10197. { 0x8f9ff059, 0xfe72, 0x488e, { 0xa0, 0x66, 0xb1, 0x4e, 0x79, 0x48, 0xec, 0x8 } };
  10198. #if __cplusplus >= 201103L
  10199. enum NV_META_COMMAND_MATRIX_TRANSFORM : NvU64
  10200. {
  10201. NV_META_COMMAND_MATRIX_TRANSFORM_NONE,
  10202. NV_META_COMMAND_MATRIX_TRANSFORM_TRANSPOSE,
  10203. NV_META_COMMAND_MATRIX_TRANSFORM_COUNT,
  10204. };
  10205. struct NV_META_COMMAND_CREATE_GEMM_DESC
  10206. {
  10207. NV_META_COMMAND_TENSOR_DESC DescA;
  10208. NV_META_COMMAND_TENSOR_DESC DescB;
  10209. NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescC;
  10210. NV_META_COMMAND_TENSOR_DESC DescOut;
  10211. NV_META_COMMAND_PRECISION Precision;
  10212. NV_META_COMMAND_MATRIX_TRANSFORM TransA;
  10213. NV_META_COMMAND_MATRIX_TRANSFORM TransB;
  10214. float Alpha;
  10215. float Beta;
  10216. NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation;
  10217. };
  10218. #else
  10219. enum NV_META_COMMAND_MATRIX_TRANSFORM
  10220. {
  10221. NV_META_COMMAND_MATRIX_TRANSFORM_NONE,
  10222. NV_META_COMMAND_MATRIX_TRANSFORM_TRANSPOSE,
  10223. NV_META_COMMAND_MATRIX_TRANSFORM_COUNT,
  10224. };
  10225. struct NV_META_COMMAND_CREATE_GEMM_DESC
  10226. {
  10227. NV_META_COMMAND_TENSOR_DESC DescA;
  10228. NV_META_COMMAND_TENSOR_DESC DescB;
  10229. NV_META_COMMAND_OPTIONAL_TENSOR_DESC DescC;
  10230. NV_META_COMMAND_TENSOR_DESC DescOut;
  10231. NvU64 Precision; // NV_META_COMMAND_PRECISION
  10232. NvU64 TransA; // NV_META_COMMAND_MATRIX_TRANSFORM
  10233. NvU64 TransB; // NV_META_COMMAND_MATRIX_TRANSFORM
  10234. float Alpha;
  10235. float Beta;
  10236. NV_META_COMMAND_OPTIONAL_ACTIVATION_DESC Activation;
  10237. };
  10238. #endif
  10239. #pragma pack(pop)
  10240. #endif // #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  10241. #if defined (__cplusplus) && defined(__d3d11_h__)
  10242. ///////////////////////////////////////////////////////////////////////////////
  10243. //
  10244. // FUNCTION NAME: NvAPI_D3D11_EnumerateMetaCommands
  10245. //
  10246. //! \since Release: 400
  10247. //
  10248. //! \code
  10249. //! DESCRIPTION: Enumerates MetaCommands supported on the system
  10250. //!
  10251. //! \param [in] pDevice A pointer to D3D11 device.
  10252. //! \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.
  10253. //! When the value pointed is non-zero, the value indicates number of Metacommand descriptions to be populated in pDescs array.
  10254. //! \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.
  10255. //! Otherwise should have enough space to hold *pNumMetaCommands descriptors
  10256. //! SUPPORTED OS: Windows 10
  10257. //!
  10258. //! \return This API can return any of the error codes enumerated in
  10259. //! #NvAPI_Status. If there are return error codes with specific
  10260. //! meaning for this API, they are listed below.
  10261. //! \endcode
  10262. //! \ingroup dx
  10263. ///////////////////////////////////////////////////////////////////////////////
  10264. NVAPI_INTERFACE NvAPI_D3D11_EnumerateMetaCommands(__in ID3D11Device *pDevice,
  10265. __inout NvU32 *pNumMetaCommands,
  10266. __out_ecount_opt(*pNumMetaCommands) NVAPI_META_COMMAND_DESC *pDescs);
  10267. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10268. #if defined (__cplusplus) && defined(__d3d11_h__)
  10269. ///////////////////////////////////////////////////////////////////////////////
  10270. //
  10271. // FUNCTION NAME: NvAPI_D3D11_CreateMetaCommand
  10272. //
  10273. //! \since Release: 400
  10274. //
  10275. //! \code
  10276. //! DESCRIPTION: Creates a MetaCommand object which can be used to execute optimized operations exposed by driver like convolutions.
  10277. //!
  10278. //! \param [in] pDevice A pointer to D3D11 device.
  10279. //! \param [in] CommandId GUID of the operations to perform
  10280. //! \param [in] pCreationParametersData structure containing all creation parameters for the requested Metacommand
  10281. //! \param [in] CreationParametersDataSize size of parameter data structure
  10282. //! \param [out] ppMetaCommand A pointer to memory that receives the pointer to the created MetaCommand object.
  10283. //! SUPPORTED OS: Windows 10
  10284. //!
  10285. //! \return This API can return any of the error codes enumerated in
  10286. //! #NvAPI_Status. If there are return error codes with specific
  10287. //! meaning for this API, they are listed below.
  10288. //!
  10289. //! DXGI_ERROR_NOT_SUPPORTED - The requested Metacommand is not supported.
  10290. //! \endcode
  10291. //! \ingroup dx
  10292. ///////////////////////////////////////////////////////////////////////////////
  10293. #pragma pack(push, 4)
  10294. struct NV_D3D11_META_COMMAND_RESOURCE
  10295. {
  10296. union
  10297. {
  10298. NVDX_ObjectHandle ResourceHandle; // NVAPI handle of a buffer resource (use NvAPI_D3D11_GetResourceHandle to get this handle)
  10299. NvU64 unused; // to get correct sturcutre size on 32 bit builds
  10300. };
  10301. NvU64 Offset; // offset within the resource in bytes
  10302. };
  10303. struct NV_D3D11_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC
  10304. {
  10305. // Persistent resource used as scratch space by driver
  10306. // it's written at time of init, and read at time of execute
  10307. // use GetRequiredParameterResourceSize to query its size
  10308. NV_D3D11_META_COMMAND_RESOURCE PersistentResource;
  10309. };
  10310. struct NV_D3D11_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC
  10311. {
  10312. NV_D3D11_META_COMMAND_RESOURCE InputResource;
  10313. NV_D3D11_META_COMMAND_RESOURCE FilterResource;
  10314. NV_D3D11_META_COMMAND_RESOURCE BiasResource; // optional
  10315. NV_D3D11_META_COMMAND_RESOURCE OutputResource;
  10316. // Alpha1Resource and Alpha2Resource are used only when
  10317. // PerChannelScaling is set. Otherwise the scalars Alpha1/Alpha2 are used
  10318. // should have same dimension as bias
  10319. NV_D3D11_META_COMMAND_RESOURCE Alpha1Resource;
  10320. NV_D3D11_META_COMMAND_RESOURCE Alpha2Resource;
  10321. // optional, same dimension/descriptor as output
  10322. NV_D3D11_META_COMMAND_RESOURCE SkipConnectionResource;
  10323. // should point to same memory that was specified at time of init
  10324. NV_D3D11_META_COMMAND_RESOURCE PersistentResource;
  10325. // temporary resource used as scratch space by driver
  10326. // used for both read and write at the time of execute
  10327. // use GetRequiredParameterResourceSize to query its size
  10328. NV_D3D11_META_COMMAND_RESOURCE TemporaryResource;
  10329. };
  10330. // make sure structure sizes match what the driver assumes
  10331. compile_time_assert(sizeof(NV_D3D11_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC) == 16);
  10332. compile_time_assert(sizeof(NV_D3D11_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC) == 144);
  10333. struct NV_D3D11_META_COMMAND_INITIALIZE_GEMM_DESC
  10334. {
  10335. NV_D3D11_META_COMMAND_RESOURCE PersistentResource;
  10336. };
  10337. struct NV_D3D11_META_COMMAND_EXECUTE_GEMM_DESC
  10338. {
  10339. NV_D3D11_META_COMMAND_RESOURCE AResource;
  10340. NV_D3D11_META_COMMAND_RESOURCE BResource;
  10341. NV_D3D11_META_COMMAND_RESOURCE CResource;
  10342. NV_D3D11_META_COMMAND_RESOURCE OutputResource;
  10343. NV_D3D11_META_COMMAND_RESOURCE PersistentResource;
  10344. NV_D3D11_META_COMMAND_RESOURCE TemporaryResource;
  10345. };
  10346. // make sure structure sizes match what the driver assumes
  10347. compile_time_assert(sizeof(NV_D3D11_META_COMMAND_INITIALIZE_GEMM_DESC) == 16);
  10348. compile_time_assert(sizeof(NV_D3D11_META_COMMAND_EXECUTE_GEMM_DESC) == 96);
  10349. #pragma pack(pop)
  10350. DECLARE_INTERFACE_(__declspec(uuid("00BF193A-117B-42BC-BBCD-E964A0EA4F2B"))ID3D11NvMetaCommand_V1, IUnknown)
  10351. {
  10352. BEGIN_INTERFACE
  10353. // *** IUnknown methods ***
  10354. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  10355. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  10356. STDMETHOD_(ULONG,Release)(THIS) PURE;
  10357. // ** ID3D11NvMetaCommand methods ***
  10358. // Return size of parameter
  10359. STDMETHOD(GetRequiredParameterResourceSize)(THIS_ NV_META_COMMAND_RESOURCE_TYPE ResourceType, NvU64 *SizeInBytes) const PURE;
  10360. END_INTERFACE
  10361. };
  10362. typedef ID3D11NvMetaCommand_V1 ID3D11NvMetaCommand;
  10363. #define ID3D11NvMetaCommand_VER1 MAKE_NVAPI_VERSION(IID3D11NvMetaCommand_V1, 1)
  10364. #define ID3D11NvMetaCommand_VER ID3D11NvMetaCommand_VER1
  10365. NVAPI_INTERFACE NvAPI_D3D11_CreateMetaCommand(__in ID3D11Device *pDevice,
  10366. __in REFGUID CommandId,
  10367. __in_bcount(CreationParametersDataSize) const void *pCreationParametersData,
  10368. __in NvU32 CreationParametersDataSize,
  10369. __out ID3D11NvMetaCommand **ppMetaCommand);
  10370. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10371. #if defined (__cplusplus) && defined(__d3d11_h__)
  10372. ///////////////////////////////////////////////////////////////////////////////
  10373. //
  10374. // FUNCTION NAME: NvAPI_D3D11_InitializeMetaCommand
  10375. //
  10376. //! \since Release: 400
  10377. //
  10378. //! \code
  10379. //! DESCRIPTION: Initializes the given MetaCommand with the parameters passed in
  10380. //!
  10381. //! \param [in] pDeviceContext A pointer to the d3d11 device context
  10382. //! \param [in] pMetaCommand the MetaCommand to initialize
  10383. //! \param [in] pInitializationParametersData Structure containing parameters
  10384. //! \param [in] InitializationParametersDataSize Size of the parameter structure in bytes
  10385. //! SUPPORTED OS: Windows 10
  10386. //!
  10387. //! \return This API can return any of the error codes enumerated in
  10388. //! #NvAPI_Status. If there are return error codes with specific
  10389. //! meaning for this API, they are listed below.
  10390. //! \endcode
  10391. //! \ingroup dx
  10392. ///////////////////////////////////////////////////////////////////////////////
  10393. NVAPI_INTERFACE NvAPI_D3D11_InitializeMetaCommand(__in ID3D11DeviceContext *pDeviceContext,
  10394. __in ID3D11NvMetaCommand *pMetaCommand,
  10395. __in_bcount(InitializationParametersDataSize) const void *pInitializationParametersData,
  10396. __in NvU32 InitializationParametersDataSize);
  10397. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10398. #if defined (__cplusplus) && defined(__d3d11_h__)
  10399. ///////////////////////////////////////////////////////////////////////////////
  10400. //
  10401. // FUNCTION NAME: NvAPI_D3D11_ExecuteMetaCommand
  10402. //
  10403. //! \since Release: 400
  10404. //
  10405. //! \code
  10406. //! DESCRIPTION: Executes the given MetaCommand with the parameters passed in
  10407. //!
  10408. //! \param [in] pDeviceContext A pointer to the d3d11 device context
  10409. //! \param [in] pMetaCommand the MetaCommand to execute
  10410. //! \param [in] pExecutionParametersData Structure containing parameters
  10411. //! \param [in] ExecutionParametersDataSize Size of the parameter structure in bytes
  10412. //! SUPPORTED OS: Windows 10
  10413. //!
  10414. //! \return This API can return any of the error codes enumerated in
  10415. //! #NvAPI_Status. If there are return error codes with specific
  10416. //! meaning for this API, they are listed below.
  10417. //! \endcode
  10418. //! \ingroup dx
  10419. ///////////////////////////////////////////////////////////////////////////////
  10420. NVAPI_INTERFACE NvAPI_D3D11_ExecuteMetaCommand(__in ID3D11DeviceContext *pDeviceContext,
  10421. __in ID3D11NvMetaCommand *pMetaCommand,
  10422. __in_bcount(ExecutionParametersDataSize) const void *pExecutionParametersData,
  10423. __in NvU32 ExecutionParametersDataSize);
  10424. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10425. #if defined (__cplusplus) && defined(__d3d12_h__)
  10426. ///////////////////////////////////////////////////////////////////////////////
  10427. //
  10428. // FUNCTION NAME: NvAPI_D3D12_EnumerateMetaCommands
  10429. //
  10430. //! \since Release: 400
  10431. //
  10432. //! \code
  10433. //! DESCRIPTION: Enumerates MetaCommands supported on the system
  10434. //!
  10435. //! \param [in] pDevice A pointer to D3D12 device.
  10436. //! \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.
  10437. //! When the value pointed is non-zero, the value indicates number of Metacommand descriptions to be populated in pDescs array.
  10438. //! \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.
  10439. //! Otherwise should have enough space to hold *pNumMetaCommands descriptors
  10440. //! SUPPORTED OS: Windows 10
  10441. //!
  10442. //! \return This API can return any of the error codes enumerated in
  10443. //! #NvAPI_Status. If there are return error codes with specific
  10444. //! meaning for this API, they are listed below.
  10445. //! \endcode
  10446. //! \ingroup dx
  10447. ///////////////////////////////////////////////////////////////////////////////
  10448. NVAPI_INTERFACE NvAPI_D3D12_EnumerateMetaCommands(__in ID3D12Device *pDevice,
  10449. __inout NvU32 *pNumMetaCommands,
  10450. __out_ecount_opt(*pNumMetaCommands) NVAPI_META_COMMAND_DESC *pDescs);
  10451. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  10452. #if defined (__cplusplus) && defined(__d3d12_h__)
  10453. ///////////////////////////////////////////////////////////////////////////////
  10454. //
  10455. // FUNCTION NAME: NvAPI_D3D12_CreateMetaCommand
  10456. //
  10457. //! \since Release: 400
  10458. //
  10459. //! \code
  10460. //! DESCRIPTION: Creates a MetaCommand object which can be used to execute optimized operations exposed by driver like convolutions.
  10461. //!
  10462. //! \param [in] pDevice A pointer to D3D12 device.
  10463. //! \param [in] CommandId GUID of the operations to perform
  10464. //! \param [in] NodeMask GPU mask for which metacommand is to be created. Set it to 0 for single GPU systems
  10465. //! \param [in] pCreationParametersData structure containing all creation parameters for the requested Metacommand
  10466. //! \param [in] CreationParametersDataSize size of parameter data structure
  10467. //! \param [out] ppMetaCommand A pointer to memory that receives the pointer to the created MetaCommand object.
  10468. //! SUPPORTED OS: Windows 10
  10469. //!
  10470. //! \return This API can return any of the error codes enumerated in
  10471. //! #NvAPI_Status. If there are return error codes with specific
  10472. //! meaning for this API, they are listed below.
  10473. //!
  10474. //! DXGI_ERROR_NOT_SUPPORTED - The requested Metacommand is not supported.
  10475. //! \endcode
  10476. //! \ingroup dx
  10477. ///////////////////////////////////////////////////////////////////////////////
  10478. #pragma pack(push, 4)
  10479. struct NV_D3D12_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC
  10480. {
  10481. // Persistent resource used as scratch space by driver
  10482. // it's written at time of init, and read at time of execute
  10483. // use GetRequiredParameterResourceSize to query its size
  10484. D3D12_GPU_VIRTUAL_ADDRESS PersistentResource;
  10485. };
  10486. struct NV_D3D12_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC
  10487. {
  10488. D3D12_GPU_VIRTUAL_ADDRESS InputResource;
  10489. D3D12_GPU_VIRTUAL_ADDRESS FilterResource;
  10490. D3D12_GPU_VIRTUAL_ADDRESS BiasResource; // optional
  10491. D3D12_GPU_VIRTUAL_ADDRESS OutputResource;
  10492. // Alpha1Resource and Alpha2Resource are used only when
  10493. // PerChannelScaling is set. Otherwise the scalars Alpha1/Alpha2 are used
  10494. // should have same dimension as bias
  10495. D3D12_GPU_VIRTUAL_ADDRESS Alpha1Resource;
  10496. D3D12_GPU_VIRTUAL_ADDRESS Alpha2Resource;
  10497. // optional, same dimension/descriptor as output
  10498. D3D12_GPU_VIRTUAL_ADDRESS SkipConnectionResource;
  10499. // should point to same memory that was specified at time of init
  10500. D3D12_GPU_VIRTUAL_ADDRESS PersistentResource;
  10501. // temporary resource used as scratch space by driver
  10502. // both written and read at time of execute
  10503. // use GetRequiredParameterResourceSize to query its size
  10504. D3D12_GPU_VIRTUAL_ADDRESS TemporaryResource;
  10505. };
  10506. // make sure structure sizes match what the driver assumes
  10507. compile_time_assert(sizeof(NV_D3D12_META_COMMAND_INITIALIZE_CONVOLUTION_EX_DESC) == 8);
  10508. compile_time_assert(sizeof(NV_D3D12_META_COMMAND_EXECUTE_CONVOLUTION_EX_DESC) == 72);
  10509. struct NV_D3D12_META_COMMAND_INITIALIZE_GEMM_DESC
  10510. {
  10511. NvU64 PersistentResource;
  10512. };
  10513. struct NV_D3D12_META_COMMAND_EXECUTE_GEMM_DESC
  10514. {
  10515. NvU64 AResource;
  10516. NvU64 BResource;
  10517. NvU64 CResource;
  10518. NvU64 OutputResource;
  10519. NvU64 PersistentResource;
  10520. NvU64 TemporaryResource;
  10521. };
  10522. // make sure structure sizes match what the driver assumes
  10523. compile_time_assert(sizeof(NV_D3D12_META_COMMAND_INITIALIZE_GEMM_DESC) == 8);
  10524. compile_time_assert(sizeof(NV_D3D12_META_COMMAND_EXECUTE_GEMM_DESC) == 48);
  10525. #pragma pack(pop)
  10526. DECLARE_INTERFACE_(__declspec(uuid("00BF193A-117B-42BC-BBCD-E964A0EA4F2B"))ID3D12NvMetaCommand_V1, IUnknown)
  10527. {
  10528. BEGIN_INTERFACE
  10529. // *** IUnknown methods ***
  10530. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  10531. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  10532. STDMETHOD_(ULONG,Release)(THIS) PURE;
  10533. // ** ID3D12NvMetaCommand methods ***
  10534. // Return size of parameter
  10535. STDMETHOD(GetRequiredParameterResourceSize)(THIS_ NV_META_COMMAND_RESOURCE_TYPE ResourceType, NvU64 *SizeInBytes) const PURE;
  10536. END_INTERFACE
  10537. };
  10538. typedef ID3D12NvMetaCommand_V1 ID3D12NvMetaCommand;
  10539. #define ID3D12NvMetaCommand_VER1 MAKE_NVAPI_VERSION(IID3D12NvMetaCommand_V1, 1)
  10540. #define ID3D12NvMetaCommand_VER ID3D12NvMetaCommand_VER1
  10541. NVAPI_INTERFACE NvAPI_D3D12_CreateMetaCommand(__in ID3D12Device *pDevice,
  10542. __in REFGUID CommandId,
  10543. __in NvU32 NodeMask,
  10544. __in_bcount(CreationParametersDataSize) const void *pCreationParametersData,
  10545. __in NvU32 CreationParametersDataSize,
  10546. __out ID3D12NvMetaCommand **ppMetaCommand);
  10547. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  10548. #if defined (__cplusplus) && defined(__d3d12_h__)
  10549. ///////////////////////////////////////////////////////////////////////////////
  10550. //
  10551. // FUNCTION NAME: NvAPI_D3D12_InitializeMetaCommand
  10552. //
  10553. //! \since Release: 400
  10554. //
  10555. //! \code
  10556. //! DESCRIPTION: Initializes the given MetaCommand with the parameters passed in
  10557. //!
  10558. //! \param [in] pCommandList A pointer to D3D12 command list.
  10559. //! \param [in] pMetaCommand the MetaCommand to initialize
  10560. //! \param [in] pInitializationParametersData Structure containing parameters
  10561. //! \param [in] InitializationParametersDataSize Size of the parameter structure in bytes
  10562. //! SUPPORTED OS: Windows 10
  10563. //!
  10564. //! \return This API can return any of the error codes enumerated in
  10565. //! #NvAPI_Status. If there are return error codes with specific
  10566. //! meaning for this API, they are listed below.
  10567. //! \endcode
  10568. //! \ingroup dx
  10569. ///////////////////////////////////////////////////////////////////////////////
  10570. NVAPI_INTERFACE NvAPI_D3D12_InitializeMetaCommand(__in ID3D12GraphicsCommandList *pCommandlist,
  10571. __in ID3D12NvMetaCommand *pMetaCommand,
  10572. __in_bcount(InitializationParametersDataSize) const void *pInitializationParametersData,
  10573. __in NvU32 InitializationParametersDataSize);
  10574. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  10575. #if defined (__cplusplus) && defined(__d3d12_h__)
  10576. ///////////////////////////////////////////////////////////////////////////////
  10577. //
  10578. // FUNCTION NAME: NvAPI_D3D12_ExecuteMetaCommand
  10579. //
  10580. //! \since Release: 400
  10581. //
  10582. //! \code
  10583. //! DESCRIPTION: Executes the given MetaCommand with the parameters passed in
  10584. //!
  10585. //! \param [in] pCommandList A pointer to D3D12 command list.
  10586. //! \param [in] pMetaCommand the MetaCommand to execute
  10587. //! \param [in] pExecutionParametersData Structure containing parameters
  10588. //! \param [in] ExecutionParametersDataSize Size of the parameter structure in bytes
  10589. //! SUPPORTED OS: Windows 10
  10590. //!
  10591. //! \return This API can return any of the error codes enumerated in
  10592. //! #NvAPI_Status. If there are return error codes with specific
  10593. //! meaning for this API, they are listed below.
  10594. //! \endcode
  10595. //! \ingroup dx
  10596. ///////////////////////////////////////////////////////////////////////////////
  10597. NVAPI_INTERFACE NvAPI_D3D12_ExecuteMetaCommand(__in ID3D12GraphicsCommandList *pCommandlist,
  10598. __in ID3D12NvMetaCommand *pMetaCommand,
  10599. __in_bcount(ExecutionParametersDataSize) const void *pExecutionParametersData,
  10600. __in NvU32 ExecutionParametersDataSize);
  10601. #endif //defined(__cplusplus) && defined(__d3d12_h__)
  10602. #if defined (__cplusplus) && defined(__d3d12_h__)
  10603. ///////////////////////////////////////////////////////////////////////////////
  10604. //
  10605. // FUNCTION NAME: NvAPI_D3D12_IsNvShaderExtnOpCodeSupported
  10606. //
  10607. //! DESCRIPTION: This function checks if a nv HLSL shader extension opcode is
  10608. //! supported on current hardware. List of opcodes is in nvShaderExtnEnums.h
  10609. //! To use Nvidia HLSL extensions the application must include nvHLSLExtns.h
  10610. //! in the hlsl shader code. See nvHLSLExtns.h for more details on supported opcodes.
  10611. //!
  10612. //! \since Release: 364
  10613. //!
  10614. //! SUPPORTED OS: Windows 10
  10615. //!
  10616. //!
  10617. //! \param [in] pDev The device on which to query for support
  10618. //! \param [in] opCode the opcode to check
  10619. //! \param [out] pSupported true if supported, false otherwise
  10620. //!
  10621. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  10622. //! \retval :: NVAPI_OK if the call succeeded
  10623. //!
  10624. //! \ingroup dx
  10625. ///////////////////////////////////////////////////////////////////////////////
  10626. NVAPI_INTERFACE NvAPI_D3D12_IsNvShaderExtnOpCodeSupported(__in ID3D12Device *pDevice,
  10627. __in NvU32 opCode,
  10628. __out bool *pSupported);
  10629. #endif //defined (__cplusplus) && defined(__d3d12_h__)
  10630. #if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  10631. ///////////////////////////////////////////////////////////////////////////////
  10632. //!
  10633. //! FUNCTION NAME: NvAPI_D3D_IsGSyncCapable
  10634. //! DESCRIPTION: This API gets G-Sync capability for the given device context.
  10635. //! This is only reliable after the first present call has completed.
  10636. //! \param [in] pDeviceOrContext The D3D9, D3D10, D3D11 device, or D3D11 device context
  10637. //! \param [in] NVDX_ObjectHandle The handle of primary surface
  10638. //! \param [out] pIsGsyncCapable if G-Sync can be enabled, *pIsGsyncCapable is true.
  10639. //!
  10640. //! SUPPORTED OS: Windows 7 and higher
  10641. //!
  10642. //!
  10643. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  10644. //! If there are return error codes with specific meaning for this API, they are listed below.
  10645. //!
  10646. //! \ingroup dx
  10647. ///////////////////////////////////////////////////////////////////////////////
  10648. NVAPI_INTERFACE NvAPI_D3D_IsGSyncCapable(__in IUnknown *pDeviceOrContext, __in NVDX_ObjectHandle primarySurface, __out BOOL *pIsGsyncCapable);
  10649. #endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  10650. #if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  10651. ///////////////////////////////////////////////////////////////////////////////
  10652. //!
  10653. //! FUNCTION NAME: NvAPI_D3D_IsGSyncActive
  10654. //! DESCRIPTION: This API get the G-Sync state for the given device context.
  10655. //! This is only reliable after the first present call has completed.
  10656. //! As it is a bit time consuming, It should not be called per frame.
  10657. //! \param [in] pDeviceOrContext The D3D9, D3D10, D3D11 device, or D3D11 device context
  10658. //! \param [in] NVDX_ObjectHandle The handle of primary surface
  10659. //! \param [out] pIsGsyncActive if G-Sync is active, *pisGsyncActive is true.
  10660. //!
  10661. //! SUPPORTED OS: Windows 7 and higher
  10662. //!
  10663. //!
  10664. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  10665. //! If there are return error codes with specific meaning for this API, they are listed below.
  10666. //!
  10667. //! \ingroup dx
  10668. ///////////////////////////////////////////////////////////////////////////////
  10669. NVAPI_INTERFACE NvAPI_D3D_IsGSyncActive(__in IUnknown *pDeviceOrContext, __in NVDX_ObjectHandle primarySurface, __out BOOL *pIsGsyncActive);
  10670. #endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  10671. //! SUPPORTED OS: Windows 7 and higher
  10672. //!
  10673. #if defined (__cplusplus) && ( defined(__d3d10_h__) || defined(__d3d10_1_h__) ||defined(__d3d11_h__) )
  10674. ///////////////////////////////////////////////////////////////////////////////
  10675. //
  10676. // FUNCTION NAME: NvAPI_D3D1x_DisableShaderDiskCache
  10677. //
  10678. //! DESCRIPTION: Disables driver managed caching of shader compilations to disk
  10679. //!
  10680. //! \param [in] pDevice Device to disabled the shader disk cache on
  10681. //!
  10682. //!
  10683. //! \retval ::NVAPI_OK Shader disk cache was disabled
  10684. //! \retval ::NVAPI_ERROR The operation failed.
  10685. //! \retval ::NVAPI_INVALID_ARGUMENT Argument passed in is invalid.
  10686. //! \ingroup dx
  10687. ///////////////////////////////////////////////////////////////////////////////
  10688. NVAPI_INTERFACE NvAPI_D3D1x_DisableShaderDiskCache(IUnknown *pDevice);
  10689. #endif //defined(__cplusplus) && ( defined(__d3d10_h__) || defined(__d3d10_1_h__) ||defined(__d3d11_h__) )
  10690. //! SUPPORTED OS: Windows 7 and higher
  10691. //!
  10692. #if defined (__cplusplus) && defined(__d3d11_h__)
  10693. ///////////////////////////////////////////////////////////////////////////////
  10694. //
  10695. // FUNCTION NAME: NvAPI_D3D11_MultiGPU_GetCaps
  10696. //
  10697. //! DESCRIPTION: Request to get multi GPU extension caps.
  10698. //!
  10699. //! \param [in/out] pMultiGPUCaps Pointer to a structure returning multi GPU caps
  10700. //! \retval ::NVAPI_OK Call succeeded.
  10701. //! \retval ::NVAPI_ERROR Call failed.
  10702. //! \ingroup dx
  10703. ///////////////////////////////////////////////////////////////////////////////
  10704. //! \ingroup dx
  10705. typedef struct _NV_MULTIGPU_CAPS_V1
  10706. {
  10707. NvU32 multiGPUVersion;
  10708. NvU32 reserved;
  10709. NvU32 nTotalGPUs;
  10710. NvU32 nSLIGPUs;
  10711. NvU32 videoBridgePresent;
  10712. } NV_MULTIGPU_CAPS_V1, *PNV_MULTIGPU_CAPS_V1;
  10713. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10714. //! SUPPORTED OS: Windows 7 and higher
  10715. //!
  10716. #if defined (__cplusplus) && defined(__d3d11_h__)
  10717. typedef struct _NV_MULTIGPU_CAPS_V2
  10718. {
  10719. NvU32 multiGPUVersion;
  10720. union
  10721. {
  10722. NvU32 reserved;
  10723. NvU32 version; //!< The version of the structure
  10724. };
  10725. NvU32 nTotalGPUs;
  10726. NvU32 nSLIGPUs;
  10727. NvU32 videoBridgePresent;
  10728. NvU32 NvLinkPresent;
  10729. NvU32 fastNvLinkReads;
  10730. } NV_MULTIGPU_CAPS_V2, *PNV_MULTIGPU_CAPS_V2;
  10731. #define NV_MULTIGPU_CAPS_VER1 MAKE_NVAPI_VERSION(NV_MULTIGPU_CAPS_V1, 1)
  10732. #define NV_MULTIGPU_CAPS_VER2 MAKE_NVAPI_VERSION(NV_MULTIGPU_CAPS_V2, 2)
  10733. #define NV_MULTIGPU_CAPS_VER NV_MULTIGPU_CAPS_VER2
  10734. typedef NV_MULTIGPU_CAPS_V2 NV_MULTIGPU_CAPS;
  10735. typedef PNV_MULTIGPU_CAPS_V2 PNV_MULTIGPU_CAPS;
  10736. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10737. //! SUPPORTED OS: Windows 7 and higher
  10738. //!
  10739. #if defined (__cplusplus) && defined(__d3d11_h__)
  10740. //! \ingroup dx
  10741. #ifndef NV_MULTIGPU_CAPS_VER
  10742. typedef NV_MULTIGPU_CAPS_V1 NV_MULTIGPU_CAPS;
  10743. typedef PNV_MULTIGPU_CAPS_V1 PNV_MULTIGPU_CAPS;
  10744. #endif
  10745. NVAPI_INTERFACE NvAPI_D3D11_MultiGPU_GetCaps(__inout PNV_MULTIGPU_CAPS pMultiGPUCaps);
  10746. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10747. //! SUPPORTED OS: Windows 7 and higher
  10748. //!
  10749. #if defined (__cplusplus) && defined(__d3d11_h__)
  10750. ///////////////////////////////////////////////////////////////////////////////
  10751. //
  10752. // FUNCTION NAME: NvAPI_D3D11_MultiGPU_Init
  10753. //
  10754. //! DESCRIPTION: Request to enable/disable multi GPU extension. Also if enabled automatically disables auto stereo.
  10755. //!
  10756. //! \param [in] bEnable if true enables the extension for all subsequently created devices. Otherwise disables it
  10757. //! \retval ::NVAPI_OK Call succeeded.
  10758. //! \retval ::NVAPI_ERROR Call failed.
  10759. //! \ingroup dx
  10760. ///////////////////////////////////////////////////////////////////////////////
  10761. NVAPI_INTERFACE NvAPI_D3D11_MultiGPU_Init(__in bool bEnable);
  10762. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10763. //! SUPPORTED OS: Windows 7 and higher
  10764. //!
  10765. #if defined (__cplusplus) && defined(__d3d11_h__)
  10766. ///////////////////////////////////////////////////////////////////////////////
  10767. //
  10768. // FUNCTION NAME: NvAPI_D3D11_CreateMultiGPUDevice
  10769. //! \code
  10770. //! DESCRIPTION: This function returns ID3D11MultiGPUDevice used for multi GPU VR support
  10771. //!
  10772. //! \param [in] pDevice current d3d device
  10773. //! \param [in] version version of requested ID3D11MultiGPUDevice.
  10774. //! \param [out] currentVersion pointer to returned current version of ID3D11MultiGPUDevice.
  10775. //! \param [out] ppD3D11MultiGPUDevice pointer to returned ID3D11MultiGPUDevice.
  10776. //! \param [in] maxGpus max number of gpus this ID3D11MultiGPUDevice is allowed to use
  10777. //!
  10778. //!
  10779. //! \return ::NVAPI_OK if the call succeeds.
  10780. //! NVAPI_INVALID_ARGUMENT if NvAPI_D3D11_MultiGPU_Init() was not enabled prior to the creation of the D3D11 device,
  10781. //! or if maxGpus is greater than the number of GPUs in the SLI group.
  10782. //! NVAPI_NO_ACTIVE_SLI_TOPOLOGY on single-GPU systems, or
  10783. //! if SLI has not been enabled in the NVIDIA control panel.
  10784. //! NVAPI_INVALID_CALL if there is already an ID3D11MultiGPUDevice created for the specified ID3D11Device.
  10785. //! NVAPI_INCOMPATIBLE_STRUCT_VERSION if requested interface version is greater than the one that is supported by installed.
  10786. //! driver. In this case currentVersion will contain version supported by installed driver.
  10787. //! \endcode
  10788. ///////////////////////////////////////////////////////////////////////////////
  10789. //! \ingroup dx
  10790. #define NVAPI_COPY_ASYNCHRONOUSLY 1
  10791. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10792. //! SUPPORTED OS: Windows 7 and higher
  10793. //!
  10794. #if defined (__cplusplus) && defined(__d3d11_h__)
  10795. #define NVAPI_COPY_P2P_READ 2
  10796. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10797. //! SUPPORTED OS: Windows 7 and higher
  10798. //!
  10799. #if defined (__cplusplus) && defined(__d3d11_h__)
  10800. #define NVAPI_CPU_RESOURCE 0xffffffff
  10801. DECLARE_INTERFACE(ID3D11MultiGPUDevice_V1)
  10802. {
  10803. ////////////////////////////// VER1 methods //////////////////////////////////////////
  10804. STDMETHOD_(void,Destroy)(THIS) PURE;
  10805. STDMETHOD_(UINT,SetGPUMask)(THIS_ __in UINT GPUMask) PURE;
  10806. STDMETHOD_(NvAPI_Status,CopySubresourceRegion)(THIS_ __in ID3D11DeviceContext *pContext, __in ID3D11Resource *pDstResource, __in UINT DstSubresource,
  10807. __in UINT DstGPUIndex, __in UINT DstX, __in UINT DstY, __in UINT DstZ,
  10808. __in ID3D11Resource *pSrcResource, __in UINT SrcSubresource, __in UINT SrcGPUIndex,
  10809. __in const D3D11_BOX *pSrcBox, __in UINT ExtendedFlags = 0) PURE;
  10810. #if defined(__d3d11_1_h__)
  10811. STDMETHOD_(NvAPI_Status,CopySubresourceRegion1)(THIS_ __in ID3D11DeviceContext1 *pContext1, __in ID3D11Resource *pDstResource, __in UINT DstSubresource,
  10812. __in UINT DstGPUIndex, __in UINT DstX, __in UINT DstY, __in UINT DstZ,
  10813. __in ID3D11Resource *pSrcResource, __in UINT SrcSubresource, __in UINT SrcGPUIndex,
  10814. __in const D3D11_BOX *pSrcBox, __in UINT CopyFlags, __in UINT ExtendedFlags = 0 ) PURE;
  10815. #else
  10816. STDMETHOD_(NvAPI_Status,CopySubresourceRegion1)(THIS_ __in void *pContext1, __in ID3D11Resource *pDstResource, __in UINT DstSubresource,
  10817. __in UINT DstGPUIndex, __in UINT DstX, __in UINT DstY, __in UINT DstZ,
  10818. __in ID3D11Resource *pSrcResource, __in UINT SrcSubresource, __in UINT SrcGPUIndex,
  10819. __in const D3D11_BOX *pSrcBox, __in UINT CopyFlags, __in UINT ExtendedFlags = 0 ) PURE;
  10820. #endif
  10821. STDMETHOD_(NvAPI_Status,UpdateSubresource)(THIS_ __in ID3D11DeviceContext *pContext,__in ID3D11Resource *pDstResource, __in UINT DstSubresource, __in UINT DstGPUIndex,
  10822. __in const D3D11_BOX *pDstBox, __in const void *pSrcData, __in UINT SrcRowPitch, __in UINT SrcDepthPitch) PURE;
  10823. STDMETHOD_(NvAPI_Status,VSSetConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT GPUMask, __in UINT StartSlot,
  10824. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
  10825. __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
  10826. STDMETHOD_(NvAPI_Status,PSSetConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT GPUMask, __in UINT StartSlot,
  10827. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
  10828. __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
  10829. STDMETHOD_(NvAPI_Status,GSSetConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT GPUMask, __in UINT StartSlot,
  10830. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
  10831. __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
  10832. STDMETHOD_(NvAPI_Status,DSSetConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT GPUMask, __in UINT StartSlot,
  10833. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
  10834. __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
  10835. STDMETHOD_(NvAPI_Status,HSSetConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT GPUMask, __in UINT StartSlot,
  10836. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
  10837. __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
  10838. STDMETHOD_(NvAPI_Status,CSSetConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT GPUMask, __in UINT StartSlot,
  10839. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers,
  10840. __in UINT *const pFirstConstant = NULL, __in UINT *const pNumConstants = NULL) PURE;
  10841. STDMETHOD_(NvAPI_Status,SetViewports)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT GPUMask, __in UINT NumViewports,
  10842. __in const D3D11_VIEWPORT *pViewports) PURE;
  10843. STDMETHOD_(NvAPI_Status,SetScissorRects)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT GPUMask, __in UINT NumRects,
  10844. __in const D3D11_RECT *pRects) PURE;
  10845. STDMETHOD_(HRESULT,GetData)(THIS_ __in ID3D11DeviceContext *pContext, __in ID3D11Asynchronous *pAsync, __in UINT GPUIndex,
  10846. __out void *pData, __in UINT DataSize, __in UINT GetDataFlags) PURE;
  10847. #if defined(__d3d11_2_h__)
  10848. STDMETHOD_(NvAPI_Status,UpdateTiles)(THIS_ __in ID3D11DeviceContext2 *pContext2, __in ID3D11Resource *pDestTiledResource,
  10849. __in UINT GPUMask, __in const D3D11_TILED_RESOURCE_COORDINATE *pDestTileRegionStartCoordinate,
  10850. __in const D3D11_TILE_REGION_SIZE *pDestTileRegionSize, __in const void *pSourceTileData,
  10851. __in UINT Flags) PURE;
  10852. #else
  10853. STDMETHOD_(NvAPI_Status,UpdateTiles)(THIS_ __in void *pContext2, __in ID3D11Resource *pDestTiledResource,
  10854. __in UINT GPUMask, __in const void *pDestTileRegionStartCoordinate,
  10855. __in const void *pDestTileRegionSize, __in const void *pSourceTileData,
  10856. __in UINT Flags) PURE;
  10857. #endif
  10858. STDMETHOD_(NvAPI_Status,CreateFences)(THIS_ __in UINT count, __out void **ppFences) PURE;
  10859. STDMETHOD_(NvAPI_Status,SetFence)(THIS_ __in UINT GPUIndex, __in void *hFence, __in UINT64 value) PURE;
  10860. STDMETHOD_(NvAPI_Status,WaitForFence)(THIS_ __in UINT GPUIMask, __in void *hFence, __in UINT64 value) PURE;
  10861. STDMETHOD_(NvAPI_Status,FreeFences)(THIS_ __in UINT count, __in void **ppFences) PURE;
  10862. STDMETHOD_(NvAPI_Status,PresentCompositingConfig )(THIS_ __in IUnknown *pSwapChain, __in UINT GPUMask,
  10863. __in const D3D11_RECT *pRects, __in UINT flags) PURE;
  10864. ////////////////////////////// end of VER1 methods //////////////////////////////////////////
  10865. ////////////////////////////// Methods added in VER2 //////////////////////////////////////////
  10866. STDMETHOD_(NvAPI_Status,SetContextGPUMask)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT GPUMask) PURE;
  10867. STDMETHOD_(NvAPI_Status,GetVideoBridgeStatus)(THIS_ __in IUnknown *pSwapChain, __in UINT* pVideoBridgeStatus) PURE;
  10868. ////////////////////////////// end of VER2 methods //////////////////////////////////////////
  10869. ////////////////////////////// Methods added in VER3 //////////////////////////////////////////
  10870. STDMETHOD_(NvAPI_Status,CreateMultiGPUConstantBuffer)(THIS_ __in const D3D11_BUFFER_DESC *pDesc, __in_opt const D3D11_SUBRESOURCE_DATA **ppInitialData, __out ID3D11Buffer **ppBuffer) PURE;
  10871. STDMETHOD_(NvAPI_Status,ReleaseMultiGPUConstantBuffer)(THIS_ __in ID3D11Buffer *pBuffer) PURE;
  10872. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  10873. // Following XXSetMGPUConstantBuffers work the same way as DX XXSetConstantBuffers
  10874. // The difference is that
  10875. // 1. They are setting constant buffers on GPUs that are defined by
  10876. // current GPU mask that is set via SetGPUMask.
  10877. // 2. For constant buffer created via CreateMultiGPUConstantBuffer these calls set GPU specific constant buffer.
  10878. // 3. For regular constant buffers these calls set the same constant buffer on all GPUs defined by 1.
  10879. // 4. If these functions are called in deferred context then GPUs are defined as GlobalGPUmask&LocalGPUMask
  10880. // where GlobalGPUmask is GPUMask set before CL execution
  10881. // and LocalGPUMask is current GPUMask set in CL.
  10882. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  10883. STDMETHOD_(NvAPI_Status,VSSetMGPUConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT StartSlot,
  10884. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
  10885. STDMETHOD_(NvAPI_Status,PSSetMGPUConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT StartSlot,
  10886. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
  10887. STDMETHOD_(NvAPI_Status,GSSetMGPUConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT StartSlot,
  10888. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
  10889. STDMETHOD_(NvAPI_Status,DSSetMGPUConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT StartSlot,
  10890. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
  10891. STDMETHOD_(NvAPI_Status,HSSetMGPUConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT StartSlot,
  10892. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
  10893. STDMETHOD_(NvAPI_Status,CSSetMGPUConstantBuffers)(THIS_ __in ID3D11DeviceContext *pContext, __in UINT StartSlot,
  10894. __in UINT NumBuffers, __in ID3D11Buffer *const *ppConstantBuffers) PURE;
  10895. STDMETHOD_(NvAPI_Status,UpdateConstantBuffer)(__in ID3D11DeviceContext *pContext, __in ID3D11Buffer *pBuffer, __in const void *pSrcData, __in_opt UINT GPUMask = 0) PURE;
  10896. ////////////////////////////// end of VER3 methods //////////////////////////////////////////
  10897. };
  10898. //! Synchronization macros based on fences.
  10899. #define FENCE_SYNCHRONIZATION_START(pMultiGPUDevice, hFence, Value, srcGpu, dstGpu) \
  10900. pMultiGPUDevice->SetFence(dstGpu, hFence, Value); \
  10901. pMultiGPUDevice->WaitForFence(1 << (srcGpu), hFence, Value); \
  10902. Value++;
  10903. #define FENCE_SYNCHRONIZATION_END(pMultiGPUDevice, hFence, Value, srcGpu, dstGpu) \
  10904. pMultiGPUDevice->SetFence(srcGpu, hFence, Value); \
  10905. pMultiGPUDevice->WaitForFence(1 << (dstGpu), hFence, Value); \
  10906. Value++;
  10907. //! PresentCompositingConfig method flags.
  10908. #define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_USE_VIDEO_BRIDGE 0x01
  10909. #define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_CLEAR_OUTBANDS 0x02
  10910. #define NVAPI_PRESENT_COMPOSITING_CONFIG_FLAG_GET_VIDEO_BRIDGE_STATUS 0x80000000
  10911. #define NVAPI_VIDEO_BRIDGE_STATUS_AVAILABLE 0
  10912. #define NVAPI_VIDEO_BRIDGE_STATUS_NOT_AVAILABLE 1
  10913. #define NVAPI_VIDEO_BRIDGE_STATUS_FAILED_ACCESS 2
  10914. #define NVAPI_VIDEO_BRIDGE_STATUS_UNKNOWN 3
  10915. #define NVAPI_ALL_GPUS 0
  10916. typedef ID3D11MultiGPUDevice_V1 ID3D11MultiGPUDevice;
  10917. #define ID3D11MultiGPUDevice_VER1 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 1)
  10918. #define ID3D11MultiGPUDevice_VER2 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 2)
  10919. #define ID3D11MultiGPUDevice_VER3 MAKE_NVAPI_VERSION(ID3D11MultiGPUDevice_V1, 3)
  10920. #define ID3D11MultiGPUDevice_VER ID3D11MultiGPUDevice_VER3
  10921. #define ALL_GPUS 0
  10922. //! \ingroup dx
  10923. NVAPI_INTERFACE NvAPI_D3D11_CreateMultiGPUDevice(__in ID3D11Device *pDevice, __in ULONG version, __out ULONG *currentVersion, __out ID3D11MultiGPUDevice **ppD3D11MultiGPUDevice, __in UINT maxGpus=ALL_GPUS);
  10924. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  10925. //! SUPPORTED OS: Windows 7 and higher
  10926. //!
  10927. //! Used to query the support of Single Pass Stereo HW feature
  10928. //! \ingroup dx
  10929. typedef struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1
  10930. {
  10931. NvU32 version; // parameter struct version
  10932. NvU32 bSinglePassStereoSupported; // Single Pass Stereo supported
  10933. } NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1;
  10934. typedef struct _NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2
  10935. {
  10936. NvU32 version; // _IN_ parameter struct version
  10937. NvU32 bSinglePassStereoSupported : 1; // _OUT_ Single Pass Stereo supported
  10938. NvU32 bSinglePassStereoXYZWSupported : 1; // _OUT_ Single Pass Stereo XYZW supported
  10939. NvU32 reserved : 30; // _INOUT_ bits reserved for future use
  10940. } NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2;
  10941. typedef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2 NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS;
  10942. #define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1, 1)
  10943. #define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER2 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V2, 2)
  10944. #define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER2
  10945. #ifndef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER
  10946. typedef NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1 NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS;
  10947. #define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_V1, 1)
  10948. #define NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS_VER1
  10949. #endif
  10950. #if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  10951. ///////////////////////////////////////////////////////////////////////////////
  10952. //
  10953. // FUNCTION NAME: NvAPI_D3D_QuerySinglePassStereoSupport
  10954. //
  10955. //! DESCRIPTION: Queries the support of Single Pass Stereo feature on current setup and returns appropriate boolean value.
  10956. //!
  10957. //! SUPPORTED OS: Windows 7 and higher
  10958. //!
  10959. //!
  10960. //! \param [in] pDevice The ID3D11Device to use.
  10961. //! \param [inout] pSinglePassStereoSupportedParams Stores value of whether Single Pass Stereo is supported on current setup or not.
  10962. //!
  10963. //! \retval NVAPI_OK Call succeeded.
  10964. //! \retval NVAPI_ERROR Call failed.
  10965. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  10966. //!
  10967. //! \ingroup dx
  10968. ///////////////////////////////////////////////////////////////////////////////
  10969. NVAPI_INTERFACE NvAPI_D3D_QuerySinglePassStereoSupport(__in IUnknown *pDevice,
  10970. __inout NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS *pQuerySinglePassStereoSupportedParams);
  10971. #endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  10972. #if defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
  10973. ///////////////////////////////////////////////////////////////////////////////
  10974. //
  10975. // FUNCTION NAME: NvAPI_D3D_SetSinglePassStereoMode
  10976. //
  10977. //! DESCRIPTION: Set the Single Pass Stereo state
  10978. //!
  10979. //! \note Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid.
  10980. //! Returned value NVAPI_OK does not reflect that Single Pass Stereo is supported or is set in hardware.
  10981. //! One must call NvAPI_D3D_QuerySinglePassStereoSupport() to confirm that the current setup
  10982. //! supports Single Pass Stereo before calling this set-function.
  10983. //!
  10984. //! SUPPORTED OS: Windows 7 and higher
  10985. //!
  10986. //!
  10987. //! \param [in] pDevOrContext The ID3D11Device or ID3D11DeviceContext to use.
  10988. //! \param [in] numViews Number of views to render.
  10989. //! \param [in] renderTargetIndexOffset Offset between render targets of the different views.
  10990. //! \param [in] independentViewportMaskEnable Is the independent viewport mask enabled.
  10991. //!
  10992. //! \retval NVAPI_OK Call succeeded.
  10993. //! \retval NVAPI_ERROR Call failed.
  10994. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  10995. //!
  10996. //! \ingroup dx
  10997. ///////////////////////////////////////////////////////////////////////////////
  10998. NVAPI_INTERFACE NvAPI_D3D_SetSinglePassStereoMode(__in IUnknown *pDevOrContext, __in NvU32 numViews, __in NvU32 renderTargetIndexOffset, __in NvU8 independentViewportMaskEnable);
  10999. #endif //defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
  11000. #if defined(__cplusplus) && ( defined(__d3d12_h__))
  11001. ///////////////////////////////////////////////////////////////////////////////
  11002. //
  11003. // FUNCTION NAME: NvAPI_D3D12_QuerySinglePassStereoSupport
  11004. //
  11005. //! DESCRIPTION: Queries the support of Single Pass Stereo feature on current setup and returns appropriate boolean value.
  11006. //!
  11007. //! SUPPORTED OS: Windows 10
  11008. //!
  11009. //!
  11010. //! \param [in] pDevice The IDirect3DDevice12 to use.
  11011. //! \param [inout] pQuerySinglePassStereoSupportedParams Stores value of whether Single Pass Stereo is supported on current setup or not.
  11012. //!
  11013. //! \retval NVAPI_OK Call succeeded.
  11014. //! \retval NVAPI_ERROR Call failed.
  11015. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  11016. //!
  11017. //! \ingroup dx
  11018. ///////////////////////////////////////////////////////////////////////////////
  11019. NVAPI_INTERFACE NvAPI_D3D12_QuerySinglePassStereoSupport(__in ID3D12Device *pDevice,
  11020. __inout NV_QUERY_SINGLE_PASS_STEREO_SUPPORT_PARAMS *pQuerySinglePassStereoSupportedParams);
  11021. #endif // defined(__cplusplus) && ( defined(__d3d12_h__))
  11022. #if defined(__cplusplus) && ( defined(__d3d12_h__))
  11023. ///////////////////////////////////////////////////////////////////////////////
  11024. //
  11025. // FUNCTION NAME: NvAPI_D3D12_SetSinglePassStereoMode
  11026. //
  11027. //! DESCRIPTION: Set the Single Pass Stereo state.
  11028. //!
  11029. //! \note Note that Single Pass Stereo state persists on a particular CommandList till it is closed.
  11030. //! The state is reset to default (disabled) for every newly created CommandList.
  11031. //! One must call NvAPI_D3D12_QuerySinglePassStereoSupport() to confirm that the current setup
  11032. //! supports Single Pass Stereo before calling this set-function.
  11033. //!
  11034. //! SUPPORTED OS: Windows 10
  11035. //!
  11036. //!
  11037. //! \param [in] pCommandList The command list in which we will add push buffer commmands for enabling Single Pass Stereo feature
  11038. //! Note: Command list of type D3D12_COMMAND_LIST_TYPE_BUNDLE is not allowed for setting the state of this feature.
  11039. //! \param [in] numViews Number of views to render.
  11040. //! \param [in] RenderTargetIndexOffset Offset between render targets of the different views.
  11041. //! \param [in] IndependentViewportMaskEnable Is the independent viewport mask enabled.
  11042. //!
  11043. //! \retval NVAPI_OK Call succeeded.
  11044. //! \retval NVAPI_ERROR Call failed.
  11045. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  11046. //!
  11047. //! \ingroup dx
  11048. ///////////////////////////////////////////////////////////////////////////////
  11049. NVAPI_INTERFACE NvAPI_D3D12_SetSinglePassStereoMode(__in ID3D12GraphicsCommandList* pCommandList,
  11050. __in NvU32 numViews,
  11051. __in NvU32 renderTargetIndexOffset,
  11052. __in NvU8 independentViewportMaskEnable);
  11053. #endif // defined(__cplusplus) && ( defined(__d3d12_h__))
  11054. //! SUPPORTED OS: Windows 7 and higher
  11055. //!
  11056. //! Used to query the support of MultiView HW feature
  11057. //! \ingroup dx
  11058. typedef struct _NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1
  11059. {
  11060. NvU32 version; // _IN_ parameter struct version
  11061. NvU32 bMultiViewSupported : 1; // _OUT_ MultiView supported (Render 4 views in a single pass)
  11062. NvU32 bSinglePassStereoSupported : 1; // _OUT_ StereoX supported (Render 2 views in a single pass)
  11063. NvU32 bSinglePassStereoXYZWSupported : 1; // _OUT_ StereoXYZW supported (Render 2 views in a single pass)
  11064. NvU32 reserved : 29; // _INOUT_ bits reserved for future use
  11065. } NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1;
  11066. typedef NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1 NV_QUERY_MULTIVIEW_SUPPORT_PARAMS;
  11067. #define NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_V1, 1)
  11068. #define NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER NV_QUERY_MULTIVIEW_SUPPORT_PARAMS_VER1
  11069. #define NV_MULTIVIEW_MAX_SUPPORTED_VIEWS 4
  11070. #if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  11071. ///////////////////////////////////////////////////////////////////////////////
  11072. //
  11073. // FUNCTION NAME: NvAPI_D3D_QueryMultiViewSupport
  11074. //
  11075. //! DESCRIPTION: Queries the support of MultiView feature on current setup and returns appropriate boolean value.
  11076. //!
  11077. //! SUPPORTED OS: Windows 7 and higher
  11078. //!
  11079. //!
  11080. //! \since Release: 410
  11081. //!
  11082. //! \param [in] pDevice The ID3D11Device to use.
  11083. //! \param [inout] pMultiViewSupportedParams Stores value of whether MultiView is supported on current setup or not.
  11084. //!
  11085. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  11086. //! If there are return error codes with specific meaning for this API, they are listed below.
  11087. //! (none)
  11088. //!
  11089. //! \ingroup dx
  11090. ///////////////////////////////////////////////////////////////////////////////
  11091. NVAPI_INTERFACE NvAPI_D3D_QueryMultiViewSupport(__in IUnknown *pDevice,
  11092. __inout NV_QUERY_MULTIVIEW_SUPPORT_PARAMS *pQueryMultiViewSupportedParams);
  11093. #endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  11094. //! SUPPORTED OS: Windows 7 and higher
  11095. //!
  11096. //! Used for setting the Mode for MultiView HW Feature.
  11097. //! \ingroup dx
  11098. typedef struct _NV_MULTIVIEW_PARAMS_V1
  11099. {
  11100. NvU32 version; // _IN_ parameter struct version
  11101. NvU32 numViews; // _IN_ Number of views to render.
  11102. NvU32 renderTargetIndexOffset[NV_MULTIVIEW_MAX_SUPPORTED_VIEWS]; // _IN_ Offset between render targets for each of the per views.
  11103. NvU8 independentViewportMaskEnable; // _IN_ Is the independent viewport mask enabled.
  11104. } NV_MULTIVIEW_PARAMS_V1;
  11105. typedef NV_MULTIVIEW_PARAMS_V1 NV_MULTIVIEW_PARAMS;
  11106. #define NV_MULTIVIEW_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_MULTIVIEW_PARAMS_V1, 1)
  11107. #define NV_MULTIVIEW_PARAMS_VER NV_MULTIVIEW_PARAMS_VER1
  11108. #if defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
  11109. ///////////////////////////////////////////////////////////////////////////////
  11110. //
  11111. // FUNCTION NAME: NvAPI_D3D_SetMultiViewMode
  11112. //
  11113. //! DESCRIPTION: Set the MultiView state
  11114. //!
  11115. //! \note Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid.
  11116. //! Returned value NVAPI_OK does not reflect that MultiView is supported or is set in hardware.
  11117. //! One must call NvAPI_D3D_QueryMultiViewSupport() to confirm that the current setup
  11118. //! supports MultiView before calling this set-function.
  11119. //!
  11120. //! SUPPORTED OS: Windows 7 and higher
  11121. //!
  11122. //!
  11123. //! \since Release: 410
  11124. //!
  11125. //! \param [in] pDevOrContext The ID3D11Device or ID3D11DeviceContext to use.
  11126. //! \param [in] pMultiViewParams MultiView Params
  11127. //!
  11128. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  11129. //! If there are return error codes with specific meaning for this API, they are listed below.
  11130. //! (none)
  11131. //!
  11132. //! \ingroup dx
  11133. ///////////////////////////////////////////////////////////////////////////////
  11134. NVAPI_INTERFACE NvAPI_D3D_SetMultiViewMode(__in IUnknown *pDevOrContext, __in NV_MULTIVIEW_PARAMS *pMultiViewParams);
  11135. #endif //defined(__cplusplus) && defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
  11136. //! SUPPORTED OS: Windows 7 and higher
  11137. //!
  11138. //! Used to query the support of Lens Matched Shading HW feature
  11139. //! \ingroup dx
  11140. typedef struct _NV_QUERY_MODIFIED_W_SUPPORT_PARAMS
  11141. {
  11142. NvU32 version; // parameter struct version
  11143. NvU32 bModifiedWSupported; // Modified W supported
  11144. } NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1;
  11145. typedef NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1 NV_QUERY_MODIFIED_W_SUPPORT_PARAMS;
  11146. #define NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_V1, 1)
  11147. #define NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER NV_QUERY_MODIFIED_W_SUPPORT_PARAMS_VER1
  11148. #if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  11149. ///////////////////////////////////////////////////////////////////////////////
  11150. //
  11151. // FUNCTION NAME: NvAPI_D3D_QueryModifiedWSupport
  11152. //
  11153. //! DESCRIPTION: Queries the support of Modified W feature on current setup and returns appropriate boolean value.
  11154. //!
  11155. //! SUPPORTED OS: Windows 7 and higher
  11156. //!
  11157. //!
  11158. //! \param [in] pDevice The ID3D11Device to use.
  11159. //! \param [inout] pQueryModifiedWSupportedParams Stores value of whether Modified W is supported on current setup or not.
  11160. //!
  11161. //! \retval NVAPI_OK Call succeeded.
  11162. //! \retval NVAPI_ERROR Call failed.
  11163. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  11164. //!
  11165. //! \ingroup dx
  11166. ///////////////////////////////////////////////////////////////////////////////
  11167. NVAPI_INTERFACE NvAPI_D3D_QueryModifiedWSupport(__in IUnknown *pDev,
  11168. __inout NV_QUERY_MODIFIED_W_SUPPORT_PARAMS *pQueryModifiedWSupportedParams);
  11169. #endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  11170. //! SUPPORTED OS: Windows 7 and higher
  11171. //!
  11172. #define NV_MODIFIED_W_MAX_VIEWPORTS 16
  11173. typedef struct _NV_MODIFIED_W_COEFFICIENTS
  11174. {
  11175. float fA; // A coefficient in w' = w + Ax + By
  11176. float fB; // B coefficient in w' = w + Ax + By
  11177. float fAReserved; // reserved
  11178. float fBReserved; // reserved
  11179. float fReserved[2]; // reserved
  11180. } NV_MODIFIED_W_COEFFICIENTS;
  11181. typedef struct _NV_MODIFIED_W_PARAMS
  11182. {
  11183. NvU32 version; // parameter struct version
  11184. NvU32 numEntries; // number of valid NV_MODIFIED_W_COEFFICIENTS structs in array
  11185. NV_MODIFIED_W_COEFFICIENTS modifiedWCoefficients[NV_MODIFIED_W_MAX_VIEWPORTS]; // coefficients
  11186. NvU32 id; // reserved
  11187. NvU32 reserved[NV_MODIFIED_W_MAX_VIEWPORTS]; // reserved
  11188. } NV_MODIFIED_W_PARAMS_V1;
  11189. typedef NV_MODIFIED_W_PARAMS_V1 NV_MODIFIED_W_PARAMS;
  11190. #define NV_MODIFIED_W_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_MODIFIED_W_PARAMS_V1, 1)
  11191. #define NV_MODIFIED_W_PARAMS_VER NV_MODIFIED_W_PARAMS_VER1
  11192. #if defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  11193. ///////////////////////////////////////////////////////////////////////////////
  11194. //
  11195. // FUNCTION NAME: NvAPI_D3D_SetModifiedWMode
  11196. //
  11197. //! DESCRIPTION: Set the Modified W state and A,B coefficients for HW support
  11198. //!
  11199. //! \note Note that this is an asynchronous function and returns NVAPI_OK if all arguments are valid.
  11200. //! Returned value NVAPI_OK does not reflect that Modified-W is supported or is set in hardware.
  11201. //! One must call NvAPI_D3D_QueryModifiedWSupport() to confirm that the current setup
  11202. //! supports Modified-W before calling this set-function.
  11203. //!
  11204. //! SUPPORTED OS: Windows 7 and higher
  11205. //!
  11206. //!
  11207. //! \param [in] pDevOrContext The ID3D11Device or ID3D11DeviceContext to use.
  11208. //! \param [in] psModifiedWParams Modified W parameters.
  11209. //!
  11210. //! \retval NVAPI_OK Call succeeded.
  11211. //! \retval NVAPI_ERROR Call failed.
  11212. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  11213. //!
  11214. //! \ingroup dx
  11215. ///////////////////////////////////////////////////////////////////////////////
  11216. NVAPI_INTERFACE NvAPI_D3D_SetModifiedWMode(__in IUnknown *pDevOrContext, __in NV_MODIFIED_W_PARAMS *psModifiedWParams);
  11217. #endif //defined(__cplusplus) && (defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  11218. #if defined(__cplusplus) && ( defined(__d3d12_h__))
  11219. ///////////////////////////////////////////////////////////////////////////////
  11220. //
  11221. // FUNCTION NAME: NvAPI_D3D12_QueryModifiedWSupport
  11222. //
  11223. //! DESCRIPTION: Queries the support of Modified-W feature on current setup and returns appropriate boolean value.
  11224. //!
  11225. //! SUPPORTED OS: Windows 10
  11226. //!
  11227. //!
  11228. //! \param [in] pDevice The ID3D12Device Device created by application
  11229. //! \param [inout] pQueryModifiedWSupportedParams Stores value of whether Modified-W is supported on current setup or not.
  11230. //!
  11231. //! \retval NVAPI_OK Call succeeded.
  11232. //! \retval NVAPI_ERROR Call failed.
  11233. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  11234. //!
  11235. //! \ingroup dx
  11236. ///////////////////////////////////////////////////////////////////////////////
  11237. NVAPI_INTERFACE NvAPI_D3D12_QueryModifiedWSupport(__in ID3D12Device *pDevice,
  11238. __inout NV_QUERY_MODIFIED_W_SUPPORT_PARAMS *pQueryModifiedWSupportedParams);
  11239. #endif // defined(__cplusplus) && ( defined(__d3d12_h__))
  11240. #if defined(__cplusplus) && ( defined(__d3d12_h__))
  11241. ///////////////////////////////////////////////////////////////////////////////
  11242. //
  11243. // FUNCTION NAME: NvAPI_D3D12_SetModifiedWMode
  11244. //
  11245. //! DESCRIPTION: Set the Modified-W state and A, B coefficients for HW support
  11246. //!
  11247. //! \note Note that Modified-W state persists on a particular CommandList till it is closed.
  11248. //! The state is reset to default (disabled) for every newly created CommandList.
  11249. //! One must call NvAPI_D3D12_QueryModifiedWSupport() to confirm that the current setup
  11250. //! supports Modified-W before calling this set-function.
  11251. //!
  11252. //! SUPPORTED OS: Windows 10
  11253. //!
  11254. //!
  11255. //! \param [in] pCommandList The command list in which we will add push buffer commmands for enabling Modified-W feature
  11256. //! Note: Command list of type D3D12_COMMAND_LIST_TYPE_BUNDLE is not allowed for setting the state of this feature.
  11257. //! \param [in] pModifiedWParams Modified-W parameters.
  11258. //!
  11259. //! \retval NVAPI_OK Call succeeded.
  11260. //! \retval NVAPI_ERROR Call failed.
  11261. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  11262. //!
  11263. //! \ingroup dx
  11264. ///////////////////////////////////////////////////////////////////////////////
  11265. NVAPI_INTERFACE NvAPI_D3D12_SetModifiedWMode(__in ID3D12GraphicsCommandList* pCommandList,
  11266. __in NV_MODIFIED_W_PARAMS *pModifiedWParams);
  11267. #endif // defined(__cplusplus) && ( defined(__d3d12_h__))
  11268. #if defined(__cplusplus) && (defined(__d3d11_h__))
  11269. //! \ingroup dx
  11270. //! See NvAPI_D3D_CreateLateLatchObject
  11271. DECLARE_INTERFACE(ID3DLateLatchObject_V1)
  11272. {
  11273. STDMETHOD_(UINT,Release) (THIS) PURE; //! Release the created LateLatch object and associated buffers.
  11274. STDMETHOD_(NvAPI_Status,Latch) (THIS_ __in IUnknown* pContext = NULL) PURE; //! Request to queue the latch operation to the GPU.
  11275. STDMETHOD_(ID3D11Buffer*,GetD3D11Buffer) (THIS_ __in UINT index = 0) PURE; //! Get ID3D11Buffer* available at the given 'index'
  11276. STDMETHOD_(UINT,GetBufferCount) (THIS) PURE; //! Returns the number of late latch buffers created for this LateLatchObject.
  11277. STDMETHOD_(NvAPI_Status,UpdateData) (THIS_ __in void **ppData) PURE; //! Fully update all LateLatch buffers with new data.
  11278. STDMETHOD_(NvAPI_Status,UpdateData) (THIS_ __in void *pData, __in size_t offset,
  11279. __in size_t size, __in UINT index = 0) PURE; //! Partially update one of the LateLatch buffers with new data.
  11280. };
  11281. //! \ingroup dx
  11282. //! See NvAPI_D3D_CreateLateLatchObject
  11283. typedef ID3DLateLatchObject_V1 ID3DLateLatchObject;
  11284. #define ID3DLateLatchObject_VER1 MAKE_NVAPI_VERSION(ID3DLateLatchObject_V1, 1)
  11285. #define ID3DLateLatchObject_VER ID3DLateLatchObject_VER1
  11286. typedef struct _NV_D3D_LATELATCH_OBJECT_DESC_V1
  11287. {
  11288. NvU32 version;
  11289. NvU32 numBuffers; // _IN_ Number of LateLatch buffers that the app wants to create.
  11290. D3D11_BUFFER_DESC **ppBufferDesc; // _IN_ Description of buffers
  11291. ID3DLateLatchObject **ppD3DLateLatchObject; // _Out_ Pointer to created interface
  11292. } NV_D3D_LATELATCH_OBJECT_DESC_V1;
  11293. typedef NV_D3D_LATELATCH_OBJECT_DESC_V1 NV_D3D_LATELATCH_OBJECT_DESC;
  11294. #define NV_D3D_LATELATCH_OBJECT_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D_LATELATCH_OBJECT_DESC_V1, 1)
  11295. #define NV_D3D_LATELATCH_OBJECT_DESC_VER NV_D3D_LATELATCH_OBJECT_DESC_VER1
  11296. ///////////////////////////////////////////////////////////////////////////////
  11297. //
  11298. // FUNCTION NAME: NvAPI_D3D_CreateLateLatchObject
  11299. //
  11300. //! DESCRIPTION: Creates a Late Latch Object interface
  11301. //!
  11302. //! SUPPORTED OS: Windows 7 and higher
  11303. //!
  11304. //!
  11305. //! \since Release: 384
  11306. //!
  11307. //! \param [in] pDevice Current ID3D11Device.
  11308. //! \param [inout] pLateLatchObjectDesc Pointer to in/out structure for late latch object creation
  11309. //!
  11310. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  11311. //! If there are return error codes with specific meaning for this API, they are listed below.
  11312. //!
  11313. //! \ingroup dx
  11314. ///////////////////////////////////////////////////////////////////////////////
  11315. NVAPI_INTERFACE NvAPI_D3D_CreateLateLatchObject(__in IUnknown *pDevice, __inout NV_D3D_LATELATCH_OBJECT_DESC* pLateLatchObjectDesc);
  11316. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  11317. #if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11318. //! \ingroup dx
  11319. //! See NvAPI_D3D_QueryLateLatchSupport
  11320. typedef struct _NV_QUERY_LATELATCH_SUPPORT_PARAMS
  11321. {
  11322. NvU32 version; //!< (IN) Parameter structure version
  11323. NvU32 bLateLatchSupported; //!< (OUT) LateLatch supported
  11324. } NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1;
  11325. typedef NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1 NV_QUERY_LATELATCH_SUPPORT_PARAMS;
  11326. #define NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_LATELATCH_SUPPORT_PARAMS_V1, 1)
  11327. #define NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER NV_QUERY_LATELATCH_SUPPORT_PARAMS_VER1
  11328. ///////////////////////////////////////////////////////////////////////////////
  11329. //
  11330. // FUNCTION NAME: NvAPI_D3D_QueryLateLatchSupport
  11331. //
  11332. //! DESCRIPTION: Queries the support of DX11 Late Latch feature on current setup.
  11333. //!
  11334. //! SUPPORTED OS: Windows 7 and higher
  11335. //!
  11336. //!
  11337. //! \since Release: 384
  11338. //!
  11339. //! \param [in] pDevice Current ID3D11Device.
  11340. //! \param [inout] pQueryLateLatchSupportParams Stores value of whether Late Latch is supported on current setup or not.
  11341. //!
  11342. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  11343. //! If there are return error codes with specific meaning for this API, they are listed below.
  11344. //!
  11345. //! \ingroup dx
  11346. ///////////////////////////////////////////////////////////////////////////////
  11347. NVAPI_INTERFACE NvAPI_D3D_QueryLateLatchSupport(__in IUnknown *pDevice,
  11348. __inout NV_QUERY_LATELATCH_SUPPORT_PARAMS *pQueryLateLatchSupportParams);
  11349. #endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11350. #if defined (__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  11351. ///////////////////////////////////////////////////////////////////////////////
  11352. //
  11353. // FUNCTION NAME: NvAPI_D3D_RegisterDevice
  11354. //
  11355. //! DESCRIPTION: Tells NvAPI about a D3D device. This must be called prior to using any DX1x
  11356. //! deferred-context calls.
  11357. //!
  11358. //! SUPPORTED OS: Windows 7 and higher
  11359. //!
  11360. //!
  11361. //! \param [in] pDev The ID3D10Device or ID3D11Device to use.
  11362. //!
  11363. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  11364. //! If there are return error codes with specific meaning for this API, they are listed below.
  11365. //!
  11366. //! \ingroup dx
  11367. ///////////////////////////////////////////////////////////////////////////////
  11368. NVAPI_INTERFACE NvAPI_D3D_RegisterDevice(__in IUnknown *pDev);
  11369. #endif //if defined(__cplusplus) && (defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__))
  11370. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  11371. ///////////////////////////////////////////////////////////////////////////////
  11372. //
  11373. // FUNCTION NAME: NvAPI_D3D11_MultiDrawInstancedIndirect
  11374. //
  11375. //! DESCRIPTION: Extension of DrawInstancedIndirect that takes a draw count in. The effect of this function is to loop over
  11376. //! that draw count and perform the DrawInstancedIndirect operation each time, incrementing the buffer offset
  11377. //! by the supplied stride each time.
  11378. //!
  11379. //! SUPPORTED OS: Windows 7 and higher
  11380. //!
  11381. //!
  11382. //! \param [in] *pDevContext11 Pointer to D3D11 device context (IC or DC)
  11383. //! \param [in] drawCount Do DrawInstancedIndirect operation this many times
  11384. //! \param [in] *pBuffer ID3D11Buffer that contains the command parameters
  11385. //! \param [in] alignedByteOffsetForArgs Start in pBuffer of the command parameters
  11386. //! \param [in] alignedByteStrideForArgs Stride of the command parameters - must be >= 4 * sizeof(NvU32)
  11387. //!
  11388. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  11389. //! If there are return error codes with specific meaning for this API, they are listed below.
  11390. //!
  11391. //! \retval NVAPI_D3D_DEVICE_NOT_REGISTERED When MultiDraw is called on a deferred context, and the device has not yet
  11392. //! been registered (NvAPI_D3D_RegisterDevice), this error is returned.
  11393. //! \ingroup dx
  11394. ///////////////////////////////////////////////////////////////////////////////
  11395. NVAPI_INTERFACE NvAPI_D3D11_MultiDrawInstancedIndirect(__in ID3D11DeviceContext *pDevContext11,
  11396. __in NvU32 drawCount,
  11397. __in ID3D11Buffer *pBuffer,
  11398. __in NvU32 alignedByteOffsetForArgs,
  11399. __in NvU32 alignedByteStrideForArgs);
  11400. #endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  11401. #if defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  11402. ///////////////////////////////////////////////////////////////////////////////
  11403. //
  11404. // FUNCTION NAME: NvAPI_D3D11_MultiDrawIndexedInstancedIndirect
  11405. //
  11406. //! DESCRIPTION: Extension of DrawIndexedInstancedIndirect that takes a draw count in. The effect of this function is to loop over
  11407. //! that draw count and perform the DrawIndexedInstancedIndirect operation each time, incrementing the buffer offset
  11408. //! by the supplied stride each time.
  11409. //!
  11410. //! SUPPORTED OS: Windows 7 and higher
  11411. //!
  11412. //!
  11413. //! \param [in] *pDevContext11 Pointer to D3D11 device context (IC or DC)
  11414. //! \param [in] drawCount Do DrawIndexedInstancedIndirect operation this many times
  11415. //! \param [in] *pBuffer ID3D11Buffer that contains the command parameters
  11416. //! \param [in] alignedByteOffsetForArgs Start in pBuffer of the command parameters
  11417. //! \param [in] alignedByteStrideForArgs Stride of the command parameters - must be >= 5 * sizeof(NvU32)
  11418. //!
  11419. //! RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status.
  11420. //! If there are return error codes with specific meaning for this API, they are listed below.
  11421. //!
  11422. //! \retval NVAPI_D3D_DEVICE_NOT_REGISTERED When MultiDraw is called on a deferred context, and the device has not yet
  11423. //! been registered (NvAPI_D3D_RegisterDevice), this error is returned.
  11424. //! \ingroup dx
  11425. ///////////////////////////////////////////////////////////////////////////////
  11426. NVAPI_INTERFACE NvAPI_D3D11_MultiDrawIndexedInstancedIndirect(__in ID3D11DeviceContext *pDevContext11,
  11427. __in NvU32 drawCount,
  11428. __in ID3D11Buffer *pBuffer,
  11429. __in NvU32 alignedByteOffsetForArgs,
  11430. __in NvU32 alignedByteStrideForArgs);
  11431. #endif //defined (__cplusplus) && (defined(__d3d11_h__) || defined(__d3d11_1_h__))
  11432. //! SUPPORTED OS: Windows 7 and higher
  11433. //!
  11434. #if defined (__cplusplus) && ( defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) ||defined(__d3d11_h__) )
  11435. ///////////////////////////////////////////////////////////////////////////////
  11436. //
  11437. // FUNCTION NAME: NvAPI_D3D_ImplicitSLIControl
  11438. //
  11439. //! 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
  11440. //! 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
  11441. //! 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.
  11442. //! This NvAPI call is supported in all DX10+ versions of the driver. It is supported on all Windows versions.
  11443. //!
  11444. //! \retval NVAPI_OK Completed request
  11445. //! \retval NVAPI_ERROR Error occurred
  11446. //! \ingroup dx
  11447. ///////////////////////////////////////////////////////////////////////////////
  11448. //! \ingroup dx
  11449. typedef enum _IMPLICIT_SLI_CONTROL
  11450. {
  11451. DISABLE_IMPLICIT_SLI = 0,
  11452. ENABLE_IMPLICIT_SLI = 1,
  11453. } IMPLICIT_SLI_CONTROL;
  11454. //! \ingroup dx
  11455. NVAPI_INTERFACE NvAPI_D3D_ImplicitSLIControl(__in IMPLICIT_SLI_CONTROL implicitSLIControl);
  11456. #endif //defined (__cplusplus) && ( defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) ||defined(__d3d11_h__) )
  11457. //! SUPPORTED OS: Windows 10
  11458. //!
  11459. #if defined (__cplusplus) && defined(__d3d12_h__)
  11460. ///////////////////////////////////////////////////////////////////////////////
  11461. //
  11462. // FUNCTION NAME: NvAPI_D3D12_UseDriverHeapPriorities
  11463. //
  11464. //! \code
  11465. //! 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.
  11466. //!
  11467. //! \param [in] pDevice The IDirect3DDevice12 to use.
  11468. //!
  11469. //! \return This API can return any of the error codes enumerated in
  11470. //! #NvAPI_Status. If there are return error codes with specific
  11471. //! meaning for this API, they are listed below.
  11472. //!
  11473. //! \since Release: 381
  11474. //!
  11475. //! \endcode
  11476. //! \ingroup dx
  11477. ///////////////////////////////////////////////////////////////////////////////
  11478. NVAPI_INTERFACE NvAPI_D3D12_UseDriverHeapPriorities(__in ID3D12Device *pDevice);
  11479. #endif // defined (__cplusplus) && defined(__d3d12_h__)
  11480. //! SUPPORTED OS: Windows 10 and higher
  11481. //!
  11482. #if defined(__cplusplus) && ( defined(__d3d12_h__))
  11483. typedef struct _NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS
  11484. {
  11485. __in NvU32 version; //!< Structure version
  11486. __in ID3D12Device *pDevice; //!< The ID3D12Device created by application.
  11487. __in ID3D12Resource *pSwapChainBuffer; //!< The ID3D12Resource part of the application swap chain that has companion allocations.
  11488. __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.
  11489. __inout ID3D12Resource **ppCompanionResources; //!< An array of ID3D12Resource pointers sized to match companionBufferCount, which will receive the companion allocations.
  11490. } NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1;
  11491. typedef NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1 NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS;
  11492. #define NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_V1, 1)
  11493. #define NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS_VER1
  11494. ///////////////////////////////////////////////////////////////////////////////
  11495. //
  11496. // FUNCTION NAME: NvAPI_D3D12_Mosaic_GetCompanionAllocations
  11497. //
  11498. //! DESCRIPTION: Queries the driver for internally created allocations that accompany a swap chain buffer for present-related operations.
  11499. //! 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.
  11500. //!
  11501. //! \param [inout] companionBufferCount The parameters for this function.
  11502. //!
  11503. //! \retval NVAPI_OK Call succeeded.
  11504. //! \retval NVAPI_ERROR Call failed.
  11505. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  11506. //!
  11507. //! \ingroup dx
  11508. ///////////////////////////////////////////////////////////////////////////////
  11509. NVAPI_INTERFACE NvAPI_D3D12_Mosaic_GetCompanionAllocations(__inout NV_D3D12_MOSAIC_GETCOMPANIONALLOCATIONS *params);
  11510. #endif // defined(__cplusplus) && ( defined(__d3d12_h__))
  11511. //! SUPPORTED OS: Windows 10 and higher
  11512. //!
  11513. #if defined(__cplusplus) && ( defined(__d3d12_h__))
  11514. typedef struct _NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS
  11515. {
  11516. __in NvU32 version; //!< Structure version
  11517. __in ID3D12Device *pDevice; //!< The ID3D12Device created by application.
  11518. __in ID3D12Resource *pSwapChainBuffer; //!< The ID3D12Resource part of the application swap chain.
  11519. __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.
  11520. __inout RECT *pViewport; //!< An optional array to hold the viewport information per partition. When this is valid pNodeMask must also be valid.
  11521. __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.
  11522. } NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1;
  11523. typedef NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1 NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS;
  11524. #define NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER1 MAKE_NVAPI_VERSION(NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_V1, 1)
  11525. #define NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS_VER1
  11526. ///////////////////////////////////////////////////////////////////////////////
  11527. //
  11528. // FUNCTION NAME: NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions
  11529. //
  11530. //! DESCRIPTION: Queries the driver for how a swap chain display surface is subdivided across devices in relation to display connectivity.
  11531. //! Call this interface with NULL pPartitions in order to know how many subdivisions exist and allocate a proper size to hold all data.
  11532. //! Call it a second time with a properly sized partitions array to receive all subdivisions along with GPU node masks of each rectangle.
  11533. //!
  11534. //! \param [inout] params The parameters for this function.
  11535. //!
  11536. //! \retval NVAPI_OK Call succeeded.
  11537. //! \retval NVAPI_ERROR Call failed.
  11538. //! \retval NVAPI_INVALID_ARGUMENT One or more arguments are invalid.
  11539. //!
  11540. //! \ingroup dx
  11541. ///////////////////////////////////////////////////////////////////////////////
  11542. NVAPI_INTERFACE NvAPI_D3D12_Mosaic_GetViewportAndGpuPartitions(__inout NV_D3D12_MOSAIC_GETVIEWPORTANDGPUPARTITIONS *params);
  11543. #endif // defined(__cplusplus) && ( defined(__d3d12_h__))
  11544. #if defined(__cplusplus) && (defined(__d3d11_h__))
  11545. //! \ingroup dx
  11546. //! See NvAPI_D3D1x_GetGraphicsCapabilities
  11547. typedef struct _NV_D3D1x_GRAPHICS_CAPS_V1
  11548. {
  11549. NvU32 bExclusiveScissorRectsSupported : 1; //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not
  11550. NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not
  11551. NvU32 reservedBits : 30; // Reserved bits for future expansion
  11552. NvU32 reserved[7]; // Reserved for future expansion
  11553. } NV_D3D1x_GRAPHICS_CAPS_V1;
  11554. #define NV_D3D1x_GRAPHICS_CAPS_VER1 MAKE_NVAPI_VERSION(NV_D3D1x_GRAPHICS_CAPS_V1, 1)
  11555. typedef struct _NV_D3D1x_GRAPHICS_CAPS_V2
  11556. {
  11557. NvU32 bExclusiveScissorRectsSupported : 1; //!< (OUT) Outputs whether Exclusive Scissor Rects are supported or not
  11558. NvU32 bVariablePixelRateShadingSupported : 1; //!< (OUT) Outputs whether Variable Pixel Shading Rates are supported or not
  11559. NvU32 reservedBits : 30; // Reserved bits for future expansion
  11560. NvU16 majorSMVersion; //!< (OUT) Major SM version of the device
  11561. NvU16 minorSMVersion; //!< (OUT) Minor SM version of the device
  11562. NvU32 reserved[14]; // Reserved for future expansion
  11563. } NV_D3D1x_GRAPHICS_CAPS_V2;
  11564. typedef NV_D3D1x_GRAPHICS_CAPS_V2 NV_D3D1x_GRAPHICS_CAPS;
  11565. #define NV_D3D1x_GRAPHICS_CAPS_VER2 MAKE_NVAPI_VERSION(NV_D3D1x_GRAPHICS_CAPS_V2, 2)
  11566. #define NV_D3D1x_GRAPHICS_CAPS_VER NV_D3D1x_GRAPHICS_CAPS_VER2
  11567. ///////////////////////////////////////////////////////////////////////////////
  11568. //
  11569. // FUNCTION NAME: NvAPI_D3D1x_GetGraphicsCapabilities
  11570. //
  11571. //! DESCRIPTION: Get the graphics capabilities for current hardware/software setup
  11572. //!
  11573. //! SUPPORTED OS: Windows 7 and higher
  11574. //!
  11575. //!
  11576. //! \since Release: 410
  11577. //!
  11578. //! \param [in] pDevice The ID3D11Device device to be used for getting the graphics capabilities.
  11579. //! \param [in] structVersion Version of the caps struct. Should be set to NV_D3D1x_GRAPHICS_CAPS_VER.
  11580. //! \param [inout] pGraphicsCaps Pointer to a NV_D3D1x_GRAPHICS_CAPS_CAPS struct created by app.
  11581. //! Graphics capabilities will be filled in this struct by the driver.
  11582. //!
  11583. //!
  11584. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  11585. //! If there are return error codes with specific meaning for this API, they are listed below.
  11586. //! (none)
  11587. //!
  11588. //! \ingroup dx
  11589. ///////////////////////////////////////////////////////////////////////////////
  11590. NVAPI_INTERFACE NvAPI_D3D1x_GetGraphicsCapabilities(__in IUnknown *pDevice,
  11591. __in NvU32 structVersion,
  11592. __inout NV_D3D1x_GRAPHICS_CAPS *pGraphicsCaps);
  11593. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  11594. #if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11595. #define NV_MAX_NUM_EXCLUSIVE_SCISSOR_RECTS 16
  11596. #endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11597. #if defined(__cplusplus) && (defined(__d3d11_h__))
  11598. //! \ingroup dx
  11599. //! See NvAPI_D3D11_RSSetExclusiveScissorRects
  11600. typedef struct _NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1
  11601. {
  11602. bool enableExclusiveScissorRect; //!< (IN) Control of enabling Exclusive ScissorRect per rect
  11603. D3D11_RECT scissorRect; //!< (IN) Single rect dimensions
  11604. } NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1;
  11605. typedef struct _NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1
  11606. {
  11607. NvU32 version; //!< (IN) Parameter struct version
  11608. NvU32 numRects; //!< (IN) Number of Exclusive Scissor Rects to be set.
  11609. // \note Passing zero will globally disable Exclusive Scissor Rects
  11610. // \note Max value can be equal to NV_MAX_NUM_EXCLUSIVE_SCISSOR_RECTS
  11611. 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
  11612. } NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1;
  11613. typedef NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1 NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC;
  11614. typedef NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC_V1 NV_D3D11_EXCLUSIVE_SCISSOR_RECT_DESC;
  11615. #define NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_V1, 1)
  11616. #define NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC_VER1
  11617. ///////////////////////////////////////////////////////////////////////////////
  11618. //
  11619. // FUNCTION NAME: NvAPI_D3D11_RSSetExclusiveScissorRects
  11620. //
  11621. //! DESCRIPTION: Sets Exclusive Scissor Rects. The content bounded within the Scissor Rects
  11622. //! will be excluded from rendering unlike regular Scissor Rects. These are
  11623. //! orthogonal with Regular Scissor Rects.
  11624. //!
  11625. //! SUPPORTED OS: Windows 7 and higher
  11626. //!
  11627. //!
  11628. //! \since Release: 410
  11629. //!
  11630. //! \param [in] pContext The device context (ID3D11DeviceContext) to be used for setting the Exclusive Scissor Rects.
  11631. //! \param [in] pExclusiveScissorRectsDesc Description of the Exclusive Scissor Rects duly filled with their dimensions
  11632. //! and control over enablement of individual ScissorRect
  11633. //!
  11634. //!
  11635. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  11636. //! If there are return error codes with specific meaning for this API, they are listed below.
  11637. //! (none)
  11638. //!
  11639. //! \ingroup dx
  11640. ///////////////////////////////////////////////////////////////////////////////
  11641. NVAPI_INTERFACE NvAPI_D3D11_RSSetExclusiveScissorRects(__in IUnknown *pContext,
  11642. __in NV_D3D11_EXCLUSIVE_SCISSOR_RECTS_DESC *pExclusiveScissorRectsDesc);
  11643. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  11644. #if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11645. //! \ingroup dx
  11646. //! See NvAPI_D3D11_RSSetViewportsPixelShadingRates
  11647. #define NV_MAX_PIXEL_SHADING_RATES 16 // Currently only 12 Shading Rates are available
  11648. #define NV_MAX_NUM_VIEWPORTS 16
  11649. // Every element in Shading Rate Resource represents the shading rate for all pixels in the corresponding tile
  11650. // The Shading Rate Resource dimensions must be the bound render target size divided by the tile dimensions (width/height)
  11651. #define NV_VARIABLE_PIXEL_SHADING_TILE_WIDTH 16 // Width of the tile, in pixels
  11652. #define NV_VARIABLE_PIXEL_SHADING_TILE_HEIGHT 16 // Height of the tile, in pixels
  11653. typedef enum
  11654. {
  11655. NV_PIXEL_X0_CULL_RASTER_PIXELS, // No shading, tiles are culled
  11656. NV_PIXEL_X16_PER_RASTER_PIXEL, // 16 shading passes per 1 raster pixel
  11657. NV_PIXEL_X8_PER_RASTER_PIXEL, // 8 shading passes per 1 raster pixel
  11658. NV_PIXEL_X4_PER_RASTER_PIXEL, // 4 shading passes per 1 raster pixel
  11659. NV_PIXEL_X2_PER_RASTER_PIXEL, // 2 shading passes per 1 raster pixel
  11660. NV_PIXEL_X1_PER_RASTER_PIXEL, // Per-pixel shading
  11661. NV_PIXEL_X1_PER_2X1_RASTER_PIXELS, // 1 shading pass per 2 raster pixels
  11662. NV_PIXEL_X1_PER_1X2_RASTER_PIXELS, // 1 shading pass per 2 raster pixels
  11663. NV_PIXEL_X1_PER_2X2_RASTER_PIXELS, // 1 shading pass per 4 raster pixels
  11664. NV_PIXEL_X1_PER_4X2_RASTER_PIXELS, // 1 shading pass per 8 raster pixels
  11665. NV_PIXEL_X1_PER_2X4_RASTER_PIXELS, // 1 shading pass per 8 raster pixels
  11666. NV_PIXEL_X1_PER_4X4_RASTER_PIXELS // 1 shading pass per 16 raster pixels
  11667. } NV_PIXEL_SHADING_RATE;
  11668. #endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11669. #if defined(__cplusplus) && (defined(__d3d11_h__))
  11670. typedef struct _NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1
  11671. {
  11672. bool enableVariablePixelShadingRate; //!< (IN) Control of enabling Variable Pixel Shading Rate per viewport
  11673. NV_PIXEL_SHADING_RATE shadingRateTable[NV_MAX_PIXEL_SHADING_RATES]; //!< (IN) Lookup table of converting Shading Rate Index to NV_PIXEL_SHADING_RATE
  11674. // \note Shading Rate Resource View would be populated by application with indices of this table
  11675. } NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1;
  11676. typedef struct _NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1
  11677. {
  11678. NvU32 version; //!< (IN) Struct version
  11679. NvU32 numViewports; //!< (IN) Number of viewports with shading rate set.
  11680. // \note Passing zero will globally disable Variable Pixel Rate Shading for all viewports immaterial of values in pViewports
  11681. // \note Max value can be equal to NV_MAX_NUM_VIEWPORTS
  11682. NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 *pViewports; //!< (IN) Array of NV_D3D11_VIEWPORT_SHADING_RATE_DESC with number of elements equal to NumViewports
  11683. } NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1;
  11684. typedef NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1 NV_D3D11_VIEWPORTS_SHADING_RATE_DESC;
  11685. typedef NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1 NV_D3D11_VIEWPORT_SHADING_RATE_DESC;
  11686. #define NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_V1, 1)
  11687. #define NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER NV_D3D11_VIEWPORTS_SHADING_RATE_DESC_VER1
  11688. ///////////////////////////////////////////////////////////////////////////////
  11689. //
  11690. // FUNCTION NAME: NvAPI_D3D11_RSSetViewportsPixelShadingRates
  11691. //
  11692. //! DESCRIPTION: Sets Pixel Shading Rates and Enables/Disables per-viewport Variable Pixel Shading Rate feature
  11693. //!
  11694. //! SUPPORTED OS: Windows 7 and higher
  11695. //!
  11696. //!
  11697. //! \since Release: 410
  11698. //!
  11699. //! \param [in] pContext The device context (ID3D11DeviceContext) to be used for setting the Viewports Shading Rates
  11700. //! \param [in] pShadingRateDesc Shading rate descriptor
  11701. //!
  11702. //!
  11703. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  11704. //! If there are return error codes with specific meaning for this API, they are listed below.
  11705. //! (none)
  11706. //!
  11707. //! \ingroup dx
  11708. ///////////////////////////////////////////////////////////////////////////////
  11709. NVAPI_INTERFACE NvAPI_D3D11_RSSetViewportsPixelShadingRates(__in IUnknown *pContext,
  11710. __in NV_D3D11_VIEWPORTS_SHADING_RATE_DESC *pShadingRateDesc);
  11711. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  11712. #if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11713. typedef enum _NV_SRRV_DIMENSION
  11714. {
  11715. NV_SRRV_DIMENSION_TEXTURE2D = 4,
  11716. NV_SRRV_DIMENSION_TEXTURE2DARRAY = 5,
  11717. } NV_SRRV_DIMENSION;
  11718. typedef struct _NV_TEX2D_SRRV
  11719. {
  11720. UINT MipSlice;
  11721. } NV_TEX2D_SRRV;
  11722. typedef struct _NV_TEX2D_ARRAY_SRRV
  11723. {
  11724. UINT MipSlice;
  11725. UINT FirstArraySlice;
  11726. UINT ArraySize;
  11727. } NV_TEX2D_ARRAY_SRRV;
  11728. #endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11729. #if defined(__cplusplus) && (defined(__d3d11_h__))
  11730. typedef struct _NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1
  11731. {
  11732. NvU32 version; //!< (IN) Parameter struct version
  11733. 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
  11734. NV_SRRV_DIMENSION ViewDimension; //!< (IN) This declares whether the Shading Rate Surface is a simple 2D Texture or Array of 2D Textures
  11735. union
  11736. {
  11737. NV_TEX2D_SRRV Texture2D;
  11738. NV_TEX2D_ARRAY_SRRV Texture2DArray;
  11739. };
  11740. } NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1;
  11741. typedef NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1 NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC;
  11742. #define NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER1 MAKE_NVAPI_VERSION(NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_V1, 1)
  11743. #define NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC_VER1
  11744. DECLARE_INTERFACE_(__declspec(uuid("E14BE7F6-8FF5-4F5E-B63A-AD016EB8FBE5"))ID3D11NvShadingRateResourceView_V1, ID3D11View)
  11745. {
  11746. BEGIN_INTERFACE
  11747. // *** IUnknown methods ***
  11748. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  11749. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  11750. STDMETHOD_(ULONG,Release)(THIS) PURE;
  11751. // **** ID3D11View method **/
  11752. // Get Shading Rate Resource used while creating the Shading Rate Resource View
  11753. STDMETHOD_(void,GetResource)(THIS_ _Outptr_ ID3D11Resource **ppResource) PURE;
  11754. // ** ID3D11NvShadingRateResourceView methods ***
  11755. // The descriptor used while creating the Shading Rate Resource View
  11756. STDMETHOD(GetDesc)(THIS_ NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC* pDesc) PURE;
  11757. END_INTERFACE
  11758. };
  11759. typedef ID3D11NvShadingRateResourceView_V1 ID3D11NvShadingRateResourceView;
  11760. #define ID3D11NvShadingRateResourceView_VER1 MAKE_NVAPI_VERSION(ID3D11NvShadingRateResourceView_V1, 1)
  11761. #define ID3D11NvShadingRateResourceView_VER ID3D11NvShadingRateResourceView_VER1
  11762. ///////////////////////////////////////////////////////////////////////////////
  11763. //
  11764. // FUNCTION NAME: NvAPI_D3D11_CreateShadingRateResourceView
  11765. //
  11766. //! DESCRIPTION: Creates Shading Rate Resource View by taking ID3D11Resource as an input Shading Rate Surface.
  11767. //!
  11768. //! SUPPORTED OS: Windows 7 and higher
  11769. //!
  11770. //!
  11771. //! \since Release: 410
  11772. //!
  11773. //! \param [in] pDevice The device to be used for creating the Shading Rate Resource View
  11774. //! \param [in] pShadingRateResource Shading Rate Resource on which the view is to be created.
  11775. //! \note This should be of format DXGI_FORMAT_R8_UINT or DXGI_FORMAT_R8_TYPELESS
  11776. //! \note This should be confined to size calculated using render target dimensions,
  11777. //! NV_VARIABLE_PIXEL_SHADING_TILE_WIDTH and NV_VARIABLE_PIXEL_SHADING_TILE_HEIGHT
  11778. //! \param [in] pShadingRateDesc Shading Rate Resource View descriptor
  11779. //! \param [out] ppShadingRateResourceView Address of a pointer to ID3D11NvShadingRateResourceView for returning the newly created Shading Rate Resource View
  11780. //!
  11781. //!
  11782. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  11783. //! If there are return error codes with specific meaning for this API, they are listed below.
  11784. //! (none)
  11785. //!
  11786. //! \ingroup dx
  11787. ///////////////////////////////////////////////////////////////////////////////
  11788. NVAPI_INTERFACE NvAPI_D3D11_CreateShadingRateResourceView(__in ID3D11Device *pDevice,
  11789. __in ID3D11Resource *pShadingRateResource,
  11790. __in NV_D3D11_SHADING_RATE_RESOURCE_VIEW_DESC *pShadingRateResourceViewDesc,
  11791. __out ID3D11NvShadingRateResourceView **ppShadingRateResourceView);
  11792. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  11793. #if defined(__cplusplus) && (defined(__d3d11_h__))
  11794. ///////////////////////////////////////////////////////////////////////////////
  11795. //
  11796. // FUNCTION NAME: NvAPI_D3D11_RSSetShadingRateResourceView
  11797. //
  11798. //! DESCRIPTION: Sets Shading Rate Resource View
  11799. //!
  11800. //! SUPPORTED OS: Windows 7 and higher
  11801. //!
  11802. //!
  11803. //! \since Release: 410
  11804. //!
  11805. //! \param [in] pContext The device context (ID3D11DeviceContext) used for setting the Shading Rate Resource View
  11806. //! \param [out] pShadingRateResourceView Shading Rate Resource View to be set
  11807. //! \note See NvAPI_D3D11_CreateShadingRateResourceView
  11808. //! \note Passing this as null will reset Shading Rate Resource View to defaults
  11809. //!
  11810. //!
  11811. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  11812. //! If there are return error codes with specific meaning for this API, they are listed below.
  11813. //! (none)
  11814. //!
  11815. //! \ingroup dx
  11816. ///////////////////////////////////////////////////////////////////////////////
  11817. NVAPI_INTERFACE NvAPI_D3D11_RSSetShadingRateResourceView(__in IUnknown *pContext,
  11818. __in ID3D11NvShadingRateResourceView *pShadingRateResourceView);
  11819. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  11820. #if defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11821. //! \ingroup dx
  11822. //! See NvAPI_D3D11_RSGetPixelShadingRateSampleOrder
  11823. //! See NvAPI_D3D11_RSSetPixelShadingRateSampleOrder
  11824. // X, Y = sample position. S = sample number.
  11825. // The inner-most dimension is the sample number, followed by X and Y.
  11826. typedef struct _NV_PIXEL_SRSO_1x2
  11827. {
  11828. struct NV_PIXEL_SRSO_1x2_X1 { NvU8 Y[2]; } X1;
  11829. struct NV_PIXEL_SRSO_1x2_X2 { NvU8 YS[2][2]; } X2;
  11830. struct NV_PIXEL_SRSO_1x2_X4 { NvU8 YS[2][4]; } X4;
  11831. struct NV_PIXEL_SRSO_1x2_X8 { NvU8 YS[2][8]; } X8;
  11832. } NV_PIXEL_SRSO_1x2;
  11833. typedef struct _NV_PIXEL_SRSO_2x1
  11834. {
  11835. struct NV_PIXEL_SRSO_2x1_X1 { NvU8 X[2]; } X1;
  11836. struct NV_PIXEL_SRSO_2x1_X2 { NvU8 XS[2][2]; } X2;
  11837. struct NV_PIXEL_SRSO_2x1_X4 { NvU8 XS[2][4]; } X4;
  11838. } NV_PIXEL_SRSO_2x1;
  11839. typedef struct _NV_PIXEL_SRSO_2x2
  11840. {
  11841. struct NV_PIXEL_SRSO_2x2_X1 { NvU8 YX[2][2]; } X1;
  11842. struct NV_PIXEL_SRSO_2x2_X2 { NvU8 YXS[2][2][2]; } X2;
  11843. struct NV_PIXEL_SRSO_2x2_X4 { NvU8 YXS[2][2][4]; } X4;
  11844. } NV_PIXEL_SRSO_2x2;
  11845. typedef struct _NV_PIXEL_SRSO_2x4
  11846. {
  11847. struct NV_PIXEL_SRSO_2x4_X1 { NvU8 YX[4][2]; } X1;
  11848. struct NV_PIXEL_SRSO_2x4_X2 { NvU8 YXS[4][2][2]; } X2;
  11849. } NV_PIXEL_SRSO_2x4;
  11850. typedef struct _NV_PIXEL_SRSO_4x2
  11851. {
  11852. struct NV_PIXEL_SRSO_4x2_X1 { NvU8 YX[2][4]; } X1;
  11853. } NV_PIXEL_SRSO_4x2;
  11854. typedef struct _NV_PIXEL_SRSO_4x4
  11855. {
  11856. struct NV_PIXEL_SRSO_4x4_X1 { NvU8 YX[4][4]; } X1;
  11857. } NV_PIXEL_SRSO_4x4;
  11858. typedef struct _NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1
  11859. {
  11860. NvU32 version;
  11861. NV_PIXEL_SRSO_1x2 Pixel_1x2;
  11862. NV_PIXEL_SRSO_2x1 Pixel_2x1;
  11863. NV_PIXEL_SRSO_2x2 Pixel_2x2;
  11864. NV_PIXEL_SRSO_2x4 Pixel_2x4;
  11865. NV_PIXEL_SRSO_4x2 Pixel_4x2;
  11866. NV_PIXEL_SRSO_4x4 Pixel_4x4;
  11867. } NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1;
  11868. typedef NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1 NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE;
  11869. #define NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER1 MAKE_NVAPI_VERSION(NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_V1, 1)
  11870. #define NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE_VER1
  11871. #endif // defined(__cplusplus) && (defined(__d3d11_h__) || defined(__d3d12_h__))
  11872. #if defined(__cplusplus) && (defined(__d3d11_h__))
  11873. ///////////////////////////////////////////////////////////////////////////////
  11874. //
  11875. // FUNCTION NAME: NvAPI_D3D11_RSGetPixelShadingRateSampleOrder
  11876. //
  11877. //! DESCRIPTION: Get the Sample Order for Variable Shading Rate
  11878. //!
  11879. //! SUPPORTED OS: Windows 7 and higher
  11880. //!
  11881. //!
  11882. //! \since Release: 410
  11883. //!
  11884. //! \param [in] pContext The device context (ID3D11DeviceContext) used for getting the Shading Rate Sample Order
  11885. //! \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
  11886. //!
  11887. //!
  11888. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  11889. //! If there are return error codes with specific meaning for this API, they are listed below.
  11890. //! (none)
  11891. //!
  11892. //! \ingroup dx
  11893. ///////////////////////////////////////////////////////////////////////////////
  11894. NVAPI_INTERFACE NvAPI_D3D11_RSGetPixelShadingRateSampleOrder(__in IUnknown *pContext,
  11895. __out NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE* pSampleOrderTable);
  11896. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  11897. #if defined(__cplusplus) && (defined(__d3d11_h__))
  11898. ///////////////////////////////////////////////////////////////////////////////
  11899. //
  11900. // FUNCTION NAME: NvAPI_D3D11_RSSetPixelShadingRateSampleOrder
  11901. //
  11902. //! DESCRIPTION: Set the Sample Order for Variable Shading Rate
  11903. //!
  11904. //! SUPPORTED OS: Windows 7 and higher
  11905. //!
  11906. //!
  11907. //! \since Release: 410
  11908. //!
  11909. //! \param [in] pContext The device context (ID3D11DeviceContext) used for setting the Shading Rate Sample Order
  11910. //! \param [out] pSampleOrderTable Sample Order for Variable Shading Rate to be set
  11911. //!
  11912. //!
  11913. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  11914. //! If there are return error codes with specific meaning for this API, they are listed below.
  11915. //! (none)
  11916. //!
  11917. //! \ingroup dx
  11918. ///////////////////////////////////////////////////////////////////////////////
  11919. NVAPI_INTERFACE NvAPI_D3D11_RSSetPixelShadingRateSampleOrder(__in IUnknown *pContext,
  11920. __in NV_PIXEL_SHADING_RATE_SAMPLE_ORDER_TABLE* pSampleOrderTable);
  11921. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  11922. //! SUPPORTED OS: Windows 7 and higher
  11923. //!
  11924. #if defined(__cplusplus) && (defined(__d3d11_h__))
  11925. typedef struct _NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1
  11926. {
  11927. NvU32 version; //!< (IN) Struct version
  11928. NvU32 flags; //!< (IN) Reserved for future use
  11929. } NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1;
  11930. typedef NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1 NV_VRS_HELPER_LATCH_GAZE_PARAMS;
  11931. #define NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_LATCH_GAZE_PARAMS_V1, 1)
  11932. #define NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER NV_VRS_HELPER_LATCH_GAZE_PARAMS_VER1
  11933. typedef enum _NV_VRS_CONTENT_TYPE
  11934. {
  11935. NV_VRS_CONTENT_TYPE_INVALID = 0x0,
  11936. NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING = 0x1,
  11937. NV_VRS_CONTENT_TYPE_MAX = NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING
  11938. } NV_VRS_CONTENT_TYPE;
  11939. typedef enum _NV_FOVEATED_RENDERING_SHADING_RATE_PRESET
  11940. {
  11941. NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_INVALID = 0,
  11942. NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGHEST_PERFORMANCE = 1,
  11943. NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGH_PERFORMANCE = 2,
  11944. NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_BALANCED = 3,
  11945. NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGH_QUALITY = 4,
  11946. NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_HIGHEST_QUALITY = 5,
  11947. NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM = 6,
  11948. NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_MAX = NV_FOVEATED_RENDERING_SHADING_RATE_PRESET_CUSTOM
  11949. } NV_FOVEATED_RENDERING_SHADING_RATE_PRESET;
  11950. typedef struct _NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1
  11951. {
  11952. NvU32 version;
  11953. NV_PIXEL_SHADING_RATE InnerMostRegionShadingRate; //!< (IN) Shading Rate for the inner-most region of the foveated rendering pattern
  11954. NV_PIXEL_SHADING_RATE MiddleRegionShadingRate; //!< (IN) Shading Rate for the middle region of the foveated rendering pattern
  11955. NV_PIXEL_SHADING_RATE PeripheralRegionShadingRate; //!< (IN) Shading Rate for the peripheral region of the foveated rendering pattern
  11956. } NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1;
  11957. typedef NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1 NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC;
  11958. #define NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_V1, 1)
  11959. #define NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER NV_FOVEATED_RENDERING_CUSTOM_SHADING_RATE_PRESET_DESC_VER1
  11960. typedef enum _NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET
  11961. {
  11962. NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_INVALID = 0,
  11963. NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_WIDE = 1,
  11964. NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_BALANCED = 2,
  11965. NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_NARROW = 3,
  11966. NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM = 4,
  11967. NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_MAX = NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET_CUSTOM
  11968. } NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET;
  11969. typedef struct _NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1
  11970. {
  11971. NvU32 version;
  11972. float fInnermostRadii[2]; //!< (IN) Horizontal and vertical radius for the inner-most region of the foveated rendering pattern
  11973. float fMiddleRadii[2]; //!< (IN) Horizontal and vertical radius for the middle region of the foveated rendering pattern
  11974. float fPeripheralRadii[2]; //!< (IN) Horizontal and vertical radius for the peripheral region of the foveated rendering pattern
  11975. } NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1;
  11976. typedef NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1 NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC;
  11977. #define NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_V1, 1)
  11978. #define NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER NV_FOVEATED_RENDERING_CUSTOM_FOVEATION_PATTERN_PRESET_DESC_VER1
  11979. typedef struct _NV_FOVEATED_RENDERING_DESC_V1
  11980. {
  11981. NvU32 version; //!< (IN) Struct version
  11982. NvU32 flags; //!< (IN) Reserved for future use
  11983. NV_FOVEATED_RENDERING_SHADING_RATE_PRESET ShadingRatePreset; //!< (IN) Preset of the shading rate
  11984. 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
  11985. NV_FOVEATED_RENDERING_FOVEATION_PATTERN_PRESET FoveationPatternPreset; //!< (IN) Preset of the foveation pattern
  11986. 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
  11987. NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking.
  11988. // Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1)
  11989. } NV_FOVEATED_RENDERING_DESC_V1;
  11990. typedef NV_FOVEATED_RENDERING_DESC_V1 NV_FOVEATED_RENDERING_DESC;
  11991. #define NV_FOVEATED_RENDERING_DESC_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_DESC_V1, 1)
  11992. #define NV_FOVEATED_RENDERING_DESC_VER NV_FOVEATED_RENDERING_DESC_VER1
  11993. typedef enum _NV_VRS_RENDER_MODE
  11994. {
  11995. NV_VRS_RENDER_MODE_INVALID = 0,
  11996. NV_VRS_RENDER_MODE_MONO = 1, // States mono rendering on the entire render target
  11997. NV_VRS_RENDER_MODE_LEFT_EYE = 2, // States Left eye rendering of a stereo pair on the entire render target
  11998. NV_VRS_RENDER_MODE_RIGHT_EYE = 3, // States Right eye rendering of a stereo pair on the entire render target
  11999. NV_VRS_RENDER_MODE_STEREO = 4, // States side-by-side stereo rendering on the render target
  12000. NV_VRS_RENDER_MODE_MAX = NV_VRS_RENDER_MODE_STEREO
  12001. } NV_VRS_RENDER_MODE;
  12002. #define MAX_NUMBER_OF_GAZE_DATA_PROVIDERS 8 // Maximum number of gaze data providers / devices.
  12003. typedef struct _NV_VRS_HELPER_ENABLE_PARAMS_V1
  12004. {
  12005. NvU32 version; //!< (IN) Struct version
  12006. NvU32 flags; //!< (IN) Reserved for future use
  12007. NV_VRS_RENDER_MODE RenderMode; //!< (IN) This defines whether subsequent render calls are for mono/stereo
  12008. NV_VRS_CONTENT_TYPE ContentType; //!< (IN) This defines the type of content with which the VRS pattern will be generated
  12009. NV_FOVEATED_RENDERING_DESC_V1 sFoveatedRenderingDesc; //!< (IN) Provide this if ContentType has NV_VRS_CONTENT_TYPE_FOVEATED_RENDERING flag
  12010. } NV_VRS_HELPER_ENABLE_PARAMS_V1;
  12011. typedef NV_VRS_HELPER_ENABLE_PARAMS_V1 NV_VRS_HELPER_ENABLE_PARAMS;
  12012. #define NV_VRS_HELPER_ENABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_ENABLE_PARAMS_V1, 1)
  12013. #define NV_VRS_HELPER_ENABLE_PARAMS_VER NV_VRS_HELPER_ENABLE_PARAMS_VER1
  12014. typedef struct _NV_VRS_HELPER_DISABLE_PARAMS_V1
  12015. {
  12016. NvU32 version; //!< (IN) Struct version
  12017. NvU32 reserved; //!< (IN) Reserved for future use
  12018. } NV_VRS_HELPER_DISABLE_PARAMS_V1;
  12019. typedef NV_VRS_HELPER_DISABLE_PARAMS_V1 NV_VRS_HELPER_DISABLE_PARAMS;
  12020. #define NV_VRS_HELPER_DISABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_DISABLE_PARAMS_V1, 1)
  12021. #define NV_VRS_HELPER_DISABLE_PARAMS_VER NV_VRS_HELPER_DISABLE_PARAMS_VER1
  12022. typedef struct _NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1
  12023. {
  12024. NvU32 version; //!< (IN) Struct version
  12025. IUnknown **ppShadingRateResource; //!< (OUT) Pointer to 2D Texture resource with currently applied shading rate pattern
  12026. NV_PIXEL_SHADING_RATE shadingRateTable[NV_MAX_PIXEL_SHADING_RATES]; //!< (OUT) Shading Rate Table filled by the driver
  12027. } NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1;
  12028. typedef NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1 NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS;
  12029. #define NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_V1, 1)
  12030. #define NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS_VER1
  12031. typedef struct _NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1
  12032. {
  12033. NvU32 version; //!< (IN) Struct version
  12034. NvU32 reserved; //!< (IN) Reserved for future use
  12035. } NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1;
  12036. typedef NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1 NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS;
  12037. #define NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_V1, 1)
  12038. #define NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS_VER1
  12039. DECLARE_INTERFACE(ID3DNvVRSHelper_V1)
  12040. {
  12041. BEGIN_INTERFACE
  12042. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  12043. STDMETHOD_(ULONG,Release)(THIS) PURE;
  12044. // Latches the latest gaze which will be used for subsequent foveated rendering. Recommended to be called once per frame before scene drawing begins.
  12045. STDMETHOD_(NvAPI_Status,LatchGaze)(THIS_ IUnknown* pContext, NV_VRS_HELPER_LATCH_GAZE_PARAMS* pLatchGazeParams) PURE;
  12046. // Enables VRS with sepcified content type and preset. This can be called per draw call.
  12047. STDMETHOD_(NvAPI_Status,Enable)(THIS_ IUnknown* pContext, NV_VRS_HELPER_ENABLE_PARAMS* pEnableParams) PURE;
  12048. // Disables VRS till re-enabled.
  12049. STDMETHOD_(NvAPI_Status,Disable)(THIS_ IUnknown* pContext, NV_VRS_HELPER_DISABLE_PARAMS* pDisableParams) PURE;
  12050. // Creates a 2D texture, copies the current shading rate pattern on it and returns the pointer to this texture.
  12051. // It also returns an array that conveys which value in the shading rate resource corresponds to which exact pixel shading rate.
  12052. STDMETHOD_(NvAPI_Status,GetShadingRateResource)(THIS_ IUnknown* pContext, NV_VRS_HELPER_GET_SHADING_RATE_RESOURCE_PARAMS *pGetShadingRateResourceParams) PURE;
  12053. // Destroys all internally created shading rate resources and views.
  12054. STDMETHOD_(NvAPI_Status,PurgeInternalShadingRateResources)(THIS_ IUnknown* pContext, NV_VRS_HELPER_PURGE_INTERNAL_RESOURCES_PARAMS* pPurgeParams) PURE;
  12055. END_INTERFACE
  12056. };
  12057. typedef ID3DNvVRSHelper_V1 ID3DNvVRSHelper;
  12058. #define ID3DNvVRSHelper_VER1 MAKE_NVAPI_VERSION(ID3DNvVRSHelper_V1, 1)
  12059. #define ID3DNvVRSHelper_VER ID3DNvVRSHelper_VER1
  12060. typedef struct _NV_VRS_HELPER_INIT_PARAMS_V1
  12061. {
  12062. NvU32 version; //!< (IN) Struct version
  12063. NvU32 flags; //!< (IN) Reserved for future use
  12064. ID3DNvVRSHelper_V1 **ppVRSHelper; //!< (OUT) Interface for Shading Rate Pattern Tracker
  12065. } NV_VRS_HELPER_INIT_PARAMS_V1;
  12066. typedef NV_VRS_HELPER_INIT_PARAMS_V1 NV_VRS_HELPER_INIT_PARAMS;
  12067. #define NV_VRS_HELPER_INIT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_VRS_HELPER_INIT_PARAMS_V1, 1)
  12068. #define NV_VRS_HELPER_INIT_PARAMS_VER NV_VRS_HELPER_INIT_PARAMS_VER1
  12069. //! SUPPORTED OS: Windows 7 and higher
  12070. //!
  12071. ///////////////////////////////////////////////////////////////////////////////
  12072. //
  12073. // FUNCTION NAME: NvAPI_D3D_InitializeVRSHelper
  12074. //
  12075. //! DESCRIPTION: Creates an interface for updating, enabling and disabling internally tracked shading rate pattern for Variable Rate Shading
  12076. //!
  12077. //! SUPPORTED OS: Windows 7 and higher
  12078. //!
  12079. //!
  12080. //! \since Release: 430
  12081. //!
  12082. //! \param [in] pDevice The device to be used for creating the VRS Handler interface
  12083. //! \note This should be same the device used for Gaze Handler. See also: NvAPI_D3D_InitializeNvGazeHandler.
  12084. //! \param [in] pInitializeVRSHelperParams Descriptor for VRS Helper initialization
  12085. //!
  12086. //!
  12087. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  12088. //! If there are return error codes with specific meaning for this API, they are listed below.
  12089. //! (none)
  12090. //!
  12091. //! \ingroup dx
  12092. ///////////////////////////////////////////////////////////////////////////////
  12093. NVAPI_INTERFACE NvAPI_D3D_InitializeVRSHelper(__in IUnknown *pDevice,
  12094. __inout NV_VRS_HELPER_INIT_PARAMS *pInitializeVRSHelperParams);
  12095. typedef enum _NV_GAZE_DATA_VALIDITY_FLAGS
  12096. {
  12097. NV_GAZE_ORIGIN_VALID = 0x1,
  12098. NV_GAZE_DIRECTION_VALID = 0x2,
  12099. NV_GAZE_LOCATION_VALID = 0x4,
  12100. NV_GAZE_VELOCITY_VALID = 0x8,
  12101. NV_GAZE_PUPIL_DIAMETER_VALID = 0x10,
  12102. NV_GAZE_EYE_OPENNESS_VALID = 0x20,
  12103. NV_GAZE_EYE_SACCADE_DATA_VALID = 0x40
  12104. } NV_GAZE_DATA_VALIDITY_FLAGS;
  12105. typedef struct _NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE
  12106. {
  12107. NvU32 version; //!< (IN) Version of the structure
  12108. NvU32 GazeDataValidityFlags; //!< (IN) To be populated with OR'ing flags from NV_GAZE_DATA_VALIDITY_FLAGS
  12109. 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.
  12110. 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.
  12111. 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.
  12112. 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.
  12113. float fPupilDiameter_mm; //!< (IN) Use flag NV_GAZE_PUPIL_DIAMETER_VALID. Unused at the moment.
  12114. float fEyeOpenness; //!< (IN) Use flag NV_GAZE_EYE_OPENNESS_VALID. Unused at the moment.
  12115. BOOL bInSaccade; //!< (IN) Use flag NV_GAZE_EYE_SACCADE_DATA_VALID. Denotes whether eye is currently in saccade movement or not.
  12116. } NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1;
  12117. typedef NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE;
  12118. #define NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1, 1)
  12119. #define NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_VER1
  12120. typedef struct _NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS
  12121. {
  12122. NvU32 version; //!< (IN) Struct version
  12123. NvU32 flags; //!< (IN) Reserved for future use
  12124. NvU64 Timestamp; //!< (IN) Timestamp at which the gaze data has been captured. Should be larger than timestamp provided at previous update.
  12125. union
  12126. {
  12127. NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sMonoData; //!< (IN) Gaze data for Mono rendering mode
  12128. struct
  12129. {
  12130. NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sLeftEye; //!< (IN) Gaze data for Left Eye of Stereo rendering mode
  12131. NV_FOVEATED_RENDERING_GAZE_DATA_PER_EYE_V1 sRightEye; //!< (IN) Gaze data for Right Eye of Stereo rendering mode
  12132. } sStereoData;
  12133. };
  12134. } NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1;
  12135. typedef NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1 NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS;
  12136. #define NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_V1, 1)
  12137. #define NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS_VER1
  12138. DECLARE_INTERFACE(ID3DNvGazeHandler_V1)
  12139. {
  12140. BEGIN_INTERFACE
  12141. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  12142. STDMETHOD_(ULONG,Release)(THIS) PURE;
  12143. // Updates the gaze data for foveated rendering
  12144. STDMETHOD_(NvAPI_Status,UpdateGazeData)(THIS_ IUnknown* pContext, NV_FOVEATED_RENDERING_UPDATE_GAZE_DATA_PARAMS* pUpdateGazeDataParams) PURE;
  12145. END_INTERFACE
  12146. };
  12147. typedef ID3DNvGazeHandler_V1 ID3DNvGazeHandler;
  12148. #define ID3DNvGazeHandler_VER1 MAKE_NVAPI_VERSION(ID3DNvGazeHandler_V1, 1)
  12149. #define ID3DNvGazeHandler_VER ID3DNvGazeHandler_VER1
  12150. typedef enum _NV_GAZE_DATA_TYPE
  12151. {
  12152. NV_GAZE_DATA_INVALID = 0,
  12153. NV_GAZE_DATA_MONO = 1,
  12154. NV_GAZE_DATA_STEREO = 2,
  12155. NV_GAZE_DATA_MAX = NV_GAZE_DATA_STEREO
  12156. } NV_GAZE_DATA_TYPE;
  12157. typedef struct _NV_GAZE_HANDLER_INIT_PARAMS_V1
  12158. {
  12159. NvU32 version; //!< (IN) Struct version
  12160. NvU32 GazeDataDeviceId; //!< (IN) ID of the gaze data provider. Needed only for supporting more than one device with eye tracking.
  12161. // Should be 0 if gaze data is provided only from a single device. Should be less than (MAX_NUMBER_OF_GAZE_DATA_PROVIDERS - 1)
  12162. NV_GAZE_DATA_TYPE GazeDataType; //!< (IN) Describes whether gaze is Mono or Stereo
  12163. NvU32 flags; //!< (IN) Reserved for future use
  12164. float fHorizontalFOV; //!< (IN) Horizontal Field of View
  12165. float fVericalFOV; //!< (IN) Vertical Field of View
  12166. ID3DNvGazeHandler_V1 **ppNvGazeHandler; //!< (OUT) Interface for Gaze Data Handler
  12167. } NV_GAZE_HANDLER_INIT_PARAMS_V1;
  12168. typedef NV_GAZE_HANDLER_INIT_PARAMS_V1 NV_GAZE_HANDLER_INIT_PARAMS;
  12169. #define NV_GAZE_HANDLER_INIT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_GAZE_HANDLER_INIT_PARAMS_V1, 1)
  12170. #define NV_GAZE_HANDLER_INIT_PARAMS_VER NV_GAZE_HANDLER_INIT_PARAMS_VER1
  12171. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  12172. //! SUPPORTED OS: Windows 7 and higher
  12173. //!
  12174. #if defined(__cplusplus) && (defined(__d3d11_h__))
  12175. ///////////////////////////////////////////////////////////////////////////////
  12176. //
  12177. // FUNCTION NAME: NvAPI_D3D_InitializeNvGazeHandler
  12178. //
  12179. //! DESCRIPTION: Creates an interface for updating and managing gaze data
  12180. //!
  12181. //! SUPPORTED OS: Windows 7 and higher
  12182. //!
  12183. //!
  12184. //! \since Release: 430
  12185. //!
  12186. //! \param [in] pDevice The device to be used for creating the Gaze Handler interface
  12187. //! \note This should be same as the device used with VRS Handler. See also: NvAPI_D3D_InitializeVRSHelper.
  12188. //! \param [in] pInitializeNvGazeHandlerParams Descriptor for Gaze Data Handler initialization
  12189. //!
  12190. //!
  12191. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  12192. //! If there are return error codes with specific meaning for this API, they are listed below.
  12193. //! (none)
  12194. //!
  12195. //! \ingroup dx
  12196. ///////////////////////////////////////////////////////////////////////////////
  12197. NVAPI_INTERFACE NvAPI_D3D_InitializeNvGazeHandler(__in IUnknown *pDevice,
  12198. __inout NV_GAZE_HANDLER_INIT_PARAMS *pInitializeNvGazeHandlerParams);
  12199. #endif // defined(__cplusplus) && (defined(__d3d11_h__))
  12200. //! SUPPORTED OS: Windows 7 and higher
  12201. //!
  12202. #if defined (__cplusplus) && defined(__d3d11_h__)
  12203. //! \ingroup dx
  12204. typedef enum NV_SMP_ASSIST_TYPE
  12205. {
  12206. NV_SMP_ASSIST_NONE = 0,
  12207. NV_SMP_ASSIST_MRS = 1, // SMP Assist required for Multi-Res Shading
  12208. NV_SMP_ASSIST_LMS = 2, // SMP Assist required for Lens Matched Shading
  12209. NV_SMP_ASSIST_NUM_TYPES
  12210. } NV_SMP_ASSIST_TYPE;
  12211. typedef enum NV_SMP_ASSIST_LEVEL
  12212. {
  12213. 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
  12214. NV_SMP_ASSIST_LEVEL_PARTIAL = 1, // Partial assistance. App provides a custom MRS/LMS config, driver handles correct setting of viewport, scissors and FastGS
  12215. 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.
  12216. NV_SMP_ASSIST_NUM_LEVELS
  12217. } NV_SMP_ASSIST_LEVEL;
  12218. typedef enum NV_MRS_CONFIG
  12219. {
  12220. NV_MRS_CONFIG_BALANCED = 0,
  12221. NV_MRS_CONFIG_AGGRESSIVE = 1,
  12222. NV_MRS_CONFIG_OCULUSRIFT_CV1_CONSERVATIVE = 2,
  12223. NV_MRS_CONFIG_OCULUSRIFT_CV1_BALANCED = 3,
  12224. NV_MRS_CONFIG_OCULUSRIFT_CV1_AGGRESSIVE = 4,
  12225. NV_MRS_CONFIG_HTC_VIVE_CONSERVATIVE = 5,
  12226. NV_MRS_CONFIG_HTC_VIVE_BALANCED = 6,
  12227. NV_MRS_CONFIG_HTC_VIVE_AGGRESSIVE = 7,
  12228. NV_MRS_NUM_CONFIGS
  12229. } NV_MRS_CONFIG;
  12230. typedef enum NV_LMS_CONFIG
  12231. {
  12232. NV_LMS_CONFIG_OCULUSRIFT_CV1_CONSERVATIVE = 0,
  12233. NV_LMS_CONFIG_OCULUSRIFT_CV1_BALANCED = 1,
  12234. NV_LMS_CONFIG_OCULUSRIFT_CV1_AGGRESSIVE = 2,
  12235. NV_LMS_CONFIG_HTC_VIVE_CONSERVATIVE = 3,
  12236. NV_LMS_CONFIG_HTC_VIVE_BALANCED = 4,
  12237. NV_LMS_CONFIG_HTC_VIVE_AGGRESSIVE = 5,
  12238. NV_LMS_NUM_CONFIGS
  12239. } NV_LMS_CONFIG;
  12240. #define NV_SMP_ASSIST_FLAGS_DEFAULT 0x00000000
  12241. #define NV_SMP_ASSIST_MAX_VIEWPORTS 16
  12242. typedef struct _NV_MRS_CUSTOM_CONFIG_V1
  12243. {
  12244. float centerWidth; //!< (IN) Size of the central viewport, ranging (0,1], where 1 is full original viewport size
  12245. float centerHeight;
  12246. float centerX; //!< (IN) Location of the central viewport, ranging 0..1, where 0.5 is the center of the screen
  12247. float centerY;
  12248. 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)
  12249. float densityScaleY[3];
  12250. } NV_MRS_CUSTOM_CONFIG_V1;
  12251. typedef NV_MRS_CUSTOM_CONFIG_V1 NV_MRS_CUSTOM_CONFIG;
  12252. typedef struct _NV_MRS_INSTANCED_STEREO_CONFIG_V1
  12253. { //!< (OUT) MRS Instanced stereo config returned by the SMP Assist GetConstants API
  12254. float centerWidth[2]; //!< (OUT) Size of the central viewport, ranging (0,1], where 1 is full original viewport size
  12255. float centerHeight;
  12256. float centerX[2]; //!< (OUT) Location of the central viewport, ranging 0..1, where 0.5 is the center of the screen
  12257. float centerY;
  12258. 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)
  12259. float densityScaleY[3];
  12260. } NV_MRS_INSTANCED_STEREO_CONFIG_V1;
  12261. typedef NV_MRS_INSTANCED_STEREO_CONFIG_V1 NV_MRS_INSTANCED_STEREO_CONFIG;
  12262. typedef struct _NV_LMS_CUSTOM_CONFIG_V1
  12263. {
  12264. float warpLeft; //!< (IN) LMS params to control warping of the 2 left quadrants
  12265. float warpRight; //!< (IN) LMS params to control warping of the 2 right quadrants
  12266. float warpUp; //!< (IN) LMS params to control warping of the 2 upper quadrants
  12267. float warpDown; //!< (IN) LMS params to control warping of the 2 lower quadrants
  12268. float relativeSizeLeft; //!< (IN) LMS params to control the width of the 2 left quandrants relative to the bounding box width
  12269. float relativeSizeRight; //!< (IN) LMS params to control the width of the 2 right quandrants relative to the bounding box width
  12270. float relativeSizeUp; //!< (IN) LMS params to control the height of the 2 upper quandrants relative to the bounding box height
  12271. float relativeSizeDown; //!< (IN) LMS params to control the height of the 2 lower quandrants relative to the bounding box height
  12272. } NV_LMS_CUSTOM_CONFIG_V1;
  12273. typedef NV_LMS_CUSTOM_CONFIG_V1 NV_LMS_CUSTOM_CONFIG;
  12274. typedef struct _NV_LMS_INSTANCED_STEREO_CONFIG_V1
  12275. { //!< (OUT) LMS Instanced stereo config returned by the SMP Assist GetConstants API
  12276. NV_LMS_CUSTOM_CONFIG_V1 sLeftConfig; //!< (OUT) LMS config for the Left eye view
  12277. NV_LMS_CUSTOM_CONFIG_V1 sRightConfig; //!< (OUT) LMS config for the Right eye view
  12278. } NV_LMS_INSTANCED_STEREO_CONFIG_V1;
  12279. typedef NV_LMS_INSTANCED_STEREO_CONFIG_V1 NV_LMS_INSTANCED_STEREO_CONFIG;
  12280. typedef enum _NV_SMP_ASSIST_EYE_INDEX
  12281. {
  12282. NV_SMP_ASSIST_EYE_INDEX_MONO = 0, // Non-stereo rendering
  12283. NV_SMP_ASSIST_EYE_INDEX_LEFT_EYE = 1, // Stereo - Rendering left eye
  12284. NV_SMP_ASSIST_EYE_INDEX_RIGHT_EYE = 2, // Stereo - Rendering right eye
  12285. NV_SMP_ASSIST_EYE_INDEX_INSTANCED_STEREO = 3, // Stereo - Rendering both eyes
  12286. } NV_SMP_ASSIST_EYE_INDEX;
  12287. #define NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES 4
  12288. typedef struct _NV_CUSTOM_RECTS_V1
  12289. {
  12290. NvU32 numViewports[NV_SMP_ASSIST_MINIMAL_LEVEL_NUM_EYE_INDICES];
  12291. 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)
  12292. 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)
  12293. } NV_CUSTOM_RECTS_V1;
  12294. typedef NV_CUSTOM_RECTS_V1 NV_CUSTOM_RECTS;
  12295. typedef struct _NV_SMP_ASSIST_ENABLE_PARAMS_V1
  12296. {
  12297. NvU32 version; //!< (IN) Structure version
  12298. NV_SMP_ASSIST_EYE_INDEX eEyeIndex; //!< (IN) Rendering mode for upcoming draw calls (Mono/Stereo-Left/Stereo-Right/Instanced Stereo)
  12299. } NV_SMP_ASSIST_ENABLE_PARAMS_V1;
  12300. typedef NV_SMP_ASSIST_ENABLE_PARAMS_V1 NV_SMP_ASSIST_ENABLE_PARAMS;
  12301. #define NV_SMP_ASSIST_ENABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_ENABLE_PARAMS_V1, 1)
  12302. #define NV_SMP_ASSIST_ENABLE_PARAMS_VER NV_SMP_ASSIST_ENABLE_PARAMS_VER1
  12303. typedef struct _NV_SMP_ASSIST_DISABLE_PARAMS_V1
  12304. {
  12305. NvU32 version; //!< (IN) Structure version
  12306. NvU32 Reserved; //!< (IN) Unused.
  12307. } NV_SMP_ASSIST_DISABLE_PARAMS_V1;
  12308. typedef NV_SMP_ASSIST_DISABLE_PARAMS_V1 NV_SMP_ASSIST_DISABLE_PARAMS;
  12309. #define NV_SMP_ASSIST_DISABLE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_DISABLE_PARAMS_V1, 1)
  12310. #define NV_SMP_ASSIST_DISABLE_PARAMS_VER NV_SMP_ASSIST_DISABLE_PARAMS_VER1
  12311. // FastGS constant buffer data returned by the GetConstants API.
  12312. // Refer VRWorks SDK's multiprojection_dx app (struct FastGSCBData)
  12313. typedef struct _NV_SMP_ASSIST_FASTGSCBDATA_V1
  12314. {
  12315. float NDCSplitsX[2]; //!< (OUT) FastGS constant buffer data for Multi-Res Shading/ Lens Matched Shading
  12316. float NDCSplitsY[2];
  12317. } NV_SMP_ASSIST_FASTGSCBDATA_V1;
  12318. typedef NV_SMP_ASSIST_FASTGSCBDATA_V1 NV_SMP_ASSIST_FASTGSCBDATA;
  12319. typedef struct _NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1
  12320. {
  12321. 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
  12322. float NDCSplitsY[2];
  12323. } NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1;
  12324. typedef NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO_V1 NV_SMP_ASSIST_FASTGSCBDATA_MRS_INSTANCED_STEREO;
  12325. // Constant buffer data to supply the UV-remapping helper functions
  12326. // Refer VRWorks SDK's multiprojection_dx app (struct RemapCBData)
  12327. typedef struct _NV_SMP_ASSIST_REMAPCBDATA_V1
  12328. {
  12329. //!< (OUT) Constant buffer data to supply the UV-remapping helper functions
  12330. float ClipToWindowSplitsX[2];
  12331. float ClipToWindowSplitsY[2];
  12332. float ClipToWindowX[3][2]; // ClipToWindowX[i][0] is Scale and ClipToWindowX[i][1] is Bias
  12333. float ClipToWindowY[3][2]; // ClipToWindowY[i][0] is Scale and ClipToWindowY[i][1] is Bias
  12334. float ClipToWindowZ[2]; // ClipToWindowZ[0] is Scale and ClipToWindowZ[1] is Bias
  12335. float WindowToClipSplitsX[2];
  12336. float WindowToClipSplitsY[2];
  12337. float WindowToClipX[3][2]; // WindowToClipX[i][0] is Scale and WindowToClipX[i][1] is Bias
  12338. float WindowToClipY[3][2]; // WindowToClipY[i][0] is Scale and WindowToClipY[i][1] is Bias
  12339. float WindowToClipZ[2]; // WindowToClipZ[0] is Scale and WindowToClipZ[1] is Bias
  12340. float BoundingRectOriginX;
  12341. float BoundingRectOriginY;
  12342. float BoundingRectSizeWidth;
  12343. float BoundingRectSizeHeight;
  12344. float BoundingRectSizeInvWidth;
  12345. float BoundingRectSizeInvHeight;
  12346. float Padding[2];
  12347. }NV_SMP_ASSIST_REMAPCBDATA_V1;
  12348. typedef NV_SMP_ASSIST_REMAPCBDATA_V1 NV_SMP_ASSIST_REMAPCBDATA;
  12349. //! SUPPORTED OS: Windows 7 and higher
  12350. //!
  12351. typedef struct _NV_SMP_ASSIST_GET_CONSTANTS_V3
  12352. {
  12353. NvU32 version; //!< (IN) Structure version
  12354. NV_SMP_ASSIST_EYE_INDEX eEyeIndex; //!< (IN) Viewports/scissors/constant buffer data corresponding to the input eEyeIndex will be returned
  12355. NvU32 numViewports; //!< (OUT) Number of valid viewport entries
  12356. D3D11_VIEWPORT *pViewports; //!< (OUT) If not NULL, this will contain the viewports computed by driver based on init params
  12357. D3D11_RECT *pScissors; //!< (OUT) If not NULL, this will contain the scissors computed by the driver based on init params
  12358. NV_SMP_ASSIST_TYPE eSMPAssistType; //!< (OUT) SMP type provided in Init call
  12359. NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (OUT) SMP Assist level provided in Init call
  12360. union
  12361. {
  12362. NV_MRS_CUSTOM_CONFIG_V1 sMRSConfig; //!< (OUT) If eSMPAssistType is MRS, then MRS config will be populated
  12363. NV_LMS_CUSTOM_CONFIG_V1 sLMSConfig; //!< (OUT) If eSMPAssistType is LMS, then LMS config will be populated
  12364. };
  12365. float projectionSizeWidth; //!< (OUT) MRS/LMS projection size
  12366. float projectionSizeHeight; //!< (OUT)
  12367. 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
  12368. NV_SMP_ASSIST_REMAPCBDATA_V1 *pRemapCBData; //!< (OUT) If not NULL, this will contain constant buffer data to supply the UV-remapping helper functions
  12369. D3D11_VIEWPORT boundingViewport; //!< (OUT) If eSMPType is MRS or LMS then this will be a union of the individual viewports populated in pViewports
  12370. D3D11_RECT boundingScissor; //!< (OUT) If eSMPType is MRS or LMS then this will be a union of the individual scissor rects populated in pScissors
  12371. union
  12372. {
  12373. 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
  12374. 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
  12375. };
  12376. 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
  12377. } NV_SMP_ASSIST_GET_CONSTANTS_V3;
  12378. #define NV_SMP_ASSIST_GET_CONSTANTS_VER3 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_GET_CONSTANTS_V3, 3)
  12379. typedef NV_SMP_ASSIST_GET_CONSTANTS_V3 NV_SMP_ASSIST_GET_CONSTANTS;
  12380. #define NV_SMP_ASSIST_GET_CONSTANTS_VER NV_SMP_ASSIST_GET_CONSTANTS_VER3
  12381. //! SUPPORTED OS: Windows 7 and higher
  12382. //!
  12383. typedef struct _NV_SMP_ASSIST_SETUP_PARAMS_V1
  12384. {
  12385. NvU32 version; //!< (IN) Structure version
  12386. union
  12387. {
  12388. NV_MRS_CONFIG eMRSConfig; //!< (IN) If eSMPAssistType is MRS and SMP Assist Level is Full then provide MRS config enum
  12389. NV_LMS_CONFIG eLMSConfig; //!< (IN) If eSMPAssistType is LMS and SMP Assist Level is Full then provide LMS config enum
  12390. NV_MRS_CUSTOM_CONFIG_V1 sMRSCustomConfig; //!< (IN) If eSMPAssistType is MRS and SMP Assist Level is Partial, then provide MRS config
  12391. NV_LMS_CUSTOM_CONFIG_V1 sLMSCustomConfig; //!< (IN) If eSMPAssistType is LMS and SMP Assist Level is Partial, then provide LMS config
  12392. NV_CUSTOM_RECTS_V1 sCustomRects; //!< (IN) If SMP Assist Level is Minimal, provide custom viewports and scissor rects for each eye index.
  12393. };
  12394. float resolutionScale; //!< (IN) A resolution multiplier in the range [0.1, 3.0] if app wants to render at higher resolution
  12395. D3D11_VIEWPORT boundingBox; //!< (IN) Rect on the rendertarget, to place the projection
  12396. float vpOffsets[2]; //!< (IN) Default set to 0. If non-zero, MRS/LMS viewports' TopLeftX and TopLeftY will be
  12397. //!< offset by vpOffsets[0] and vpOffsets[1] respectively.
  12398. } NV_SMP_ASSIST_SETUP_PARAMS_V1;
  12399. typedef NV_SMP_ASSIST_SETUP_PARAMS_V1 NV_SMP_ASSIST_SETUP_PARAMS;
  12400. #define NV_SMP_ASSIST_SETUP_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_SETUP_PARAMS_V1, 1)
  12401. #define NV_SMP_ASSIST_SETUP_PARAMS_VER NV_SMP_ASSIST_SETUP_PARAMS_VER1
  12402. typedef struct _NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1
  12403. {
  12404. NvU32 version; //!< (IN) Structure version
  12405. NV_SMP_ASSIST_TYPE eSMPAssistType; // Patch instanced stereo shaders (created with packed eye index) with this SMPAssistType (NV_SMP_ASSIST_LMS only)
  12406. float leftCoeffs[4]; // Left eye: outpos.x = dotproduct(outputpos, leftCoeffs) + leftConst
  12407. float leftConst;
  12408. float rightCoeffs[4]; // Right eye: outpos.x = dotproduct(outputpos, rightCoeffs) + rightConst
  12409. float rightConst;
  12410. } NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1;
  12411. typedef NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1 NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS;
  12412. #define NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_V1, 1)
  12413. #define NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS_VER1
  12414. //! SUPPORTED OS: Windows 7 and higher
  12415. //!
  12416. DECLARE_INTERFACE(ID3DNvSMPAssist_V1)
  12417. {
  12418. ////////////////////////////// VER1 methods //////////////////////////////////////////
  12419. // Disable SMP Assist for further Draw calls
  12420. STDMETHOD_(NvAPI_Status,Disable)(THIS_ __in IUnknown *pDevContext, __in const NV_SMP_ASSIST_DISABLE_PARAMS *psSMPAssistDisableParams) PURE;
  12421. // 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
  12422. STDMETHOD_(NvAPI_Status,Enable)(THIS_ __in IUnknown *pDevContext, __in const NV_SMP_ASSIST_ENABLE_PARAMS *psSMPAssistEnableParams) PURE;
  12423. // Get the constants used by the drivers
  12424. STDMETHOD_(NvAPI_Status,GetConstants)(THIS_ __inout NV_SMP_ASSIST_GET_CONSTANTS *psSMPAssistGetConstants) PURE;
  12425. // Setup the projections (rects, constant buffer data etc.)
  12426. STDMETHOD_(NvAPI_Status,SetupProjections)(THIS_ __in IUnknown *pDevice, __in const NV_SMP_ASSIST_SETUP_PARAMS *psSMPAssistSetupParams) PURE;
  12427. // Update instanced stereo specific data
  12428. STDMETHOD_(NvAPI_Status,UpdateInstancedStereoData)(THIS_ __in IUnknown *pDevice, __in const NV_SMP_ASSIST_UPDATE_INSTANCEDSTEREO_DATA_PARAMS *psSMPAssistInstancedStereoParams) PURE;
  12429. ////////////////////////////// end of VER1 methods //////////////////////////////////////////
  12430. };
  12431. typedef ID3DNvSMPAssist_V1 ID3DNvSMPAssist;
  12432. #define ID3DNVSMPASSIST_VER1 MAKE_NVAPI_VERSION(ID3DNvSMPAssist_V1, 1)
  12433. #define ID3DNVSMPASSIST_VER ID3DNVSMPASSIST_VER1
  12434. //! SUPPORTED OS: Windows 7 and higher
  12435. //!
  12436. typedef struct _NV_SMP_ASSIST_INITIALIZE_PARAMS_V1
  12437. {
  12438. NvU32 version; //!< (IN) Structure version
  12439. NV_SMP_ASSIST_TYPE eSMPAssistType; //!< (IN) None/MRS/LMS
  12440. NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (IN) Full/Partial/Minimal
  12441. NvU32 flags; //!< (IN) Flags, if any
  12442. ID3DNvSMPAssist **ppD3DNvSMPAssist; //!< (OUT) Interface pointer returned by the Init call. Use for future Enable/Disable etc. calls
  12443. } NV_SMP_ASSIST_INITIALIZE_PARAMS_V1;
  12444. #define NV_SMP_ASSIST_INITIALIZE_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_SMP_ASSIST_INITIALIZE_PARAMS_V1, 1)
  12445. #ifndef NV_SMP_ASSIST_INITIALIZE_PARAMS_VER
  12446. typedef NV_SMP_ASSIST_INITIALIZE_PARAMS_V1 NV_SMP_ASSIST_INITIALIZE_PARAMS;
  12447. #define NV_SMP_ASSIST_INITIALIZE_PARAMS_VER NV_SMP_ASSIST_INITIALIZE_PARAMS_VER1
  12448. #endif
  12449. ///////////////////////////////////////////////////////////////////////////////
  12450. //
  12451. // FUNCTION NAME: NvAPI_D3D_InitializeSMPAssist
  12452. //
  12453. //! DESCRIPTION: Initialize SMP Assist extension. Take the SMPAssist(MRS/LMS) params from the application.
  12454. //! Provide the application with a interface pointer for future use.
  12455. //!
  12456. //! \since Release: 396
  12457. //! \param [in] pDevice Pointer to IUnknown (Currently supports ID3D11Device)
  12458. //! \param [inout] pSMPAssistInitParams SMP Assist initialization params
  12459. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  12460. //! If there are return error codes with specific meaning for this API, they are listed below.
  12461. //! \retval ::NVAPI_OK Call succeeded.
  12462. //! \retval ::NVAPI_ERROR Call failed.
  12463. //! \retval ::NVAPI_INVALID_ARGUMENT One of the required input arguments was NULL
  12464. //! \ingroup dx
  12465. ///////////////////////////////////////////////////////////////////////////////
  12466. NVAPI_INTERFACE NvAPI_D3D_InitializeSMPAssist(__in IUnknown *pDevice, __inout NV_SMP_ASSIST_INITIALIZE_PARAMS *pSMPAssistInitParams);
  12467. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  12468. //! SUPPORTED OS: Windows 7 and higher
  12469. //!
  12470. #if defined (__cplusplus) && defined(__d3d11_h__)
  12471. //! \ingroup dx
  12472. typedef struct _NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1
  12473. {
  12474. NvU32 version; //!< (IN) Structure version
  12475. NV_SMP_ASSIST_TYPE eSMPAssistType; //!< (IN) None/MRS/LMS
  12476. NV_SMP_ASSIST_LEVEL eSMPAssistLevel; //!< (IN) Full/Partial/Minimal
  12477. NvBool bSMPAssistSupported; //!< (OUT) SMP Assist supported or not
  12478. } NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1;
  12479. typedef NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1 NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS;
  12480. #define NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER1 MAKE_NVAPI_VERSION(NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_V1, 1)
  12481. #define NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS_VER1
  12482. //! SUPPORTED OS: Windows 7 and higher
  12483. //!
  12484. //! \ingroup dx
  12485. ///////////////////////////////////////////////////////////////////////////////
  12486. //
  12487. // FUNCTION NAME: NvAPI_D3D_QuerySMPAssistSupport
  12488. //
  12489. //! DESCRIPTION: Query SMP assist extension support.
  12490. //!
  12491. //! \since Release: 396
  12492. //! \param [in] pDev Pointer to IUnknown (Currently supports ID3D11Device)
  12493. //! \param [out] pQuerySMPAssistSupportParams Pointer to a structure returning requested SMP assist support
  12494. //!
  12495. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  12496. //! If there are return error codes with specific meaning for this API, they are listed below.
  12497. //! \retval ::NVAPI_NOT_SUPPORTED Requested SMP assist is not supported.
  12498. //! \retval ::NVAPI_OK Call succeeded. Check value of pQuerySMPAssistSupportParams->bSMPAssistSupported
  12499. //! \retval ::NVAPI_INVALID_POINTER pDev or pQuerySMPAssistSupportParams was a NULL pointer
  12500. //! \ingroup dx
  12501. ///////////////////////////////////////////////////////////////////////////////
  12502. NVAPI_INTERFACE NvAPI_D3D_QuerySMPAssistSupport(__in IUnknown *pDev, __inout NV_QUERY_SMP_ASSIST_SUPPORT_PARAMS *pQuerySMPAssistSupportParams);
  12503. #endif //defined(__cplusplus) && defined(__d3d11_h__)
  12504. //! \ingroup vidio
  12505. //! Unique identifier for VIO owner (process identifier or NVVIOOWNERID_NONE)
  12506. typedef NvU32 NVVIOOWNERID;
  12507. //! \addtogroup vidio
  12508. //! @{
  12509. #define NVVIOOWNERID_NONE 0 //!< Unregistered ownerId
  12510. //! Owner type for device
  12511. typedef enum _NVVIOOWNERTYPE
  12512. {
  12513. NVVIOOWNERTYPE_NONE , //!< No owner for the device
  12514. NVVIOOWNERTYPE_APPLICATION , //!< Application owns the device
  12515. NVVIOOWNERTYPE_DESKTOP , //!< Desktop transparent mode owns the device (not applicable for video input)
  12516. }NVVIOOWNERTYPE;
  12517. // Access rights for NvAPI_VIO_Open()
  12518. //! Read access (not applicable for video output)
  12519. #define NVVIO_O_READ 0x00000000
  12520. //! Write exclusive access (not applicable for video input)
  12521. #define NVVIO_O_WRITE_EXCLUSIVE 0x00010001
  12522. //!
  12523. #define NVVIO_VALID_ACCESSRIGHTS (NVVIO_O_READ | \
  12524. NVVIO_O_WRITE_EXCLUSIVE )
  12525. //! VIO_DATA.ulOwnerID high-bit is set only if device has been initialized by VIOAPI
  12526. //! examined at NvAPI_GetCapabilities|NvAPI_VIO_Open to determine if settings need to be applied from registry or POR state read
  12527. #define NVVIO_OWNERID_INITIALIZED 0x80000000
  12528. //! VIO_DATA.ulOwnerID next-bit is set only if device is currently in exclusive write access mode from NvAPI_VIO_Open()
  12529. #define NVVIO_OWNERID_EXCLUSIVE 0x40000000
  12530. //! VIO_DATA.ulOwnerID lower bits are:
  12531. //! NVGVOOWNERTYPE_xxx enumerations indicating use context
  12532. #define NVVIO_OWNERID_TYPEMASK 0x0FFFFFFF //!< mask for NVVIOOWNERTYPE_xxx
  12533. //! @}
  12534. //---------------------------------------------------------------------
  12535. // Enumerations
  12536. //---------------------------------------------------------------------
  12537. //! \addtogroup vidio
  12538. //! @{
  12539. //! Video signal format and resolution
  12540. typedef enum _NVVIOSIGNALFORMAT
  12541. {
  12542. NVVIOSIGNALFORMAT_NONE, //!< Invalid signal format
  12543. NVVIOSIGNALFORMAT_487I_59_94_SMPTE259_NTSC, //!< 01 487i 59.94Hz (SMPTE259) NTSC
  12544. NVVIOSIGNALFORMAT_576I_50_00_SMPTE259_PAL, //!< 02 576i 50.00Hz (SMPTE259) PAL
  12545. NVVIOSIGNALFORMAT_1035I_60_00_SMPTE260, //!< 03 1035i 60.00Hz (SMPTE260)
  12546. NVVIOSIGNALFORMAT_1035I_59_94_SMPTE260, //!< 04 1035i 59.94Hz (SMPTE260)
  12547. NVVIOSIGNALFORMAT_1080I_50_00_SMPTE295, //!< 05 1080i 50.00Hz (SMPTE295)
  12548. NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274, //!< 06 1080i 60.00Hz (SMPTE274)
  12549. NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274, //!< 07 1080i 59.94Hz (SMPTE274)
  12550. NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274, //!< 08 1080i 50.00Hz (SMPTE274)
  12551. NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274, //!< 09 1080p 30.00Hz (SMPTE274)
  12552. NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274, //!< 10 1080p 29.97Hz (SMPTE274)
  12553. NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274, //!< 11 1080p 25.00Hz (SMPTE274)
  12554. NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274, //!< 12 1080p 24.00Hz (SMPTE274)
  12555. NVVIOSIGNALFORMAT_1080P_23_976_SMPTE274, //!< 13 1080p 23.976Hz (SMPTE274)
  12556. NVVIOSIGNALFORMAT_720P_60_00_SMPTE296, //!< 14 720p 60.00Hz (SMPTE296)
  12557. NVVIOSIGNALFORMAT_720P_59_94_SMPTE296, //!< 15 720p 59.94Hz (SMPTE296)
  12558. NVVIOSIGNALFORMAT_720P_50_00_SMPTE296, //!< 16 720p 50.00Hz (SMPTE296)
  12559. NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274, //!< 17 1080I 48.00Hz (SMPTE274)
  12560. NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274, //!< 18 1080I 47.96Hz (SMPTE274)
  12561. NVVIOSIGNALFORMAT_720P_30_00_SMPTE296, //!< 19 720p 30.00Hz (SMPTE296)
  12562. NVVIOSIGNALFORMAT_720P_29_97_SMPTE296, //!< 20 720p 29.97Hz (SMPTE296)
  12563. NVVIOSIGNALFORMAT_720P_25_00_SMPTE296, //!< 21 720p 25.00Hz (SMPTE296)
  12564. NVVIOSIGNALFORMAT_720P_24_00_SMPTE296, //!< 22 720p 24.00Hz (SMPTE296)
  12565. NVVIOSIGNALFORMAT_720P_23_98_SMPTE296, //!< 23 720p 23.98Hz (SMPTE296)
  12566. NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372, //!< 24 2048p 30.00Hz (SMPTE372)
  12567. NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372, //!< 25 2048p 29.97Hz (SMPTE372)
  12568. NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372, //!< 26 2048i 60.00Hz (SMPTE372)
  12569. NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372, //!< 27 2048i 59.94Hz (SMPTE372)
  12570. NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372, //!< 28 2048p 25.00Hz (SMPTE372)
  12571. NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372, //!< 29 2048i 50.00Hz (SMPTE372)
  12572. NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372, //!< 30 2048p 24.00Hz (SMPTE372)
  12573. NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372, //!< 31 2048p 23.98Hz (SMPTE372)
  12574. NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372, //!< 32 2048i 48.00Hz (SMPTE372)
  12575. NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372, //!< 33 2048i 47.96Hz (SMPTE372)
  12576. NVVIOSIGNALFORMAT_1080PSF_25_00_SMPTE274, //!< 34 1080PsF 25.00Hz (SMPTE274)
  12577. NVVIOSIGNALFORMAT_1080PSF_29_97_SMPTE274, //!< 35 1080PsF 29.97Hz (SMPTE274)
  12578. NVVIOSIGNALFORMAT_1080PSF_30_00_SMPTE274, //!< 36 1080PsF 30.00Hz (SMPTE274)
  12579. NVVIOSIGNALFORMAT_1080PSF_24_00_SMPTE274, //!< 37 1080PsF 24.00Hz (SMPTE274)
  12580. NVVIOSIGNALFORMAT_1080PSF_23_98_SMPTE274, //!< 38 1080PsF 23.98Hz (SMPTE274)
  12581. NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_A, //!< 39 1080P 50.00Hz (SMPTE274) 3G Level A
  12582. NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_A, //!< 40 1080P 59.94Hz (SMPTE274) 3G Level A
  12583. NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_A, //!< 41 1080P 60.00Hz (SMPTE274) 3G Level A
  12584. NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_B, //!< 42 1080p 60.00Hz (SMPTE274) 3G Level B
  12585. NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274_3G_LEVEL_B, //!< 43 1080i 60.00Hz (SMPTE274) 3G Level B
  12586. NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372_3G_LEVEL_B, //!< 44 2048i 60.00Hz (SMPTE372) 3G Level B
  12587. NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_B, //!< 45 1080p 50.00Hz (SMPTE274) 3G Level B
  12588. NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274_3G_LEVEL_B, //!< 46 1080i 50.00Hz (SMPTE274) 3G Level B
  12589. NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372_3G_LEVEL_B, //!< 47 2048i 50.00Hz (SMPTE372) 3G Level B
  12590. NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274_3G_LEVEL_B, //!< 48 1080p 30.00Hz (SMPTE274) 3G Level B
  12591. NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372_3G_LEVEL_B, //!< 49 2048p 30.00Hz (SMPTE372) 3G Level B
  12592. NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274_3G_LEVEL_B, //!< 50 1080p 25.00Hz (SMPTE274) 3G Level B
  12593. NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372_3G_LEVEL_B, //!< 51 2048p 25.00Hz (SMPTE372) 3G Level B
  12594. NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274_3G_LEVEL_B, //!< 52 1080p 24.00Hz (SMPTE274) 3G Level B
  12595. NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372_3G_LEVEL_B, //!< 53 2048p 24.00Hz (SMPTE372) 3G Level B
  12596. NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274_3G_LEVEL_B, //!< 54 1080i 48.00Hz (SMPTE274) 3G Level B
  12597. NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372_3G_LEVEL_B, //!< 55 2048i 48.00Hz (SMPTE372) 3G Level B
  12598. NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_B, //!< 56 1080p 59.94Hz (SMPTE274) 3G Level B
  12599. NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274_3G_LEVEL_B, //!< 57 1080i 59.94Hz (SMPTE274) 3G Level B
  12600. NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372_3G_LEVEL_B, //!< 58 2048i 59.94Hz (SMPTE372) 3G Level B
  12601. NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274_3G_LEVEL_B, //!< 59 1080p 29.97Hz (SMPTE274) 3G Level B
  12602. NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372_3G_LEVEL_B, //!< 60 2048p 29.97Hz (SMPTE372) 3G Level B
  12603. NVVIOSIGNALFORMAT_1080P_23_98_SMPTE274_3G_LEVEL_B, //!< 61 1080p 29.98Hz (SMPTE274) 3G Level B
  12604. NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372_3G_LEVEL_B, //!< 62 2048p 29.98Hz (SMPTE372) 3G Level B
  12605. NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274_3G_LEVEL_B, //!< 63 1080i 47.96Hz (SMPTE274) 3G Level B
  12606. NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372_3G_LEVEL_B, //!< 64 2048i 47.96Hz (SMPTE372) 3G Level B
  12607. NVVIOSIGNALFORMAT_END //!< 65 To indicate end of signal format list
  12608. }NVVIOSIGNALFORMAT;
  12609. //! SMPTE standards format
  12610. typedef enum _NVVIOVIDEOSTANDARD
  12611. {
  12612. NVVIOVIDEOSTANDARD_SMPTE259 , //!< SMPTE259
  12613. NVVIOVIDEOSTANDARD_SMPTE260 , //!< SMPTE260
  12614. NVVIOVIDEOSTANDARD_SMPTE274 , //!< SMPTE274
  12615. NVVIOVIDEOSTANDARD_SMPTE295 , //!< SMPTE295
  12616. NVVIOVIDEOSTANDARD_SMPTE296 , //!< SMPTE296
  12617. NVVIOVIDEOSTANDARD_SMPTE372 , //!< SMPTE372
  12618. }NVVIOVIDEOSTANDARD;
  12619. //! HD or SD video type
  12620. typedef enum _NVVIOVIDEOTYPE
  12621. {
  12622. NVVIOVIDEOTYPE_SD , //!< Standard-definition (SD)
  12623. NVVIOVIDEOTYPE_HD , //!< High-definition (HD)
  12624. }NVVIOVIDEOTYPE;
  12625. //! Interlace mode
  12626. typedef enum _NVVIOINTERLACEMODE
  12627. {
  12628. NVVIOINTERLACEMODE_PROGRESSIVE , //!< Progressive (p)
  12629. NVVIOINTERLACEMODE_INTERLACE , //!< Interlace (i)
  12630. NVVIOINTERLACEMODE_PSF , //!< Progressive Segment Frame (psf)
  12631. }NVVIOINTERLACEMODE;
  12632. //! Video data format
  12633. typedef enum _NVVIODATAFORMAT
  12634. {
  12635. NVVIODATAFORMAT_UNKNOWN = -1 , //!< Invalid DataFormat
  12636. NVVIODATAFORMAT_R8G8B8_TO_YCRCB444 , //!< R8:G8:B8 => YCrCb (4:4:4)
  12637. NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4444 , //!< R8:G8:B8:A8 => YCrCbA (4:4:4:4)
  12638. NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4444 , //!< R8:G8:B8:Z10 => YCrCbZ (4:4:4:4)
  12639. NVVIODATAFORMAT_R8G8B8_TO_YCRCB422 , //!< R8:G8:B8 => YCrCb (4:2:2)
  12640. NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4224 , //!< R8:G8:B8:A8 => YCrCbA (4:2:2:4)
  12641. NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4224 , //!< R8:G8:B8:Z10 => YCrCbZ (4:2:2:4)
  12642. NVVIODATAFORMAT_X8X8X8_444_PASSTHRU , //!< R8:G8:B8 => RGB (4:4:4)
  12643. NVVIODATAFORMAT_X8X8X8A8_4444_PASSTHRU , //!< R8:G8:B8:A8 => RGBA (4:4:4:4)
  12644. NVVIODATAFORMAT_X8X8X8Z10_4444_PASSTHRU , //!< R8:G8:B8:Z10 => RGBZ (4:4:4:4)
  12645. NVVIODATAFORMAT_X10X10X10_444_PASSTHRU , //!< Y10:CR10:CB10 => YCrCb (4:4:4)
  12646. NVVIODATAFORMAT_X10X8X8_444_PASSTHRU , //!< Y10:CR8:CB8 => YCrCb (4:4:4)
  12647. NVVIODATAFORMAT_X10X8X8A10_4444_PASSTHRU , //!< Y10:CR8:CB8:A10 => YCrCbA (4:4:4:4)
  12648. NVVIODATAFORMAT_X10X8X8Z10_4444_PASSTHRU , //!< Y10:CR8:CB8:Z10 => YCrCbZ (4:4:4:4)
  12649. NVVIODATAFORMAT_DUAL_R8G8B8_TO_DUAL_YCRCB422 , //!< R8:G8:B8 + R8:G8:B8 => YCrCb (4:2:2 + 4:2:2)
  12650. NVVIODATAFORMAT_DUAL_X8X8X8_TO_DUAL_422_PASSTHRU , //!< Y8:CR8:CB8 + Y8:CR8:CB8 => YCrCb (4:2:2 + 4:2:2)
  12651. NVVIODATAFORMAT_R10G10B10_TO_YCRCB422 , //!< R10:G10:B10 => YCrCb (4:2:2)
  12652. NVVIODATAFORMAT_R10G10B10_TO_YCRCB444 , //!< R10:G10:B10 => YCrCb (4:4:4)
  12653. NVVIODATAFORMAT_X12X12X12_444_PASSTHRU , //!< X12:X12:X12 => XXX (4:4:4)
  12654. NVVIODATAFORMAT_X12X12X12_422_PASSTHRU , //!< X12:X12:X12 => XXX (4:2:2)
  12655. NVVIODATAFORMAT_Y10CR10CB10_TO_YCRCB422 , //!< Y10:CR10:CB10 => YCrCb (4:2:2)
  12656. NVVIODATAFORMAT_Y8CR8CB8_TO_YCRCB422 , //!< Y8:CR8:CB8 => YCrCb (4:2:2)
  12657. NVVIODATAFORMAT_Y10CR8CB8A10_TO_YCRCBA4224 , //!< Y10:CR8:CB8:A10 => YCrCbA (4:2:2:4)
  12658. NVVIODATAFORMAT_R10G10B10_TO_RGB444 , //!< R10:G10:B10 => RGB (4:4:4)
  12659. NVVIODATAFORMAT_R12G12B12_TO_YCRCB444 , //!< R12:G12:B12 => YCrCb (4:4:4)
  12660. NVVIODATAFORMAT_R12G12B12_TO_YCRCB422 , //!< R12:G12:B12 => YCrCb (4:2:2)
  12661. }NVVIODATAFORMAT;
  12662. //! Video output area
  12663. typedef enum _NVVIOOUTPUTAREA
  12664. {
  12665. NVVIOOUTPUTAREA_FULLSIZE , //!< Output to entire video resolution (full size)
  12666. NVVIOOUTPUTAREA_SAFEACTION , //!< Output to centered 90% of video resolution (safe action)
  12667. NVVIOOUTPUTAREA_SAFETITLE , //!< Output to centered 80% of video resolution (safe title)
  12668. }NVVIOOUTPUTAREA;
  12669. //! Synchronization source
  12670. typedef enum _NVVIOSYNCSOURCE
  12671. {
  12672. NVVIOSYNCSOURCE_SDISYNC , //!< SDI Sync (Digital input)
  12673. NVVIOSYNCSOURCE_COMPSYNC , //!< COMP Sync (Composite input)
  12674. }NVVIOSYNCSOURCE;
  12675. //! Composite synchronization type
  12676. typedef enum _NVVIOCOMPSYNCTYPE
  12677. {
  12678. NVVIOCOMPSYNCTYPE_AUTO , //!< Auto-detect
  12679. NVVIOCOMPSYNCTYPE_BILEVEL , //!< Bi-level signal
  12680. NVVIOCOMPSYNCTYPE_TRILEVEL , //!< Tri-level signal
  12681. }NVVIOCOMPSYNCTYPE;
  12682. //! Video input output status
  12683. typedef enum _NVVIOINPUTOUTPUTSTATUS
  12684. {
  12685. NVINPUTOUTPUTSTATUS_OFF , //!< Not in use
  12686. NVINPUTOUTPUTSTATUS_ERROR , //!< Error detected
  12687. NVINPUTOUTPUTSTATUS_SDI_SD , //!< SDI (standard-definition)
  12688. NVINPUTOUTPUTSTATUS_SDI_HD , //!< SDI (high-definition)
  12689. }NVVIOINPUTOUTPUTSTATUS;
  12690. //! Synchronization input status
  12691. typedef enum _NVVIOSYNCSTATUS
  12692. {
  12693. NVVIOSYNCSTATUS_OFF , //!< Sync not detected
  12694. NVVIOSYNCSTATUS_ERROR , //!< Error detected
  12695. NVVIOSYNCSTATUS_SYNCLOSS , //!< Genlock in use, format mismatch with output
  12696. NVVIOSYNCSTATUS_COMPOSITE , //!< Composite sync
  12697. NVVIOSYNCSTATUS_SDI_SD , //!< SDI sync (standard-definition)
  12698. NVVIOSYNCSTATUS_SDI_HD , //!< SDI sync (high-definition)
  12699. }NVVIOSYNCSTATUS;
  12700. //! Video Capture Status
  12701. typedef enum _NVVIOCAPTURESTATUS
  12702. {
  12703. NVVIOSTATUS_STOPPED , //!< Sync not detected
  12704. NVVIOSTATUS_RUNNING , //!< Error detected
  12705. NVVIOSTATUS_ERROR , //!< Genlock in use, format mismatch with output
  12706. }NVVIOCAPTURESTATUS;
  12707. //! Video Capture Status
  12708. typedef enum _NVVIOSTATUSTYPE
  12709. {
  12710. NVVIOSTATUSTYPE_IN , //!< Input Status
  12711. NVVIOSTATUSTYPE_OUT , //!< Output Status
  12712. }NVVIOSTATUSTYPE;
  12713. //! Assumption, maximum 4 SDI input and 4 SDI output cards supported on a system
  12714. #define NVAPI_MAX_VIO_DEVICES 8
  12715. //! 4 physical jacks supported on each SDI input card.
  12716. #define NVAPI_MAX_VIO_JACKS 4
  12717. //! Each physical jack an on SDI input card can have
  12718. //! two "channels" in the case of "3G" VideoFormats, as specified
  12719. //! by SMPTE 425; for non-3G VideoFormats, only the first channel within
  12720. //! a physical jack is valid.
  12721. #define NVAPI_MAX_VIO_CHANNELS_PER_JACK 2
  12722. //! 4 Streams, 1 per physical jack
  12723. #define NVAPI_MAX_VIO_STREAMS 4
  12724. #define NVAPI_MIN_VIO_STREAMS 1
  12725. //! SDI input supports a max of 2 links per stream
  12726. #define NVAPI_MAX_VIO_LINKS_PER_STREAM 2
  12727. #define NVAPI_MAX_FRAMELOCK_MAPPING_MODES 20
  12728. //! Min number of capture images
  12729. #define NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES 1
  12730. //! Max number of capture images
  12731. #define NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES 32
  12732. //! Default number of capture images
  12733. #define NVAPI_GVI_DEFAULT_RAW_CAPTURE_IMAGES 5
  12734. // Data Signal notification events. These need a event handler in RM.
  12735. // Register/Unregister and PopEvent NVAPI's are already available.
  12736. //! Device configuration
  12737. typedef enum _NVVIOCONFIGTYPE
  12738. {
  12739. NVVIOCONFIGTYPE_IN , //!< Input Status
  12740. NVVIOCONFIGTYPE_OUT , //!< Output Status
  12741. }NVVIOCONFIGTYPE;
  12742. typedef enum _NVVIOCOLORSPACE
  12743. {
  12744. NVVIOCOLORSPACE_UNKNOWN,
  12745. NVVIOCOLORSPACE_YCBCR,
  12746. NVVIOCOLORSPACE_YCBCRA,
  12747. NVVIOCOLORSPACE_YCBCRD,
  12748. NVVIOCOLORSPACE_GBR,
  12749. NVVIOCOLORSPACE_GBRA,
  12750. NVVIOCOLORSPACE_GBRD,
  12751. } NVVIOCOLORSPACE;
  12752. //! Component sampling
  12753. typedef enum _NVVIOCOMPONENTSAMPLING
  12754. {
  12755. NVVIOCOMPONENTSAMPLING_UNKNOWN,
  12756. NVVIOCOMPONENTSAMPLING_4444,
  12757. NVVIOCOMPONENTSAMPLING_4224,
  12758. NVVIOCOMPONENTSAMPLING_444,
  12759. NVVIOCOMPONENTSAMPLING_422
  12760. } NVVIOCOMPONENTSAMPLING;
  12761. typedef enum _NVVIOBITSPERCOMPONENT
  12762. {
  12763. NVVIOBITSPERCOMPONENT_UNKNOWN,
  12764. NVVIOBITSPERCOMPONENT_8,
  12765. NVVIOBITSPERCOMPONENT_10,
  12766. NVVIOBITSPERCOMPONENT_12,
  12767. } NVVIOBITSPERCOMPONENT;
  12768. typedef enum _NVVIOLINKID
  12769. {
  12770. NVVIOLINKID_UNKNOWN,
  12771. NVVIOLINKID_A,
  12772. NVVIOLINKID_B,
  12773. NVVIOLINKID_C,
  12774. NVVIOLINKID_D
  12775. } NVVIOLINKID;
  12776. typedef enum _NVVIOANCPARITYCOMPUTATION
  12777. {
  12778. NVVIOANCPARITYCOMPUTATION_AUTO,
  12779. NVVIOANCPARITYCOMPUTATION_ON,
  12780. NVVIOANCPARITYCOMPUTATION_OFF
  12781. } NVVIOANCPARITYCOMPUTATION;
  12782. //! @}
  12783. //---------------------------------------------------------------------
  12784. // Structures
  12785. //---------------------------------------------------------------------
  12786. //! \addtogroup vidio
  12787. //! @{
  12788. //! Supports Serial Digital Interface (SDI) output
  12789. #define NVVIOCAPS_VIDOUT_SDI 0x00000001
  12790. //! Supports Internal timing source
  12791. #define NVVIOCAPS_SYNC_INTERNAL 0x00000100
  12792. //! Supports Genlock timing source
  12793. #define NVVIOCAPS_SYNC_GENLOCK 0x00000200
  12794. //! Supports Serial Digital Interface (SDI) synchronization input
  12795. #define NVVIOCAPS_SYNCSRC_SDI 0x00001000
  12796. //! Supports Composite synchronization input
  12797. #define NVVIOCAPS_SYNCSRC_COMP 0x00002000
  12798. //! Supports Desktop transparent mode
  12799. #define NVVIOCAPS_OUTPUTMODE_DESKTOP 0x00010000
  12800. //! Supports OpenGL application mode
  12801. #define NVVIOCAPS_OUTPUTMODE_OPENGL 0x00020000
  12802. //! Supports Serial Digital Interface (SDI) input
  12803. #define NVVIOCAPS_VIDIN_SDI 0x00100000
  12804. //! Supports Packed ANC
  12805. #define NVVIOCAPS_PACKED_ANC_SUPPORTED 0x00200000
  12806. //! Supports ANC audio blanking
  12807. #define NVVIOCAPS_AUDIO_BLANKING_SUPPORTED 0x00400000
  12808. //! SDI-class interface: SDI output with two genlock inputs
  12809. #define NVVIOCLASS_SDI 0x00000001
  12810. //! Device capabilities
  12811. typedef struct _NVVIOCAPS
  12812. {
  12813. NvU32 version; //!< Structure version
  12814. NvAPI_String adapterName; //!< Graphics adapter name
  12815. NvU32 adapterClass; //!< Graphics adapter classes (NVVIOCLASS_SDI mask)
  12816. NvU32 adapterCaps; //!< Graphics adapter capabilities (NVVIOCAPS_* mask)
  12817. NvU32 dipSwitch; //!< On-board DIP switch settings bits
  12818. NvU32 dipSwitchReserved; //!< On-board DIP switch settings reserved bits
  12819. NvU32 boardID; //!< Board ID
  12820. //! Driver version
  12821. struct //
  12822. {
  12823. NvU32 majorVersion; //!< Major version. For GVI, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD)
  12824. NvU32 minorVersion; //!< Minor version. For GVI, minorVersion contains Revison(HIWORD) And Build(LOWORD)
  12825. } driver; //
  12826. //! Firmware version
  12827. struct
  12828. {
  12829. NvU32 majorVersion; //!< Major version. In version 2, for both GVI and GVO, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD)
  12830. NvU32 minorVersion; //!< Minor version. In version 2, for both GVI and GVO, minorVersion contains Revison(HIWORD) And Build(LOWORD)
  12831. } firmWare; //
  12832. NVVIOOWNERID ownerId; //!< Unique identifier for owner of video output (NVVIOOWNERID_INVALID if free running)
  12833. NVVIOOWNERTYPE ownerType; //!< Owner type (OpenGL application or Desktop mode)
  12834. } NVVIOCAPS;
  12835. //! Macro for constructing the version field of NVVIOCAPS
  12836. #define NVVIOCAPS_VER1 MAKE_NVAPI_VERSION(NVVIOCAPS,1)
  12837. #define NVVIOCAPS_VER2 MAKE_NVAPI_VERSION(NVVIOCAPS,2)
  12838. #define NVVIOCAPS_VER NVVIOCAPS_VER2
  12839. //! Input channel status
  12840. typedef struct _NVVIOCHANNELSTATUS
  12841. {
  12842. NvU32 smpte352; //!< 4-byte SMPTE 352 video payload identifier
  12843. NVVIOSIGNALFORMAT signalFormat; //!< Signal format
  12844. NVVIOBITSPERCOMPONENT bitsPerComponent; //!< Bits per component
  12845. NVVIOCOMPONENTSAMPLING samplingFormat; //!< Sampling format
  12846. NVVIOCOLORSPACE colorSpace; //!< Color space
  12847. NVVIOLINKID linkID; //!< Link ID
  12848. } NVVIOCHANNELSTATUS;
  12849. //! Input device status
  12850. typedef struct _NVVIOINPUTSTATUS
  12851. {
  12852. NVVIOCHANNELSTATUS vidIn[NVAPI_MAX_VIO_JACKS][NVAPI_MAX_VIO_CHANNELS_PER_JACK]; //!< Video input status per channel within a jack
  12853. NVVIOCAPTURESTATUS captureStatus; //!< status of video capture
  12854. } NVVIOINPUTSTATUS;
  12855. //! Output device status
  12856. typedef struct _NVVIOOUTPUTSTATUS
  12857. {
  12858. NVVIOINPUTOUTPUTSTATUS vid1Out; //!< Video 1 output status
  12859. NVVIOINPUTOUTPUTSTATUS vid2Out; //!< Video 2 output status
  12860. NVVIOSYNCSTATUS sdiSyncIn; //!< SDI sync input status
  12861. NVVIOSYNCSTATUS compSyncIn; //!< Composite sync input status
  12862. NvU32 syncEnable; //!< Sync enable (TRUE if using syncSource)
  12863. NVVIOSYNCSOURCE syncSource; //!< Sync source
  12864. NVVIOSIGNALFORMAT syncFormat; //!< Sync format
  12865. NvU32 frameLockEnable; //!< Framelock enable flag
  12866. NvU32 outputVideoLocked; //!< Output locked status
  12867. NvU32 dataIntegrityCheckErrorCount; //!< Data integrity check error count
  12868. NvU32 dataIntegrityCheckEnabled; //!< Data integrity check status enabled
  12869. NvU32 dataIntegrityCheckFailed; //!< Data integrity check status failed
  12870. NvU32 uSyncSourceLocked; //!< genlocked to framelocked to ref signal
  12871. NvU32 uPowerOn; //!< TRUE: indicates there is sufficient power
  12872. } NVVIOOUTPUTSTATUS;
  12873. //! Video device status.
  12874. typedef struct _NVVIOSTATUS
  12875. {
  12876. NvU32 version; //!< Structure version
  12877. NVVIOSTATUSTYPE nvvioStatusType; //!< Input or Output status
  12878. union
  12879. {
  12880. NVVIOINPUTSTATUS inStatus; //!< Input device status
  12881. NVVIOOUTPUTSTATUS outStatus; //!< Output device status
  12882. }vioStatus;
  12883. } NVVIOSTATUS;
  12884. //! Macro for constructingthe version field of NVVIOSTATUS
  12885. #define NVVIOSTATUS_VER MAKE_NVAPI_VERSION(NVVIOSTATUS,1)
  12886. //! Output region
  12887. typedef struct _NVVIOOUTPUTREGION
  12888. {
  12889. NvU32 x; //!< Horizontal origin in pixels
  12890. NvU32 y; //!< Vertical origin in pixels
  12891. NvU32 width; //!< Width of region in pixels
  12892. NvU32 height; //!< Height of region in pixels
  12893. } NVVIOOUTPUTREGION;
  12894. //! Gamma ramp (8-bit index)
  12895. typedef struct _NVVIOGAMMARAMP8
  12896. {
  12897. NvU16 uRed[256]; //!< Red channel gamma ramp (8-bit index, 16-bit values)
  12898. NvU16 uGreen[256]; //!< Green channel gamma ramp (8-bit index, 16-bit values)
  12899. NvU16 uBlue[256]; //!< Blue channel gamma ramp (8-bit index, 16-bit values)
  12900. } NVVIOGAMMARAMP8;
  12901. //! Gamma ramp (10-bit index)
  12902. typedef struct _NVVIOGAMMARAMP10
  12903. {
  12904. NvU16 uRed[1024]; //!< Red channel gamma ramp (10-bit index, 16-bit values)
  12905. NvU16 uGreen[1024]; //!< Green channel gamma ramp (10-bit index, 16-bit values)
  12906. NvU16 uBlue[1024]; //!< Blue channel gamma ramp (10-bit index, 16-bit values)
  12907. } NVVIOGAMMARAMP10;
  12908. //! Sync delay
  12909. typedef struct _NVVIOSYNCDELAY
  12910. {
  12911. NvU32 version; //!< Structure version
  12912. NvU32 horizontalDelay; //!< Horizontal delay in pixels
  12913. NvU32 verticalDelay; //!< Vertical delay in lines
  12914. } NVVIOSYNCDELAY;
  12915. //! Macro for constructing the version field of NVVIOSYNCDELAY
  12916. #define NVVIOSYNCDELAY_VER MAKE_NVAPI_VERSION(NVVIOSYNCDELAY,1)
  12917. //! Video mode information
  12918. typedef struct _NVVIOVIDEOMODE
  12919. {
  12920. NvU32 horizontalPixels; //!< Horizontal resolution (in pixels)
  12921. NvU32 verticalLines; //!< Vertical resolution for frame (in lines)
  12922. float fFrameRate; //!< Frame rate
  12923. NVVIOINTERLACEMODE interlaceMode; //!< Interlace mode
  12924. NVVIOVIDEOSTANDARD videoStandard; //!< SMPTE standards format
  12925. NVVIOVIDEOTYPE videoType; //!< HD or SD signal classification
  12926. } NVVIOVIDEOMODE;
  12927. //! Signal format details
  12928. typedef struct _NVVIOSIGNALFORMATDETAIL
  12929. {
  12930. NVVIOSIGNALFORMAT signalFormat; //!< Signal format enumerated value
  12931. NVVIOVIDEOMODE videoMode; //!< Video mode for signal format
  12932. }NVVIOSIGNALFORMATDETAIL;
  12933. //! R8:G8:B8
  12934. #define NVVIOBUFFERFORMAT_R8G8B8 0x00000001
  12935. //! R8:G8:B8:Z24
  12936. #define NVVIOBUFFERFORMAT_R8G8B8Z24 0x00000002
  12937. //! R8:G8:B8:A8
  12938. #define NVVIOBUFFERFORMAT_R8G8B8A8 0x00000004
  12939. //! R8:G8:B8:A8:Z24
  12940. #define NVVIOBUFFERFORMAT_R8G8B8A8Z24 0x00000008
  12941. //! R16FP:G16FP:B16FP
  12942. #define NVVIOBUFFERFORMAT_R16FPG16FPB16FP 0x00000010
  12943. //! R16FP:G16FP:B16FP:Z24
  12944. #define NVVIOBUFFERFORMAT_R16FPG16FPB16FPZ24 0x00000020
  12945. //! R16FP:G16FP:B16FP:A16FP
  12946. #define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FP 0x00000040
  12947. //! R16FP:G16FP:B16FP:A16FP:Z24
  12948. #define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FPZ24 0x00000080
  12949. //! Data format details
  12950. typedef struct _NVVIODATAFORMATDETAIL
  12951. {
  12952. NVVIODATAFORMAT dataFormat; //!< Data format enumerated value
  12953. NvU32 vioCaps; //!< Data format capabilities (NVVIOCAPS_* mask)
  12954. }NVVIODATAFORMATDETAIL;
  12955. //! Colorspace conversion
  12956. typedef struct _NVVIOCOLORCONVERSION
  12957. {
  12958. NvU32 version; //!< Structure version
  12959. float colorMatrix[3][3]; //!< Output[n] =
  12960. float colorOffset[3]; //!< Input[0] * colorMatrix[n][0] +
  12961. float colorScale[3]; //!< Input[1] * colorMatrix[n][1] +
  12962. //!< Input[2] * colorMatrix[n][2] +
  12963. //!< OutputRange * colorOffset[n]
  12964. //!< where OutputRange is the standard magnitude of
  12965. //!< Output[n][n] and colorMatrix and colorOffset
  12966. //!< values are within the range -1.0 to +1.0
  12967. NvU32 compositeSafe; //!< compositeSafe constrains luminance range when using composite output
  12968. } NVVIOCOLORCONVERSION;
  12969. //! macro for constructing the version field of _NVVIOCOLORCONVERSION.
  12970. #define NVVIOCOLORCONVERSION_VER MAKE_NVAPI_VERSION(NVVIOCOLORCONVERSION,1)
  12971. //! Gamma correction
  12972. typedef struct _NVVIOGAMMACORRECTION
  12973. {
  12974. NvU32 version; //!< Structure version
  12975. NvU32 vioGammaCorrectionType; //!< Gamma correction type (8-bit or 10-bit)
  12976. //! Gamma correction:
  12977. union
  12978. {
  12979. NVVIOGAMMARAMP8 gammaRamp8; //!< Gamma ramp (8-bit index, 16-bit values)
  12980. NVVIOGAMMARAMP10 gammaRamp10; //!< Gamma ramp (10-bit index, 16-bit values)
  12981. }gammaRamp;
  12982. float fGammaValueR; //!< Red Gamma value within gamma ranges. 0.5 - 6.0
  12983. float fGammaValueG; //!< Green Gamma value within gamma ranges. 0.5 - 6.0
  12984. float fGammaValueB; //!< Blue Gamma value within gamma ranges. 0.5 - 6.0
  12985. } NVVIOGAMMACORRECTION;
  12986. //! Macro for constructing thevesion field of _NVVIOGAMMACORRECTION
  12987. #define NVVIOGAMMACORRECTION_VER MAKE_NVAPI_VERSION(NVVIOGAMMACORRECTION,1)
  12988. //! Maximum number of ranges per channel
  12989. #define MAX_NUM_COMPOSITE_RANGE 2
  12990. typedef struct _NVVIOCOMPOSITERANGE
  12991. {
  12992. NvU32 uRange;
  12993. NvU32 uEnabled;
  12994. NvU32 uMin;
  12995. NvU32 uMax;
  12996. } NVVIOCOMPOSITERANGE;
  12997. // Device configuration (fields masks indicating NVVIOCONFIG fields to use for NvAPI_VIO_GetConfig/NvAPI_VIO_SetConfig() )
  12998. //
  12999. #define NVVIOCONFIG_SIGNALFORMAT 0x00000001 //!< fields: signalFormat
  13000. #define NVVIOCONFIG_DATAFORMAT 0x00000002 //!< fields: dataFormat
  13001. #define NVVIOCONFIG_OUTPUTREGION 0x00000004 //!< fields: outputRegion
  13002. #define NVVIOCONFIG_OUTPUTAREA 0x00000008 //!< fields: outputArea
  13003. #define NVVIOCONFIG_COLORCONVERSION 0x00000010 //!< fields: colorConversion
  13004. #define NVVIOCONFIG_GAMMACORRECTION 0x00000020 //!< fields: gammaCorrection
  13005. #define NVVIOCONFIG_SYNCSOURCEENABLE 0x00000040 //!< fields: syncSource and syncEnable
  13006. #define NVVIOCONFIG_SYNCDELAY 0x00000080 //!< fields: syncDelay
  13007. #define NVVIOCONFIG_COMPOSITESYNCTYPE 0x00000100 //!< fields: compositeSyncType
  13008. #define NVVIOCONFIG_FRAMELOCKENABLE 0x00000200 //!< fields: EnableFramelock
  13009. #define NVVIOCONFIG_422FILTER 0x00000400 //!< fields: bEnable422Filter
  13010. #define NVVIOCONFIG_COMPOSITETERMINATE 0x00000800 //!< fields: bCompositeTerminate (Not supported on Quadro FX 4000 SDI)
  13011. #define NVVIOCONFIG_DATAINTEGRITYCHECK 0x00001000 //!< fields: bEnableDataIntegrityCheck (Not supported on Quadro FX 4000 SDI)
  13012. #define NVVIOCONFIG_CSCOVERRIDE 0x00002000 //!< fields: colorConversion override
  13013. #define NVVIOCONFIG_FLIPQUEUELENGTH 0x00004000 //!< fields: flipqueuelength control
  13014. #define NVVIOCONFIG_ANCTIMECODEGENERATION 0x00008000 //!< fields: bEnableANCTimeCodeGeneration
  13015. #define NVVIOCONFIG_COMPOSITE 0x00010000 //!< fields: bEnableComposite
  13016. #define NVVIOCONFIG_ALPHAKEYCOMPOSITE 0x00020000 //!< fields: bEnableAlphaKeyComposite
  13017. #define NVVIOCONFIG_COMPOSITE_Y 0x00040000 //!< fields: compRange
  13018. #define NVVIOCONFIG_COMPOSITE_CR 0x00080000 //!< fields: compRange
  13019. #define NVVIOCONFIG_COMPOSITE_CB 0x00100000 //!< fields: compRange
  13020. #define NVVIOCONFIG_FULL_COLOR_RANGE 0x00200000 //!< fields: bEnableFullColorRange
  13021. #define NVVIOCONFIG_RGB_DATA 0x00400000 //!< fields: bEnableRGBData
  13022. #define NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE 0x00800000 //!< fields: bEnableSDIOutput
  13023. #define NVVIOCONFIG_STREAMS 0x01000000 //!< fields: streams
  13024. #define NVVIOCONFIG_ANC_PARITY_COMPUTATION 0x02000000 //!< fields: ancParityComputation
  13025. #define NVVIOCONFIG_ANC_AUDIO_REPEAT 0x04000000 //!< fields: enableAudioBlanking
  13026. // Don't forget to update NVVIOCONFIG_VALIDFIELDS in nvapi.spec when NVVIOCONFIG_ALLFIELDS changes.
  13027. #define NVVIOCONFIG_ALLFIELDS ( NVVIOCONFIG_SIGNALFORMAT | \
  13028. NVVIOCONFIG_DATAFORMAT | \
  13029. NVVIOCONFIG_OUTPUTREGION | \
  13030. NVVIOCONFIG_OUTPUTAREA | \
  13031. NVVIOCONFIG_COLORCONVERSION | \
  13032. NVVIOCONFIG_GAMMACORRECTION | \
  13033. NVVIOCONFIG_SYNCSOURCEENABLE | \
  13034. NVVIOCONFIG_SYNCDELAY | \
  13035. NVVIOCONFIG_COMPOSITESYNCTYPE | \
  13036. NVVIOCONFIG_FRAMELOCKENABLE | \
  13037. NVVIOCONFIG_422FILTER | \
  13038. NVVIOCONFIG_COMPOSITETERMINATE | \
  13039. NVVIOCONFIG_DATAINTEGRITYCHECK | \
  13040. NVVIOCONFIG_CSCOVERRIDE | \
  13041. NVVIOCONFIG_FLIPQUEUELENGTH | \
  13042. NVVIOCONFIG_ANCTIMECODEGENERATION | \
  13043. NVVIOCONFIG_COMPOSITE | \
  13044. NVVIOCONFIG_ALPHAKEYCOMPOSITE | \
  13045. NVVIOCONFIG_COMPOSITE_Y | \
  13046. NVVIOCONFIG_COMPOSITE_CR | \
  13047. NVVIOCONFIG_COMPOSITE_CB | \
  13048. NVVIOCONFIG_FULL_COLOR_RANGE | \
  13049. NVVIOCONFIG_RGB_DATA | \
  13050. NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \
  13051. NVVIOCONFIG_STREAMS | \
  13052. NVVIOCONFIG_ANC_PARITY_COMPUTATION | \
  13053. NVVIOCONFIG_ANC_AUDIO_REPEAT )
  13054. #define NVVIOCONFIG_VALIDFIELDS ( NVVIOCONFIG_SIGNALFORMAT | \
  13055. NVVIOCONFIG_DATAFORMAT | \
  13056. NVVIOCONFIG_OUTPUTREGION | \
  13057. NVVIOCONFIG_OUTPUTAREA | \
  13058. NVVIOCONFIG_COLORCONVERSION | \
  13059. NVVIOCONFIG_GAMMACORRECTION | \
  13060. NVVIOCONFIG_SYNCSOURCEENABLE | \
  13061. NVVIOCONFIG_SYNCDELAY | \
  13062. NVVIOCONFIG_COMPOSITESYNCTYPE | \
  13063. NVVIOCONFIG_FRAMELOCKENABLE | \
  13064. NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \
  13065. NVVIOCONFIG_422FILTER | \
  13066. NVVIOCONFIG_COMPOSITETERMINATE | \
  13067. NVVIOCONFIG_DATAINTEGRITYCHECK | \
  13068. NVVIOCONFIG_CSCOVERRIDE | \
  13069. NVVIOCONFIG_FLIPQUEUELENGTH | \
  13070. NVVIOCONFIG_ANCTIMECODEGENERATION | \
  13071. NVVIOCONFIG_COMPOSITE | \
  13072. NVVIOCONFIG_ALPHAKEYCOMPOSITE | \
  13073. NVVIOCONFIG_COMPOSITE_Y | \
  13074. NVVIOCONFIG_COMPOSITE_CR | \
  13075. NVVIOCONFIG_COMPOSITE_CB | \
  13076. NVVIOCONFIG_FULL_COLOR_RANGE | \
  13077. NVVIOCONFIG_RGB_DATA | \
  13078. NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \
  13079. NVVIOCONFIG_STREAMS | \
  13080. NVVIOCONFIG_ANC_PARITY_COMPUTATION | \
  13081. NVVIOCONFIG_ANC_AUDIO_REPEAT)
  13082. #define NVVIOCONFIG_DRIVERFIELDS ( NVVIOCONFIG_OUTPUTREGION | \
  13083. NVVIOCONFIG_OUTPUTAREA | \
  13084. NVVIOCONFIG_COLORCONVERSION | \
  13085. NVVIOCONFIG_FLIPQUEUELENGTH)
  13086. #define NVVIOCONFIG_GAMMAFIELDS ( NVVIOCONFIG_GAMMACORRECTION )
  13087. #define NVVIOCONFIG_RMCTRLFIELDS ( NVVIOCONFIG_SIGNALFORMAT | \
  13088. NVVIOCONFIG_DATAFORMAT | \
  13089. NVVIOCONFIG_SYNCSOURCEENABLE | \
  13090. NVVIOCONFIG_COMPOSITESYNCTYPE | \
  13091. NVVIOCONFIG_FRAMELOCKENABLE | \
  13092. NVVIOCONFIG_422FILTER | \
  13093. NVVIOCONFIG_COMPOSITETERMINATE | \
  13094. NVVIOCONFIG_DATAINTEGRITYCHECK | \
  13095. NVVIOCONFIG_COMPOSITE | \
  13096. NVVIOCONFIG_ALPHAKEYCOMPOSITE | \
  13097. NVVIOCONFIG_COMPOSITE_Y | \
  13098. NVVIOCONFIG_COMPOSITE_CR | \
  13099. NVVIOCONFIG_COMPOSITE_CB)
  13100. #define NVVIOCONFIG_RMSKEWFIELDS ( NVVIOCONFIG_SYNCDELAY )
  13101. #define NVVIOCONFIG_ALLOWSDIRUNNING_FIELDS ( NVVIOCONFIG_DATAINTEGRITYCHECK | \
  13102. NVVIOCONFIG_SYNCDELAY | \
  13103. NVVIOCONFIG_CSCOVERRIDE | \
  13104. NVVIOCONFIG_ANCTIMECODEGENERATION | \
  13105. NVVIOCONFIG_COMPOSITE | \
  13106. NVVIOCONFIG_ALPHAKEYCOMPOSITE | \
  13107. NVVIOCONFIG_COMPOSITE_Y | \
  13108. NVVIOCONFIG_COMPOSITE_CR | \
  13109. NVVIOCONFIG_COMPOSITE_CB | \
  13110. NVVIOCONFIG_ANC_PARITY_COMPUTATION)
  13111. #define NVVIOCONFIG_RMMODESET_FIELDS ( NVVIOCONFIG_SIGNALFORMAT | \
  13112. NVVIOCONFIG_DATAFORMAT | \
  13113. NVVIOCONFIG_SYNCSOURCEENABLE | \
  13114. NVVIOCONFIG_FRAMELOCKENABLE | \
  13115. NVVIOCONFIG_COMPOSITESYNCTYPE | \
  13116. NVVIOCONFIG_ANC_AUDIO_REPEAT)
  13117. //! Output device configuration
  13118. // No members can be deleted from below structure. Only add new members at the
  13119. // end of the structure.
  13120. typedef struct _NVVIOOUTPUTCONFIG_V1
  13121. {
  13122. NVVIOSIGNALFORMAT signalFormat; //!< Signal format for video output
  13123. NVVIODATAFORMAT dataFormat; //!< Data format for video output
  13124. NVVIOOUTPUTREGION outputRegion; //!< Region for video output (Desktop mode)
  13125. NVVIOOUTPUTAREA outputArea; //!< Usable resolution for video output (safe area)
  13126. NVVIOCOLORCONVERSION colorConversion; //!< Color conversion.
  13127. NVVIOGAMMACORRECTION gammaCorrection;
  13128. NvU32 syncEnable; //!< Sync enable (TRUE to use syncSource)
  13129. NVVIOSYNCSOURCE syncSource; //!< Sync source
  13130. NVVIOSYNCDELAY syncDelay; //!< Sync delay
  13131. NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type
  13132. NvU32 frameLockEnable; //!< Flag indicating whether framelock was on/off
  13133. NvU32 psfSignalFormat; //!< Indicates whether contained format is PSF Signal format
  13134. NvU32 enable422Filter; //!< Enables/Disables 4:2:2 filter
  13135. NvU32 compositeTerminate; //!< Composite termination
  13136. NvU32 enableDataIntegrityCheck; //!< Enable data integrity check: true - enable, false - disable
  13137. NvU32 cscOverride; //!< Use provided CSC color matrix to overwrite
  13138. NvU32 flipQueueLength; //!< Number of buffers used for the internal flipqueue
  13139. NvU32 enableANCTimeCodeGeneration; //!< Enable SDI ANC time code generation
  13140. NvU32 enableComposite; //!< Enable composite
  13141. NvU32 enableAlphaKeyComposite; //!< Enable Alpha key composite
  13142. NVVIOCOMPOSITERANGE compRange; //!< Composite ranges
  13143. NvU8 reservedData[256]; //!< Inicates last stored SDI output state TRUE-ON / FALSE-OFF
  13144. NvU32 enableFullColorRange; //!< Flag indicating Full Color Range
  13145. NvU32 enableRGBData; //!< Indicates data is in RGB format
  13146. } NVVIOOUTPUTCONFIG_V1;
  13147. typedef struct _NVVIOOUTPUTCONFIG_V2
  13148. {
  13149. NVVIOSIGNALFORMAT signalFormat; //!< Signal format for video output
  13150. NVVIODATAFORMAT dataFormat; //!< Data format for video output
  13151. NVVIOOUTPUTREGION outputRegion; //!< Region for video output (Desktop mode)
  13152. NVVIOOUTPUTAREA outputArea; //!< Usable resolution for video output (safe area)
  13153. NVVIOCOLORCONVERSION colorConversion; //!< Color conversion.
  13154. NVVIOGAMMACORRECTION gammaCorrection;
  13155. NvU32 syncEnable; //!< Sync enable (TRUE to use syncSource)
  13156. NVVIOSYNCSOURCE syncSource; //!< Sync source
  13157. NVVIOSYNCDELAY syncDelay; //!< Sync delay
  13158. NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type
  13159. NvU32 frameLockEnable; //!< Flag indicating whether framelock was on/off
  13160. NvU32 psfSignalFormat; //!< Indicates whether contained format is PSF Signal format
  13161. NvU32 enable422Filter; //!< Enables/Disables 4:2:2 filter
  13162. NvU32 compositeTerminate; //!< Composite termination
  13163. NvU32 enableDataIntegrityCheck; //!< Enable data integrity check: true - enable, false - disable
  13164. NvU32 cscOverride; //!< Use provided CSC color matrix to overwrite
  13165. NvU32 flipQueueLength; //!< Number of buffers used for the internal flip queue
  13166. NvU32 enableANCTimeCodeGeneration; //!< Enable SDI ANC time code generation
  13167. NvU32 enableComposite; //!< Enable composite
  13168. NvU32 enableAlphaKeyComposite; //!< Enable Alpha key composite
  13169. NVVIOCOMPOSITERANGE compRange; //!< Composite ranges
  13170. NvU8 reservedData[256]; //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF
  13171. NvU32 enableFullColorRange; //!< Flag indicating Full Color Range
  13172. NvU32 enableRGBData; //!< Indicates data is in RGB format
  13173. NVVIOANCPARITYCOMPUTATION ancParityComputation; //!< Enable HW ANC parity bit computation (auto/on/off)
  13174. } NVVIOOUTPUTCONFIG_V2;
  13175. typedef struct _NVVIOOUTPUTCONFIG_V3
  13176. {
  13177. NVVIOSIGNALFORMAT signalFormat; //!< Signal format for video output
  13178. NVVIODATAFORMAT dataFormat; //!< Data format for video output
  13179. NVVIOOUTPUTREGION outputRegion; //!< Region for video output (Desktop mode)
  13180. NVVIOOUTPUTAREA outputArea; //!< Usable resolution for video output (safe area)
  13181. NVVIOCOLORCONVERSION colorConversion; //!< Color conversion.
  13182. NVVIOGAMMACORRECTION gammaCorrection;
  13183. NvU32 syncEnable; //!< Sync enable (TRUE to use syncSource)
  13184. NVVIOSYNCSOURCE syncSource; //!< Sync source
  13185. NVVIOSYNCDELAY syncDelay; //!< Sync delay
  13186. NVVIOCOMPSYNCTYPE compositeSyncType; //!< Composite sync type
  13187. NvU32 frameLockEnable; //!< Flag indicating whether framelock was on/off
  13188. NvU32 psfSignalFormat; //!< Indicates whether contained format is PSF Signal format
  13189. NvU32 enable422Filter; //!< Enables/Disables 4:2:2 filter
  13190. NvU32 compositeTerminate; //!< Composite termination
  13191. NvU32 enableDataIntegrityCheck; //!< Enable data integrity check: true - enable, false - disable
  13192. NvU32 cscOverride; //!< Use provided CSC color matrix to overwrite
  13193. NvU32 flipQueueLength; //!< Number of buffers used for the internal flip queue
  13194. NvU32 enableANCTimeCodeGeneration; //!< Enable SDI ANC time code generation
  13195. NvU32 enableComposite; //!< Enable composite
  13196. NvU32 enableAlphaKeyComposite; //!< Enable Alpha key composite
  13197. NVVIOCOMPOSITERANGE compRange; //!< Composite ranges
  13198. NvU8 reservedData[256]; //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF
  13199. NvU32 enableFullColorRange; //!< Flag indicating Full Color Range
  13200. NvU32 enableRGBData; //!< Indicates data is in RGB format
  13201. NVVIOANCPARITYCOMPUTATION ancParityComputation; //!< Enable HW ANC parity bit computation (auto/on/off)
  13202. NvU32 enableAudioBlanking; //!< Enable HANC audio blanking on repeat frames
  13203. } NVVIOOUTPUTCONFIG_V3;
  13204. //! Stream configuration
  13205. typedef struct _NVVIOSTREAM
  13206. {
  13207. NvU32 bitsPerComponent; //!< Bits per component
  13208. NVVIOCOMPONENTSAMPLING sampling; //!< Sampling
  13209. NvU32 expansionEnable; //!< Enable/disable 4:2:2->4:4:4 expansion
  13210. NvU32 numLinks; //!< Number of active links
  13211. struct
  13212. {
  13213. NvU32 jack; //!< This stream's link[i] will use the specified (0-based) channel within the
  13214. NvU32 channel; //!< specified (0-based) jack
  13215. } links[NVAPI_MAX_VIO_LINKS_PER_STREAM];
  13216. } NVVIOSTREAM;
  13217. //! Input device configuration
  13218. typedef struct _NVVIOINPUTCONFIG
  13219. {
  13220. NvU32 numRawCaptureImages; //!< numRawCaptureImages is the number of frames to keep in the capture queue.
  13221. //!< must be between NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES and NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES,
  13222. NVVIOSIGNALFORMAT signalFormat; //!< Signal format.
  13223. //!< Please note that both numRawCaptureImages and signalFormat should be set together.
  13224. NvU32 numStreams; //!< Number of active streams.
  13225. NVVIOSTREAM streams[NVAPI_MAX_VIO_STREAMS]; //!< Stream configurations
  13226. NvU32 bTestMode; //!< This attribute controls the GVI test mode.
  13227. //!< Possible values 0/1. When testmode enabled, the
  13228. //!< GVI device will generate fake data as quickly as possible.
  13229. } NVVIOINPUTCONFIG;
  13230. typedef struct _NVVIOCONFIG_V1
  13231. {
  13232. NvU32 version; //!< Structure version
  13233. NvU32 fields; //!< Caller sets to NVVIOCONFIG_* mask for fields to use
  13234. NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration
  13235. union
  13236. {
  13237. NVVIOINPUTCONFIG inConfig; //!< Input device configuration
  13238. NVVIOOUTPUTCONFIG_V1 outConfig; //!< Output device configuration
  13239. }vioConfig;
  13240. } NVVIOCONFIG_V1;
  13241. typedef struct _NVVIOCONFIG_V2
  13242. {
  13243. NvU32 version; //!< Structure version
  13244. NvU32 fields; //!< Caller sets to NVVIOCONFIG_* mask for fields to use
  13245. NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration
  13246. union
  13247. {
  13248. NVVIOINPUTCONFIG inConfig; //!< Input device configuration
  13249. NVVIOOUTPUTCONFIG_V2 outConfig; //!< Output device configuration
  13250. }vioConfig;
  13251. } NVVIOCONFIG_V2;
  13252. typedef struct _NVVIOCONFIG_V3
  13253. {
  13254. NvU32 version; //!< Structure version
  13255. NvU32 fields; //!< Caller sets to NVVIOCONFIG_* mask for fields to use
  13256. NVVIOCONFIGTYPE nvvioConfigType; //!< Input or Output configuration
  13257. union
  13258. {
  13259. NVVIOINPUTCONFIG inConfig; //!< Input device configuration
  13260. NVVIOOUTPUTCONFIG_V3 outConfig; //!< Output device configuration
  13261. }vioConfig;
  13262. } NVVIOCONFIG_V3;
  13263. typedef NVVIOOUTPUTCONFIG_V3 NVVIOOUTPUTCONFIG;
  13264. typedef NVVIOCONFIG_V3 NVVIOCONFIG;
  13265. #define NVVIOCONFIG_VER1 MAKE_NVAPI_VERSION(NVVIOCONFIG_V1,1)
  13266. #define NVVIOCONFIG_VER2 MAKE_NVAPI_VERSION(NVVIOCONFIG_V2,2)
  13267. #define NVVIOCONFIG_VER3 MAKE_NVAPI_VERSION(NVVIOCONFIG_V3,3)
  13268. #define NVVIOCONFIG_VER NVVIOCONFIG_VER3
  13269. typedef struct
  13270. {
  13271. NvPhysicalGpuHandle hPhysicalGpu; //!< Handle to Physical GPU (This could be NULL for GVI device if its not binded)
  13272. NvVioHandle hVioHandle; //!<handle to SDI Input/Output device
  13273. NvU32 vioId; //!<device Id of SDI Input/Output device
  13274. NvU32 outputId; //!<deviceMask of the SDI display connected to GVO device.
  13275. //!<outputId will be 0 for GVI device.
  13276. } NVVIOTOPOLOGYTARGET;
  13277. typedef struct _NV_VIO_TOPOLOGY
  13278. {
  13279. NvU32 version;
  13280. NvU32 vioTotalDeviceCount; //!<How many video I/O targets are valid
  13281. NVVIOTOPOLOGYTARGET vioTarget[NVAPI_MAX_VIO_DEVICES]; //!<Array of video I/O targets
  13282. }NV_VIO_TOPOLOGY, NVVIOTOPOLOGY;
  13283. //! Macro for constructing the version field of NV_VIO_TOPOLOGY
  13284. #define NV_VIO_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_VIO_TOPOLOGY,1)
  13285. //! Macro for constructing the version field of NVVIOTOPOLOGY
  13286. #define NVVIOTOPOLOGY_VER MAKE_NVAPI_VERSION(NVVIOTOPOLOGY,1)
  13287. //! @}
  13288. //! \addtogroup vidio
  13289. //! @{
  13290. ///////////////////////////////////////////////////////////////////////////////
  13291. //!
  13292. //! Function: NvAPI_VIO_GetCapabilities
  13293. //!
  13294. //! Description: This API determine the graphics adapter video I/O capabilities.
  13295. //!
  13296. //! \deprecated Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.
  13297. //! SUPPORTED OS: Windows 7 and higher
  13298. //!
  13299. //!
  13300. //! \since Release: 190
  13301. //!
  13302. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13303. //! \param [out] pAdapterCaps Pointer to receive capabilities
  13304. //!
  13305. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13306. //!
  13307. ///////////////////////////////////////////////////////////////////////////////
  13308. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.")
  13309. NVAPI_INTERFACE NvAPI_VIO_GetCapabilities(NvVioHandle hVioHandle,
  13310. NVVIOCAPS *pAdapterCaps);
  13311. ////////////////////////////////////////////////////////////////////////////////
  13312. //! Function: NvAPI_VIO_Open
  13313. //!
  13314. //! Description: This API opens the graphics adapter for video I/O operations
  13315. //! using the OpenGL application interface. Read operations
  13316. //! are permitted in this mode by multiple clients, but Write
  13317. //! operations are application exclusive.
  13318. //!
  13319. //! \deprecated Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.
  13320. //! SUPPORTED OS: Windows 7 and higher
  13321. //!
  13322. //!
  13323. //! \since Release: 190
  13324. //!
  13325. //! \param [in] NvVioHandle The caller provides the SDI output device handle as input.
  13326. //! \param [in] vioClass Class interface (NVVIOCLASS_* value)
  13327. //! \param [in] ownerType Specify NVVIOOWNERTYPE_APPLICATION or NVVIOOWNERTYPE_DESKTOP.
  13328. //!
  13329. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13330. //!
  13331. ///////////////////////////////////////////////////////////////////////////////
  13332. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.")
  13333. NVAPI_INTERFACE NvAPI_VIO_Open(NvVioHandle hVioHandle,
  13334. NvU32 vioClass,
  13335. NVVIOOWNERTYPE ownerType);
  13336. ///////////////////////////////////////////////////////////////////////////////
  13337. //! Function: NvAPI_VIO_Close
  13338. //!
  13339. //! Description: This API closes the graphics adapter for graphics-to-video operations
  13340. //! using the OpenGL application interface. Closing an
  13341. //! OpenGL handle releases the device.
  13342. //!
  13343. //! \deprecated Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.
  13344. //! SUPPORTED OS: Windows 7 and higher
  13345. //!
  13346. //!
  13347. //! \since Release: 190
  13348. //!
  13349. //! \param [in] NvVioHandle The caller provides the SDI output device handle as input.
  13350. //! \param [in] bRelease boolean value to either keep or release ownership
  13351. //!
  13352. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13353. //!
  13354. ///////////////////////////////////////////////////////////////////////////////
  13355. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.")
  13356. NVAPI_INTERFACE NvAPI_VIO_Close(NvVioHandle hVioHandle,
  13357. NvU32 bRelease);
  13358. ///////////////////////////////////////////////////////////////////////////////
  13359. //! Function: NvAPI_VIO_Status
  13360. //!
  13361. //! Description: This API gets the Video I/O LED status.
  13362. //!
  13363. //! \deprecated Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.
  13364. //! SUPPORTED OS: Windows 7 and higher
  13365. //!
  13366. //!
  13367. //! \since Release: 190
  13368. //!
  13369. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13370. //! \param [out] pStatus Return pointer to NVVIOSTATUS
  13371. //!
  13372. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13373. //!
  13374. ///////////////////////////////////////////////////////////////////////////////
  13375. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.")
  13376. NVAPI_INTERFACE NvAPI_VIO_Status(NvVioHandle hVioHandle,
  13377. NVVIOSTATUS *pStatus);
  13378. ////////////////////////////////////////////////////////////////////////////////
  13379. //! Function: NvAPI_VIO_SyncFormatDetect
  13380. //!
  13381. //! Description: This API detects the Video I/O incoming sync video format.
  13382. //!
  13383. //! \deprecated Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.
  13384. //! SUPPORTED OS: Windows 7 and higher
  13385. //!
  13386. //!
  13387. //! \since Release: 190
  13388. //!
  13389. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13390. //! \param [out] pWait Pointer to receive how many milliseconds will lapse
  13391. //! before VIOStatus returns the detected syncFormat.
  13392. //!
  13393. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13394. //!
  13395. ///////////////////////////////////////////////////////////////////////////////
  13396. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.")
  13397. NVAPI_INTERFACE NvAPI_VIO_SyncFormatDetect(NvVioHandle hVioHandle,
  13398. NvU32 *pWait);
  13399. ///////////////////////////////////////////////////////////////////////////////
  13400. //! Function: NvAPI_VIO_GetConfig
  13401. //!
  13402. //! Description: This API gets the graphics-to-video configuration.
  13403. //!
  13404. //! \deprecated Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.
  13405. //! SUPPORTED OS: Windows 7 and higher
  13406. //!
  13407. //!
  13408. //! \since Release: 190
  13409. //!
  13410. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13411. //! \param [out] pConfig Pointer to the graphics-to-video configuration
  13412. //!
  13413. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13414. //!
  13415. ///////////////////////////////////////////////////////////////////////////////
  13416. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.")
  13417. NVAPI_INTERFACE NvAPI_VIO_GetConfig(NvVioHandle hVioHandle,
  13418. NVVIOCONFIG *pConfig);
  13419. ///////////////////////////////////////////////////////////////////////////////
  13420. //! Function: NvAPI_VIO_SetConfig
  13421. //!
  13422. //! Description: This API sets the graphics-to-video configuration.
  13423. //!
  13424. //! \deprecated Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.
  13425. //! SUPPORTED OS: Windows 7 and higher
  13426. //!
  13427. //!
  13428. //! \since Release: 190
  13429. //!
  13430. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13431. //! \param [in] pConfig Pointer to Graphics-to-Video configuration
  13432. //!
  13433. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13434. //!
  13435. ///////////////////////////////////////////////////////////////////////////////
  13436. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 396. Instead, use NvAPI_D3D_QuerySMPAssistSupport.")
  13437. NVAPI_INTERFACE NvAPI_VIO_SetConfig(NvVioHandle hVioHandle,
  13438. const NVVIOCONFIG *pConfig);
  13439. ///////////////////////////////////////////////////////////////////////////////
  13440. //! Function: NvAPI_VIO_SetCSC
  13441. //!
  13442. //! Description: This API sets the colorspace conversion parameters.
  13443. //!
  13444. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.
  13445. //! SUPPORTED OS: Windows 7 and higher
  13446. //!
  13447. //!
  13448. //! \since Release: 190
  13449. //!
  13450. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13451. //! \param [in] pCSC Pointer to CSC parameters
  13452. //!
  13453. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13454. //!
  13455. ////////////////////////////////////////////////////////////////////////////////----
  13456. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.")
  13457. NVAPI_INTERFACE NvAPI_VIO_SetCSC(NvVioHandle hVioHandle,
  13458. NVVIOCOLORCONVERSION *pCSC);
  13459. ////////////////////////////////////////////////////////////////////////////////
  13460. //! Function: NvAPI_VIO_GetCSC
  13461. //!
  13462. //! Description: This API gets the colorspace conversion parameters.
  13463. //!
  13464. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13465. //! SUPPORTED OS: Windows 7 and higher
  13466. //!
  13467. //!
  13468. //! \since Release: 190
  13469. //!
  13470. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13471. //! \param [out] pCSC Pointer to CSC parameters
  13472. //!
  13473. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13474. //!
  13475. ////////////////////////////////////////////////////////////////////////////////
  13476. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13477. NVAPI_INTERFACE NvAPI_VIO_GetCSC(NvVioHandle hVioHandle,
  13478. NVVIOCOLORCONVERSION *pCSC);
  13479. ///////////////////////////////////////////////////////////////////////////////
  13480. //! Function: NvAPI_VIO_SetGamma
  13481. //!
  13482. //! Description: This API sets the gamma conversion parameters.
  13483. //!
  13484. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.
  13485. //! SUPPORTED OS: Windows 7 and higher
  13486. //!
  13487. //!
  13488. //! \since Release: 190
  13489. //!
  13490. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13491. //! \param [in] pGamma Pointer to gamma parameters
  13492. //!
  13493. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13494. //!
  13495. ///////////////////////////////////////////////////////////////////////////////
  13496. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.")
  13497. NVAPI_INTERFACE NvAPI_VIO_SetGamma(NvVioHandle hVioHandle,
  13498. NVVIOGAMMACORRECTION *pGamma);
  13499. ///////////////////////////////////////////////////////////////////////////////
  13500. //! Function: NvAPI_VIO_GetGamma
  13501. //!
  13502. //! Description: This API gets the gamma conversion parameters.
  13503. //!
  13504. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13505. //! SUPPORTED OS: Windows 7 and higher
  13506. //!
  13507. //!
  13508. //! \since Release: 190
  13509. //!
  13510. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13511. //! \param [out] pGamma Pointer to gamma parameters
  13512. //!
  13513. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13514. //!
  13515. ///////////////////////////////////////////////////////////////////////////////
  13516. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13517. NVAPI_INTERFACE NvAPI_VIO_GetGamma(NvVioHandle hVioHandle,
  13518. NVVIOGAMMACORRECTION* pGamma);
  13519. ////////////////////////////////////////////////////////////////////////////////
  13520. //! Function: NvAPI_VIO_SetSyncDelay
  13521. //!
  13522. //! Description: This API sets the sync delay parameters.
  13523. //!
  13524. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.
  13525. //! SUPPORTED OS: Windows 7 and higher
  13526. //!
  13527. //!
  13528. //! \since Release: 190
  13529. //!
  13530. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13531. //! \param [in] pSyncDelay Pointer to sync delay parameters
  13532. //!
  13533. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13534. //!
  13535. ///////////////////////////////////////////////////////////////////////////////
  13536. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.")
  13537. NVAPI_INTERFACE NvAPI_VIO_SetSyncDelay(NvVioHandle hVioHandle,
  13538. const NVVIOSYNCDELAY *pSyncDelay);
  13539. ////////////////////////////////////////////////////////////////////////////////
  13540. //! Function: NvAPI_VIO_GetSyncDelay
  13541. //!
  13542. //! Description: This API gets the sync delay parameters.
  13543. //!
  13544. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13545. //! SUPPORTED OS: Windows 7 and higher
  13546. //!
  13547. //!
  13548. //! \since Release: 190
  13549. //!
  13550. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13551. //! \param [out] pSyncDelay Pointer to sync delay parameters
  13552. //!
  13553. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13554. //!
  13555. ///////////////////////////////////////////////////////////////////////////////
  13556. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13557. NVAPI_INTERFACE NvAPI_VIO_GetSyncDelay(NvVioHandle hVioHandle,
  13558. NVVIOSYNCDELAY *pSyncDelay);
  13559. typedef enum _NVVIOPCILINKRATE
  13560. {
  13561. NVVIOPCILINKRATE_UNKNOWN = 0,
  13562. NVVIOPCILINKRATE_GEN1 = 1, //<! 2.5 Gbps.
  13563. NVVIOPCILINKRATE_GEN2 = 2, //<! 5 Gbps.
  13564. NVVIOPCILINKRATE_GEN3 = 3, //<! 8 Gbps.
  13565. }NVVIOPCILINKRATE;
  13566. typedef enum _NVVIOPCILINKWIDTH
  13567. {
  13568. NVVIOPCILINKWIDTH_UNKNOWN = 0,
  13569. NVVIOPCILINKWIDTH_x1 = 1,
  13570. NVVIOPCILINKWIDTH_x2 = 2,
  13571. NVVIOPCILINKWIDTH_x4 = 4,
  13572. NVVIOPCILINKWIDTH_x8 = 8,
  13573. NVVIOPCILINKWIDTH_x16 = 16,
  13574. }NVVIOPCILINKWIDTH;
  13575. typedef struct _NVVIOPCIINFO
  13576. {
  13577. NvU32 version; //!< Structure version
  13578. NvU32 pciDeviceId; //!< specifies the internal PCI device identifier for the GVI.
  13579. NvU32 pciSubSystemId; //!< specifies the internal PCI subsystem identifier for the GVI.
  13580. NvU32 pciRevisionId; //!< specifies the internal PCI device-specific revision identifier for the GVI.
  13581. NvU32 pciDomain; //!< specifies the PCI domain of the GVI device.
  13582. NvU32 pciBus; //!< specifies the PCI bus number of the GVI device.
  13583. NvU32 pciSlot; //!< specifies the PCI slot number of the GVI device.
  13584. NVVIOPCILINKWIDTH pciLinkWidth; //!< specifies the the negotiated PCIE link width.
  13585. NVVIOPCILINKRATE pciLinkRate; //!< specifies the the negotiated PCIE link rate.
  13586. } NVVIOPCIINFO_V1;
  13587. typedef NVVIOPCIINFO_V1 NVVIOPCIINFO;
  13588. #define NVVIOPCIINFO_VER1 MAKE_NVAPI_VERSION(NVVIOPCIINFO_V1,1)
  13589. #define NVVIOPCIINFO_VER NVVIOPCIINFO_VER1
  13590. ///////////////////////////////////////////////////////////////////////////////
  13591. //
  13592. // FUNCTION NAME: NvAPI_VIO_GetPCIInfo()
  13593. //
  13594. // DESCRIPTION: This API gets PCI information of the attached SDI(input) capture card.
  13595. //
  13596. // PARAMETERS: hVioHandle (IN) - Handle to SDI capture card.
  13597. // pVioPCIInfo (OUT) - PCI information of the attached SDI capture card.
  13598. //
  13599. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13600. //! SUPPORTED OS: Windows 7 and higher
  13601. //!
  13602. //
  13603. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13604. //
  13605. ///////////////////////////////////////////////////////////////////////////////
  13606. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13607. NVAPI_INTERFACE NvAPI_VIO_GetPCIInfo(__in NvVioHandle hVioHandle,
  13608. __inout NVVIOPCIINFO* pVioPCIInfo);
  13609. ////////////////////////////////////////////////////////////////////////////////
  13610. //! Function: NvAPI_VIO_IsRunning
  13611. //!
  13612. //! Description: This API determines if Video I/O is running.
  13613. //!
  13614. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13615. //! SUPPORTED OS: Windows 7 and higher
  13616. //!
  13617. //!
  13618. //! \since Release: 190
  13619. //!
  13620. //! \param [in] NvVioHandle[IN] The caller provides the SDI device handle as input.
  13621. //!
  13622. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13623. //!
  13624. ///////////////////////////////////////////////////////////////////////////////
  13625. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13626. NVAPI_INTERFACE NvAPI_VIO_IsRunning(NvVioHandle hVioHandle);
  13627. ///////////////////////////////////////////////////////////////////////////////
  13628. //! Function: NvAPI_VIO_Start
  13629. //!
  13630. //! Description: This API starts Video I/O.
  13631. //! This API should be called for NVVIOOWNERTYPE_DESKTOP only and will not work for OGL applications.
  13632. //!
  13633. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13634. //! SUPPORTED OS: Windows 7 and higher
  13635. //!
  13636. //!
  13637. //! \since Release: 190
  13638. //!
  13639. //! \param [in] NvVioHandle[IN] The caller provides the SDI device handle as input.
  13640. //!
  13641. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13642. //!
  13643. ///////////////////////////////////////////////////////////////////////////////
  13644. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13645. NVAPI_INTERFACE NvAPI_VIO_Start(NvVioHandle hVioHandle);
  13646. ///////////////////////////////////////////////////////////////////////////////
  13647. //! Function: NvAPI_VIO_Stop
  13648. //!
  13649. //! Description: This API stops Video I/O.
  13650. //! This API should be called for NVVIOOWNERTYPE_DESKTOP only and will not work for OGL applications.
  13651. //!
  13652. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13653. //! SUPPORTED OS: Windows 7 and higher
  13654. //!
  13655. //!
  13656. //! \since Release: 190
  13657. //!
  13658. //! \param [in] NvVioHandle[IN] The caller provides the SDI device handle as input.
  13659. //!
  13660. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13661. //!
  13662. ///////////////////////////////////////////////////////////////////////////////
  13663. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13664. NVAPI_INTERFACE NvAPI_VIO_Stop(NvVioHandle hVioHandle);
  13665. ///////////////////////////////////////////////////////////////////////////////
  13666. //! Function: NvAPI_VIO_IsFrameLockModeCompatible
  13667. //!
  13668. //! Description: This API checks whether modes are compatible in frame lock mode.
  13669. //!
  13670. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13671. //! SUPPORTED OS: Windows 7 and higher
  13672. //!
  13673. //!
  13674. //! \since Release: 190
  13675. //!
  13676. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13677. //! \param [in] srcEnumIndex Source Enumeration index
  13678. //! \param [in] destEnumIndex Destination Enumeration index
  13679. //! \param [out] pbCompatible Pointer to receive compatibility
  13680. //!
  13681. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13682. //!
  13683. ///////////////////////////////////////////////////////////////////////////////
  13684. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13685. NVAPI_INTERFACE NvAPI_VIO_IsFrameLockModeCompatible(NvVioHandle hVioHandle,
  13686. NvU32 srcEnumIndex,
  13687. NvU32 destEnumIndex,
  13688. NvU32* pbCompatible);
  13689. ///////////////////////////////////////////////////////////////////////////////
  13690. //! Function: NvAPI_VIO_EnumDevices
  13691. //!
  13692. //! Description: This API enumerate all VIO devices connected to the system.
  13693. //!
  13694. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13695. //! SUPPORTED OS: Windows 7 and higher
  13696. //!
  13697. //!
  13698. //! \since Release: 190
  13699. //!
  13700. //! \param [out] NvVioHandle User passes the pointer of NvVioHandle[] array to get handles to
  13701. //! all the connected video I/O devices.
  13702. //! \param [out] vioDeviceCount User gets total number of VIO devices connected to the system.
  13703. //!
  13704. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13705. //!
  13706. ///////////////////////////////////////////////////////////////////////////////
  13707. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13708. NVAPI_INTERFACE NvAPI_VIO_EnumDevices(NvVioHandle hVioHandle[NVAPI_MAX_VIO_DEVICES],
  13709. NvU32 *vioDeviceCount);
  13710. ///////////////////////////////////////////////////////////////////////////////
  13711. //! Function: NvAPI_VIO_QueryTopology
  13712. //!
  13713. //! Description: This API queries the valid SDI topologies.
  13714. //!
  13715. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13716. //! SUPPORTED OS: Windows 7 and higher
  13717. //!
  13718. //!
  13719. //! \since Release: 190
  13720. //!
  13721. //! \param [out] pNvVIOTopology User passes the pointer to NVVIOTOPOLOGY to fetch all valid SDI topologies.
  13722. //!
  13723. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13724. //!
  13725. ///////////////////////////////////////////////////////////////////////////////
  13726. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13727. NVAPI_INTERFACE NvAPI_VIO_QueryTopology(NV_VIO_TOPOLOGY *pNvVIOTopology);
  13728. ///////////////////////////////////////////////////////////////////////////////
  13729. //! Function: NvAPI_VIO_EnumSignalFormats
  13730. //!
  13731. //! Description: This API enumerates signal formats supported by Video I/O.
  13732. //!
  13733. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13734. //! SUPPORTED OS: Windows 7 and higher
  13735. //!
  13736. //!
  13737. //! \since Release: 190
  13738. //!
  13739. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13740. //! \param [in] enumIndex Enumeration index
  13741. //! \param [out] pSignalFormatDetail Pointer to receive detail or NULL
  13742. //!
  13743. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13744. //!
  13745. ///////////////////////////////////////////////////////////////////////////////
  13746. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13747. NVAPI_INTERFACE NvAPI_VIO_EnumSignalFormats(NvVioHandle hVioHandle,
  13748. NvU32 enumIndex,
  13749. NVVIOSIGNALFORMATDETAIL *pSignalFormatDetail);
  13750. ///////////////////////////////////////////////////////////////////////////////
  13751. //! Function: NvAPI_VIO_EnumDataFormats
  13752. //!
  13753. //! Description: This API enumerates data formats supported by Video I/O.
  13754. //!
  13755. //! \deprecated Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
  13756. //! SUPPORTED OS: Windows 7 and higher
  13757. //!
  13758. //!
  13759. //! \since Release: 190
  13760. //!
  13761. //! \param [in] NvVioHandle The caller provides the SDI device handle as input.
  13762. //! \param [in] enumIndex Enumeration index
  13763. //! \param [out] pDataFormatDetail Pointer to receive detail or NULL
  13764. //!
  13765. //! \retval :: NVAPI_NOT_SUPPORTED API is not supported
  13766. //!
  13767. ///////////////////////////////////////////////////////////////////////////////
  13768. __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
  13769. NVAPI_INTERFACE NvAPI_VIO_EnumDataFormats(NvVioHandle hVioHandle,
  13770. NvU32 enumIndex,
  13771. NVVIODATAFORMATDETAIL *pDataFormatDetail);
  13772. //! @}
  13773. ///////////////////////////////////////////////////////////////////////////////////
  13774. // CAMERA TEST API
  13775. // These APIs allows test apps to perform low level camera tests
  13776. //! \addtogroup vidio
  13777. //! @{
  13778. ///////////////////////////////////////////////////////////////////////////////
  13779. //
  13780. // FUNCTION NAME: NvAPI_Stereo_CreateConfigurationProfileRegistryKey
  13781. //
  13782. //! \fn NvAPI_Stereo_CreateConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType)
  13783. //!
  13784. //! DESCRIPTION: Creates new configuration registry key for current application.
  13785. //!
  13786. //! If there is no configuration profile prior to the function call,
  13787. //! this API tries to create a new configuration profile registry key
  13788. //! for a given application and fill it with the default values.
  13789. //! If an application already has a configuration profile registry key, the API does nothing.
  13790. //! The name of the key is automatically set to the name of the executable that calls this function.
  13791. //! Because of this, the executable should have a distinct and unique name.
  13792. //! If the application is using only one version of DirectX, then the default profile type will be appropriate.
  13793. //! If the application is using more than one version of DirectX from the same executable,
  13794. //! it should use the appropriate profile type for each configuration profile.
  13795. //!
  13796. //! HOW TO USE: When there is a need for an application to have default stereo parameter values,
  13797. //! use this function to create a key to store the values.
  13798. //!
  13799. //! SUPPORTED OS: Windows 7 and higher
  13800. //!
  13801. //!
  13802. //! \since Release: 180
  13803. //!
  13804. //! \param [in] registryProfileType Type of profile the application wants to create. It should be one of the symbolic constants defined in
  13805. //! ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause function to do nothing and return
  13806. //! ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  13807. //!
  13808. //! \retval ::NVAPI_OK Key exists in the registry.
  13809. //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED This profile type is not supported.
  13810. //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED Access to registry failed.
  13811. //! \retval ::NVAPI_API_NOT_INTIALIZED
  13812. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
  13813. //! \retval ::NVAPI_ERROR
  13814. //!
  13815. ///////////////////////////////////////////////////////////////////////////////
  13816. //! \ingroup stereoapi
  13817. //! Used in NvAPI_Stereo_CreateConfigurationProfileRegistryKey()
  13818. typedef enum _NV_StereoRegistryProfileType
  13819. {
  13820. NVAPI_STEREO_DEFAULT_REGISTRY_PROFILE, //!< Default registry configuration profile.
  13821. NVAPI_STEREO_DX9_REGISTRY_PROFILE, //!< Separate registry configuration profile for a DirectX 9 executable.
  13822. NVAPI_STEREO_DX10_REGISTRY_PROFILE //!< Separate registry configuration profile for a DirectX 10 executable.
  13823. } NV_STEREO_REGISTRY_PROFILE_TYPE;
  13824. //! \ingroup stereoapi
  13825. NVAPI_INTERFACE NvAPI_Stereo_CreateConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType);
  13826. ///////////////////////////////////////////////////////////////////////////////
  13827. //
  13828. // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileRegistryKey
  13829. //
  13830. //! DESCRIPTION: Removes configuration registry key for current application.
  13831. //!
  13832. //! If an application already has a configuration profile prior to this function call,
  13833. //! the function attempts to remove the application's configuration profile registry key from the registry.
  13834. //! If there is no configuration profile registry key prior to the function call,
  13835. //! the function does nothing and does not report an error.
  13836. //!
  13837. //! SUPPORTED OS: Windows 7 and higher
  13838. //!
  13839. //!
  13840. //! \since Release: 180
  13841. //!
  13842. //! \param [in] registryProfileType Type of profile that the application wants to delete. This should be one of the symbolic
  13843. //! constants defined in ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause the function
  13844. //! to do nothing and return ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  13845. //!
  13846. //! \retval ::NVAPI_OK Key does not exist in the registry any more.
  13847. //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED This profile type is not supported.
  13848. //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED Access to registry failed.
  13849. //! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI is not initialized.
  13850. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI is not initialized.
  13851. //! \retval ::NVAPI_ERROR
  13852. //!
  13853. //! \ingroup stereoapi
  13854. ///////////////////////////////////////////////////////////////////////////////
  13855. NVAPI_INTERFACE NvAPI_Stereo_DeleteConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType);
  13856. ///////////////////////////////////////////////////////////////////////////////
  13857. //
  13858. // FUNCTION NAME: NvAPI_Stereo_SetConfigurationProfileValue
  13859. //
  13860. //! \fn NvAPI_Stereo_SetConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID, void *pValue)
  13861. //!
  13862. //! DESCRIPTION: This API sets the given parameter value under the application's registry key.
  13863. //!
  13864. //! If the value does not exist under the application's registry key,
  13865. //! the value will be created under the key.
  13866. //!
  13867. //! SUPPORTED OS: Windows 7 and higher
  13868. //!
  13869. //!
  13870. //! \since Release: 180
  13871. //!
  13872. //! \param [in] registryProfileType The type of profile the application wants to access. It should be one of the
  13873. //! symbolic constants defined in ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value
  13874. //! will cause function to do nothing and return ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  13875. //! \param [in] valueRegistryID ID of the value that is being set. It should be one of the symbolic constants defined in
  13876. //! ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause function to do nothing
  13877. //! and return ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
  13878. //! \param [in] pValue Address of the value that is being set. It should be either address of a DWORD or of a float,
  13879. //! dependent on the type of the stereo parameter whose value is being set. The API will then cast that
  13880. //! address to DWORD* and write whatever is in those 4 bytes as a DWORD to the registry.
  13881. //!
  13882. //! \retval ::NVAPI_OK Value is written to registry.
  13883. //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED This profile type is not supported.
  13884. //! \retval ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED This value is not supported.
  13885. //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED Access to registry failed.
  13886. //! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI is not initialized.
  13887. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI is not initialized.
  13888. //! \retval ::NVAPI_ERROR Something is wrong (generic error).
  13889. //
  13890. ///////////////////////////////////////////////////////////////////////////////
  13891. //! \ingroup stereoapi
  13892. //! Used in NvAPI_Stereo_SetConfigurationProfileValue()
  13893. typedef enum _NV_StereoRegistryID
  13894. {
  13895. NVAPI_CONVERGENCE_ID, //!< Symbolic constant for convergence registry ID.
  13896. NVAPI_FRUSTUM_ADJUST_MODE_ID, //!< Symbolic constant for frustum adjust mode registry ID.
  13897. } NV_STEREO_REGISTRY_ID;
  13898. //! \ingroup stereoapi
  13899. NVAPI_INTERFACE NvAPI_Stereo_SetConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID, void *pValue);
  13900. ///////////////////////////////////////////////////////////////////////////////
  13901. //
  13902. // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileValue
  13903. //
  13904. //! DESCRIPTION: This API removes the given value from the application's configuration profile registry key.
  13905. //! If there is no such value, the function does nothing and does not report an error.
  13906. //!
  13907. //! SUPPORTED OS: Windows 7 and higher
  13908. //!
  13909. //!
  13910. //! \since Release: 180
  13911. //!
  13912. //! \param [in] registryProfileType The type of profile the application wants to access. It should be one of the
  13913. //! symbolic constants defined in ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will
  13914. //! cause function to do nothing and return ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  13915. //! \param [in] valueRegistryID ID of the value that is being deleted. It should be one of the symbolic constants defined in
  13916. //! ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause function to do nothing and return
  13917. //! ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
  13918. //!
  13919. //! \retval ::NVAPI_OK Value does not exist in registry any more.
  13920. //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED This profile type is not supported.
  13921. //! \retval ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED This value is not supported.
  13922. //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED Access to registry failed.
  13923. //! \retval ::NVAPI_API_NOT_INTIALIZED
  13924. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
  13925. //! \retval ::NVAPI_ERROR
  13926. //!
  13927. //! \ingroup stereoapi
  13928. ///////////////////////////////////////////////////////////////////////////////
  13929. NVAPI_INTERFACE NvAPI_Stereo_DeleteConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID);
  13930. //! \addtogroup stereoapi
  13931. //! @{
  13932. typedef struct _NVAPI_STEREO_CAPS
  13933. {
  13934. NvU32 version;
  13935. NvU32 supportsWindowedModeOff : 1;
  13936. NvU32 supportsWindowedModeAutomatic : 1;
  13937. NvU32 supportsWindowedModePersistent : 1;
  13938. NvU32 reserved : 29; // must be 0
  13939. NvU32 reserved2[3]; // must be 0
  13940. } NVAPI_STEREO_CAPS_V1;
  13941. #define NVAPI_STEREO_CAPS_VER1 MAKE_NVAPI_VERSION(NVAPI_STEREO_CAPS,1)
  13942. #define NVAPI_STEREO_CAPS_VER NVAPI_STEREO_CAPS_VER1
  13943. typedef NVAPI_STEREO_CAPS_V1 NVAPI_STEREO_CAPS;
  13944. //! @}
  13945. ///////////////////////////////////////////////////////////////////////////////
  13946. //
  13947. // FUNCTION NAME: NvAPI_Stereo_GetStereoSupport
  13948. //
  13949. //! DESCRIPTION: This API checks what kind of stereo support is currently supported on a particular display.
  13950. //! If the the display is prohibited from showing stereo (e.g. secondary in a multi-mon setup), we will
  13951. //! return 0 for all stereo modes (full screen exclusive, automatic windowed, persistent windowed).
  13952. //! Otherwise, we will check which stereo mode is supported. On 120Hz display, this will be what
  13953. //! the user chooses in control panel. On HDMI 1.4 display, persistent windowed mode is always assumed to be
  13954. //! supported. Note that this function does not check if the CURRENT RESOLUTION/REFRESH RATE can support
  13955. //! stereo. For HDMI 1.4, it is the app's responsibility to change the resolution/refresh rate to one that is
  13956. //! 3D compatible. For 120Hz, the driver will ALWAYS force 120Hz anyway.
  13957. //!
  13958. //! SUPPORTED OS: Windows 7 and higher
  13959. //!
  13960. //!
  13961. //! \since Release: 304
  13962. //!
  13963. //! \param [in] hMonitor handle to monitor that app is going to run on
  13964. //! \param [out] pCaps Address where the result of the inquiry will be placed.
  13965. //! *pCaps is defined in NVAPI_STEREO_CAPS.
  13966. //! \return This API can return any of the following error codes enumerated in #NvAPI_Status
  13967. //! \retval ::NVAPI_OK
  13968. //!
  13969. //! \ingroup stereoapi
  13970. ///////////////////////////////////////////////////////////////////////////////
  13971. NVAPI_INTERFACE NvAPI_Stereo_GetStereoSupport(__in NvMonitorHandle hMonitor, __out NVAPI_STEREO_CAPS *pCaps);
  13972. ///////////////////////////////////////////////////////////////////////////////
  13973. //
  13974. // FUNCTION NAME: NvAPI_Stereo_DecreaseSeparation
  13975. //
  13976. //! DESCRIPTION: This API decreases separation for the given device interface (just like the Ctrl+F3 hotkey).
  13977. //!
  13978. //! WHEN TO USE: After the stereo handle for device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
  13979. //!
  13980. //! SUPPORTED OS: Windows 7 and higher
  13981. //!
  13982. //!
  13983. //! \since Release: 180
  13984. //!
  13985. //! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
  13986. //!
  13987. //! \retval ::NVAPI_OK - Decrease of separation percentage was successfull.
  13988. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  13989. //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  13990. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  13991. //! \retval ::NVAPI_ERROR - Something is wrong (generic error).
  13992. //!
  13993. //! \ingroup stereoapi
  13994. ///////////////////////////////////////////////////////////////////////////////
  13995. NVAPI_INTERFACE NvAPI_Stereo_DecreaseSeparation(StereoHandle stereoHandle);
  13996. ///////////////////////////////////////////////////////////////////////////////
  13997. //
  13998. // FUNCTION NAME: NvAPI_Stereo_IncreaseSeparation
  13999. //
  14000. //! DESCRIPTION: This API increases separation for the given device interface (just like the Ctrl+F4 hotkey).
  14001. //!
  14002. //! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
  14003. //!
  14004. //! SUPPORTED OS: Windows 7 and higher
  14005. //!
  14006. //!
  14007. //! \since Release: 180
  14008. //!
  14009. //! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
  14010. //!
  14011. //! \retval ::NVAPI_OK Increase of separation percentage was successfull.
  14012. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
  14013. //! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
  14014. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
  14015. //! \retval ::NVAPI_ERROR Something is wrong (generic error).
  14016. //!
  14017. //! \ingroup stereoapi
  14018. ///////////////////////////////////////////////////////////////////////////////
  14019. NVAPI_INTERFACE NvAPI_Stereo_IncreaseSeparation(StereoHandle stereoHandle);
  14020. ///////////////////////////////////////////////////////////////////////////////
  14021. //
  14022. // FUNCTION NAME: NvAPI_Stereo_DecreaseConvergence
  14023. //
  14024. //! DESCRIPTION: This API decreases convergence for the given device interface (just like the Ctrl+F5 hotkey).
  14025. //!
  14026. //! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
  14027. //!
  14028. //! SUPPORTED OS: Windows 7 and higher
  14029. //!
  14030. //!
  14031. //! \since Release: 180
  14032. //!
  14033. //! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
  14034. //!
  14035. //! \retval ::NVAPI_OK - Decrease of convergence was successfull.
  14036. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  14037. //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  14038. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  14039. //! \retval ::NVAPI_ERROR - Something is wrong (generic error).
  14040. //!
  14041. //! \ingroup stereoapi
  14042. ///////////////////////////////////////////////////////////////////////////////
  14043. NVAPI_INTERFACE NvAPI_Stereo_DecreaseConvergence(StereoHandle stereoHandle);
  14044. ///////////////////////////////////////////////////////////////////////////////
  14045. //
  14046. // FUNCTION NAME: NvAPI_Stereo_IncreaseConvergence
  14047. //
  14048. //! DESCRIPTION: This API increases convergence for given the device interface (just like the Ctrl+F5 hotkey).
  14049. //!
  14050. //! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
  14051. //!
  14052. //! SUPPORTED OS: Windows 7 and higher
  14053. //!
  14054. //!
  14055. //! \since Release: 180
  14056. //!
  14057. //! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
  14058. //!
  14059. //! \retval ::NVAPI_OK Increase of convergence was successfull.
  14060. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
  14061. //! \retval ::NVAPI_API_NOT_INTIALIZED
  14062. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
  14063. //! \retval ::NVAPI_ERROR
  14064. //!
  14065. //! \ingroup stereoapi
  14066. ///////////////////////////////////////////////////////////////////////////////
  14067. NVAPI_INTERFACE NvAPI_Stereo_IncreaseConvergence(StereoHandle stereoHandle);
  14068. ///////////////////////////////////////////////////////////////////////////////
  14069. //
  14070. // FUNCTION NAME: NvAPI_Stereo_GetFrustumAdjustMode
  14071. //
  14072. //! \fn NvAPI_Stereo_GetFrustumAdjustMode(StereoHandle stereoHandle, NV_FRUSTUM_ADJUST_MODE *pFrustumAdjustMode)
  14073. //! DESCRIPTION: This API gets the current frustum adjust mode value.
  14074. //!
  14075. //! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
  14076. //!
  14077. //! SUPPORTED OS: Windows 7 and higher
  14078. //!
  14079. //!
  14080. //! \since Release: 180
  14081. //!
  14082. //! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
  14083. //! \param [out] pFrustumAdjustMode Address of the NV_FRUSTUM_ADJUST_MODE type variable to store current frustum value in.
  14084. //!
  14085. //! \retval ::NVAPI_OK - Retrieval of frustum adjust mode was successfull.
  14086. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  14087. //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  14088. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  14089. //! \retval ::NVAPI_ERROR - Something is wrong (generic error).
  14090. //!
  14091. ///////////////////////////////////////////////////////////////////////////////
  14092. //! \ingroup stereoapi
  14093. //! Used in NvAPI_Stereo_GetFrustumAdjustMode().
  14094. typedef enum _NV_FrustumAdjustMode
  14095. {
  14096. NVAPI_NO_FRUSTUM_ADJUST, //!< Do not adjust frustum.
  14097. NVAPI_FRUSTUM_STRETCH, //!< Stretch images in X.
  14098. NVAPI_FRUSTUM_CLEAR_EDGES //!< Clear corresponding edges for each eye.
  14099. } NV_FRUSTUM_ADJUST_MODE;
  14100. //! \ingroup stereoapi
  14101. NVAPI_INTERFACE NvAPI_Stereo_GetFrustumAdjustMode(StereoHandle stereoHandle, NV_FRUSTUM_ADJUST_MODE *pFrustumAdjustMode);
  14102. ///////////////////////////////////////////////////////////////////////////////
  14103. //
  14104. // FUNCTION NAME: NvAPI_Stereo_SetFrustumAdjustMode
  14105. //
  14106. //! DESCRIPTION: This API sets the current frustum adjust mode value.
  14107. //!
  14108. //! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
  14109. //!
  14110. //! SUPPORTED OS: Windows 7 and higher
  14111. //!
  14112. //!
  14113. //! \since Release: 180
  14114. //!
  14115. //! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
  14116. //! \param [in] newFrustumAdjustModeValue New value for frustum adjust mode. It should be one of the symbolic constants defined in
  14117. //! ::NV_FRUSTUM_ADJUST_MODE. Any other value will cause function to do nothing and return
  14118. //! ::NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED.
  14119. //!
  14120. //! \retval ::NVAPI_OK Retrieval of frustum adjust mode was successfull.
  14121. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
  14122. //! \retval ::NVAPI_API_NOT_INTIALIZED
  14123. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
  14124. //! \retval ::NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED Given frustum adjust mode is not supported.
  14125. //! \retval ::NVAPI_ERROR
  14126. //!
  14127. //! \ingroup stereoapi
  14128. ///////////////////////////////////////////////////////////////////////////////
  14129. NVAPI_INTERFACE NvAPI_Stereo_SetFrustumAdjustMode(StereoHandle stereoHandle, NV_FRUSTUM_ADJUST_MODE newFrustumAdjustModeValue);
  14130. ///////////////////////////////////////////////////////////////////////////////
  14131. //
  14132. // FUNCTION NAME: NvAPI_Stereo_CaptureJpegImage
  14133. //
  14134. //! DESCRIPTION: This API captures the current stereo image in JPEG stereo format with the given quality.
  14135. //! Only the last capture call per flip will be effective.
  14136. //!
  14137. //! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
  14138. //!
  14139. //! SUPPORTED OS: Windows 7 and higher
  14140. //!
  14141. //!
  14142. //! \since Release: 180
  14143. //!
  14144. //! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
  14145. //! \param [in] quality Quality of the JPEG image to be captured. Integer value betweeen 0 and 100.
  14146. //!
  14147. //! \retval ::NVAPI_OK Image captured.
  14148. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
  14149. //! \retval ::NVAPI_API_NOT_INTIALIZED
  14150. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED
  14151. //! \retval ::NVAPI_STEREO_PARAMETER_OUT_OF_RANGE Given quality is out of [0..100] range.
  14152. //! \retval ::NVAPI_ERROR
  14153. //!
  14154. //! \ingroup stereoapi
  14155. ///////////////////////////////////////////////////////////////////////////////
  14156. NVAPI_INTERFACE NvAPI_Stereo_CaptureJpegImage(StereoHandle stereoHandle, NvU32 quality);
  14157. ///////////////////////////////////////////////////////////////////////////////
  14158. //
  14159. // FUNCTION NAME: NvAPI_Stereo_InitActivation
  14160. //
  14161. //! DESCRIPTION: This API allows an application to enable stereo viewing, without the need of a GUID/Key pair
  14162. //! This API cannot be used to enable stereo viewing on 3DTV.
  14163. //!
  14164. //! HOW TO USE: Call this function immediately after device creation, then follow with a reset. \n
  14165. //! Very generically:
  14166. //! Create Device->Create Stereo Handle->InitActivation->Reset Device
  14167. //!
  14168. //! SUPPORTED OS: Windows 7 and higher
  14169. //!
  14170. //! \since Release: 302
  14171. //!
  14172. //! \param [in] stereoHandle Stereo handle corresponding to the device interface.
  14173. //! \param [in] bDelayed Use delayed activation
  14174. //!
  14175. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  14176. //! If there are return error codes with specific meaning for this API,
  14177. //! they are listed below.
  14178. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  14179. //!
  14180. //! \ingroup stereoapi
  14181. ///////////////////////////////////////////////////////////////////////////////
  14182. //! \addtogroup stereoapi
  14183. //! @{
  14184. //! InitActivation Flags
  14185. typedef enum _NVAPI_STEREO_INIT_ACTIVATION_FLAGS
  14186. {
  14187. NVAPI_STEREO_INIT_ACTIVATION_IMMEDIATE = 0X00,
  14188. NVAPI_STEREO_INIT_ACTIVATION_DELAYED = 0x01,
  14189. } NVAPI_STEREO_INIT_ACTIVATION_FLAGS;
  14190. NVAPI_INTERFACE NvAPI_Stereo_InitActivation(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_INIT_ACTIVATION_FLAGS flags);
  14191. //! @}
  14192. ///////////////////////////////////////////////////////////////////////////////
  14193. //
  14194. // FUNCTION NAME: NvAPI_Stereo_Trigger_Activation
  14195. //
  14196. //! DESCRIPTION: This API allows an application to trigger creation of a stereo desktop,
  14197. //! in case the creation was stopped on application launch.
  14198. //!
  14199. //! SUPPORTED OS: Windows 7 and higher
  14200. //!
  14201. //! \since Release: 302
  14202. //!
  14203. //! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
  14204. //!
  14205. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  14206. //! If there are return error codes with specific meaning for this API,
  14207. //! they are listed below.
  14208. //! \retval ::NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE - Stereo InitActivation not called.
  14209. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  14210. //!
  14211. //! \ingroup stereoapi
  14212. ///////////////////////////////////////////////////////////////////////////////
  14213. NVAPI_INTERFACE NvAPI_Stereo_Trigger_Activation(__in StereoHandle hStereoHandle);
  14214. ///////////////////////////////////////////////////////////////////////////////
  14215. //
  14216. // FUNCTION NAME: NvAPI_Stereo_CapturePngImage
  14217. //
  14218. //! DESCRIPTION: This API captures the current stereo image in PNG stereo format.
  14219. //! Only the last capture call per flip will be effective.
  14220. //!
  14221. //! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
  14222. //!
  14223. //! SUPPORTED OS: Windows 7 and higher
  14224. //!
  14225. //!
  14226. //! \since Release: 180
  14227. //!
  14228. //! \param [in] stereoHandle Stereo handle corresponding to the device interface.
  14229. //!
  14230. //! \retval ::NVAPI_OK Image captured.
  14231. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
  14232. //! \retval ::NVAPI_API_NOT_INTIALIZED
  14233. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
  14234. //! \retval ::NVAPI_ERROR
  14235. //!
  14236. //! \ingroup stereoapi
  14237. ///////////////////////////////////////////////////////////////////////////////
  14238. NVAPI_INTERFACE NvAPI_Stereo_CapturePngImage(StereoHandle stereoHandle);
  14239. ///////////////////////////////////////////////////////////////////////////////
  14240. //
  14241. // FUNCTION NAME: NvAPI_Stereo_ReverseStereoBlitControl
  14242. //
  14243. //! DESCRIPTION: This API turns on/off reverse stereo blit.
  14244. //!
  14245. //! HOW TO USE: Use after the stereo handle for the device interface is created via successfull call to the appropriate
  14246. //! NvAPI_Stereo_CreateHandleFrom() function.
  14247. //! After reversed stereo blit control is turned on, blits from the stereo surface will
  14248. //! produce the right-eye image in the left side of the destination surface and the left-eye
  14249. //! image in the right side of the destination surface.
  14250. //!
  14251. //! In DirectX 9, the destination surface must be created as the render target, and StretchRect must be used.
  14252. //! Conditions:
  14253. //! - DstWidth == 2*SrcWidth
  14254. //! - DstHeight == SrcHeight
  14255. //! - Src surface is the stereo surface.
  14256. //! - SrcRect must be {0,0,SrcWidth,SrcHeight}
  14257. //! - DstRect must be {0,0,DstWidth,DstHeight}
  14258. //!
  14259. //! In DirectX 10, ResourceCopyRegion must be used.
  14260. //! Conditions:
  14261. //! - DstWidth == 2*SrcWidth
  14262. //! - DstHeight == SrcHeight
  14263. //! - dstX == 0,
  14264. //! - dstY == 0,
  14265. //! - dstZ == 0,
  14266. //! - SrcBox: left=top=front==0; right==SrcWidth; bottom==SrcHeight; back==1;
  14267. //!
  14268. //! SUPPORTED OS: Windows 7 and higher
  14269. //!
  14270. //!
  14271. //! \since Release: 185
  14272. //!
  14273. //! \param [in] stereoHandle Stereo handle corresponding to the device interface.
  14274. //! \param [in] TurnOn != 0 : Turns on \n
  14275. //! == 0 : Turns off
  14276. //!
  14277. //!
  14278. //! \retval ::NVAPI_OK Retrieval of frustum adjust mode was successfull.
  14279. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
  14280. //! \retval ::NVAPI_API_NOT_INTIALIZED
  14281. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
  14282. //! \retval ::NVAPI_ERROR
  14283. //!
  14284. //! \ingroup stereoapi
  14285. ///////////////////////////////////////////////////////////////////////////////
  14286. NVAPI_INTERFACE NvAPI_Stereo_ReverseStereoBlitControl(StereoHandle hStereoHandle, NvU8 TurnOn);
  14287. ///////////////////////////////////////////////////////////////////////////////
  14288. //
  14289. // FUNCTION NAME: NvAPI_Stereo_SetNotificationMessage
  14290. //
  14291. //! DESCRIPTION: This API is a Setup notification message that the stereo driver uses to notify the application
  14292. //! when the user changes the stereo driver state.
  14293. //!
  14294. //! When the user changes the stereo state (Activated or Deactivated, separation or conversion)
  14295. //! the stereo driver posts a defined message with the following parameters:
  14296. //!
  14297. //! lParam is the current conversion. (Actual conversion is *(float*)&lParam )
  14298. //!
  14299. //! wParam == MAKEWPARAM(l, h) where
  14300. //! - l == 0 if stereo is deactivated
  14301. //! - l == 1 if stereo is deactivated
  14302. //! - h is the current separation. (Actual separation is float(h*100.f/0xFFFF)
  14303. //!
  14304. //! Call this API with NULL hWnd to prohibit notification.
  14305. //!
  14306. //! WHEN TO USE: Use after the stereo handle for device interface is created via successful call to appropriate
  14307. //! NvAPI_Stereo_CreateHandleFrom() function.
  14308. //!
  14309. //!
  14310. //! SUPPORTED OS: Windows 7 and higher
  14311. //!
  14312. //!
  14313. //! \since Release: 180
  14314. //!
  14315. //!
  14316. //! \param [in] stereoHandle Stereo handle corresponding to the device interface.
  14317. //! \param [in] hWnd Window HWND that will be notified when the user changes the stereo driver state.
  14318. //! Actual HWND must be cast to an NvU64.
  14319. //! \param [in] messageID MessageID of the message that will be posted to hWnd
  14320. //!
  14321. //! \retval ::NVAPI_OK Notification set.
  14322. //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
  14323. //! \retval ::NVAPI_API_NOT_INTIALIZED
  14324. //! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
  14325. //! \retval ::NVAPI_ERROR
  14326. //!
  14327. //! \ingroup stereoapi
  14328. ///////////////////////////////////////////////////////////////////////////////
  14329. NVAPI_INTERFACE NvAPI_Stereo_SetNotificationMessage(StereoHandle hStereoHandle, NvU64 hWnd,NvU64 messageID);
  14330. //! \ingroup stereoapi
  14331. #define NVAPI_STEREO_QUADBUFFERED_API_VERSION 0x2
  14332. //! \ingroup stereoapi
  14333. typedef enum _NV_StereoSwapChainMode
  14334. {
  14335. NVAPI_STEREO_SWAPCHAIN_DEFAULT = 0,
  14336. NVAPI_STEREO_SWAPCHAIN_STEREO = 1,
  14337. NVAPI_STEREO_SWAPCHAIN_MONO = 2,
  14338. } NV_STEREO_SWAPCHAIN_MODE;
  14339. #if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
  14340. ///////////////////////////////////////////////////////////////////////////////
  14341. //
  14342. // FUNCTION NAME: NvAPI_D3D1x_CreateSwapChain
  14343. //
  14344. //! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain.
  14345. //!
  14346. //! NOTE: NvAPI_D3D1x_CreateSwapChain is a wrapper of the method IDXGIFactory::CreateSwapChain which
  14347. //! additionally notifies the D3D driver of the mode in which stereo mode the swap chain is to be
  14348. //! created.
  14349. //!
  14350. //! \since Release: 285
  14351. //!
  14352. //! SUPPORTED OS: Windows 7 and higher
  14353. //!
  14354. //!
  14355. //! \param [in] hStereoHandle Stereo handle that corresponds to the device interface.
  14356. //! A pointer to the device that will write 2D images to the swap chain.
  14357. //! \param [in] pDesc A pointer to the swap-chain description (DXGI_SWAP_CHAIN_DESC). This parameter cannot be NULL.
  14358. //! \param [out] ppSwapChain A pointer to the swap chain created.
  14359. //! \param [in] mode The stereo mode fot the swap chain.
  14360. //! NVAPI_STEREO_SWAPCHAIN_DEFAULT
  14361. //! NVAPI_STEREO_SWAPCHAIN_STEREO
  14362. //! NVAPI_STEREO_SWAPCHAIN_MONO
  14363. //!
  14364. //! \retval ::NVAPI_OK The swap chain was created successfully.
  14365. //! \retval ::NVAPI_ERROR The operation failed.
  14366. //!
  14367. //! \ingroup stereoapi
  14368. ///////////////////////////////////////////////////////////////////////////////
  14369. NVAPI_INTERFACE NvAPI_D3D1x_CreateSwapChain(StereoHandle hStereoHandle,
  14370. DXGI_SWAP_CHAIN_DESC* pDesc,
  14371. IDXGISwapChain** ppSwapChain,
  14372. NV_STEREO_SWAPCHAIN_MODE mode);
  14373. #endif //if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
  14374. #if defined(_D3D9_H_) //NvAPI_D3D9_CreateSwapChain
  14375. ///////////////////////////////////////////////////////////////////////////////
  14376. //
  14377. // FUNCTION NAME: NvAPI_D3D9_CreateSwapChain
  14378. //
  14379. //! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain.
  14380. //!
  14381. //! NOTE: NvAPI_D3D9_CreateSwapChain is a wrapper of the method IDirect3DDevice9::CreateAdditionalSwapChain which
  14382. //! additionally notifies the D3D driver if the swap chain creation mode must be stereo or mono.
  14383. //!
  14384. //!
  14385. //! \since Release: 285
  14386. //!
  14387. //! SUPPORTED OS: Windows 7 and higher
  14388. //!
  14389. //!
  14390. //! \param [in] hStereoHandle Stereo handle that corresponds to the device interface.
  14391. //! \param [in, out] pPresentationParameters A pointer to the swap-chain description (DXGI). This parameter cannot be NULL.
  14392. //! \param [out] ppSwapChain A pointer to the swap chain created.
  14393. //! \param [in] mode The stereo mode for the swap chain.
  14394. //! NVAPI_STEREO_SWAPCHAIN_DEFAULT
  14395. //! NVAPI_STEREO_SWAPCHAIN_STEREO
  14396. //! NVAPI_STEREO_SWAPCHAIN_MONO
  14397. //!
  14398. //! \retval ::NVAPI_OK The swap chain creation was successful
  14399. //! \retval ::NVAPI_ERROR The operation failed.
  14400. //!
  14401. //!\ingroup stereoapi
  14402. ///////////////////////////////////////////////////////////////////////////////
  14403. NVAPI_INTERFACE NvAPI_D3D9_CreateSwapChain(StereoHandle hStereoHandle,
  14404. D3DPRESENT_PARAMETERS *pPresentationParameters,
  14405. IDirect3DSwapChain9 **ppSwapChain,
  14406. NV_STEREO_SWAPCHAIN_MODE mode);
  14407. #endif //if defined(_D3D9_H_) //NvAPI_D3D9_CreateSwapChain
  14408. //! \addtogroup drsapi
  14409. //! @{
  14410. // GPU Profile APIs
  14411. NV_DECLARE_HANDLE(NvDRSSessionHandle);
  14412. NV_DECLARE_HANDLE(NvDRSProfileHandle);
  14413. #define NVAPI_DRS_GLOBAL_PROFILE ((NvDRSProfileHandle) -1)
  14414. #define NVAPI_SETTING_MAX_VALUES 100
  14415. typedef enum _NVDRS_SETTING_TYPE
  14416. {
  14417. NVDRS_DWORD_TYPE,
  14418. NVDRS_BINARY_TYPE,
  14419. NVDRS_STRING_TYPE,
  14420. NVDRS_WSTRING_TYPE
  14421. } NVDRS_SETTING_TYPE;
  14422. typedef enum _NVDRS_SETTING_LOCATION
  14423. {
  14424. NVDRS_CURRENT_PROFILE_LOCATION,
  14425. NVDRS_GLOBAL_PROFILE_LOCATION,
  14426. NVDRS_BASE_PROFILE_LOCATION,
  14427. NVDRS_DEFAULT_PROFILE_LOCATION
  14428. } NVDRS_SETTING_LOCATION;
  14429. typedef struct _NVDRS_GPU_SUPPORT
  14430. {
  14431. NvU32 geforce : 1;
  14432. NvU32 quadro : 1;
  14433. NvU32 nvs : 1;
  14434. NvU32 reserved4 : 1;
  14435. NvU32 reserved5 : 1;
  14436. NvU32 reserved6 : 1;
  14437. NvU32 reserved7 : 1;
  14438. NvU32 reserved8 : 1;
  14439. NvU32 reserved9 : 1;
  14440. NvU32 reserved10 : 1;
  14441. NvU32 reserved11 : 1;
  14442. NvU32 reserved12 : 1;
  14443. NvU32 reserved13 : 1;
  14444. NvU32 reserved14 : 1;
  14445. NvU32 reserved15 : 1;
  14446. NvU32 reserved16 : 1;
  14447. NvU32 reserved17 : 1;
  14448. NvU32 reserved18 : 1;
  14449. NvU32 reserved19 : 1;
  14450. NvU32 reserved20 : 1;
  14451. NvU32 reserved21 : 1;
  14452. NvU32 reserved22 : 1;
  14453. NvU32 reserved23 : 1;
  14454. NvU32 reserved24 : 1;
  14455. NvU32 reserved25 : 1;
  14456. NvU32 reserved26 : 1;
  14457. NvU32 reserved27 : 1;
  14458. NvU32 reserved28 : 1;
  14459. NvU32 reserved29 : 1;
  14460. NvU32 reserved30 : 1;
  14461. NvU32 reserved31 : 1;
  14462. NvU32 reserved32 : 1;
  14463. } NVDRS_GPU_SUPPORT;
  14464. //! Enum to decide on the datatype of setting value.
  14465. typedef struct _NVDRS_BINARY_SETTING
  14466. {
  14467. NvU32 valueLength; //!< valueLength should always be in number of bytes.
  14468. NvU8 valueData[NVAPI_BINARY_DATA_MAX];
  14469. } NVDRS_BINARY_SETTING;
  14470. typedef struct _NVDRS_SETTING_VALUES
  14471. {
  14472. NvU32 version; //!< Structure Version
  14473. NvU32 numSettingValues; //!< Total number of values available in a setting.
  14474. NVDRS_SETTING_TYPE settingType; //!< Type of setting value.
  14475. union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
  14476. {
  14477. NvU32 u32DefaultValue; //!< Accessing default DWORD value of this setting.
  14478. NVDRS_BINARY_SETTING binaryDefaultValue; //!< Accessing default Binary value of this setting.
  14479. //!< Must be allocated by caller with valueLength specifying buffer size, or only valueLength will be filled in.
  14480. NvAPI_UnicodeString wszDefaultValue; //!< Accessing default unicode string value of this setting.
  14481. };
  14482. union //!< Setting values can be of either DWORD, Binary values or String type,
  14483. { //!< NOT mixed types.
  14484. NvU32 u32Value; //!< All possible DWORD values for a setting
  14485. NVDRS_BINARY_SETTING binaryValue; //!< All possible Binary values for a setting
  14486. NvAPI_UnicodeString wszValue; //!< Accessing current unicode string value of this setting.
  14487. }settingValues[NVAPI_SETTING_MAX_VALUES];
  14488. } NVDRS_SETTING_VALUES;
  14489. //! Macro for constructing the version field of ::_NVDRS_SETTING_VALUES
  14490. #define NVDRS_SETTING_VALUES_VER MAKE_NVAPI_VERSION(NVDRS_SETTING_VALUES,1)
  14491. typedef struct _NVDRS_SETTING_V1
  14492. {
  14493. NvU32 version; //!< Structure Version
  14494. NvAPI_UnicodeString settingName; //!< String name of setting
  14495. NvU32 settingId; //!< 32 bit setting Id
  14496. NVDRS_SETTING_TYPE settingType; //!< Type of setting value.
  14497. NVDRS_SETTING_LOCATION settingLocation; //!< Describes where the value in CurrentValue comes from.
  14498. NvU32 isCurrentPredefined; //!< It is different than 0 if the currentValue is a predefined Value,
  14499. //!< 0 if the currentValue is a user value.
  14500. NvU32 isPredefinedValid; //!< It is different than 0 if the PredefinedValue union contains a valid value.
  14501. union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
  14502. {
  14503. NvU32 u32PredefinedValue; //!< Accessing default DWORD value of this setting.
  14504. NVDRS_BINARY_SETTING binaryPredefinedValue; //!< Accessing default Binary value of this setting.
  14505. //!< Must be allocated by caller with valueLength specifying buffer size,
  14506. //!< or only valueLength will be filled in.
  14507. NvAPI_UnicodeString wszPredefinedValue; //!< Accessing default unicode string value of this setting.
  14508. };
  14509. union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
  14510. {
  14511. NvU32 u32CurrentValue; //!< Accessing current DWORD value of this setting.
  14512. NVDRS_BINARY_SETTING binaryCurrentValue; //!< Accessing current Binary value of this setting.
  14513. //!< Must be allocated by caller with valueLength specifying buffer size,
  14514. //!< or only valueLength will be filled in.
  14515. NvAPI_UnicodeString wszCurrentValue; //!< Accessing current unicode string value of this setting.
  14516. };
  14517. } NVDRS_SETTING_V1;
  14518. //! Macro for constructing the version field of ::_NVDRS_SETTING
  14519. #define NVDRS_SETTING_VER1 MAKE_NVAPI_VERSION(NVDRS_SETTING_V1, 1)
  14520. typedef NVDRS_SETTING_V1 NVDRS_SETTING;
  14521. #define NVDRS_SETTING_VER NVDRS_SETTING_VER1
  14522. typedef struct _NVDRS_APPLICATION_V1
  14523. {
  14524. NvU32 version; //!< Structure Version
  14525. NvU32 isPredefined; //!< Is the application userdefined/predefined
  14526. NvAPI_UnicodeString appName; //!< String name of the Application
  14527. NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application
  14528. NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the application
  14529. } NVDRS_APPLICATION_V1;
  14530. typedef struct _NVDRS_APPLICATION_V2
  14531. {
  14532. NvU32 version; //!< Structure Version
  14533. NvU32 isPredefined; //!< Is the application userdefined/predefined
  14534. NvAPI_UnicodeString appName; //!< String name of the Application
  14535. NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application
  14536. NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application
  14537. NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found.
  14538. //!< When specifying multiple files, separate them using the ':' character.
  14539. } NVDRS_APPLICATION_V2;
  14540. typedef struct _NVDRS_APPLICATION_V3
  14541. {
  14542. NvU32 version; //!< Structure Version
  14543. NvU32 isPredefined; //!< Is the application userdefined/predefined
  14544. NvAPI_UnicodeString appName; //!< String name of the Application
  14545. NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application
  14546. NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application
  14547. NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found.
  14548. //!< When specifying multiple files, separate them using the ':' character.
  14549. NvU32 isMetro:1; //!< Windows 8 style app
  14550. NvU32 isCommandLine:1; //!< Command line parsing for the application name
  14551. NvU32 reserved:30; //!< Reserved. Should be 0.
  14552. } NVDRS_APPLICATION_V3;
  14553. typedef struct _NVDRS_APPLICATION_V4
  14554. {
  14555. NvU32 version; //!< Structure Version
  14556. NvU32 isPredefined; //!< Is the application userdefined/predefined
  14557. NvAPI_UnicodeString appName; //!< String name of the Application
  14558. NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application
  14559. NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application
  14560. NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found.
  14561. //!< When specifying multiple files, separate them using the ':' character.
  14562. NvU32 isMetro:1; //!< Windows 8 style app
  14563. NvU32 isCommandLine:1; //!< Command line parsing for the application name
  14564. NvU32 reserved:30; //!< Reserved. Should be 0.
  14565. NvAPI_UnicodeString commandLine; //!< If isCommandLine is set to 0 this must be an empty. If isCommandLine is set to 1
  14566. //!< this contains application's command line as if it was returned by GetCommandLineW.
  14567. } NVDRS_APPLICATION_V4;
  14568. #define NVDRS_APPLICATION_VER_V1 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V1,1)
  14569. #define NVDRS_APPLICATION_VER_V2 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V2,2)
  14570. #define NVDRS_APPLICATION_VER_V3 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V3,3)
  14571. #define NVDRS_APPLICATION_VER_V4 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V4,4)
  14572. typedef NVDRS_APPLICATION_V4 NVDRS_APPLICATION;
  14573. #define NVDRS_APPLICATION_VER NVDRS_APPLICATION_VER_V4
  14574. typedef struct _NVDRS_PROFILE_V1
  14575. {
  14576. NvU32 version; //!< Structure Version
  14577. NvAPI_UnicodeString profileName; //!< String name of the Profile
  14578. NVDRS_GPU_SUPPORT gpuSupport; //!< This read-only flag indicates the profile support on either
  14579. //!< Quadro, or Geforce, or both.
  14580. NvU32 isPredefined; //!< Is the Profile user-defined, or predefined
  14581. NvU32 numOfApps; //!< Total number of applications that belong to this profile. Read-only
  14582. NvU32 numOfSettings; //!< Total number of settings applied for this Profile. Read-only
  14583. } NVDRS_PROFILE_V1;
  14584. typedef NVDRS_PROFILE_V1 NVDRS_PROFILE;
  14585. //! Macro for constructing the version field of ::NVDRS_PROFILE
  14586. #define NVDRS_PROFILE_VER1 MAKE_NVAPI_VERSION(NVDRS_PROFILE_V1,1)
  14587. #define NVDRS_PROFILE_VER NVDRS_PROFILE_VER1
  14588. ///////////////////////////////////////////////////////////////////////////////
  14589. //
  14590. // FUNCTION NAME: NvAPI_DRS_CreateSession
  14591. //
  14592. //! DESCRIPTION: This API allocates memory and initializes the session.
  14593. //!
  14594. //! SUPPORTED OS: Windows 7 and higher
  14595. //!
  14596. //!
  14597. //! \param [out] *phSession Return pointer to the session handle.
  14598. //!
  14599. //! \retval ::NVAPI_OK SUCCESS
  14600. //! \retval ::NVAPI_ERROR: For miscellaneous errors.
  14601. //
  14602. ///////////////////////////////////////////////////////////////////////////////
  14603. NVAPI_INTERFACE NvAPI_DRS_CreateSession(NvDRSSessionHandle *phSession);
  14604. ///////////////////////////////////////////////////////////////////////////////
  14605. //
  14606. // FUNCTION NAME: NvAPI_DRS_DestroySession
  14607. //
  14608. //! DESCRIPTION: This API frees the allocation: cleanup of NvDrsSession.
  14609. //!
  14610. //! SUPPORTED OS: Windows 7 and higher
  14611. //!
  14612. //!
  14613. //! \param [in] hSession Input to the session handle.
  14614. //!
  14615. //! \retval ::NVAPI_OK SUCCESS
  14616. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14617. //
  14618. ///////////////////////////////////////////////////////////////////////////////
  14619. NVAPI_INTERFACE NvAPI_DRS_DestroySession(NvDRSSessionHandle hSession);
  14620. ///////////////////////////////////////////////////////////////////////////////
  14621. //
  14622. // FUNCTION NAME: NvAPI_DRS_LoadSettings
  14623. //
  14624. //! DESCRIPTION: This API loads and parses the settings data.
  14625. //!
  14626. //! SUPPORTED OS: Windows 7 and higher
  14627. //!
  14628. //!
  14629. //! \param [in] hSession Input to the session handle.
  14630. //!
  14631. //! \retval ::NVAPI_OK SUCCESS
  14632. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14633. //
  14634. ///////////////////////////////////////////////////////////////////////////////
  14635. NVAPI_INTERFACE NvAPI_DRS_LoadSettings(NvDRSSessionHandle hSession);
  14636. ///////////////////////////////////////////////////////////////////////////////
  14637. //
  14638. // FUNCTION NAME: NvAPI_DRS_SaveSettings
  14639. //
  14640. //! DESCRIPTION: This API saves the settings data to the system.
  14641. //!
  14642. //! SUPPORTED OS: Windows 7 and higher
  14643. //!
  14644. //!
  14645. //! \param [in] hSession Input to the session handle.
  14646. //!
  14647. //! \retval ::NVAPI_OK SUCCESS
  14648. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14649. //
  14650. ///////////////////////////////////////////////////////////////////////////////
  14651. NVAPI_INTERFACE NvAPI_DRS_SaveSettings(NvDRSSessionHandle hSession);
  14652. ///////////////////////////////////////////////////////////////////////////////
  14653. //
  14654. // FUNCTION NAME: NvAPI_DRS_LoadSettingsFromFile
  14655. //
  14656. //! DESCRIPTION: This API loads settings from the given file path.
  14657. //!
  14658. //! SUPPORTED OS: Windows 7 and higher
  14659. //!
  14660. //!
  14661. //! \param [in] hSession Input to the session handle
  14662. //! \param [in] fileName Binary File Name/Path
  14663. //!
  14664. //! \retval ::NVAPI_OK SUCCESS
  14665. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14666. //
  14667. ///////////////////////////////////////////////////////////////////////////////
  14668. NVAPI_INTERFACE NvAPI_DRS_LoadSettingsFromFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName);
  14669. ///////////////////////////////////////////////////////////////////////////////
  14670. //
  14671. // FUNCTION NAME: NvAPI_DRS_SaveSettingsToFile
  14672. //
  14673. //! DESCRIPTION: This API saves settings to the given file path.
  14674. //!
  14675. //! SUPPORTED OS: Windows 7 and higher
  14676. //!
  14677. //!
  14678. //! \param [in] hSession Input to the session handle.
  14679. //! \param [in] fileName Binary File Name/Path
  14680. //!
  14681. //! \retval ::NVAPI_OK SUCCESS
  14682. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14683. //
  14684. ///////////////////////////////////////////////////////////////////////////////
  14685. NVAPI_INTERFACE NvAPI_DRS_SaveSettingsToFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName);
  14686. //! @}
  14687. ///////////////////////////////////////////////////////////////////////////////
  14688. //
  14689. // FUNCTION NAME: NvAPI_DRS_CreateProfile
  14690. //
  14691. //! DESCRIPTION: This API creates an empty profile.
  14692. //!
  14693. //! SUPPORTED OS: Windows 7 and higher
  14694. //!
  14695. //!
  14696. //! \param [in] hSession Input to the session handle.
  14697. //! \param [in] *pProfileInfo Input pointer to NVDRS_PROFILE.
  14698. //! \param [in] *phProfile Returns pointer to profile handle.
  14699. //!
  14700. //! \retval ::NVAPI_OK SUCCESS
  14701. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14702. //!
  14703. //! \ingroup drsapi
  14704. ///////////////////////////////////////////////////////////////////////////////
  14705. NVAPI_INTERFACE NvAPI_DRS_CreateProfile(NvDRSSessionHandle hSession, NVDRS_PROFILE *pProfileInfo, NvDRSProfileHandle *phProfile);
  14706. ///////////////////////////////////////////////////////////////////////////////
  14707. //
  14708. // FUNCTION NAME: NvAPI_DRS_DeleteProfile
  14709. //
  14710. //! DESCRIPTION: This API deletes a profile or sets it back to a predefined value.
  14711. //!
  14712. //! SUPPORTED OS: Windows 7 and higher
  14713. //!
  14714. //!
  14715. //! \param [in] hSession Input to the session handle.
  14716. //! \param [in] hProfile Input profile handle.
  14717. //!
  14718. //! \retval ::NVAPI_OK SUCCESS if the profile is found
  14719. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14720. //!
  14721. //! \ingroup drsapi
  14722. ///////////////////////////////////////////////////////////////////////////////
  14723. NVAPI_INTERFACE NvAPI_DRS_DeleteProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile);
  14724. ///////////////////////////////////////////////////////////////////////////////
  14725. //
  14726. // FUNCTION NAME: NvAPI_DRS_SetCurrentGlobalProfile
  14727. //
  14728. //! DESCRIPTION: This API sets the current global profile in the driver.
  14729. //!
  14730. //! SUPPORTED OS: Windows 7 and higher
  14731. //!
  14732. //!
  14733. //! \param [in] hSession Input to the session handle.
  14734. //! \param [in] wszGlobalProfileName Input current Global profile name.
  14735. //!
  14736. //! \retval ::NVAPI_OK SUCCESS
  14737. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14738. //!
  14739. //! \ingroup drsapi
  14740. ///////////////////////////////////////////////////////////////////////////////
  14741. NVAPI_INTERFACE NvAPI_DRS_SetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvAPI_UnicodeString wszGlobalProfileName);
  14742. ///////////////////////////////////////////////////////////////////////////////
  14743. //
  14744. // FUNCTION NAME: NvAPI_DRS_GetCurrentGlobalProfile
  14745. //
  14746. //! DESCRIPTION: This API returns the handle to the current global profile.
  14747. //!
  14748. //! SUPPORTED OS: Windows 7 and higher
  14749. //!
  14750. //!
  14751. //! \param [in] hSession Input to the session handle.
  14752. //! \param [out] *phProfile Returns current Global profile handle.
  14753. //!
  14754. //! \retval ::NVAPI_OK SUCCESS
  14755. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14756. //!
  14757. //! \ingroup drsapi
  14758. ///////////////////////////////////////////////////////////////////////////////
  14759. NVAPI_INTERFACE NvAPI_DRS_GetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile);
  14760. ///////////////////////////////////////////////////////////////////////////////
  14761. //
  14762. // FUNCTION NAME: NvAPI_DRS_GetProfileInfo
  14763. //
  14764. //! DESCRIPTION: This API gets information about the given profile. User needs to specify the name of the Profile.
  14765. //!
  14766. //! SUPPORTED OS: Windows 7 and higher
  14767. //!
  14768. //!
  14769. //! \param [in] hSession Input to the session handle.
  14770. //! \param [in] hProfile Input profile handle.
  14771. //! \param [out] *pProfileInfo Return the profile info.
  14772. //!
  14773. //! \retval ::NVAPI_OK SUCCESS
  14774. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14775. //!
  14776. //! \ingroup drsapi
  14777. ///////////////////////////////////////////////////////////////////////////////
  14778. NVAPI_INTERFACE NvAPI_DRS_GetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo);
  14779. ///////////////////////////////////////////////////////////////////////////////
  14780. //
  14781. // FUNCTION NAME: NvAPI_DRS_SetProfileInfo
  14782. //
  14783. //! DESCRIPTION: Specifies flags for a given profile. Currently only the NVDRS_GPU_SUPPORT is
  14784. //! used to update the profile. Neither the name, number of settings or applications
  14785. //! or other profile information can be changed with this function.
  14786. //!
  14787. //! SUPPORTED OS: Windows 7 and higher
  14788. //!
  14789. //!
  14790. //! \param [in] hSession Input to the session handle.
  14791. //! \param [in] hProfile Input profile handle.
  14792. //! \param [in] *pProfileInfo Input the new profile info.
  14793. //!
  14794. //! \retval ::NVAPI_OK SUCCESS
  14795. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14796. //!
  14797. //! \ingroup drsapi
  14798. ///////////////////////////////////////////////////////////////////////////////
  14799. NVAPI_INTERFACE NvAPI_DRS_SetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo);
  14800. ///////////////////////////////////////////////////////////////////////////////
  14801. //
  14802. // FUNCTION NAME: NvAPI_DRS_FindProfileByName
  14803. //
  14804. //! DESCRIPTION: This API finds a profile in the current session.
  14805. //!
  14806. //! SUPPORTED OS: Windows 7 and higher
  14807. //!
  14808. //!
  14809. //! \param [in] hSession Input to the session handle.
  14810. //! \param [in] profileName Input profileName.
  14811. //! \param [out] phProfile Input profile handle.
  14812. //!
  14813. //! \retval ::NVAPI_OK SUCCESS if the profile is found
  14814. //! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found
  14815. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14816. //!
  14817. //! \ingroup drsapi
  14818. ///////////////////////////////////////////////////////////////////////////////
  14819. NVAPI_INTERFACE NvAPI_DRS_FindProfileByName(NvDRSSessionHandle hSession, NvAPI_UnicodeString profileName, NvDRSProfileHandle* phProfile);
  14820. ///////////////////////////////////////////////////////////////////////////////
  14821. //
  14822. // FUNCTION NAME: NvAPI_DRS_EnumProfiles
  14823. //
  14824. //! DESCRIPTION: This API enumerates through all the profiles in the session.
  14825. //!
  14826. //! SUPPORTED OS: Windows 7 and higher
  14827. //!
  14828. //!
  14829. //! \param [in] hSession Input to the session handle.
  14830. //! \param [in] index Input the index for enumeration.
  14831. //! \param [out] *phProfile Returns profile handle.
  14832. //!
  14833. //! RETURN STATUS: NVAPI_OK: SUCCESS if the profile is found
  14834. //! NVAPI_ERROR: For miscellaneous errors.
  14835. //! NVAPI_END_ENUMERATION: index exceeds the total number of available Profiles in DB.
  14836. //!
  14837. //! \ingroup drsapi
  14838. ///////////////////////////////////////////////////////////////////////////////
  14839. NVAPI_INTERFACE NvAPI_DRS_EnumProfiles(NvDRSSessionHandle hSession, NvU32 index, NvDRSProfileHandle *phProfile);
  14840. ///////////////////////////////////////////////////////////////////////////////
  14841. //
  14842. // FUNCTION NAME: NvAPI_DRS_GetNumProfiles
  14843. //
  14844. //! DESCRIPTION: This API obtains the number of profiles in the current session object.
  14845. //!
  14846. //! SUPPORTED OS: Windows 7 and higher
  14847. //!
  14848. //!
  14849. //! \param [in] hSession Input to the session handle.
  14850. //! \param out] *numProfiles Returns count of profiles in the current hSession.
  14851. //!
  14852. //! \retval ::NVAPI_OK SUCCESS
  14853. //! \retval ::NVAPI_API_NOT_INTIALIZED Failed to initialize.
  14854. //! \retval ::NVAPI_INVALID_ARGUMENT Invalid Arguments.
  14855. //!
  14856. //! \ingroup drsapi
  14857. ///////////////////////////////////////////////////////////////////////////////
  14858. NVAPI_INTERFACE NvAPI_DRS_GetNumProfiles(NvDRSSessionHandle hSession, NvU32 *numProfiles);
  14859. ///////////////////////////////////////////////////////////////////////////////
  14860. //
  14861. // FUNCTION NAME: NvAPI_DRS_CreateApplication
  14862. //
  14863. //! DESCRIPTION: This API adds an executable name to a profile.
  14864. //!
  14865. //! SUPPORTED OS: Windows 7 and higher
  14866. //!
  14867. //!
  14868. //! \param [in] hSession Input to the session handle.
  14869. //! \param [in] hProfile Input profile handle.
  14870. //! \param [in] *pApplication Input NVDRS_APPLICATION struct with the executable name to be added.
  14871. //!
  14872. //! \retval ::NVAPI_OK SUCCESS
  14873. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14874. //!
  14875. //! \ingroup drsapi
  14876. ///////////////////////////////////////////////////////////////////////////////
  14877. NVAPI_INTERFACE NvAPI_DRS_CreateApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_APPLICATION *pApplication);
  14878. ///////////////////////////////////////////////////////////////////////////////
  14879. //
  14880. // FUNCTION NAME: NvAPI_DRS_DeleteApplicationEx
  14881. //
  14882. //! DESCRIPTION: This API removes an executable from a profile.
  14883. //!
  14884. //! SUPPORTED OS: Windows 7 and higher
  14885. //!
  14886. //!
  14887. //! \param [in] hSession - Input to the session handle.
  14888. //! \param [in] hProfile - Input profile handle.
  14889. //! \param [in] *pApp - Input all the information about the application to be removed.
  14890. //!
  14891. //! \retval ::NVAPI_OK SUCCESS
  14892. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14893. //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables,
  14894. //! this error will be returned.
  14895. //!
  14896. //! \ingroup drsapi
  14897. ///////////////////////////////////////////////////////////////////////////////
  14898. NVAPI_INTERFACE NvAPI_DRS_DeleteApplicationEx(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_APPLICATION *pApp);
  14899. ///////////////////////////////////////////////////////////////////////////////
  14900. //
  14901. // FUNCTION NAME: NvAPI_DRS_DeleteApplication
  14902. //
  14903. //! DESCRIPTION: This API removes an executable name from a profile.
  14904. //!
  14905. //! SUPPORTED OS: Windows 7 and higher
  14906. //!
  14907. //!
  14908. //! \param [in] hSessionPARAMETERS Input to the session handle.
  14909. //! \param [in] hProfile Input profile handle.
  14910. //! \param [in] appName Input the executable name to be removed.
  14911. //!
  14912. //! \retval ::NVAPI_OK SUCCESS
  14913. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14914. //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables,
  14915. //! this error will be returned
  14916. //!
  14917. //! \ingroup drsapi
  14918. ///////////////////////////////////////////////////////////////////////////////
  14919. NVAPI_INTERFACE NvAPI_DRS_DeleteApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName);
  14920. ///////////////////////////////////////////////////////////////////////////////
  14921. //
  14922. // FUNCTION NAME: NvAPI_DRS_GetApplicationInfo
  14923. //
  14924. //! DESCRIPTION: This API gets information about the given application. The input application name
  14925. //! must match exactly what the Profile has stored for the application.
  14926. //! This function is better used to retrieve application information from a previous
  14927. //! enumeration.
  14928. //!
  14929. //! SUPPORTED OS: Windows 7 and higher
  14930. //!
  14931. //!
  14932. //! \param [in] hSession Input to the session handle.
  14933. //! \param [in] hProfile Input profile handle.
  14934. //! \param [in] appName Input application name.
  14935. //! \param [out] *pApplication Returns NVDRS_APPLICATION struct with all the attributes.
  14936. //!
  14937. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  14938. //! If there are return error codes with specific meaning for this API,
  14939. //! they are listed below.
  14940. //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS The application name could not
  14941. // single out only one executable.
  14942. //! \retval ::NVAPI_EXECUTABLE_NOT_FOUND No application with that name is found on the profile.
  14943. //!
  14944. //! \ingroup drsapi
  14945. ///////////////////////////////////////////////////////////////////////////////
  14946. NVAPI_INTERFACE NvAPI_DRS_GetApplicationInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName, NVDRS_APPLICATION *pApplication);
  14947. ///////////////////////////////////////////////////////////////////////////////
  14948. //
  14949. // FUNCTION NAME: NvAPI_DRS_EnumApplications
  14950. //
  14951. //! DESCRIPTION: This API enumerates all the applications in a given profile from the starting index to the maximum length.
  14952. //!
  14953. //! SUPPORTED OS: Windows 7 and higher
  14954. //!
  14955. //!
  14956. //! \param [in] hSession Input to the session handle.
  14957. //! \param [in] hProfile Input profile handle.
  14958. //! \param [in] startIndex Indicates starting index for enumeration.
  14959. //! \param [in,out] *appCount Input maximum length of the passed in arrays. Returns the actual length.
  14960. //! \param [out] *pApplication Returns NVDRS_APPLICATION struct with all the attributes.
  14961. //!
  14962. //! \retval ::NVAPI_OK SUCCESS
  14963. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  14964. //! \retval ::NVAPI_END_ENUMERATION startIndex exceeds the total appCount.
  14965. //!
  14966. //! \ingroup drsapi
  14967. ///////////////////////////////////////////////////////////////////////////////
  14968. NVAPI_INTERFACE NvAPI_DRS_EnumApplications(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *appCount, NVDRS_APPLICATION *pApplication);
  14969. ///////////////////////////////////////////////////////////////////////////////
  14970. //
  14971. // FUNCTION NAME: NvAPI_DRS_FindApplicationByName
  14972. //
  14973. //! DESCRIPTION: This API searches the application and the associated profile for the given application name.
  14974. //! If a fully qualified path is provided, this function will always return the profile
  14975. //! the driver will apply upon running the application (on the path provided).
  14976. //!
  14977. //! SUPPORTED OS: Windows 7 and higher
  14978. //!
  14979. //!
  14980. //! \param [in] hSession Input to the hSession handle
  14981. //! \param [in] appName Input appName. For best results, provide a fully qualified path of the type
  14982. //! c:/Folder1/Folder2/App.exe
  14983. //! \param [out] *phProfile Returns profile handle.
  14984. //! \param [in,out] *pApplication Returns NVDRS_APPLICATION struct pointer.
  14985. //!
  14986. //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
  14987. //! If there are return error codes with specific meaning for this API,
  14988. //! they are listed below:
  14989. //! \retval ::NVAPI_APPLICATION_NOT_FOUND If App not found
  14990. //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the input appName was not fully qualified, this error might return in the case of multiple matches
  14991. //!
  14992. //! \ingroup drsapi
  14993. ///////////////////////////////////////////////////////////////////////////////
  14994. NVAPI_INTERFACE NvAPI_DRS_FindApplicationByName(__in NvDRSSessionHandle hSession, __in NvAPI_UnicodeString appName, __out NvDRSProfileHandle *phProfile, __inout NVDRS_APPLICATION *pApplication);
  14995. ///////////////////////////////////////////////////////////////////////////////
  14996. //
  14997. // FUNCTION NAME: NvAPI_DRS_SetSetting
  14998. //
  14999. //! DESCRIPTION: This API adds/modifies a setting to a profile.
  15000. //!
  15001. //! SUPPORTED OS: Windows 7 and higher
  15002. //!
  15003. //!
  15004. //! \param [in] hSession Input to the session handle.
  15005. //! \param [in] hProfile Input profile handle.
  15006. //! \param [in] *pSetting Input NVDRS_SETTING struct pointer.
  15007. //!
  15008. //! \retval ::NVAPI_OK SUCCESS
  15009. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15010. //!
  15011. //! \ingroup drsapi
  15012. ///////////////////////////////////////////////////////////////////////////////
  15013. NVAPI_INTERFACE NvAPI_DRS_SetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_SETTING *pSetting);
  15014. ///////////////////////////////////////////////////////////////////////////////
  15015. //
  15016. // FUNCTION NAME: NvAPI_DRS_GetSetting
  15017. //
  15018. //! DESCRIPTION: This API gets information about the given setting.
  15019. //!
  15020. //! SUPPORTED OS: Windows 7 and higher
  15021. //!
  15022. //!
  15023. //! \param [in] hSession Input to the session handle.
  15024. //! \param [in] hProfile Input profile handle.
  15025. //! \param [in] settingId Input settingId.
  15026. //! \param [out] *pSetting Returns all the setting info
  15027. //!
  15028. //! \retval ::NVAPI_OK SUCCESS
  15029. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15030. //!
  15031. //! \ingroup drsapi
  15032. ///////////////////////////////////////////////////////////////////////////////
  15033. NVAPI_INTERFACE NvAPI_DRS_GetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId, NVDRS_SETTING *pSetting);
  15034. ///////////////////////////////////////////////////////////////////////////////
  15035. //
  15036. // FUNCTION NAME: NvAPI_DRS_EnumSettings
  15037. //
  15038. //! DESCRIPTION: This API enumerates all the settings of a given profile from startIndex to the maximum length.
  15039. //!
  15040. //! SUPPORTED OS: Windows 7 and higher
  15041. //!
  15042. //!
  15043. //! \param [in] hSession Input to the session handle.
  15044. //! \param [in] hProfile Input profile handle.
  15045. //! \param [in] startIndex Indicates starting index for enumeration.
  15046. //! \param [in,out] *settingsCount Input max length of the passed in arrays, Returns the actual length.
  15047. //! \param [out] *pSetting Returns all the settings info.
  15048. //!
  15049. //! \retval ::NVAPI_OK SUCCESS
  15050. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15051. //! \retval ::NVAPI_END_ENUMERATION startIndex exceeds the total appCount.
  15052. //!
  15053. //! \ingroup drsapi
  15054. ///////////////////////////////////////////////////////////////////////////////
  15055. NVAPI_INTERFACE NvAPI_DRS_EnumSettings(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *settingsCount, NVDRS_SETTING *pSetting);
  15056. ///////////////////////////////////////////////////////////////////////////////
  15057. //
  15058. // FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingIds
  15059. //
  15060. //! DESCRIPTION: This API enumerates all the Ids of all the settings recognized by NVAPI.
  15061. //!
  15062. //! SUPPORTED OS: Windows 7 and higher
  15063. //!
  15064. //!
  15065. //! \param [out] pSettingIds User-provided array of length *pMaxCount that NVAPI will fill with IDs.
  15066. //! \param [in,out] pMaxCount Input max length of the passed in array, Returns the actual length.
  15067. //!
  15068. //! \retval ::NVAPI_OK SUCCESS
  15069. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15070. //! NVAPI_END_ENUMERATION: the provided pMaxCount is not enough to hold all settingIds.
  15071. //!
  15072. //! \ingroup drsapi
  15073. ///////////////////////////////////////////////////////////////////////////////
  15074. NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingIds(NvU32 *pSettingIds, NvU32 *pMaxCount);
  15075. ///////////////////////////////////////////////////////////////////////////////
  15076. //
  15077. // FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingValues
  15078. //
  15079. //! DESCRIPTION: This API enumerates all available setting values for a given setting.
  15080. //!
  15081. //! SUPPORTED OS: Windows 7 and higher
  15082. //!
  15083. //!
  15084. //! \param [in] settingId Input settingId.
  15085. //! \param [in,out] pMaxNumValues Input max length of the passed in arrays, Returns the actual length.
  15086. //! \param [out] *pSettingValues Returns all available setting values and its count.
  15087. //!
  15088. //! \retval ::NVAPI_OK SUCCESS
  15089. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15090. //!
  15091. //! \ingroup drsapi
  15092. ///////////////////////////////////////////////////////////////////////////////
  15093. NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingValues(NvU32 settingId, NvU32 *pMaxNumValues, NVDRS_SETTING_VALUES *pSettingValues);
  15094. ///////////////////////////////////////////////////////////////////////////////
  15095. //
  15096. // FUNCTION NAME: NvAPI_DRS_GetSettingIdFromName
  15097. //
  15098. //! DESCRIPTION: This API gets the binary ID of a setting given the setting name.
  15099. //!
  15100. //! SUPPORTED OS: Windows 7 and higher
  15101. //!
  15102. //!
  15103. //! \param [in] settingName Input Unicode settingName.
  15104. //! \param [out] *pSettingId Returns corresponding settingId.
  15105. //!
  15106. //! \retval ::NVAPI_OK SUCCESS if the profile is found
  15107. //! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found
  15108. //! \retval ::NVAPI_SETTING_NOT_FOUND if setting is not found
  15109. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15110. //!
  15111. //! \ingroup drsapi
  15112. ///////////////////////////////////////////////////////////////////////////////
  15113. NVAPI_INTERFACE NvAPI_DRS_GetSettingIdFromName(NvAPI_UnicodeString settingName, NvU32 *pSettingId);
  15114. ///////////////////////////////////////////////////////////////////////////////
  15115. //
  15116. // FUNCTION NAME: NvAPI_DRS_GetSettingNameFromId
  15117. //
  15118. //! DESCRIPTION: This API gets the setting name given the binary ID.
  15119. //!
  15120. //! SUPPORTED OS: Windows 7 and higher
  15121. //!
  15122. //!
  15123. //! \param [in] settingId Input settingId.
  15124. //! \param [in] *pSettingName Returns corresponding Unicode settingName.
  15125. //!
  15126. //! \retval ::NVAPI_OK SUCCESS if the profile is found
  15127. //! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found
  15128. //! \retval ::NVAPI_SETTING_NOT_FOUND if setting is not found
  15129. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15130. //!
  15131. //! \ingroup drsapi
  15132. ///////////////////////////////////////////////////////////////////////////////
  15133. NVAPI_INTERFACE NvAPI_DRS_GetSettingNameFromId(NvU32 settingId, NvAPI_UnicodeString *pSettingName);
  15134. ///////////////////////////////////////////////////////////////////////////////
  15135. //
  15136. // FUNCTION NAME: NvAPI_DRS_DeleteProfileSetting
  15137. //
  15138. //! DESCRIPTION: This API deletes a setting or sets it back to predefined value.
  15139. //!
  15140. //! SUPPORTED OS: Windows 7 and higher
  15141. //!
  15142. //!
  15143. //! \param [in] hSession Input to the session handle.
  15144. //! \param [in] hProfile Input profile handle.
  15145. //! \param [in] settingId Input settingId to be deleted.
  15146. //!
  15147. //! \retval ::NVAPI_OK SUCCESS if the profile is found
  15148. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15149. //!
  15150. //! \ingroup drsapi
  15151. ///////////////////////////////////////////////////////////////////////////////
  15152. NVAPI_INTERFACE NvAPI_DRS_DeleteProfileSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId);
  15153. ///////////////////////////////////////////////////////////////////////////////
  15154. //
  15155. // FUNCTION NAME: NvAPI_DRS_RestoreAllDefaults
  15156. //
  15157. //! DESCRIPTION: This API restores the whole system to predefined(default) values.
  15158. //!
  15159. //! SUPPORTED OS: Windows 7 and higher
  15160. //!
  15161. //!
  15162. //! \param [in] hSession Input to the session handle.
  15163. //!
  15164. //! \retval ::NVAPI_OK SUCCESS if the profile is found
  15165. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15166. //!
  15167. //! \ingroup drsapi
  15168. ///////////////////////////////////////////////////////////////////////////////
  15169. NVAPI_INTERFACE NvAPI_DRS_RestoreAllDefaults(NvDRSSessionHandle hSession);
  15170. ///////////////////////////////////////////////////////////////////////////////
  15171. //
  15172. // FUNCTION NAME: NvAPI_DRS_RestoreProfileDefault
  15173. //
  15174. //! DESCRIPTION: This API restores the given profile to predefined(default) values.
  15175. //! Any and all user specified modifications will be removed.
  15176. //! If the whole profile was set by the user, the profile will be removed.
  15177. //!
  15178. //! SUPPORTED OS: Windows 7 and higher
  15179. //!
  15180. //!
  15181. //! \param [in] hSession Input to the session handle.
  15182. //! \param [in] hProfile Input profile handle.
  15183. //!
  15184. //! \retval ::NVAPI_OK SUCCESS if the profile is found
  15185. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15186. //! \retval ::NVAPI_PROFILE_REMOVED SUCCESS, and the hProfile is no longer valid.
  15187. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15188. //!
  15189. //! \ingroup drsapi
  15190. ///////////////////////////////////////////////////////////////////////////////
  15191. NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefault(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile);
  15192. ///////////////////////////////////////////////////////////////////////////////
  15193. //
  15194. // FUNCTION NAME: NvAPI_DRS_RestoreProfileDefaultSetting
  15195. //
  15196. //! DESCRIPTION: This API restores the given profile setting to predefined(default) values.
  15197. //!
  15198. //! SUPPORTED OS: Windows 7 and higher
  15199. //!
  15200. //!
  15201. //! \param [in] hSession Input to the session handle.
  15202. //! \param [in] hProfile Input profile handle.
  15203. //! \param [in] settingId Input settingId.
  15204. //!
  15205. //! \retval ::NVAPI_OK SUCCESS if the profile is found
  15206. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15207. //!
  15208. //! \ingroup drsapi
  15209. ///////////////////////////////////////////////////////////////////////////////
  15210. NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefaultSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId);
  15211. ///////////////////////////////////////////////////////////////////////////////
  15212. //
  15213. // FUNCTION NAME: NvAPI_DRS_GetBaseProfile
  15214. //
  15215. //! DESCRIPTION: Returns the handle to the current global profile.
  15216. //!
  15217. //! SUPPORTED OS: Windows 7 and higher
  15218. //!
  15219. //!
  15220. //! \param [in] hSession Input to the session handle.
  15221. //! \param [in] *phProfile Returns Base profile handle.
  15222. //!
  15223. //! \retval ::NVAPI_OK SUCCESS if the profile is found
  15224. //! \retval ::NVAPI_ERROR For miscellaneous errors.
  15225. //!
  15226. //! \ingroup drsapi
  15227. ///////////////////////////////////////////////////////////////////////////////
  15228. NVAPI_INTERFACE NvAPI_DRS_GetBaseProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile);
  15229. //! \addtogroup sysgeneral
  15230. //! @{
  15231. typedef struct
  15232. {
  15233. NvU32 version; //!< structure version
  15234. NvU32 vendorId; //!< Chipset vendor identification
  15235. NvU32 deviceId; //!< Chipset device identification
  15236. NvAPI_ShortString szVendorName; //!< Chipset vendor Name
  15237. NvAPI_ShortString szChipsetName; //!< Chipset device Name
  15238. NvU32 flags; //!< Chipset info flags - obsolete
  15239. NvU32 subSysVendorId; //!< Chipset subsystem vendor identification
  15240. NvU32 subSysDeviceId; //!< Chipset subsystem device identification
  15241. NvAPI_ShortString szSubSysVendorName; //!< subsystem vendor Name
  15242. NvU32 HBvendorId; //!< Host bridge vendor identification
  15243. NvU32 HBdeviceId; //!< Host bridge device identification
  15244. NvU32 HBsubSysVendorId; //!< Host bridge subsystem vendor identification
  15245. NvU32 HBsubSysDeviceId; //!< Host bridge subsystem device identification
  15246. } NV_CHIPSET_INFO_v4;
  15247. typedef struct
  15248. {
  15249. NvU32 version; //!< structure version
  15250. NvU32 vendorId; //!< vendor ID
  15251. NvU32 deviceId; //!< device ID
  15252. NvAPI_ShortString szVendorName; //!< vendor Name
  15253. NvAPI_ShortString szChipsetName; //!< device Name
  15254. NvU32 flags; //!< Chipset info flags - obsolete
  15255. NvU32 subSysVendorId; //!< subsystem vendor ID
  15256. NvU32 subSysDeviceId; //!< subsystem device ID
  15257. NvAPI_ShortString szSubSysVendorName; //!< subsystem vendor Name
  15258. } NV_CHIPSET_INFO_v3;
  15259. typedef enum
  15260. {
  15261. NV_CHIPSET_INFO_HYBRID = 0x00000001,
  15262. } NV_CHIPSET_INFO_FLAGS;
  15263. typedef struct
  15264. {
  15265. NvU32 version; //!< structure version
  15266. NvU32 vendorId; //!< vendor ID
  15267. NvU32 deviceId; //!< device ID
  15268. NvAPI_ShortString szVendorName; //!< vendor Name
  15269. NvAPI_ShortString szChipsetName; //!< device Name
  15270. NvU32 flags; //!< Chipset info flags
  15271. } NV_CHIPSET_INFO_v2;
  15272. typedef struct
  15273. {
  15274. NvU32 version; //structure version
  15275. NvU32 vendorId; //vendor ID
  15276. NvU32 deviceId; //device ID
  15277. NvAPI_ShortString szVendorName; //vendor Name
  15278. NvAPI_ShortString szChipsetName; //device Name
  15279. } NV_CHIPSET_INFO_v1;
  15280. #define NV_CHIPSET_INFO_VER_1 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v1,1)
  15281. #define NV_CHIPSET_INFO_VER_2 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v2,2)
  15282. #define NV_CHIPSET_INFO_VER_3 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v3,3)
  15283. #define NV_CHIPSET_INFO_VER_4 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v4,4)
  15284. #define NV_CHIPSET_INFO NV_CHIPSET_INFO_v4
  15285. #define NV_CHIPSET_INFO_VER NV_CHIPSET_INFO_VER_4
  15286. //! @}
  15287. ///////////////////////////////////////////////////////////////////////////////
  15288. //
  15289. // FUNCTION NAME: NvAPI_SYS_GetChipSetInfo
  15290. //
  15291. //! This function returns information about the system's chipset.
  15292. //!
  15293. //! SUPPORTED OS: Windows 7 and higher
  15294. //!
  15295. //!
  15296. //! \since Release: 95
  15297. //!
  15298. //! \retval NVAPI_INVALID_ARGUMENT pChipSetInfo is NULL.
  15299. //! \retval NVAPI_OK *pChipSetInfo is now set.
  15300. //! \retval NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_CHIPSET_INFO version not compatible with driver.
  15301. //! \ingroup sysgeneral
  15302. ///////////////////////////////////////////////////////////////////////////////
  15303. NVAPI_INTERFACE NvAPI_SYS_GetChipSetInfo(NV_CHIPSET_INFO *pChipSetInfo);
  15304. //! \ingroup sysgeneral
  15305. //! Lid and dock information - used in NvAPI_GetLidDockInfo()
  15306. typedef struct
  15307. {
  15308. NvU32 version; //! Structure version, constructed from the macro #NV_LID_DOCK_PARAMS_VER
  15309. NvU32 currentLidState;
  15310. NvU32 currentDockState;
  15311. NvU32 currentLidPolicy;
  15312. NvU32 currentDockPolicy;
  15313. NvU32 forcedLidMechanismPresent;
  15314. NvU32 forcedDockMechanismPresent;
  15315. }NV_LID_DOCK_PARAMS;
  15316. //! ingroup sysgeneral
  15317. #define NV_LID_DOCK_PARAMS_VER MAKE_NVAPI_VERSION(NV_LID_DOCK_PARAMS,1)
  15318. ///////////////////////////////////////////////////////////////////////////////
  15319. //
  15320. // FUNCTION NAME: NvAPI_GetLidDockInfo
  15321. //
  15322. //! DESCRIPTION: This function returns the current lid and dock information.
  15323. //!
  15324. //! SUPPORTED OS: Windows 7 and higher
  15325. //!
  15326. //!
  15327. //! \since Release: 177
  15328. //!
  15329. //! \retval ::NVAPI_OK
  15330. //! \retval ::NVAPI_ERROR
  15331. //! \retval ::NVAPI_NOT_SUPPORTED
  15332. //! \retval ::NVAPI_HANDLE_INVALIDATED
  15333. //! \retval ::NVAPI_API_NOT_INTIALIZED
  15334. //!
  15335. //! \ingroup sysgeneral
  15336. ///////////////////////////////////////////////////////////////////////////////
  15337. NVAPI_INTERFACE NvAPI_SYS_GetLidAndDockInfo(NV_LID_DOCK_PARAMS *pLidAndDock);
  15338. ///////////////////////////////////////////////////////////////////////////////
  15339. // FUNCTION NAME: NvAPI_SYS_GetDisplayIdFromGpuAndOutputId
  15340. //
  15341. //! DESCRIPTION: This API converts a Physical GPU handle and output ID to a
  15342. //! display ID.
  15343. //!
  15344. //! SUPPORTED OS: Windows 7 and higher
  15345. //!
  15346. //!
  15347. //! \param [in] hPhysicalGpu Handle to the physical GPU
  15348. //! \param [in] outputId Connected display output ID on the
  15349. //! target GPU - must only have one bit set
  15350. //! \param [out] displayId Pointer to an NvU32 which contains
  15351. //! the display ID
  15352. //!
  15353. //! \retval ::NVAPI_OK - completed request
  15354. //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
  15355. //! \retval ::NVAPI_ERROR - miscellaneous error occurred
  15356. //! \retval ::NVAPI_INVALID_ARGUMENT - Invalid input parameter.
  15357. //!
  15358. //! \ingroup sysgeneral
  15359. ///////////////////////////////////////////////////////////////////////////////
  15360. NVAPI_INTERFACE NvAPI_SYS_GetDisplayIdFromGpuAndOutputId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NvU32* displayId);
  15361. ///////////////////////////////////////////////////////////////////////////////
  15362. // FUNCTION NAME: NvAPI_SYS_GetGpuAndOutputIdFromDisplayId
  15363. //
  15364. //! DESCRIPTION: This API converts a display ID to a Physical GPU handle and output ID.
  15365. //!
  15366. //! SUPPORTED OS: Windows 7 and higher
  15367. //!
  15368. //!
  15369. //! \param [in] displayId Display ID of display to retrieve
  15370. //! GPU and outputId for
  15371. //! \param [out] hPhysicalGpu Handle to the physical GPU
  15372. //! \param [out] outputId ) Connected display output ID on the
  15373. //! target GPU will only have one bit set.
  15374. //!
  15375. //! \retval ::NVAPI_OK
  15376. //! \retval ::NVAPI_API_NOT_INTIALIZED
  15377. //! \retval ::NVAPI_ID_OUT_OF_RANGE The DisplayId corresponds to a
  15378. //! display which is not within the
  15379. //! normal outputId range.
  15380. //! \retval ::NVAPI_ERROR
  15381. //! \retval ::NVAPI_INVALID_ARGUMENT
  15382. //!
  15383. //! \ingroup sysgeneral
  15384. ///////////////////////////////////////////////////////////////////////////////
  15385. NVAPI_INTERFACE NvAPI_SYS_GetGpuAndOutputIdFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu, NvU32 *outputId);
  15386. ///////////////////////////////////////////////////////////////////////////////
  15387. // FUNCTION NAME: NvAPI_SYS_GetPhysicalGpuFromDisplayId
  15388. //
  15389. //! \code
  15390. //! DESCRIPTION: This API retrieves the Physical GPU handle of the connected display
  15391. //!
  15392. //! \since Release: 313
  15393. //!
  15394. //! SUPPORTED OS: Windows 7 and higher
  15395. //!
  15396. //!
  15397. //! PARAMETERS: displayId(IN) - Display ID of display to retrieve
  15398. //! GPU handle
  15399. //! hPhysicalGpu(OUT) - Handle to the physical GPU
  15400. //!
  15401. //! RETURN STATUS:
  15402. //! NVAPI_OK - completed request
  15403. //! NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
  15404. //! NVAPI_ERROR - miscellaneous error occurred
  15405. //! NVAPI_INVALID_ARGUMENT - Invalid input parameter.
  15406. //! \endcode
  15407. //! \ingroup sysgeneral
  15408. ///////////////////////////////////////////////////////////////////////////////
  15409. NVAPI_INTERFACE NvAPI_SYS_GetPhysicalGpuFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu);
  15410. #ifdef __cplusplus
  15411. }; //extern "C" {
  15412. #endif
  15413. #pragma pack(pop)
  15414. #endif // _NVAPI_H
  15415. #include"nvapi_lite_salend.h"