[{"data":1,"prerenderedAt":491},["ShallowReactive",2],{"KMn5Hm3mWR":3},{"title":4,"description":5,"type":6,"xrefs":7,"body":8,"_type":490,"_id":4},"ViewportIndex","Viewport index used","builtins",[],{"type":9,"children":10,"toc":486},"root",[11,24,37,49,54,86,139,151,193],{"type":12,"tag":13,"props":14,"children":16},"element","h6",{"id":15},"viewportindex",[17],{"type":12,"tag":18,"props":19,"children":21},"code",{"className":20},[],[22],{"type":23,"value":4},"text",{"type":12,"tag":25,"props":26,"children":27},"p",{},[28,30,35],{"type":23,"value":29},"Decorating a variable with the ",{"type":12,"tag":18,"props":31,"children":33},{"className":32},[],[34],{"type":23,"value":4},{"type":23,"value":36}," built-in decoration will\nmake that variable contain the index of the viewport.",{"type":12,"tag":25,"props":38,"children":39},{},[40,42,47],{"type":23,"value":41},"In a\nmesh,\nvertex, tessellation evaluation, or\ngeometry shader, the variable decorated with ",{"type":12,"tag":18,"props":43,"children":45},{"className":44},[],[46],{"type":23,"value":4},{"type":23,"value":48}," can be\nwritten to with the viewport index to which the primitive produced by that\nshader will be directed.",{"type":12,"tag":25,"props":50,"children":51},{},[52],{"type":23,"value":53},"The selected viewport index is used to select the\nviewport transform, scissor rectangle, and exclusive\nscissor rectangle.",{"type":12,"tag":25,"props":55,"children":56},{},[57,59,70,72,77,79,84],{"type":23,"value":58},"The last active\n",{"type":12,"tag":60,"props":61,"children":62},"em",{},[63],{"type":12,"tag":64,"props":65,"children":67},"a",{"href":66},"/man/VkGraphicsPipelineCreateInfo#pipelines-graphics-subsets-pre-rasterization",[68],{"type":23,"value":69},"pre-rasterization shader\nstage",{"type":23,"value":71}," (in pipeline order) controls the ",{"type":12,"tag":18,"props":73,"children":75},{"className":74},[],[76],{"type":23,"value":4},{"type":23,"value":78}," that is used.\nOutputs in previous shader stages are not used, even if the last stage fails\nto write the ",{"type":12,"tag":18,"props":80,"children":82},{"className":81},[],[83],{"type":23,"value":4},{"type":23,"value":85},".",{"type":12,"tag":25,"props":87,"children":88},{},[89,91,95,97,102,104,110,112,116,118,123,125,130,132,137],{"type":23,"value":90},"If the last active\n",{"type":12,"tag":64,"props":92,"children":93},{"href":66},[94],{"type":23,"value":69},{"type":23,"value":96}," shader entry point’s interface does not include a variable decorated\nwith ",{"type":12,"tag":18,"props":98,"children":100},{"className":99},[],[101],{"type":23,"value":4},{"type":23,"value":103},"\n, and if ",{"type":12,"tag":64,"props":105,"children":107},{"href":106},"/man/VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM#features-multiviewPerViewViewports",[108],{"type":23,"value":109},"multiviewPerViewViewports",{"type":23,"value":111},"\nis not enabled,\nthen the first viewport is used.\nIf a ",{"type":12,"tag":64,"props":113,"children":114},{"href":66},[115],{"type":23,"value":69},{"type":23,"value":117}," shader entry point’s interface includes a variable decorated with\n",{"type":12,"tag":18,"props":119,"children":121},{"className":120},[],[122],{"type":23,"value":4},{"type":23,"value":124},", it ",{"type":12,"tag":126,"props":127,"children":129},"normative",{"type":128},"must",[],{"type":23,"value":131}," write the same value to ",{"type":12,"tag":18,"props":133,"children":135},{"className":134},[],[136],{"type":23,"value":4},{"type":23,"value":138}," for\nall output vertices of a given primitive.",{"type":12,"tag":25,"props":140,"children":141},{},[142,144,149],{"type":23,"value":143},"In a fragment shader, the variable decorated with ",{"type":12,"tag":18,"props":145,"children":147},{"className":146},[],[148],{"type":23,"value":4},{"type":23,"value":150},"\ncontains the viewport index of the primitive that the fragment invocation\nbelongs to.",{"type":12,"tag":25,"props":152,"children":153},{},[154,156,164,166,170,171,176,178,184,186,191],{"type":23,"value":155},"If ",{"type":12,"tag":64,"props":157,"children":158},{"href":106},[159],{"type":12,"tag":18,"props":160,"children":162},{"className":161},[],[163],{"type":23,"value":109},{"type":23,"value":165},"\nis enabled, and if the last active\n",{"type":12,"tag":64,"props":167,"children":168},{"href":66},[169],{"type":23,"value":69},{"type":23,"value":96},{"type":12,"tag":18,"props":172,"children":174},{"className":173},[],[175],{"type":23,"value":4},{"type":23,"value":177},", then the value of ",{"type":12,"tag":18,"props":179,"children":181},{"className":180},[],[182],{"type":23,"value":183},"ViewIndex",{"type":23,"value":185}," is used as an\nindex to select the viewport transform and scissor rectangle, and the value\nof ",{"type":12,"tag":18,"props":187,"children":189},{"className":188},[],[190],{"type":23,"value":4},{"type":23,"value":192}," in the fragment shader is undefined::.",{"type":12,"tag":194,"props":195,"children":197},"validity-group",{"name":196},"Valid Usage",[198,279,364,420,439],{"type":12,"tag":199,"props":200,"children":202},"validity-field",{"name":201},"VUID-ViewportIndex-ViewportIndex-04404",[203],{"type":12,"tag":25,"props":204,"children":205},{},[206,208,213,215,218,220,226,228,234,235,241,242,248,250,256,258,264,266,272,273],{"type":23,"value":207},"The ",{"type":12,"tag":18,"props":209,"children":211},{"className":210},[],[212],{"type":23,"value":4},{"type":23,"value":214}," decoration ",{"type":12,"tag":126,"props":216,"children":217},{"type":128},[],{"type":23,"value":219}," be used only within the\n",{"type":12,"tag":18,"props":221,"children":223},{"className":222},[],[224],{"type":23,"value":225},"MeshEXT",{"type":23,"value":227},", ",{"type":12,"tag":18,"props":229,"children":231},{"className":230},[],[232],{"type":23,"value":233},"MeshNV",{"type":23,"value":227},{"type":12,"tag":18,"props":236,"children":238},{"className":237},[],[239],{"type":23,"value":240},"Vertex",{"type":23,"value":227},{"type":12,"tag":18,"props":243,"children":245},{"className":244},[],[246],{"type":23,"value":247},"TessellationEvaluation",{"type":23,"value":249},",\n",{"type":12,"tag":18,"props":251,"children":253},{"className":252},[],[254],{"type":23,"value":255},"Geometry",{"type":23,"value":257},", or ",{"type":12,"tag":18,"props":259,"children":261},{"className":260},[],[262],{"type":23,"value":263},"Fragment",{"type":23,"value":265}," ",{"type":12,"tag":18,"props":267,"children":269},{"className":268},[],[270],{"type":23,"value":271},"Execution",{"type":23,"value":265},{"type":12,"tag":18,"props":274,"children":276},{"className":275},[],[277],{"type":23,"value":278},"Model",{"type":12,"tag":199,"props":280,"children":282},{"name":281},"VUID-ViewportIndex-ViewportIndex-04406",[283,324],{"type":12,"tag":25,"props":284,"children":285},{},[286,288,293,295,300,301,306,307,312,313,318,319],{"type":23,"value":287},"The variable decorated with ",{"type":12,"tag":18,"props":289,"children":291},{"className":290},[],[292],{"type":23,"value":4},{"type":23,"value":294}," within the ",{"type":12,"tag":18,"props":296,"children":298},{"className":297},[],[299],{"type":23,"value":225},{"type":23,"value":249},{"type":12,"tag":18,"props":302,"children":304},{"className":303},[],[305],{"type":23,"value":233},{"type":23,"value":227},{"type":12,"tag":18,"props":308,"children":310},{"className":309},[],[311],{"type":23,"value":240},{"type":23,"value":227},{"type":12,"tag":18,"props":314,"children":316},{"className":315},[],[317],{"type":23,"value":247},{"type":23,"value":257},{"type":12,"tag":18,"props":320,"children":322},{"className":321},[],[323],{"type":23,"value":255},{"type":12,"tag":25,"props":325,"children":326},{},[327,332,333,338,339,342,344,350,351,357,358],{"type":12,"tag":18,"props":328,"children":330},{"className":329},[],[331],{"type":23,"value":271},{"type":23,"value":265},{"type":12,"tag":18,"props":334,"children":336},{"className":335},[],[337],{"type":23,"value":278},{"type":23,"value":265},{"type":12,"tag":126,"props":340,"children":341},{"type":128},[],{"type":23,"value":343}," be declared using the ",{"type":12,"tag":18,"props":345,"children":347},{"className":346},[],[348],{"type":23,"value":349},"Output",{"type":23,"value":265},{"type":12,"tag":18,"props":352,"children":354},{"className":353},[],[355],{"type":23,"value":356},"Storage",{"type":23,"value":265},{"type":12,"tag":18,"props":359,"children":361},{"className":360},[],[362],{"type":23,"value":363},"Class",{"type":12,"tag":199,"props":365,"children":367},{"name":366},"VUID-ViewportIndex-ViewportIndex-04407",[368,383],{"type":12,"tag":25,"props":369,"children":370},{},[371,372,377,378],{"type":23,"value":287},{"type":12,"tag":18,"props":373,"children":375},{"className":374},[],[376],{"type":23,"value":4},{"type":23,"value":294},{"type":12,"tag":18,"props":379,"children":381},{"className":380},[],[382],{"type":23,"value":263},{"type":12,"tag":25,"props":384,"children":385},{},[386,391,392,397,398,401,402,408,409,414,415],{"type":12,"tag":18,"props":387,"children":389},{"className":388},[],[390],{"type":23,"value":271},{"type":23,"value":265},{"type":12,"tag":18,"props":393,"children":395},{"className":394},[],[396],{"type":23,"value":278},{"type":23,"value":265},{"type":12,"tag":126,"props":399,"children":400},{"type":128},[],{"type":23,"value":343},{"type":12,"tag":18,"props":403,"children":405},{"className":404},[],[406],{"type":23,"value":407},"Input",{"type":23,"value":265},{"type":12,"tag":18,"props":410,"children":412},{"className":411},[],[413],{"type":23,"value":356},{"type":23,"value":265},{"type":12,"tag":18,"props":416,"children":418},{"className":417},[],[419],{"type":23,"value":363},{"type":12,"tag":199,"props":421,"children":423},{"name":422},"VUID-ViewportIndex-ViewportIndex-04408",[424],{"type":12,"tag":25,"props":425,"children":426},{},[427,428,433,434,437],{"type":23,"value":287},{"type":12,"tag":18,"props":429,"children":431},{"className":430},[],[432],{"type":23,"value":4},{"type":23,"value":265},{"type":12,"tag":126,"props":435,"children":436},{"type":128},[],{"type":23,"value":438}," be declared as a\nscalar 32-bit integer value",{"type":12,"tag":199,"props":440,"children":442},{"name":441},"VUID-ViewportIndex-ViewportIndex-07060",[443,458],{"type":12,"tag":25,"props":444,"children":445},{},[446,447,452,453],{"type":23,"value":287},{"type":12,"tag":18,"props":448,"children":450},{"className":449},[],[451],{"type":23,"value":4},{"type":23,"value":294},{"type":12,"tag":18,"props":454,"children":456},{"className":455},[],[457],{"type":23,"value":225},{"type":12,"tag":25,"props":459,"children":460},{},[461,466,467,472,473,476,478,484],{"type":12,"tag":18,"props":462,"children":464},{"className":463},[],[465],{"type":23,"value":271},{"type":23,"value":265},{"type":12,"tag":18,"props":468,"children":470},{"className":469},[],[471],{"type":23,"value":278},{"type":23,"value":265},{"type":12,"tag":126,"props":474,"children":475},{"type":128},[],{"type":23,"value":477}," also be decorated with the ",{"type":12,"tag":18,"props":479,"children":481},{"className":480},[],[482],{"type":23,"value":483},"PerPrimitiveEXT",{"type":23,"value":485},"\ndecoration",{"title":487,"searchDepth":488,"depth":488,"links":489},"",2,[],"markdown",1725732536860]