[{"data":1,"prerenderedAt":361},["ShallowReactive",2],{"4YLu4ppu0o":3},{"title":4,"description":5,"type":6,"xrefs":7,"body":8,"_type":360,"_id":4},"Layer","Layer index for layered rendering","builtins",[],{"type":9,"children":10,"toc":356},"root",[11,24,30,35,40,45,50,55,60],{"type":12,"tag":13,"props":14,"children":16},"element","h6",{"id":15},"layer",[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],{"type":23,"value":29},"Decorating a variable with the code:Layer built-in decoration will make that\nvariable contain the select layer of a multi-layer framebuffer attachment.",{"type":12,"tag":25,"props":31,"children":32},{},[33],{"type":23,"value":34},"In a\nmesh,\nvertex, tessellation evaluation, or\ngeometry shader, any variable decorated with code:Layer can be written with\nthe framebuffer layer index to which the primitive produced by that shader\nwill be directed.",{"type":12,"tag":25,"props":36,"children":37},{},[38],{"type":23,"value":39},"The last active\n\u003C\u003Cpipelines-graphics-subsets-pre-rasterization,pre-rasterization shader\nstage>> (in pipeline order) controls the code:Layer that is used.\nOutputs in previous shader stages are not used, even if the last stage fails\nto write the code:Layer.",{"type":12,"tag":25,"props":41,"children":42},{},[43],{"type":23,"value":44},"If the last active\n\u003C\u003Cpipelines-graphics-subsets-pre-rasterization,pre-rasterization shader\nstage>> shader entry point's interface does not include a variable decorated\nwith code:Layer, then the first layer is used.\nIf a \u003C\u003Cpipelines-graphics-subsets-pre-rasterization,pre-rasterization shader\nstage>> shader entry point's interface includes a variable decorated with\ncode:Layer, it must: write the same value to code:Layer for all output\nvertices of a given primitive.\nIf the code:Layer value is less than 0 or greater than or equal to the\nnumber of layers in the framebuffer, then primitives may: still be\nrasterized, fragment shaders may: be executed, and the framebuffer values\nfor all layers are undefined:.\nIn a mesh shader this also applies when the code:Layer value is greater than\nor equal to the pname:maxMeshOutputLayers limit.",{"type":12,"tag":25,"props":46,"children":47},{},[48],{"type":23,"value":49},"If a variable with the code:Layer decoration is also decorated with\ncode:ViewportRelativeNV, then the code:ViewportIndex is added to the layer\nthat is used for rendering and that is made available in the fragment\nshader.",{"type":12,"tag":25,"props":51,"children":52},{},[53],{"type":23,"value":54},"If the shader writes to a variable decorated code:ViewportMaskNV, then the\nlayer selected has a different value for each viewport a primitive is\nrendered to.",{"type":12,"tag":25,"props":56,"children":57},{},[58],{"type":23,"value":59},"In a fragment shader, a variable decorated with code:Layer contains the\nlayer index of the primitive that the fragment invocation belongs to.",{"type":12,"tag":61,"props":62,"children":64},"validity-group",{"name":63},"Valid Usage",[65,148,234,290,309],{"type":12,"tag":66,"props":67,"children":69},"validity-field",{"name":68},"VUID-Layer-Layer-04272",[70],{"type":12,"tag":25,"props":71,"children":72},{},[73,75,80,82,87,89,95,97,103,105,111,112,118,119,125,127,133,135,141,142],{"type":23,"value":74},"The ",{"type":12,"tag":18,"props":76,"children":78},{"className":77},[],[79],{"type":23,"value":4},{"type":23,"value":81}," decoration ",{"type":12,"tag":83,"props":84,"children":86},"normative",{"type":85},"must",[],{"type":23,"value":88}," be used only within the ",{"type":12,"tag":18,"props":90,"children":92},{"className":91},[],[93],{"type":23,"value":94},"MeshEXT",{"type":23,"value":96},",\n",{"type":12,"tag":18,"props":98,"children":100},{"className":99},[],[101],{"type":23,"value":102},"MeshNV",{"type":23,"value":104},", ",{"type":12,"tag":18,"props":106,"children":108},{"className":107},[],[109],{"type":23,"value":110},"Vertex",{"type":23,"value":104},{"type":12,"tag":18,"props":113,"children":115},{"className":114},[],[116],{"type":23,"value":117},"TessellationEvaluation",{"type":23,"value":104},{"type":12,"tag":18,"props":120,"children":122},{"className":121},[],[123],{"type":23,"value":124},"Geometry",{"type":23,"value":126},", or\n",{"type":12,"tag":18,"props":128,"children":130},{"className":129},[],[131],{"type":23,"value":132},"Fragment",{"type":23,"value":134}," ",{"type":12,"tag":18,"props":136,"children":138},{"className":137},[],[139],{"type":23,"value":140},"Execution",{"type":23,"value":134},{"type":12,"tag":18,"props":143,"children":145},{"className":144},[],[146],{"type":23,"value":147},"Model",{"type":12,"tag":66,"props":149,"children":151},{"name":150},"VUID-Layer-Layer-04274",[152,194],{"type":12,"tag":25,"props":153,"children":154},{},[155,157,162,164,169,170,175,176,181,182,187,189],{"type":23,"value":156},"The variable decorated with ",{"type":12,"tag":18,"props":158,"children":160},{"className":159},[],[161],{"type":23,"value":4},{"type":23,"value":163}," within the ",{"type":12,"tag":18,"props":165,"children":167},{"className":166},[],[168],{"type":23,"value":94},{"type":23,"value":96},{"type":12,"tag":18,"props":171,"children":173},{"className":172},[],[174],{"type":23,"value":102},{"type":23,"value":104},{"type":12,"tag":18,"props":177,"children":179},{"className":178},[],[180],{"type":23,"value":110},{"type":23,"value":104},{"type":12,"tag":18,"props":183,"children":185},{"className":184},[],[186],{"type":23,"value":117},{"type":23,"value":188},", or ",{"type":12,"tag":18,"props":190,"children":192},{"className":191},[],[193],{"type":23,"value":124},{"type":12,"tag":25,"props":195,"children":196},{},[197,202,203,208,209,212,214,220,221,227,228],{"type":12,"tag":18,"props":198,"children":200},{"className":199},[],[201],{"type":23,"value":140},{"type":23,"value":134},{"type":12,"tag":18,"props":204,"children":206},{"className":205},[],[207],{"type":23,"value":147},{"type":23,"value":134},{"type":12,"tag":83,"props":210,"children":211},{"type":85},[],{"type":23,"value":213}," be declared using the ",{"type":12,"tag":18,"props":215,"children":217},{"className":216},[],[218],{"type":23,"value":219},"Output",{"type":23,"value":134},{"type":12,"tag":18,"props":222,"children":224},{"className":223},[],[225],{"type":23,"value":226},"Storage",{"type":23,"value":134},{"type":12,"tag":18,"props":229,"children":231},{"className":230},[],[232],{"type":23,"value":233},"Class",{"type":12,"tag":66,"props":235,"children":237},{"name":236},"VUID-Layer-Layer-04275",[238,253],{"type":12,"tag":25,"props":239,"children":240},{},[241,242,247,248],{"type":23,"value":156},{"type":12,"tag":18,"props":243,"children":245},{"className":244},[],[246],{"type":23,"value":4},{"type":23,"value":163},{"type":12,"tag":18,"props":249,"children":251},{"className":250},[],[252],{"type":23,"value":132},{"type":12,"tag":25,"props":254,"children":255},{},[256,261,262,267,268,271,272,278,279,284,285],{"type":12,"tag":18,"props":257,"children":259},{"className":258},[],[260],{"type":23,"value":140},{"type":23,"value":134},{"type":12,"tag":18,"props":263,"children":265},{"className":264},[],[266],{"type":23,"value":147},{"type":23,"value":134},{"type":12,"tag":83,"props":269,"children":270},{"type":85},[],{"type":23,"value":213},{"type":12,"tag":18,"props":273,"children":275},{"className":274},[],[276],{"type":23,"value":277},"Input",{"type":23,"value":134},{"type":12,"tag":18,"props":280,"children":282},{"className":281},[],[283],{"type":23,"value":226},{"type":23,"value":134},{"type":12,"tag":18,"props":286,"children":288},{"className":287},[],[289],{"type":23,"value":233},{"type":12,"tag":66,"props":291,"children":293},{"name":292},"VUID-Layer-Layer-04276",[294],{"type":12,"tag":25,"props":295,"children":296},{},[297,298,303,304,307],{"type":23,"value":156},{"type":12,"tag":18,"props":299,"children":301},{"className":300},[],[302],{"type":23,"value":4},{"type":23,"value":134},{"type":12,"tag":83,"props":305,"children":306},{"type":85},[],{"type":23,"value":308}," be declared as a scalar\n32-bit integer value",{"type":12,"tag":66,"props":310,"children":312},{"name":311},"VUID-Layer-Layer-07039",[313,328],{"type":12,"tag":25,"props":314,"children":315},{},[316,317,322,323],{"type":23,"value":156},{"type":12,"tag":18,"props":318,"children":320},{"className":319},[],[321],{"type":23,"value":4},{"type":23,"value":163},{"type":12,"tag":18,"props":324,"children":326},{"className":325},[],[327],{"type":23,"value":94},{"type":12,"tag":25,"props":329,"children":330},{},[331,336,337,342,343,346,348,354],{"type":12,"tag":18,"props":332,"children":334},{"className":333},[],[335],{"type":23,"value":140},{"type":23,"value":134},{"type":12,"tag":18,"props":338,"children":340},{"className":339},[],[341],{"type":23,"value":147},{"type":23,"value":134},{"type":12,"tag":83,"props":344,"children":345},{"type":85},[],{"type":23,"value":347}," also be decorated with the ",{"type":12,"tag":18,"props":349,"children":351},{"className":350},[],[352],{"type":23,"value":353},"PerPrimitiveEXT",{"type":23,"value":355},"\ndecoration",{"title":357,"searchDepth":358,"depth":358,"links":359},"",2,[],"markdown",1725732532104]