[{"data":1,"prerenderedAt":276},["ShallowReactive",2],{"hQvgeSGmDC":3},{"title":4,"description":5,"type":6,"xrefs":7,"body":8,"_type":275,"_id":4},"SampleMask","Coverage mask for a fragment shader invocation","builtins",[],{"type":9,"children":10,"toc":271},"root",[11,24,46,81,121,140,159],{"type":12,"tag":13,"props":14,"children":16},"element","h6",{"id":15},"samplemask",[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,37,44],{"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 make\nany variable contain the ",{"type":12,"tag":38,"props":39,"children":41},"a",{"href":40},"/chapters/fragops#fragops-shader-samplemask",[42],{"type":23,"value":43},"sample mask",{"type":23,"value":45}," for the\ncurrent fragment shader invocation.",{"type":12,"tag":25,"props":47,"children":48},{},[49,51,57,59,64,66,71,73,79],{"type":23,"value":50},"A variable in the ",{"type":12,"tag":18,"props":52,"children":54},{"className":53},[],[55],{"type":23,"value":56},"Input",{"type":23,"value":58}," storage class decorated with ",{"type":12,"tag":18,"props":60,"children":62},{"className":61},[],[63],{"type":23,"value":4},{"type":23,"value":65},"\nwill contain a bitmask of the set of samples covered by the primitive\ngenerating the fragment during rasterization.\nIt has a sample bit set if and only if the sample is considered covered for\nthis fragment shader invocation.\n",{"type":12,"tag":18,"props":67,"children":69},{"className":68},[],[70],{"type":23,"value":4},{"type":23,"value":72},"[] is an array of integers.\nBits are mapped to samples in a manner where bit B of mask M\n(",{"type":12,"tag":18,"props":74,"children":76},{"className":75},[],[77],{"type":23,"value":78},"SampleMask[M]",{"type":23,"value":80},") corresponds to sample 32 × M + B.",{"type":12,"tag":25,"props":82,"children":83},{},[84,85,91,92,97,99,104,106,111,113,119],{"type":23,"value":50},{"type":12,"tag":18,"props":86,"children":88},{"className":87},[],[89],{"type":23,"value":90},"Output",{"type":23,"value":58},{"type":12,"tag":18,"props":93,"children":95},{"className":94},[],[96],{"type":23,"value":4},{"type":23,"value":98},"\nis an array of integers forming a bit array in a manner similar to an input\nvariable decorated with ",{"type":12,"tag":18,"props":100,"children":102},{"className":101},[],[103],{"type":23,"value":4},{"type":23,"value":105},", but where each bit represents\ncoverage as computed by the shader.\nThis computed ",{"type":12,"tag":18,"props":107,"children":109},{"className":108},[],[110],{"type":23,"value":4},{"type":23,"value":112}," is combined with the generated coverage mask\nin the ",{"type":12,"tag":38,"props":114,"children":116},{"href":115},"/chapters/fragops#fragops-covg",[117],{"type":23,"value":118},"multisample coverage",{"type":23,"value":120}," operation.",{"type":12,"tag":25,"props":122,"children":123},{},[124,126,131,133,138],{"type":23,"value":125},"Variables decorated with ",{"type":12,"tag":18,"props":127,"children":129},{"className":128},[],[130],{"type":23,"value":4},{"type":23,"value":132}," ",{"type":12,"tag":134,"props":135,"children":137},"normative",{"type":136},"must",[],{"type":23,"value":139}," be either an unsized array,\nor explicitly sized to be no larger than the implementation-dependent\nmaximum sample-mask (as an array of 32-bit elements), determined by the\nmaximum number of samples.",{"type":12,"tag":25,"props":141,"children":142},{},[143,145,150,152,157],{"type":23,"value":144},"If a fragment shader entry point’s interface includes an output variable\ndecorated with ",{"type":12,"tag":18,"props":146,"children":148},{"className":147},[],[149],{"type":23,"value":4},{"type":23,"value":151},", the sample mask will be undefined: for any\narray elements of any fragment shader invocations that fail to assign a\nvalue.\nIf a fragment shader entry point’s interface does not include an output\nvariable decorated with ",{"type":12,"tag":18,"props":153,"children":155},{"className":154},[],[156],{"type":23,"value":4},{"type":23,"value":158},", the sample mask has no effect on\nthe processing of a fragment.",{"type":12,"tag":160,"props":161,"children":163},"validity-group",{"name":162},"Valid Usage",[164,206,252],{"type":12,"tag":165,"props":166,"children":168},"validity-field",{"name":167},"VUID-SampleMask-SampleMask-04357",[169],{"type":12,"tag":25,"props":170,"children":171},{},[172,174,179,181,184,186,192,193,199,200],{"type":23,"value":173},"The ",{"type":12,"tag":18,"props":175,"children":177},{"className":176},[],[178],{"type":23,"value":4},{"type":23,"value":180}," decoration ",{"type":12,"tag":134,"props":182,"children":183},{"type":136},[],{"type":23,"value":185}," be used only within the\n",{"type":12,"tag":18,"props":187,"children":189},{"className":188},[],[190],{"type":23,"value":191},"Fragment",{"type":23,"value":132},{"type":12,"tag":18,"props":194,"children":196},{"className":195},[],[197],{"type":23,"value":198},"Execution",{"type":23,"value":132},{"type":12,"tag":18,"props":201,"children":203},{"className":202},[],[204],{"type":23,"value":205},"Model",{"type":12,"tag":165,"props":207,"children":209},{"name":208},"VUID-SampleMask-SampleMask-04358",[210],{"type":12,"tag":25,"props":211,"children":212},{},[213,215,220,221,224,226,231,233,238,239,245,246],{"type":23,"value":214},"The variable decorated with ",{"type":12,"tag":18,"props":216,"children":218},{"className":217},[],[219],{"type":23,"value":4},{"type":23,"value":132},{"type":12,"tag":134,"props":222,"children":223},{"type":136},[],{"type":23,"value":225}," be declared using the\n",{"type":12,"tag":18,"props":227,"children":229},{"className":228},[],[230],{"type":23,"value":56},{"type":23,"value":232}," or ",{"type":12,"tag":18,"props":234,"children":236},{"className":235},[],[237],{"type":23,"value":90},{"type":23,"value":132},{"type":12,"tag":18,"props":240,"children":242},{"className":241},[],[243],{"type":23,"value":244},"Storage",{"type":23,"value":132},{"type":12,"tag":18,"props":247,"children":249},{"className":248},[],[250],{"type":23,"value":251},"Class",{"type":12,"tag":165,"props":253,"children":255},{"name":254},"VUID-SampleMask-SampleMask-04359",[256],{"type":12,"tag":25,"props":257,"children":258},{},[259,260,265,266,269],{"type":23,"value":214},{"type":12,"tag":18,"props":261,"children":263},{"className":262},[],[264],{"type":23,"value":4},{"type":23,"value":132},{"type":12,"tag":134,"props":267,"children":268},{"type":136},[],{"type":23,"value":270}," be declared as an\narray of 32-bit integer values",{"title":272,"searchDepth":273,"depth":273,"links":274},"",2,[],"markdown",1725732533738]