[{"data":1,"prerenderedAt":784},["ShallowReactive",2],{"BhsaEpuC8M":3},{"title":4,"description":5,"parent":6,"type":7,"xrefs":8,"body":9,"_type":783,"_id":4},"vkCreateDevice","Create a new device instance","VK_VERSION_1_0","protos",[],{"type":10,"children":11,"toc":781},"root",[12,28,381,477,575,587,617,657,775],{"type":13,"tag":14,"props":15,"children":16},"element","p",{},[17,20,26],{"type":18,"value":19},"text","A logical device is created as a ",{"type":13,"tag":21,"props":22,"children":23},"em",{},[24],{"type":18,"value":25},"connection",{"type":18,"value":27}," to a physical device.\nTo create a logical device, call:",{"type":13,"tag":29,"props":30,"children":31},"code-group",{},[32,165],{"type":13,"tag":33,"props":34,"children":40},"pre",{"className":35,"code":36,"filename":37,"language":38,"meta":39,"style":39},"language-c shiki shiki-themes github-light-default github-dark-default","VkResult vkCreateDevice(\n VkPhysicalDevice physicalDevice,\n const VkDeviceCreateInfo* pCreateInfo,\n const VkAllocationCallbacks* pAllocator,\n VkDevice* pDevice);\n","C","c","",[41],{"type":13,"tag":42,"props":43,"children":44},"code",{"__ignoreMap":39},[45,67,87,116,142],{"type":13,"tag":46,"props":47,"children":50},"span",{"class":48,"line":49},"line",1,[51,57,62],{"type":13,"tag":46,"props":52,"children":54},{"style":53},"--shiki-default:#1F2328;--shiki-dark:#E6EDF3",[55],{"type":18,"value":56},"VkResult ",{"type":13,"tag":46,"props":58,"children":60},{"style":59},"--shiki-default:#8250DF;--shiki-dark:#D2A8FF",[61],{"type":18,"value":4},{"type":13,"tag":46,"props":63,"children":64},{"style":53},[65],{"type":18,"value":66},"(\n",{"type":13,"tag":46,"props":68,"children":70},{"class":48,"line":69},2,[71,76,82],{"type":13,"tag":46,"props":72,"children":73},{"style":53},[74],{"type":18,"value":75}," VkPhysicalDevice ",{"type":13,"tag":46,"props":77,"children":79},{"style":78},"--shiki-default:#953800;--shiki-dark:#FFA657",[80],{"type":18,"value":81},"physicalDevice",{"type":13,"tag":46,"props":83,"children":84},{"style":53},[85],{"type":18,"value":86},",\n",{"type":13,"tag":46,"props":88,"children":90},{"class":48,"line":89},3,[91,97,102,107,112],{"type":13,"tag":46,"props":92,"children":94},{"style":93},"--shiki-default:#CF222E;--shiki-dark:#FF7B72",[95],{"type":18,"value":96}," const",{"type":13,"tag":46,"props":98,"children":99},{"style":53},[100],{"type":18,"value":101}," VkDeviceCreateInfo",{"type":13,"tag":46,"props":103,"children":104},{"style":93},[105],{"type":18,"value":106},"*",{"type":13,"tag":46,"props":108,"children":109},{"style":78},[110],{"type":18,"value":111}," pCreateInfo",{"type":13,"tag":46,"props":113,"children":114},{"style":53},[115],{"type":18,"value":86},{"type":13,"tag":46,"props":117,"children":119},{"class":48,"line":118},4,[120,124,129,133,138],{"type":13,"tag":46,"props":121,"children":122},{"style":93},[123],{"type":18,"value":96},{"type":13,"tag":46,"props":125,"children":126},{"style":53},[127],{"type":18,"value":128}," VkAllocationCallbacks",{"type":13,"tag":46,"props":130,"children":131},{"style":93},[132],{"type":18,"value":106},{"type":13,"tag":46,"props":134,"children":135},{"style":78},[136],{"type":18,"value":137}," pAllocator",{"type":13,"tag":46,"props":139,"children":140},{"style":53},[141],{"type":18,"value":86},{"type":13,"tag":46,"props":143,"children":145},{"class":48,"line":144},5,[146,151,155,160],{"type":13,"tag":46,"props":147,"children":148},{"style":53},[149],{"type":18,"value":150}," VkDevice",{"type":13,"tag":46,"props":152,"children":153},{"style":93},[154],{"type":18,"value":106},{"type":13,"tag":46,"props":156,"children":157},{"style":78},[158],{"type":18,"value":159}," pDevice",{"type":13,"tag":46,"props":161,"children":162},{"style":53},[163],{"type":18,"value":164},");\n",{"type":13,"tag":33,"props":166,"children":171},{"className":167,"code":168,"filename":169,"language":170,"meta":39,"style":39},"language-rs shiki shiki-themes github-light-default github-dark-default","pub fn create_device(\n physical_device: vk::PhysicalDevice,\n p_create_info: *const vk::DeviceCreateInfo,\n p_allocator: *const vk::AllocationCallbacks,\n p_device: *mut crate :: vk :: vk::Device,\n) -> vk::Result;\n","Rust","rs",[172],{"type":13,"tag":42,"props":173,"children":174},{"__ignoreMap":39},[175,197,229,263,296,349],{"type":13,"tag":46,"props":176,"children":177},{"class":48,"line":49},[178,183,188,193],{"type":13,"tag":46,"props":179,"children":180},{"style":93},[181],{"type":18,"value":182},"pub",{"type":13,"tag":46,"props":184,"children":185},{"style":93},[186],{"type":18,"value":187}," fn",{"type":13,"tag":46,"props":189,"children":190},{"style":59},[191],{"type":18,"value":192}," create_device",{"type":13,"tag":46,"props":194,"children":195},{"style":53},[196],{"type":18,"value":66},{"type":13,"tag":46,"props":198,"children":199},{"class":48,"line":69},[200,205,210,215,220,225],{"type":13,"tag":46,"props":201,"children":202},{"style":53},[203],{"type":18,"value":204}," physical_device",{"type":13,"tag":46,"props":206,"children":207},{"style":93},[208],{"type":18,"value":209},":",{"type":13,"tag":46,"props":211,"children":212},{"style":78},[213],{"type":18,"value":214}," vk",{"type":13,"tag":46,"props":216,"children":217},{"style":93},[218],{"type":18,"value":219},"::",{"type":13,"tag":46,"props":221,"children":222},{"style":78},[223],{"type":18,"value":224},"PhysicalDevice",{"type":13,"tag":46,"props":226,"children":227},{"style":53},[228],{"type":18,"value":86},{"type":13,"tag":46,"props":230,"children":231},{"class":48,"line":89},[232,237,241,246,250,254,259],{"type":13,"tag":46,"props":233,"children":234},{"style":53},[235],{"type":18,"value":236}," p_create_info",{"type":13,"tag":46,"props":238,"children":239},{"style":93},[240],{"type":18,"value":209},{"type":13,"tag":46,"props":242,"children":243},{"style":93},[244],{"type":18,"value":245}," *const",{"type":13,"tag":46,"props":247,"children":248},{"style":78},[249],{"type":18,"value":214},{"type":13,"tag":46,"props":251,"children":252},{"style":93},[253],{"type":18,"value":219},{"type":13,"tag":46,"props":255,"children":256},{"style":78},[257],{"type":18,"value":258},"DeviceCreateInfo",{"type":13,"tag":46,"props":260,"children":261},{"style":53},[262],{"type":18,"value":86},{"type":13,"tag":46,"props":264,"children":265},{"class":48,"line":118},[266,271,275,279,283,287,292],{"type":13,"tag":46,"props":267,"children":268},{"style":53},[269],{"type":18,"value":270}," p_allocator",{"type":13,"tag":46,"props":272,"children":273},{"style":93},[274],{"type":18,"value":209},{"type":13,"tag":46,"props":276,"children":277},{"style":93},[278],{"type":18,"value":245},{"type":13,"tag":46,"props":280,"children":281},{"style":78},[282],{"type":18,"value":214},{"type":13,"tag":46,"props":284,"children":285},{"style":93},[286],{"type":18,"value":219},{"type":13,"tag":46,"props":288,"children":289},{"style":78},[290],{"type":18,"value":291},"AllocationCallbacks",{"type":13,"tag":46,"props":293,"children":294},{"style":53},[295],{"type":18,"value":86},{"type":13,"tag":46,"props":297,"children":298},{"class":48,"line":144},[299,304,308,313,318,323,328,332,336,340,345],{"type":13,"tag":46,"props":300,"children":301},{"style":53},[302],{"type":18,"value":303}," p_device",{"type":13,"tag":46,"props":305,"children":306},{"style":93},[307],{"type":18,"value":209},{"type":13,"tag":46,"props":309,"children":310},{"style":93},[311],{"type":18,"value":312}," *mut",{"type":13,"tag":46,"props":314,"children":315},{"style":93},[316],{"type":18,"value":317}," crate",{"type":13,"tag":46,"props":319,"children":320},{"style":93},[321],{"type":18,"value":322}," ::",{"type":13,"tag":46,"props":324,"children":325},{"style":53},[326],{"type":18,"value":327}," vk ",{"type":13,"tag":46,"props":329,"children":330},{"style":93},[331],{"type":18,"value":219},{"type":13,"tag":46,"props":333,"children":334},{"style":78},[335],{"type":18,"value":214},{"type":13,"tag":46,"props":337,"children":338},{"style":93},[339],{"type":18,"value":219},{"type":13,"tag":46,"props":341,"children":342},{"style":78},[343],{"type":18,"value":344},"Device",{"type":13,"tag":46,"props":346,"children":347},{"style":53},[348],{"type":18,"value":86},{"type":13,"tag":46,"props":350,"children":352},{"class":48,"line":351},6,[353,358,363,367,371,376],{"type":13,"tag":46,"props":354,"children":355},{"style":53},[356],{"type":18,"value":357},") ",{"type":13,"tag":46,"props":359,"children":360},{"style":93},[361],{"type":18,"value":362},"->",{"type":13,"tag":46,"props":364,"children":365},{"style":78},[366],{"type":18,"value":214},{"type":13,"tag":46,"props":368,"children":369},{"style":93},[370],{"type":18,"value":219},{"type":13,"tag":46,"props":372,"children":373},{"style":78},[374],{"type":18,"value":375},"Result",{"type":13,"tag":46,"props":377,"children":378},{"style":53},[379],{"type":18,"value":380},";\n",{"type":13,"tag":382,"props":383,"children":384},"ul",{},[385,420,439,458],{"type":13,"tag":386,"props":387,"children":388},"li",{},[389,394,396,401,403,409,411,418],{"type":13,"tag":42,"props":390,"children":392},{"className":391},[],[393],{"type":18,"value":81},{"type":18,"value":395}," ",{"type":13,"tag":397,"props":398,"children":400},"normative",{"type":399},"must",[],{"type":18,"value":402}," be one of the device handles returned from a\ncall to ",{"type":13,"tag":42,"props":404,"children":406},{"className":405},[],[407],{"type":18,"value":408},"vkEnumeratePhysicalDevices",{"type":18,"value":410}," (see\n",{"type":13,"tag":412,"props":413,"children":415},"a",{"href":414},"/chapters/devsandqueues#devsandqueues-physical-device-enumeration",[416],{"type":18,"value":417},"Physical Device\nEnumeration",{"type":18,"value":419},").",{"type":13,"tag":386,"props":421,"children":422},{},[423,429,431,437],{"type":13,"tag":42,"props":424,"children":426},{"className":425},[],[427],{"type":18,"value":428},"pCreateInfo",{"type":18,"value":430}," is a pointer to a ",{"type":13,"tag":412,"props":432,"children":434},{"href":433},"/man/VkDeviceCreateInfo",[435],{"type":18,"value":436},"VkDeviceCreateInfo",{"type":18,"value":438}," structure\ncontaining information about how to create the device.",{"type":13,"tag":386,"props":440,"children":441},{},[442,448,450,456],{"type":13,"tag":42,"props":443,"children":445},{"className":444},[],[446],{"type":18,"value":447},"pAllocator",{"type":18,"value":449}," controls host memory allocation as described in the\n",{"type":13,"tag":412,"props":451,"children":453},{"href":452},"/chapters/memory#memory-allocation",[454],{"type":18,"value":455},"Memory Allocation",{"type":18,"value":457}," chapter.",{"type":13,"tag":386,"props":459,"children":460},{},[461,467,469,475],{"type":13,"tag":42,"props":462,"children":464},{"className":463},[],[465],{"type":18,"value":466},"pDevice",{"type":18,"value":468}," is a pointer to a handle in which the created\n",{"type":13,"tag":412,"props":470,"children":472},{"href":471},"/man/VkDevice",[473],{"type":18,"value":474},"VkDevice",{"type":18,"value":476}," is returned.",{"type":13,"tag":14,"props":478,"children":479},{},[480,485,487,493,495,501,503,508,510,515,516,519,521,527,529,534,535,538,540,546,548,552,554,560,562,565,567,573],{"type":13,"tag":42,"props":481,"children":483},{"className":482},[],[484],{"type":18,"value":4},{"type":18,"value":486}," verifies that extensions and features requested in the\n",{"type":13,"tag":42,"props":488,"children":490},{"className":489},[],[491],{"type":18,"value":492},"ppEnabledExtensionNames",{"type":18,"value":494}," and ",{"type":13,"tag":42,"props":496,"children":498},{"className":497},[],[499],{"type":18,"value":500},"pEnabledFeatures",{"type":18,"value":502}," members of\n",{"type":13,"tag":42,"props":504,"children":506},{"className":505},[],[507],{"type":18,"value":428},{"type":18,"value":509},", respectively, are supported by the implementation.\nIf any requested extension is not supported, ",{"type":13,"tag":42,"props":511,"children":513},{"className":512},[],[514],{"type":18,"value":4},{"type":18,"value":395},{"type":13,"tag":397,"props":517,"children":518},{"type":399},[],{"type":18,"value":520},"\nreturn ",{"type":13,"tag":42,"props":522,"children":524},{"className":523},[],[525],{"type":18,"value":526},"VK_ERROR_EXTENSION_NOT_PRESENT",{"type":18,"value":528},".\nIf any requested feature is not supported, ",{"type":13,"tag":42,"props":530,"children":532},{"className":531},[],[533],{"type":18,"value":4},{"type":18,"value":395},{"type":13,"tag":397,"props":536,"children":537},{"type":399},[],{"type":18,"value":539}," return\n",{"type":13,"tag":42,"props":541,"children":543},{"className":542},[],[544],{"type":18,"value":545},"VK_ERROR_FEATURE_NOT_PRESENT",{"type":18,"value":547},".\nSupport for extensions ",{"type":13,"tag":397,"props":549,"children":551},{"type":550},"can",[],{"type":18,"value":553}," be checked before creating a device by querying\n",{"type":13,"tag":412,"props":555,"children":557},{"href":556},"/man/vkEnumerateDeviceExtensionProperties",[558],{"type":18,"value":559},"vkEnumerateDeviceExtensionProperties",{"type":18,"value":561},".\nSupport for features ",{"type":13,"tag":397,"props":563,"children":564},{"type":550},[],{"type":18,"value":566}," similarly be checked by querying\n",{"type":13,"tag":412,"props":568,"children":570},{"href":569},"/man/vkGetPhysicalDeviceFeatures",[571],{"type":18,"value":572},"vkGetPhysicalDeviceFeatures",{"type":18,"value":574},".",{"type":13,"tag":14,"props":576,"children":577},{},[578,580,585],{"type":18,"value":579},"After verifying and enabling the extensions the ",{"type":13,"tag":42,"props":581,"children":583},{"className":582},[],[584],{"type":18,"value":474},{"type":18,"value":586}," object is\ncreated and returned to the application.",{"type":13,"tag":14,"props":588,"children":589},{},[590,592,595,597,601,603,608,610,616],{"type":18,"value":591},"Multiple logical devices ",{"type":13,"tag":397,"props":593,"children":594},{"type":550},[],{"type":18,"value":596}," be created from the same physical device.\nLogical device creation ",{"type":13,"tag":397,"props":598,"children":600},{"type":599},"may",[],{"type":18,"value":602}," fail due to lack of device-specific resources\n(in addition to other errors).\nIf that occurs, ",{"type":13,"tag":42,"props":604,"children":606},{"className":605},[],[607],{"type":18,"value":4},{"type":18,"value":609}," will return\n",{"type":13,"tag":42,"props":611,"children":613},{"className":612},[],[614],{"type":18,"value":615},"VK_ERROR_TOO_MANY_OBJECTS",{"type":18,"value":574},{"type":13,"tag":618,"props":619,"children":621},"validity-group",{"name":620},"Valid Usage",[622],{"type":13,"tag":623,"props":624,"children":626},"validity-field",{"name":625},"VUID-vkCreateDevice-ppEnabledExtensionNames-01387",[627],{"type":13,"tag":14,"props":628,"children":629},{},[630,632,638,640,644,645,650,652,655],{"type":18,"value":631},"All ",{"type":13,"tag":412,"props":633,"children":635},{"href":634},"/chapters/extendingvulkan#extendingvulkan-extensions-extensiondependencies",[636],{"type":18,"value":637},"required device\nextensions",{"type":18,"value":639}," for each extension in the\n",{"type":13,"tag":412,"props":641,"children":642},{"href":433},[643],{"type":18,"value":436},{"type":18,"value":219},{"type":13,"tag":42,"props":646,"children":648},{"className":647},[],[649],{"type":18,"value":492},{"type":18,"value":651}," list ",{"type":13,"tag":397,"props":653,"children":654},{"type":399},[],{"type":18,"value":656}," also\nbe present in that list",{"type":13,"tag":618,"props":658,"children":660},{"name":659},"Valid Usage (Implicit)",[661,687,711,752],{"type":13,"tag":623,"props":662,"children":664},{"name":663},"VUID-vkCreateDevice-physicalDevice-parameter",[665],{"type":13,"tag":14,"props":666,"children":667},{},[668,673,674,677,679,685],{"type":13,"tag":42,"props":669,"children":671},{"className":670},[],[672],{"type":18,"value":81},{"type":18,"value":395},{"type":13,"tag":397,"props":675,"children":676},{"type":399},[],{"type":18,"value":678}," be a valid ",{"type":13,"tag":412,"props":680,"children":682},{"href":681},"/man/VkPhysicalDevice",[683],{"type":18,"value":684},"VkPhysicalDevice",{"type":18,"value":686}," handle",{"type":13,"tag":623,"props":688,"children":690},{"name":689},"VUID-vkCreateDevice-pCreateInfo-parameter",[691],{"type":13,"tag":14,"props":692,"children":693},{},[694,699,700,703,705,709],{"type":13,"tag":42,"props":695,"children":697},{"className":696},[],[698],{"type":18,"value":428},{"type":18,"value":395},{"type":13,"tag":397,"props":701,"children":702},{"type":399},[],{"type":18,"value":704}," be a valid pointer to a valid ",{"type":13,"tag":412,"props":706,"children":707},{"href":433},[708],{"type":18,"value":436},{"type":18,"value":710}," structure",{"type":13,"tag":623,"props":712,"children":714},{"name":713},"VUID-vkCreateDevice-pAllocator-parameter",[715],{"type":13,"tag":14,"props":716,"children":717},{},[718,720,725,727,733,735,740,741,744,745,751],{"type":18,"value":719},"If ",{"type":13,"tag":42,"props":721,"children":723},{"className":722},[],[724],{"type":18,"value":447},{"type":18,"value":726}," is not ",{"type":13,"tag":42,"props":728,"children":730},{"className":729},[],[731],{"type":18,"value":732},"NULL",{"type":18,"value":734},", ",{"type":13,"tag":42,"props":736,"children":738},{"className":737},[],[739],{"type":18,"value":447},{"type":18,"value":395},{"type":13,"tag":397,"props":742,"children":743},{"type":399},[],{"type":18,"value":704},{"type":13,"tag":412,"props":746,"children":748},{"href":747},"/man/VkAllocationCallbacks",[749],{"type":18,"value":750},"VkAllocationCallbacks",{"type":18,"value":710},{"type":13,"tag":623,"props":753,"children":755},{"name":754},"VUID-vkCreateDevice-pDevice-parameter",[756],{"type":13,"tag":14,"props":757,"children":758},{},[759,764,765,768,770,774],{"type":13,"tag":42,"props":760,"children":762},{"className":761},[],[763],{"type":18,"value":466},{"type":18,"value":395},{"type":13,"tag":397,"props":766,"children":767},{"type":399},[],{"type":18,"value":769}," be a valid pointer to a ",{"type":13,"tag":412,"props":771,"children":772},{"href":471},[773],{"type":18,"value":474},{"type":18,"value":686},{"type":13,"tag":776,"props":777,"children":778},"style",{},[779],{"type":18,"value":780},"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":39,"searchDepth":69,"depth":69,"links":782},[],"markdown",1725732612658]