dcl_interface (sm5 - asm) - Win32 apps | Microsoft Docs

文章推薦指數: 80 %
投票人數:10人

Declare function table pointers (interfaces). ... In the HLSL virtual inlining model it's always known what global variable/input is used ... Skiptomaincontent Thisbrowserisnolongersupported. UpgradetoMicrosoftEdgetotakeadvantageofthelatestfeatures,securityupdates,andtechnicalsupport. DownloadMicrosoftEdge Moreinfo Tableofcontents Exitfocusmode ReadinEnglish Save Tableofcontents ReadinEnglish Save Edit Twitter LinkedIn Facebook Email Tableofcontents dcl_interface(sm5-asm) Article 03/09/2021 2minutestoread 3contributors Inthisarticle Declarefunctiontablepointers(interfaces). dcl_interfacefp#[arraySize][numCallSites]={ft#,ft#,...} Item Description fp# [in]Thefunctiontablepointers. Remarks EachinterfaceneedstobeboundfromtheAPIbeforetheshaderisusable.Bindinggivesareferencetooneofthefunctiontablessothatthemethodslotscanbefilledin.Thecompilerwillnotgeneratepointersforunreferencedobjects. AfunctiontablepointerhasafullsetofmethodslotstoavoidtheextralevelofindirectionthataC++pointer-to-pointer-to-vtablerepresentationwouldrequire.Thatwouldalsorequirethatthispointersbe5-tuples.IntheHLSLvirtualinliningmodelit'salwaysknownwhatglobalvariable/inputisusedforacallsowecansetuptablesperrootobject. Functionpointerdeclarationsindicatewhichfunctiontablesarelegaltousewiththem.Thisalsoallowsderivationofmethodcorrelationinformation. Thefirst[]ofaninterfacedeclarationisthearraysize.Ifdynamicindexingisusedthedeclarationwillindicatethatasshown.Anarrayofinterfacepointerscanbeindexedstaticallyalso,itisnotrequiredthatarraysofinterfacepointersmeandynamicindexing. Numberingofinterfacepointersstartsat0forthefirstdeclarationandsubsequentlytakesarraysizeintoaccount,sothefirstpointerafterafourentryarrayfp0[4][1]wouldbefp4[][]. Thesecond[]ofaninterfacedeclarationisthenumberofcallsites,whichmustmatchthenumberofbodiesineachtablereferencedinthedeclaration. Therearenoboundstohowmanyfunctiontable(ft#)choicescanbelistedinaninterfacedeclaration. Agivenfunctiontable(ft#)canappearmorethanonceinoneormoreinterfacedeclarations. Restrictions Thenumberofobjectsitesinashader,whichisthesumacrossallfp#declarationsoftheir[arraySize]declarations,mustbenomorethan253.Thisnumbercorrespondstohowmanythispointerscanbepresent.Theruntimeenforcesthis253limittokeepaboundonthesizeoftheDDIforcommunicatingthispointerdata. Thenumberofcallsitesinashader,whichisthesumacrossallfcallstatementsofthenumberofpotentialbranchtargets,mustbenomorethan4096. Forexample,anfcallthatusesastaticindexforthefirstfp[][]dimensioncountsasone: fcallfp0[0][0]//+1 Anfcallthatusesadynamicindexcountsasthenumberofelementsinthearray(first[]ofdcl_interface): dcl_interface_dynamicindexedfp1[2][1]={ft2,ft3,ft4}... fcallfp1[r0.z+0][1]//+2 Thislimithelpssomeimplementationseasilyfittablesoffunctionbodyselectionsinconstantbuffer-likestorage. Thisinstructionappliestothefollowingshaderstages: Vertex Hull Domain Geometry Pixel Compute X X X X X X MinimumShaderModel Thisinstructionissupportedinthefollowingshadermodels: ShaderModel Supported ShaderModel5 yes ShaderModel4.1 no ShaderModel4 no ShaderModel3(DirectXHLSL) no ShaderModel2(DirectXHLSL) no ShaderModel1(DirectXHLSL) no cs_4_0andcs_4_1supportthisinstructionforUAVandSRV. Relatedtopics ShaderModel5Assembly(DirectXHLSL) Inthisarticle



請為這篇文章評分?