[{"data":1,"prerenderedAt":568},["ShallowReactive",2],{"Z0RNNDTKz7":3},{"title":4,"description":5,"parent":6,"type":7,"xrefs":8,"body":9,"_type":567,"_id":4},"vkDestroyDevice","Destroy a logical device","VK_VERSION_1_0","protos",[],{"type":10,"children":11,"toc":565},"root",[12,20,235,270,306,330,429,511,559],{"type":13,"tag":14,"props":15,"children":16},"element","p",{},[17],{"type":18,"value":19},"text","To destroy a device, call:",{"type":13,"tag":21,"props":22,"children":23},"code-group",{},[24,110],{"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","void vkDestroyDevice(\n VkDevice device,\n const VkAllocationCallbacks* pAllocator);\n","C","c","",[33],{"type":13,"tag":34,"props":35,"children":36},"code",{"__ignoreMap":31},[37,61,81],{"type":13,"tag":38,"props":39,"children":42},"span",{"class":40,"line":41},"line",1,[43,49,55],{"type":13,"tag":38,"props":44,"children":46},{"style":45},"--shiki-default:#CF222E;--shiki-dark:#FF7B72",[47],{"type":18,"value":48},"void",{"type":13,"tag":38,"props":50,"children":52},{"style":51},"--shiki-default:#8250DF;--shiki-dark:#D2A8FF",[53],{"type":18,"value":54}," vkDestroyDevice",{"type":13,"tag":38,"props":56,"children":58},{"style":57},"--shiki-default:#1F2328;--shiki-dark:#E6EDF3",[59],{"type":18,"value":60},"(\n",{"type":13,"tag":38,"props":62,"children":64},{"class":40,"line":63},2,[65,70,76],{"type":13,"tag":38,"props":66,"children":67},{"style":57},[68],{"type":18,"value":69}," VkDevice ",{"type":13,"tag":38,"props":71,"children":73},{"style":72},"--shiki-default:#953800;--shiki-dark:#FFA657",[74],{"type":18,"value":75},"device",{"type":13,"tag":38,"props":77,"children":78},{"style":57},[79],{"type":18,"value":80},",\n",{"type":13,"tag":38,"props":82,"children":84},{"class":40,"line":83},3,[85,90,95,100,105],{"type":13,"tag":38,"props":86,"children":87},{"style":45},[88],{"type":18,"value":89}," const",{"type":13,"tag":38,"props":91,"children":92},{"style":57},[93],{"type":18,"value":94}," VkAllocationCallbacks",{"type":13,"tag":38,"props":96,"children":97},{"style":45},[98],{"type":18,"value":99},"*",{"type":13,"tag":38,"props":101,"children":102},{"style":72},[103],{"type":18,"value":104}," pAllocator",{"type":13,"tag":38,"props":106,"children":107},{"style":57},[108],{"type":18,"value":109},");\n",{"type":13,"tag":25,"props":111,"children":116},{"className":112,"code":113,"filename":114,"language":115,"meta":31,"style":31},"language-rs shiki shiki-themes github-light-default github-dark-default","pub fn destroy_device(\n device: crate :: vk :: vk::Device,\n p_allocator: *const vk::AllocationCallbacks,\n);\n","Rust","rs",[117],{"type":13,"tag":34,"props":118,"children":119},{"__ignoreMap":31},[120,142,193,227],{"type":13,"tag":38,"props":121,"children":122},{"class":40,"line":41},[123,128,133,138],{"type":13,"tag":38,"props":124,"children":125},{"style":45},[126],{"type":18,"value":127},"pub",{"type":13,"tag":38,"props":129,"children":130},{"style":45},[131],{"type":18,"value":132}," fn",{"type":13,"tag":38,"props":134,"children":135},{"style":51},[136],{"type":18,"value":137}," destroy_device",{"type":13,"tag":38,"props":139,"children":140},{"style":57},[141],{"type":18,"value":60},{"type":13,"tag":38,"props":143,"children":144},{"class":40,"line":63},[145,150,155,160,165,170,175,180,184,189],{"type":13,"tag":38,"props":146,"children":147},{"style":57},[148],{"type":18,"value":149}," device",{"type":13,"tag":38,"props":151,"children":152},{"style":45},[153],{"type":18,"value":154},":",{"type":13,"tag":38,"props":156,"children":157},{"style":45},[158],{"type":18,"value":159}," crate",{"type":13,"tag":38,"props":161,"children":162},{"style":45},[163],{"type":18,"value":164}," ::",{"type":13,"tag":38,"props":166,"children":167},{"style":57},[168],{"type":18,"value":169}," vk ",{"type":13,"tag":38,"props":171,"children":172},{"style":45},[173],{"type":18,"value":174},"::",{"type":13,"tag":38,"props":176,"children":177},{"style":72},[178],{"type":18,"value":179}," vk",{"type":13,"tag":38,"props":181,"children":182},{"style":45},[183],{"type":18,"value":174},{"type":13,"tag":38,"props":185,"children":186},{"style":72},[187],{"type":18,"value":188},"Device",{"type":13,"tag":38,"props":190,"children":191},{"style":57},[192],{"type":18,"value":80},{"type":13,"tag":38,"props":194,"children":195},{"class":40,"line":83},[196,201,205,210,214,218,223],{"type":13,"tag":38,"props":197,"children":198},{"style":57},[199],{"type":18,"value":200}," p_allocator",{"type":13,"tag":38,"props":202,"children":203},{"style":45},[204],{"type":18,"value":154},{"type":13,"tag":38,"props":206,"children":207},{"style":45},[208],{"type":18,"value":209}," *const",{"type":13,"tag":38,"props":211,"children":212},{"style":72},[213],{"type":18,"value":179},{"type":13,"tag":38,"props":215,"children":216},{"style":45},[217],{"type":18,"value":174},{"type":13,"tag":38,"props":219,"children":220},{"style":72},[221],{"type":18,"value":222},"AllocationCallbacks",{"type":13,"tag":38,"props":224,"children":225},{"style":57},[226],{"type":18,"value":80},{"type":13,"tag":38,"props":228,"children":230},{"class":40,"line":229},4,[231],{"type":13,"tag":38,"props":232,"children":233},{"style":57},[234],{"type":18,"value":109},{"type":13,"tag":236,"props":237,"children":238},"ul",{},[239,250],{"type":13,"tag":240,"props":241,"children":242},"li",{},[243,248],{"type":13,"tag":34,"props":244,"children":246},{"className":245},[],[247],{"type":18,"value":75},{"type":18,"value":249}," is the logical device to destroy.",{"type":13,"tag":240,"props":251,"children":252},{},[253,259,261,268],{"type":13,"tag":34,"props":254,"children":256},{"className":255},[],[257],{"type":18,"value":258},"pAllocator",{"type":18,"value":260}," controls host memory allocation as described in the\n",{"type":13,"tag":262,"props":263,"children":265},"a",{"href":264},"/chapters/memory#memory-allocation",[266],{"type":18,"value":267},"Memory Allocation",{"type":18,"value":269}," chapter.",{"type":13,"tag":14,"props":271,"children":272},{},[273,275,281,283,288,290,296,298,304],{"type":18,"value":274},"To ensure that no work is active on the device, ",{"type":13,"tag":262,"props":276,"children":278},{"href":277},"/man/vkDeviceWaitIdle",[279],{"type":18,"value":280},"vkDeviceWaitIdle",{"type":18,"value":282}," ",{"type":13,"tag":284,"props":285,"children":287},"normative",{"type":286},"can",[],{"type":18,"value":289},"\nbe used to gate the destruction of the device.\nPrior to destroying a device, an application is responsible for\ndestroying/freeing any Vulkan objects that were created using that device as\nthe first parameter of the corresponding ",{"type":13,"tag":34,"props":291,"children":293},{"className":292},[],[294],{"type":18,"value":295},"vkCreate*",{"type":18,"value":297}," or\n",{"type":13,"tag":34,"props":299,"children":301},{"className":300},[],[302],{"type":18,"value":303},"vkAllocate*",{"type":18,"value":305}," command.",{"type":13,"tag":307,"props":308,"children":309},"note",{},[310],{"type":13,"tag":14,"props":311,"children":312},{},[313,315,321,323,328],{"type":18,"value":314},"The lifetime of each of these objects is bound by the lifetime of the\n",{"type":13,"tag":34,"props":316,"children":318},{"className":317},[],[319],{"type":18,"value":320},"VkDevice",{"type":18,"value":322}," object.\nTherefore, to avoid resource leaks, it is critical that an application\nexplicitly free all of these resources prior to calling\n",{"type":13,"tag":34,"props":324,"children":326},{"className":325},[],[327],{"type":18,"value":4},{"type":18,"value":329},".",{"type":13,"tag":331,"props":332,"children":334},"validity-group",{"name":333},"Valid Usage",[335,361,390],{"type":13,"tag":336,"props":337,"children":339},"validity-field",{"name":338},"VUID-vkDestroyDevice-device-05137",[340],{"type":13,"tag":14,"props":341,"children":342},{},[343,345,350,354,356],{"type":18,"value":344},"All child objects created on ",{"type":13,"tag":34,"props":346,"children":348},{"className":347},[],[349],{"type":18,"value":75},{"type":13,"tag":284,"props":351,"children":353},{"type":352},"must",[],{"type":18,"value":355}," have been destroyed prior to destroying ",{"type":13,"tag":34,"props":357,"children":359},{"className":358},[],[360],{"type":18,"value":75},{"type":13,"tag":336,"props":362,"children":364},{"name":363},"VUID-vkDestroyDevice-device-00379",[365],{"type":13,"tag":14,"props":366,"children":367},{},[368,370,376,378,383,385,388],{"type":18,"value":369},"If ",{"type":13,"tag":34,"props":371,"children":373},{"className":372},[],[374],{"type":18,"value":375},"VkAllocationCallbacks",{"type":18,"value":377}," were provided when ",{"type":13,"tag":34,"props":379,"children":381},{"className":380},[],[382],{"type":18,"value":75},{"type":18,"value":384}," was\ncreated, a compatible set of callbacks ",{"type":13,"tag":284,"props":386,"children":387},{"type":352},[],{"type":18,"value":389}," be provided here",{"type":13,"tag":336,"props":391,"children":393},{"name":392},"VUID-vkDestroyDevice-device-00380",[394],{"type":13,"tag":14,"props":395,"children":396},{},[397,399,404,405,410,412,417,418,421,423],{"type":18,"value":398},"If no ",{"type":13,"tag":34,"props":400,"children":402},{"className":401},[],[403],{"type":18,"value":375},{"type":18,"value":377},{"type":13,"tag":34,"props":406,"children":408},{"className":407},[],[409],{"type":18,"value":75},{"type":18,"value":411}," was\ncreated, ",{"type":13,"tag":34,"props":413,"children":415},{"className":414},[],[416],{"type":18,"value":258},{"type":18,"value":282},{"type":13,"tag":284,"props":419,"children":420},{"type":352},[],{"type":18,"value":422}," be ",{"type":13,"tag":34,"props":424,"children":426},{"className":425},[],[427],{"type":18,"value":428},"NULL",{"type":13,"tag":331,"props":430,"children":432},{"name":431},"Valid Usage (Implicit)",[433,473],{"type":13,"tag":336,"props":434,"children":436},{"name":435},"VUID-vkDestroyDevice-device-parameter",[437],{"type":13,"tag":14,"props":438,"children":439},{},[440,441,446,448,453,455,460,461,464,466,471],{"type":18,"value":369},{"type":13,"tag":34,"props":442,"children":444},{"className":443},[],[445],{"type":18,"value":75},{"type":18,"value":447}," is not ",{"type":13,"tag":34,"props":449,"children":451},{"className":450},[],[452],{"type":18,"value":428},{"type":18,"value":454},", ",{"type":13,"tag":34,"props":456,"children":458},{"className":457},[],[459],{"type":18,"value":75},{"type":18,"value":282},{"type":13,"tag":284,"props":462,"children":463},{"type":352},[],{"type":18,"value":465}," be a valid ",{"type":13,"tag":262,"props":467,"children":469},{"href":468},"/man/VkDevice",[470],{"type":18,"value":320},{"type":18,"value":472}," handle",{"type":13,"tag":336,"props":474,"children":476},{"name":475},"VUID-vkDestroyDevice-pAllocator-parameter",[477],{"type":13,"tag":14,"props":478,"children":479},{},[480,481,486,487,492,493,498,499,502,504,509],{"type":18,"value":369},{"type":13,"tag":34,"props":482,"children":484},{"className":483},[],[485],{"type":18,"value":258},{"type":18,"value":447},{"type":13,"tag":34,"props":488,"children":490},{"className":489},[],[491],{"type":18,"value":428},{"type":18,"value":454},{"type":13,"tag":34,"props":494,"children":496},{"className":495},[],[497],{"type":18,"value":258},{"type":18,"value":282},{"type":13,"tag":284,"props":500,"children":501},{"type":352},[],{"type":18,"value":503}," be a valid pointer to a valid ",{"type":13,"tag":262,"props":505,"children":507},{"href":506},"/man/VkAllocationCallbacks",[508],{"type":18,"value":375},{"type":18,"value":510}," structure",{"type":13,"tag":512,"props":513,"children":515},"validity-box",{"name":514},"Host Synchronization",[516],{"type":13,"tag":236,"props":517,"children":518},{},[519,535],{"type":13,"tag":240,"props":520,"children":521},{},[522,524,529,530,533],{"type":18,"value":523},"Host access to ",{"type":13,"tag":34,"props":525,"children":527},{"className":526},[],[528],{"type":18,"value":75},{"type":18,"value":282},{"type":13,"tag":284,"props":531,"children":532},{"type":352},[],{"type":18,"value":534}," be externally synchronized",{"type":13,"tag":240,"props":536,"children":537},{},[538,540,546,548,553,554,557],{"type":18,"value":539},"Host access to all ",{"type":13,"tag":34,"props":541,"children":543},{"className":542},[],[544],{"type":18,"value":545},"VkQueue",{"type":18,"value":547}," objects created from ",{"type":13,"tag":34,"props":549,"children":551},{"className":550},[],[552],{"type":18,"value":75},{"type":18,"value":282},{"type":13,"tag":284,"props":555,"children":556},{"type":352},[],{"type":18,"value":558}," be externally synchronized\n::",{"type":13,"tag":560,"props":561,"children":562},"style",{},[563],{"type":18,"value":564},"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":63,"depth":63,"links":566},[],"markdown",1725732615086]