[{"data":1,"prerenderedAt":513},["ShallowReactive",2],{"c9DA7U7hME":3},{"title":4,"description":5,"parent":6,"type":7,"xrefs":8,"body":9,"_type":512,"_id":4},"vkGetSemaphoreFdKHR","Get a POSIX file descriptor handle for a semaphore","VK_KHR_external_semaphore_fd","protos",[],{"type":10,"children":11,"toc":510},"root",[12,20,298,344,368,385,403,422,504],{"type":13,"tag":14,"props":15,"children":16},"element","p",{},[17],{"type":18,"value":19},"text","To export a POSIX file descriptor representing the payload of a semaphore,\ncall:",{"type":13,"tag":21,"props":22,"children":23},"code-group",{},[24,127],{"type":13,"tag":25,"props":26,"children":32},"pre",{"className":27,"code":28,"filename":29,"language":30,"meta":31,"style":31},"language-c shiki shiki-themes github-light-default github-dark-default","VkResult vkGetSemaphoreFdKHR(\n VkDevice device,\n const VkSemaphoreGetFdInfoKHR* pGetFdInfo,\n int* pFd);\n","C","c","",[33],{"type":13,"tag":34,"props":35,"children":36},"code",{"__ignoreMap":31},[37,59,79,108],{"type":13,"tag":38,"props":39,"children":42},"span",{"class":40,"line":41},"line",1,[43,49,54],{"type":13,"tag":38,"props":44,"children":46},{"style":45},"--shiki-default:#1F2328;--shiki-dark:#E6EDF3",[47],{"type":18,"value":48},"VkResult ",{"type":13,"tag":38,"props":50,"children":52},{"style":51},"--shiki-default:#8250DF;--shiki-dark:#D2A8FF",[53],{"type":18,"value":4},{"type":13,"tag":38,"props":55,"children":56},{"style":45},[57],{"type":18,"value":58},"(\n",{"type":13,"tag":38,"props":60,"children":62},{"class":40,"line":61},2,[63,68,74],{"type":13,"tag":38,"props":64,"children":65},{"style":45},[66],{"type":18,"value":67}," VkDevice ",{"type":13,"tag":38,"props":69,"children":71},{"style":70},"--shiki-default:#953800;--shiki-dark:#FFA657",[72],{"type":18,"value":73},"device",{"type":13,"tag":38,"props":75,"children":76},{"style":45},[77],{"type":18,"value":78},",\n",{"type":13,"tag":38,"props":80,"children":82},{"class":40,"line":81},3,[83,89,94,99,104],{"type":13,"tag":38,"props":84,"children":86},{"style":85},"--shiki-default:#CF222E;--shiki-dark:#FF7B72",[87],{"type":18,"value":88}," const",{"type":13,"tag":38,"props":90,"children":91},{"style":45},[92],{"type":18,"value":93}," VkSemaphoreGetFdInfoKHR",{"type":13,"tag":38,"props":95,"children":96},{"style":85},[97],{"type":18,"value":98},"*",{"type":13,"tag":38,"props":100,"children":101},{"style":70},[102],{"type":18,"value":103}," pGetFdInfo",{"type":13,"tag":38,"props":105,"children":106},{"style":45},[107],{"type":18,"value":78},{"type":13,"tag":38,"props":109,"children":111},{"class":40,"line":110},4,[112,117,122],{"type":13,"tag":38,"props":113,"children":114},{"style":85},[115],{"type":18,"value":116}," int*",{"type":13,"tag":38,"props":118,"children":119},{"style":70},[120],{"type":18,"value":121}," pFd",{"type":13,"tag":38,"props":123,"children":124},{"style":45},[125],{"type":18,"value":126},");\n",{"type":13,"tag":25,"props":128,"children":133},{"className":129,"code":130,"filename":131,"language":132,"meta":31,"style":31},"language-rs shiki shiki-themes github-light-default github-dark-default","pub fn get_semaphore_fd_khr(\n device: crate :: vk :: vk::Device,\n p_get_fd_info: *const vk::SemaphoreGetFdInfoKHR,\n p_fd: *mut c_int,\n) -> vk::Result;\n","Rust","rs",[134],{"type":13,"tag":34,"props":135,"children":136},{"__ignoreMap":31},[137,159,210,244,266],{"type":13,"tag":38,"props":138,"children":139},{"class":40,"line":41},[140,145,150,155],{"type":13,"tag":38,"props":141,"children":142},{"style":85},[143],{"type":18,"value":144},"pub",{"type":13,"tag":38,"props":146,"children":147},{"style":85},[148],{"type":18,"value":149}," fn",{"type":13,"tag":38,"props":151,"children":152},{"style":51},[153],{"type":18,"value":154}," get_semaphore_fd_khr",{"type":13,"tag":38,"props":156,"children":157},{"style":45},[158],{"type":18,"value":58},{"type":13,"tag":38,"props":160,"children":161},{"class":40,"line":61},[162,167,172,177,182,187,192,197,201,206],{"type":13,"tag":38,"props":163,"children":164},{"style":45},[165],{"type":18,"value":166}," device",{"type":13,"tag":38,"props":168,"children":169},{"style":85},[170],{"type":18,"value":171},":",{"type":13,"tag":38,"props":173,"children":174},{"style":85},[175],{"type":18,"value":176}," crate",{"type":13,"tag":38,"props":178,"children":179},{"style":85},[180],{"type":18,"value":181}," ::",{"type":13,"tag":38,"props":183,"children":184},{"style":45},[185],{"type":18,"value":186}," vk ",{"type":13,"tag":38,"props":188,"children":189},{"style":85},[190],{"type":18,"value":191},"::",{"type":13,"tag":38,"props":193,"children":194},{"style":70},[195],{"type":18,"value":196}," vk",{"type":13,"tag":38,"props":198,"children":199},{"style":85},[200],{"type":18,"value":191},{"type":13,"tag":38,"props":202,"children":203},{"style":70},[204],{"type":18,"value":205},"Device",{"type":13,"tag":38,"props":207,"children":208},{"style":45},[209],{"type":18,"value":78},{"type":13,"tag":38,"props":211,"children":212},{"class":40,"line":81},[213,218,222,227,231,235,240],{"type":13,"tag":38,"props":214,"children":215},{"style":45},[216],{"type":18,"value":217}," p_get_fd_info",{"type":13,"tag":38,"props":219,"children":220},{"style":85},[221],{"type":18,"value":171},{"type":13,"tag":38,"props":223,"children":224},{"style":85},[225],{"type":18,"value":226}," *const",{"type":13,"tag":38,"props":228,"children":229},{"style":70},[230],{"type":18,"value":196},{"type":13,"tag":38,"props":232,"children":233},{"style":85},[234],{"type":18,"value":191},{"type":13,"tag":38,"props":236,"children":237},{"style":70},[238],{"type":18,"value":239},"SemaphoreGetFdInfoKHR",{"type":13,"tag":38,"props":241,"children":242},{"style":45},[243],{"type":18,"value":78},{"type":13,"tag":38,"props":245,"children":246},{"class":40,"line":110},[247,252,256,261],{"type":13,"tag":38,"props":248,"children":249},{"style":45},[250],{"type":18,"value":251}," p_fd",{"type":13,"tag":38,"props":253,"children":254},{"style":85},[255],{"type":18,"value":171},{"type":13,"tag":38,"props":257,"children":258},{"style":85},[259],{"type":18,"value":260}," *mut",{"type":13,"tag":38,"props":262,"children":263},{"style":45},[264],{"type":18,"value":265}," c_int,\n",{"type":13,"tag":38,"props":267,"children":269},{"class":40,"line":268},5,[270,275,280,284,288,293],{"type":13,"tag":38,"props":271,"children":272},{"style":45},[273],{"type":18,"value":274},") ",{"type":13,"tag":38,"props":276,"children":277},{"style":85},[278],{"type":18,"value":279},"->",{"type":13,"tag":38,"props":281,"children":282},{"style":70},[283],{"type":18,"value":196},{"type":13,"tag":38,"props":285,"children":286},{"style":85},[287],{"type":18,"value":191},{"type":13,"tag":38,"props":289,"children":290},{"style":70},[291],{"type":18,"value":292},"Result",{"type":13,"tag":38,"props":294,"children":295},{"style":45},[296],{"type":18,"value":297},";\n",{"type":13,"tag":299,"props":300,"children":301},"ul",{},[302,313,333],{"type":13,"tag":303,"props":304,"children":305},"li",{},[306,311],{"type":13,"tag":34,"props":307,"children":309},{"className":308},[],[310],{"type":18,"value":73},{"type":18,"value":312}," is the logical device that created the semaphore being\nexported.",{"type":13,"tag":303,"props":314,"children":315},{},[316,322,324,331],{"type":13,"tag":34,"props":317,"children":319},{"className":318},[],[320],{"type":18,"value":321},"pGetFdInfo",{"type":18,"value":323}," is a pointer to a ",{"type":13,"tag":325,"props":326,"children":328},"a",{"href":327},"/man/VkSemaphoreGetFdInfoKHR",[329],{"type":18,"value":330},"VkSemaphoreGetFdInfoKHR",{"type":18,"value":332},"\nstructure containing parameters of the export operation.",{"type":13,"tag":303,"props":334,"children":335},{},[336,342],{"type":13,"tag":34,"props":337,"children":339},{"className":338},[],[340],{"type":18,"value":341},"pFd",{"type":18,"value":343}," will return the file descriptor representing the semaphore\npayload.",{"type":13,"tag":14,"props":345,"children":346},{},[347,349,354,356,361,363,366],{"type":18,"value":348},"Each call to ",{"type":13,"tag":34,"props":350,"children":352},{"className":351},[],[353],{"type":18,"value":4},{"type":18,"value":355}," ",{"type":13,"tag":357,"props":358,"children":360},"normative",{"type":359},"must",[],{"type":18,"value":362}," create a new file descriptor\nand transfer ownership of it to the application.\nTo avoid leaking resources, the application ",{"type":13,"tag":357,"props":364,"children":365},{"type":359},[],{"type":18,"value":367}," release ownership of the\nfile descriptor when it is no longer needed.",{"type":13,"tag":369,"props":370,"children":371},"note",{},[372],{"type":13,"tag":14,"props":373,"children":374},{},[375,377,383],{"type":18,"value":376},"Ownership can be released in many ways.\nFor example, the application can call ",{"type":13,"tag":34,"props":378,"children":380},{"className":379},[],[381],{"type":18,"value":382},"close",{"type":18,"value":384},"() on the file descriptor,\nor transfer ownership back to Vulkan by using the file descriptor to import\na semaphore payload.",{"type":13,"tag":14,"props":386,"children":387},{},[388,390,393,395,401],{"type":18,"value":389},"Where supported by the operating system, the implementation ",{"type":13,"tag":357,"props":391,"children":392},{"type":359},[],{"type":18,"value":394}," set the\nfile descriptor to be closed automatically when an ",{"type":13,"tag":34,"props":396,"children":398},{"className":397},[],[399],{"type":18,"value":400},"execve",{"type":18,"value":402}," system call\nis made.",{"type":13,"tag":14,"props":404,"children":405},{},[406,408,412,414,420],{"type":18,"value":407},"Exporting a file descriptor from a semaphore ",{"type":13,"tag":357,"props":409,"children":411},{"type":410},"may",[],{"type":18,"value":413}," have side effects\ndepending on the transference of the specified handle type, as described in\n",{"type":13,"tag":325,"props":415,"children":417},{"href":416},"/chapters/synchronization#synchronization-semaphores-importing",[418],{"type":18,"value":419},"Importing Semaphore State",{"type":18,"value":421},".",{"type":13,"tag":423,"props":424,"children":426},"validity-group",{"name":425},"Valid Usage (Implicit)",[427,454,478],{"type":13,"tag":428,"props":429,"children":431},"validity-field",{"name":430},"VUID-vkGetSemaphoreFdKHR-device-parameter",[432],{"type":13,"tag":14,"props":433,"children":434},{},[435,440,441,444,446,452],{"type":13,"tag":34,"props":436,"children":438},{"className":437},[],[439],{"type":18,"value":73},{"type":18,"value":355},{"type":13,"tag":357,"props":442,"children":443},{"type":359},[],{"type":18,"value":445}," be a valid ",{"type":13,"tag":325,"props":447,"children":449},{"href":448},"/man/VkDevice",[450],{"type":18,"value":451},"VkDevice",{"type":18,"value":453}," handle",{"type":13,"tag":428,"props":455,"children":457},{"name":456},"VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter",[458],{"type":13,"tag":14,"props":459,"children":460},{},[461,466,467,470,472,476],{"type":13,"tag":34,"props":462,"children":464},{"className":463},[],[465],{"type":18,"value":321},{"type":18,"value":355},{"type":13,"tag":357,"props":468,"children":469},{"type":359},[],{"type":18,"value":471}," be a valid pointer to a valid ",{"type":13,"tag":325,"props":473,"children":474},{"href":327},[475],{"type":18,"value":330},{"type":18,"value":477}," structure",{"type":13,"tag":428,"props":479,"children":481},{"name":480},"VUID-vkGetSemaphoreFdKHR-pFd-parameter",[482],{"type":13,"tag":14,"props":483,"children":484},{},[485,490,491,494,496,502],{"type":13,"tag":34,"props":486,"children":488},{"className":487},[],[489],{"type":18,"value":341},{"type":18,"value":355},{"type":13,"tag":357,"props":492,"children":493},{"type":359},[],{"type":18,"value":495}," be a valid pointer to an ",{"type":13,"tag":34,"props":497,"children":499},{"className":498},[],[500],{"type":18,"value":501},"int",{"type":18,"value":503}," value",{"type":13,"tag":505,"props":506,"children":507},"style",{},[508],{"type":18,"value":509},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":31,"searchDepth":61,"depth":61,"links":511},[],"markdown",1729612518854]