[{"data":1,"prerenderedAt":806},["ShallowReactive",2],{"Ql0aTpTbrv":3},{"title":4,"description":5,"parent":6,"type":7,"xrefs":8,"body":9,"_type":805,"_id":4},"VkImportMemoryHostPointerInfoEXT","Import memory from a host pointer","VK_EXT_external_memory_host","structs",[],{"type":10,"children":11,"toc":803},"root",[12,52,289,360,380,396,419,429,434,502,511,727,797],{"type":13,"tag":14,"props":15,"children":16},"element","p",{},[17,20,26,28,35,37,43,45,50],{"type":18,"value":19},"text","To import memory from a host pointer, add a\n",{"type":13,"tag":21,"props":22,"children":24},"a",{"href":23},"/man/VkImportMemoryHostPointerInfoEXT",[25],{"type":18,"value":4},{"type":18,"value":27}," structure to the ",{"type":13,"tag":29,"props":30,"children":32},"code",{"className":31},[],[33],{"type":18,"value":34},"pNext",{"type":18,"value":36}," chain of\nthe ",{"type":13,"tag":21,"props":38,"children":40},{"href":39},"/man/VkMemoryAllocateInfo",[41],{"type":18,"value":42},"VkMemoryAllocateInfo",{"type":18,"value":44}," structure.\nThe ",{"type":13,"tag":29,"props":46,"children":48},{"className":47},[],[49],{"type":18,"value":4},{"type":18,"value":51}," structure is defined as:",{"type":13,"tag":53,"props":54,"children":55},"code-group",{},[56,151],{"type":13,"tag":57,"props":58,"children":64},"pre",{"className":59,"code":60,"filename":61,"language":62,"meta":63,"style":63},"language-c shiki shiki-themes github-light-default github-dark-default","typedef struct VkImportMemoryHostPointerInfoEXT {\n VkStructureType sType;\n const void* pNext;\n VkExternalMemoryHandleTypeFlagBits handleType;\n void* pHostPointer;\n} VkImportMemoryHostPointerInfoEXT;\n","C","c","",[65],{"type":13,"tag":29,"props":66,"children":67},{"__ignoreMap":63},[68,91,100,119,128,142],{"type":13,"tag":69,"props":70,"children":73},"span",{"class":71,"line":72},"line",1,[74,80,85],{"type":13,"tag":69,"props":75,"children":77},{"style":76},"--shiki-default:#CF222E;--shiki-dark:#FF7B72",[78],{"type":18,"value":79},"typedef",{"type":13,"tag":69,"props":81,"children":82},{"style":76},[83],{"type":18,"value":84}," struct",{"type":13,"tag":69,"props":86,"children":88},{"style":87},"--shiki-default:#1F2328;--shiki-dark:#E6EDF3",[89],{"type":18,"value":90}," VkImportMemoryHostPointerInfoEXT {\n",{"type":13,"tag":69,"props":92,"children":94},{"class":71,"line":93},2,[95],{"type":13,"tag":69,"props":96,"children":97},{"style":87},[98],{"type":18,"value":99}," VkStructureType sType;\n",{"type":13,"tag":69,"props":101,"children":103},{"class":71,"line":102},3,[104,109,114],{"type":13,"tag":69,"props":105,"children":106},{"style":76},[107],{"type":18,"value":108}," const",{"type":13,"tag":69,"props":110,"children":111},{"style":76},[112],{"type":18,"value":113}," void*",{"type":13,"tag":69,"props":115,"children":116},{"style":87},[117],{"type":18,"value":118}," pNext;\n",{"type":13,"tag":69,"props":120,"children":122},{"class":71,"line":121},4,[123],{"type":13,"tag":69,"props":124,"children":125},{"style":87},[126],{"type":18,"value":127}," VkExternalMemoryHandleTypeFlagBits handleType;\n",{"type":13,"tag":69,"props":129,"children":131},{"class":71,"line":130},5,[132,137],{"type":13,"tag":69,"props":133,"children":134},{"style":76},[135],{"type":18,"value":136}," void*",{"type":13,"tag":69,"props":138,"children":139},{"style":87},[140],{"type":18,"value":141}," pHostPointer;\n",{"type":13,"tag":69,"props":143,"children":145},{"class":71,"line":144},6,[146],{"type":13,"tag":69,"props":147,"children":148},{"style":87},[149],{"type":18,"value":150},"} VkImportMemoryHostPointerInfoEXT;\n",{"type":13,"tag":57,"props":152,"children":157},{"className":153,"code":154,"filename":155,"language":156,"meta":63,"style":63},"language-rs shiki shiki-themes github-light-default github-dark-default","pub struct ImportMemoryHostPointerInfoEXT {\n s_type: vk::StructureType,\n p_next: *const c_void,\n handle_type: ExternalMemoryHandleTypeFlags,\n p_host_pointer: *mut c_void,\n}\n","Rust","rs",[158],{"type":13,"tag":29,"props":159,"children":160},{"__ignoreMap":63},[161,184,217,239,260,281],{"type":13,"tag":69,"props":162,"children":163},{"class":71,"line":72},[164,169,173,179],{"type":13,"tag":69,"props":165,"children":166},{"style":76},[167],{"type":18,"value":168},"pub",{"type":13,"tag":69,"props":170,"children":171},{"style":76},[172],{"type":18,"value":84},{"type":13,"tag":69,"props":174,"children":176},{"style":175},"--shiki-default:#953800;--shiki-dark:#FFA657",[177],{"type":18,"value":178}," ImportMemoryHostPointerInfoEXT",{"type":13,"tag":69,"props":180,"children":181},{"style":87},[182],{"type":18,"value":183}," {\n",{"type":13,"tag":69,"props":185,"children":186},{"class":71,"line":93},[187,192,197,202,207,212],{"type":13,"tag":69,"props":188,"children":189},{"style":87},[190],{"type":18,"value":191}," s_type",{"type":13,"tag":69,"props":193,"children":194},{"style":76},[195],{"type":18,"value":196},":",{"type":13,"tag":69,"props":198,"children":199},{"style":175},[200],{"type":18,"value":201}," vk",{"type":13,"tag":69,"props":203,"children":204},{"style":76},[205],{"type":18,"value":206},"::",{"type":13,"tag":69,"props":208,"children":209},{"style":175},[210],{"type":18,"value":211},"StructureType",{"type":13,"tag":69,"props":213,"children":214},{"style":87},[215],{"type":18,"value":216},",\n",{"type":13,"tag":69,"props":218,"children":219},{"class":71,"line":102},[220,225,229,234],{"type":13,"tag":69,"props":221,"children":222},{"style":87},[223],{"type":18,"value":224}," p_next",{"type":13,"tag":69,"props":226,"children":227},{"style":76},[228],{"type":18,"value":196},{"type":13,"tag":69,"props":230,"children":231},{"style":76},[232],{"type":18,"value":233}," *const",{"type":13,"tag":69,"props":235,"children":236},{"style":87},[237],{"type":18,"value":238}," c_void,\n",{"type":13,"tag":69,"props":240,"children":241},{"class":71,"line":121},[242,247,251,256],{"type":13,"tag":69,"props":243,"children":244},{"style":87},[245],{"type":18,"value":246}," handle_type",{"type":13,"tag":69,"props":248,"children":249},{"style":76},[250],{"type":18,"value":196},{"type":13,"tag":69,"props":252,"children":253},{"style":175},[254],{"type":18,"value":255}," ExternalMemoryHandleTypeFlags",{"type":13,"tag":69,"props":257,"children":258},{"style":87},[259],{"type":18,"value":216},{"type":13,"tag":69,"props":261,"children":262},{"class":71,"line":130},[263,268,272,277],{"type":13,"tag":69,"props":264,"children":265},{"style":87},[266],{"type":18,"value":267}," p_host_pointer",{"type":13,"tag":69,"props":269,"children":270},{"style":76},[271],{"type":18,"value":196},{"type":13,"tag":69,"props":273,"children":274},{"style":76},[275],{"type":18,"value":276}," *mut",{"type":13,"tag":69,"props":278,"children":279},{"style":87},[280],{"type":18,"value":238},{"type":13,"tag":69,"props":282,"children":283},{"class":71,"line":144},[284],{"type":13,"tag":69,"props":285,"children":286},{"style":87},[287],{"type":18,"value":288},"}\n",{"type":13,"tag":290,"props":291,"children":292},"ul",{},[293,313,331,349],{"type":13,"tag":294,"props":295,"children":296},"li",{},[297,303,305,311],{"type":13,"tag":29,"props":298,"children":300},{"className":299},[],[301],{"type":18,"value":302},"sType",{"type":18,"value":304}," is a ",{"type":13,"tag":21,"props":306,"children":308},{"href":307},"/man/VkStructureType",[309],{"type":18,"value":310},"VkStructureType",{"type":18,"value":312}," value identifying this structure.",{"type":13,"tag":294,"props":314,"children":315},{},[316,321,323,329],{"type":13,"tag":29,"props":317,"children":319},{"className":318},[],[320],{"type":18,"value":34},{"type":18,"value":322}," is ",{"type":13,"tag":29,"props":324,"children":326},{"className":325},[],[327],{"type":18,"value":328},"NULL",{"type":18,"value":330}," or a pointer to a structure extending this\nstructure.",{"type":13,"tag":294,"props":332,"children":333},{},[334,340,341,347],{"type":13,"tag":29,"props":335,"children":337},{"className":336},[],[338],{"type":18,"value":339},"handleType",{"type":18,"value":304},{"type":13,"tag":21,"props":342,"children":344},{"href":343},"/man/VkExternalMemoryHandleTypeFlagBits",[345],{"type":18,"value":346},"VkExternalMemoryHandleTypeFlagBits",{"type":18,"value":348}," value\nspecifying the handle type.",{"type":13,"tag":294,"props":350,"children":351},{},[352,358],{"type":13,"tag":29,"props":353,"children":355},{"className":354},[],[356],{"type":18,"value":357},"pHostPointer",{"type":18,"value":359}," is the host pointer to import from.",{"type":13,"tag":14,"props":361,"children":362},{},[363,365,370,372,378],{"type":18,"value":364},"Importing memory from a host pointer shares ownership of the memory between\nthe host and the Vulkan implementation.\nThe application ",{"type":13,"tag":366,"props":367,"children":369},"normative",{"type":368},"can",[],{"type":18,"value":371}," continue to access the memory through the host pointer\nbut it is the application’s responsibility to synchronize device and\nnon-device access to the payload as defined in\n",{"type":13,"tag":21,"props":373,"children":375},{"href":374},"/chapters/memory#memory-device-hostaccess",[376],{"type":18,"value":377},"Host Access to Device Memory Objects",{"type":18,"value":379},".",{"type":13,"tag":14,"props":381,"children":382},{},[383,385,388,390,394],{"type":18,"value":384},"Applications ",{"type":13,"tag":366,"props":386,"children":387},{"type":368},[],{"type":18,"value":389}," import the same payload into multiple instances of Vulkan\nand multiple times into a given Vulkan instance.\nHowever, implementations ",{"type":13,"tag":366,"props":391,"children":393},{"type":392},"may",[],{"type":18,"value":395}," fail to import the same payload multiple times\ninto a given physical device due to platform constraints.",{"type":13,"tag":14,"props":397,"children":398},{},[399,401,404,406,410,412,418],{"type":18,"value":400},"Importing memory from a particular host pointer ",{"type":13,"tag":366,"props":402,"children":403},{"type":392},[],{"type":18,"value":405}," not be possible due to\nadditional platform-specific restrictions beyond the scope of this\nspecification in which case the implementation ",{"type":13,"tag":366,"props":407,"children":409},{"type":408},"must",[],{"type":18,"value":411}," fail the memory import\noperation with the error code ",{"type":13,"tag":29,"props":413,"children":415},{"className":414},[],[416],{"type":18,"value":417},"VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR",{"type":18,"value":379},{"type":13,"tag":14,"props":420,"children":421},{},[422,424,427],{"type":18,"value":423},"Whether device memory objects imported from a host pointer hold a reference\nto their payload is undefined:.\nAs such, the application ",{"type":13,"tag":366,"props":425,"children":426},{"type":408},[],{"type":18,"value":428}," ensure that the imported memory range remains\nvalid and accessible for the lifetime of the imported memory object.",{"type":13,"tag":430,"props":431,"children":433},"anchor",{"id":432},"host-memory-import-non-visible-type",[],{"type":13,"tag":14,"props":435,"children":436},{},[437,439,442,444,450,452,457,459,462,464,470,472,476,478,481,483,488,490,494,496,500],{"type":18,"value":438},"Implementations ",{"type":13,"tag":366,"props":440,"children":441},{"type":392},[],{"type":18,"value":443}," support importing host pointers for memory types which\nare not host-visible.\nIn this case, after a successful call to ",{"type":13,"tag":21,"props":445,"children":447},{"href":446},"/man/vkAllocateMemory",[448],{"type":18,"value":449},"vkAllocateMemory",{"type":18,"value":451},", the memory\nrange imported from ",{"type":13,"tag":29,"props":453,"children":455},{"className":454},[],[456],{"type":18,"value":357},{"type":18,"value":458}," ",{"type":13,"tag":366,"props":460,"children":461},{"type":408},[],{"type":18,"value":463}," not be accessed by the\napplication until the ",{"type":13,"tag":21,"props":465,"children":467},{"href":466},"/man/VkDeviceMemory",[468],{"type":18,"value":469},"VkDeviceMemory",{"type":18,"value":471}," has been destroyed.\nMemory contents for the host memory becomes undefined: on import, and is\nleft undefined: after the ",{"type":13,"tag":21,"props":473,"children":474},{"href":466},[475],{"type":18,"value":469},{"type":18,"value":477}," has been destroyed.\nApplications ",{"type":13,"tag":366,"props":479,"children":480},{"type":408},[],{"type":18,"value":482}," also not access host memory which is mapped to the same\nphysical memory as ",{"type":13,"tag":29,"props":484,"children":486},{"className":485},[],[487],{"type":18,"value":357},{"type":18,"value":489},", but mapped to a different host\npointer while the ",{"type":13,"tag":21,"props":491,"children":492},{"href":466},[493],{"type":18,"value":469},{"type":18,"value":495}," handle is valid.\nImplementations running on general-purpose operating systems ",{"type":13,"tag":366,"props":497,"children":499},{"type":498},"should",[],{"type":18,"value":501}," not\nsupport importing host pointers for memory types which are not host-visible.",{"type":13,"tag":503,"props":504,"children":505},"note",{},[506],{"type":13,"tag":14,"props":507,"children":508},{},[509],{"type":18,"value":510},"Using host pointers to back non-host visible allocations is a\nplatform-specific use case, and applications should not attempt to do this\nunless instructed by the platform.",{"type":13,"tag":512,"props":513,"children":515},"validity-group",{"name":514},"Valid Usage",[516,552,591,622,676],{"type":13,"tag":517,"props":518,"children":520},"validity-field",{"name":519},"VUID-VkImportMemoryHostPointerInfoEXT-handleType-01747",[521],{"type":13,"tag":14,"props":522,"children":523},{},[524,526,531,533,539,541,544,546],{"type":18,"value":525},"If ",{"type":13,"tag":29,"props":527,"children":529},{"className":528},[],[530],{"type":18,"value":339},{"type":18,"value":532}," is not ",{"type":13,"tag":29,"props":534,"children":536},{"className":535},[],[537],{"type":18,"value":538},"0",{"type":18,"value":540},", it ",{"type":13,"tag":366,"props":542,"children":543},{"type":408},[],{"type":18,"value":545}," be supported for import, as\nreported in ",{"type":13,"tag":21,"props":547,"children":549},{"href":548},"/man/VkExternalMemoryProperties",[550],{"type":18,"value":551},"VkExternalMemoryProperties",{"type":13,"tag":517,"props":553,"children":555},{"name":554},"VUID-VkImportMemoryHostPointerInfoEXT-handleType-01748",[556],{"type":13,"tag":14,"props":557,"children":558},{},[559,560,565,566,571,572,575,577,583,585],{"type":18,"value":525},{"type":13,"tag":29,"props":561,"children":563},{"className":562},[],[564],{"type":18,"value":339},{"type":18,"value":532},{"type":13,"tag":29,"props":567,"children":569},{"className":568},[],[570],{"type":18,"value":538},{"type":18,"value":540},{"type":13,"tag":366,"props":573,"children":574},{"type":408},[],{"type":18,"value":576}," be\n",{"type":13,"tag":29,"props":578,"children":580},{"className":579},[],[581],{"type":18,"value":582},"VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT",{"type":18,"value":584}," or\n",{"type":13,"tag":29,"props":586,"children":588},{"className":587},[],[589],{"type":18,"value":590},"VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT",{"type":13,"tag":517,"props":592,"children":594},{"name":593},"VUID-VkImportMemoryHostPointerInfoEXT-pHostPointer-01749",[595],{"type":13,"tag":14,"props":596,"children":597},{},[598,603,604,607,609,615,616],{"type":13,"tag":29,"props":599,"children":601},{"className":600},[],[602],{"type":18,"value":357},{"type":18,"value":458},{"type":13,"tag":366,"props":605,"children":606},{"type":408},[],{"type":18,"value":608}," be a pointer aligned to an integer multiple of\n",{"type":13,"tag":29,"props":610,"children":612},{"className":611},[],[613],{"type":18,"value":614},"VkPhysicalDeviceExternalMemoryHostPropertiesEXT",{"type":18,"value":206},{"type":13,"tag":29,"props":617,"children":619},{"className":618},[],[620],{"type":18,"value":621},"minImportedHostPointerAlignment",{"type":13,"tag":517,"props":623,"children":625},{"name":624},"VUID-VkImportMemoryHostPointerInfoEXT-handleType-01750",[626],{"type":13,"tag":14,"props":627,"children":628},{},[629,630,635,637,642,643,648,649,652,654,660,662,667,669,674],{"type":18,"value":525},{"type":13,"tag":29,"props":631,"children":633},{"className":632},[],[634],{"type":18,"value":339},{"type":18,"value":636}," is\n",{"type":13,"tag":29,"props":638,"children":640},{"className":639},[],[641],{"type":18,"value":582},{"type":18,"value":216},{"type":13,"tag":29,"props":644,"children":646},{"className":645},[],[647],{"type":18,"value":357},{"type":18,"value":458},{"type":13,"tag":366,"props":650,"children":651},{"type":408},[],{"type":18,"value":653}," be a pointer to ",{"type":13,"tag":29,"props":655,"children":657},{"className":656},[],[658],{"type":18,"value":659},"allocationSize",{"type":18,"value":661}," number of\nbytes of host memory, where ",{"type":13,"tag":29,"props":663,"children":665},{"className":664},[],[666],{"type":18,"value":659},{"type":18,"value":668}," is the member of the\n",{"type":13,"tag":29,"props":670,"children":672},{"className":671},[],[673],{"type":18,"value":42},{"type":18,"value":675}," structure this structure is chained to",{"type":13,"tag":517,"props":677,"children":679},{"name":678},"VUID-VkImportMemoryHostPointerInfoEXT-handleType-01751",[680],{"type":13,"tag":14,"props":681,"children":682},{},[683,684,689,690,695,696,701,702,705,706,711,713,718,720,725],{"type":18,"value":525},{"type":13,"tag":29,"props":685,"children":687},{"className":686},[],[688],{"type":18,"value":339},{"type":18,"value":636},{"type":13,"tag":29,"props":691,"children":693},{"className":692},[],[694],{"type":18,"value":590},{"type":18,"value":216},{"type":13,"tag":29,"props":697,"children":699},{"className":698},[],[700],{"type":18,"value":357},{"type":18,"value":458},{"type":13,"tag":366,"props":703,"children":704},{"type":408},[],{"type":18,"value":653},{"type":13,"tag":29,"props":707,"children":709},{"className":708},[],[710],{"type":18,"value":659},{"type":18,"value":712}," number of\nbytes of host mapped foreign memory, where ",{"type":13,"tag":29,"props":714,"children":716},{"className":715},[],[717],{"type":18,"value":659},{"type":18,"value":719}," is the\nmember of the ",{"type":13,"tag":29,"props":721,"children":723},{"className":722},[],[724],{"type":18,"value":42},{"type":18,"value":726}," structure this structure is\nchained to",{"type":13,"tag":512,"props":728,"children":730},{"name":729},"Valid Usage (Implicit)",[731,755,779],{"type":13,"tag":517,"props":732,"children":734},{"name":733},"VUID-VkImportMemoryHostPointerInfoEXT-sType-sType",[735],{"type":13,"tag":14,"props":736,"children":737},{},[738,743,744,747,749],{"type":13,"tag":29,"props":739,"children":741},{"className":740},[],[742],{"type":18,"value":302},{"type":18,"value":458},{"type":13,"tag":366,"props":745,"children":746},{"type":408},[],{"type":18,"value":748}," be ",{"type":13,"tag":29,"props":750,"children":752},{"className":751},[],[753],{"type":18,"value":754},"VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT",{"type":13,"tag":517,"props":756,"children":758},{"name":757},"VUID-VkImportMemoryHostPointerInfoEXT-handleType-parameter",[759],{"type":13,"tag":14,"props":760,"children":761},{},[762,767,768,771,773,777],{"type":13,"tag":29,"props":763,"children":765},{"className":764},[],[766],{"type":18,"value":339},{"type":18,"value":458},{"type":13,"tag":366,"props":769,"children":770},{"type":408},[],{"type":18,"value":772}," be a valid ",{"type":13,"tag":21,"props":774,"children":775},{"href":343},[776],{"type":18,"value":346},{"type":18,"value":778}," value",{"type":13,"tag":517,"props":780,"children":782},{"name":781},"VUID-VkImportMemoryHostPointerInfoEXT-pHostPointer-parameter",[783],{"type":13,"tag":14,"props":784,"children":785},{},[786,791,792,795],{"type":13,"tag":29,"props":787,"children":789},{"className":788},[],[790],{"type":18,"value":357},{"type":18,"value":458},{"type":13,"tag":366,"props":793,"children":794},{"type":408},[],{"type":18,"value":796}," be a pointer value",{"type":13,"tag":798,"props":799,"children":800},"style",{},[801],{"type":18,"value":802},"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":63,"searchDepth":93,"depth":93,"links":804},[],"markdown",1729612453913]