[{"data":1,"prerenderedAt":607},["ShallowReactive",2],{"cI2pNnz8TX":3},{"title":4,"description":5,"parent":6,"type":7,"xrefs":8,"body":9,"_type":606,"_id":4},"vkAllocateCommandBuffers","Allocate command buffers from an existing command pool","VK_VERSION_1_0","protos",[],{"type":10,"children":11,"toc":604},"root",[12,20,314,390,426,449,462,573,598],{"type":13,"tag":14,"props":15,"children":16},"element","p",{},[17],{"type":18,"value":19},"text","To allocate command buffers, call:",{"type":13,"tag":21,"props":22,"children":23},"code-group",{},[24,131],{"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 vkAllocateCommandBuffers(\n VkDevice device,\n const VkCommandBufferAllocateInfo* pAllocateInfo,\n VkCommandBuffer* pCommandBuffers);\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}," VkCommandBufferAllocateInfo",{"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}," pAllocateInfo",{"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,121,126],{"type":13,"tag":38,"props":113,"children":114},{"style":45},[115],{"type":18,"value":116}," VkCommandBuffer",{"type":13,"tag":38,"props":118,"children":119},{"style":85},[120],{"type":18,"value":98},{"type":13,"tag":38,"props":122,"children":123},{"style":70},[124],{"type":18,"value":125}," pCommandBuffers",{"type":13,"tag":38,"props":127,"children":128},{"style":45},[129],{"type":18,"value":130},");\n",{"type":13,"tag":25,"props":132,"children":137},{"className":133,"code":134,"filename":135,"language":136,"meta":31,"style":31},"language-rs shiki shiki-themes github-light-default github-dark-default","pub fn allocate_command_buffers(\n device: crate :: vk :: vk::Device,\n p_allocate_info: *const vk::CommandBufferAllocateInfo,\n p_command_buffers: *mut vk::CommandBuffer,\n) -> vk::Result;\n","Rust","rs",[138],{"type":13,"tag":34,"props":139,"children":140},{"__ignoreMap":31},[141,163,214,248,282],{"type":13,"tag":38,"props":142,"children":143},{"class":40,"line":41},[144,149,154,159],{"type":13,"tag":38,"props":145,"children":146},{"style":85},[147],{"type":18,"value":148},"pub",{"type":13,"tag":38,"props":150,"children":151},{"style":85},[152],{"type":18,"value":153}," fn",{"type":13,"tag":38,"props":155,"children":156},{"style":51},[157],{"type":18,"value":158}," allocate_command_buffers",{"type":13,"tag":38,"props":160,"children":161},{"style":45},[162],{"type":18,"value":58},{"type":13,"tag":38,"props":164,"children":165},{"class":40,"line":61},[166,171,176,181,186,191,196,201,205,210],{"type":13,"tag":38,"props":167,"children":168},{"style":45},[169],{"type":18,"value":170}," device",{"type":13,"tag":38,"props":172,"children":173},{"style":85},[174],{"type":18,"value":175},":",{"type":13,"tag":38,"props":177,"children":178},{"style":85},[179],{"type":18,"value":180}," crate",{"type":13,"tag":38,"props":182,"children":183},{"style":85},[184],{"type":18,"value":185}," ::",{"type":13,"tag":38,"props":187,"children":188},{"style":45},[189],{"type":18,"value":190}," vk ",{"type":13,"tag":38,"props":192,"children":193},{"style":85},[194],{"type":18,"value":195},"::",{"type":13,"tag":38,"props":197,"children":198},{"style":70},[199],{"type":18,"value":200}," vk",{"type":13,"tag":38,"props":202,"children":203},{"style":85},[204],{"type":18,"value":195},{"type":13,"tag":38,"props":206,"children":207},{"style":70},[208],{"type":18,"value":209},"Device",{"type":13,"tag":38,"props":211,"children":212},{"style":45},[213],{"type":18,"value":78},{"type":13,"tag":38,"props":215,"children":216},{"class":40,"line":81},[217,222,226,231,235,239,244],{"type":13,"tag":38,"props":218,"children":219},{"style":45},[220],{"type":18,"value":221}," p_allocate_info",{"type":13,"tag":38,"props":223,"children":224},{"style":85},[225],{"type":18,"value":175},{"type":13,"tag":38,"props":227,"children":228},{"style":85},[229],{"type":18,"value":230}," *const",{"type":13,"tag":38,"props":232,"children":233},{"style":70},[234],{"type":18,"value":200},{"type":13,"tag":38,"props":236,"children":237},{"style":85},[238],{"type":18,"value":195},{"type":13,"tag":38,"props":240,"children":241},{"style":70},[242],{"type":18,"value":243},"CommandBufferAllocateInfo",{"type":13,"tag":38,"props":245,"children":246},{"style":45},[247],{"type":18,"value":78},{"type":13,"tag":38,"props":249,"children":250},{"class":40,"line":110},[251,256,260,265,269,273,278],{"type":13,"tag":38,"props":252,"children":253},{"style":45},[254],{"type":18,"value":255}," p_command_buffers",{"type":13,"tag":38,"props":257,"children":258},{"style":85},[259],{"type":18,"value":175},{"type":13,"tag":38,"props":261,"children":262},{"style":85},[263],{"type":18,"value":264}," *mut",{"type":13,"tag":38,"props":266,"children":267},{"style":70},[268],{"type":18,"value":200},{"type":13,"tag":38,"props":270,"children":271},{"style":85},[272],{"type":18,"value":195},{"type":13,"tag":38,"props":274,"children":275},{"style":70},[276],{"type":18,"value":277},"CommandBuffer",{"type":13,"tag":38,"props":279,"children":280},{"style":45},[281],{"type":18,"value":78},{"type":13,"tag":38,"props":283,"children":285},{"class":40,"line":284},5,[286,291,296,300,304,309],{"type":13,"tag":38,"props":287,"children":288},{"style":45},[289],{"type":18,"value":290},") ",{"type":13,"tag":38,"props":292,"children":293},{"style":85},[294],{"type":18,"value":295},"->",{"type":13,"tag":38,"props":297,"children":298},{"style":70},[299],{"type":18,"value":200},{"type":13,"tag":38,"props":301,"children":302},{"style":85},[303],{"type":18,"value":195},{"type":13,"tag":38,"props":305,"children":306},{"style":70},[307],{"type":18,"value":308},"Result",{"type":13,"tag":38,"props":310,"children":311},{"style":45},[312],{"type":18,"value":313},";\n",{"type":13,"tag":315,"props":316,"children":317},"ul",{},[318,329,349],{"type":13,"tag":319,"props":320,"children":321},"li",{},[322,327],{"type":13,"tag":34,"props":323,"children":325},{"className":324},[],[326],{"type":18,"value":73},{"type":18,"value":328}," is the logical device that owns the command pool.",{"type":13,"tag":319,"props":330,"children":331},{},[332,338,340,347],{"type":13,"tag":34,"props":333,"children":335},{"className":334},[],[336],{"type":18,"value":337},"pAllocateInfo",{"type":18,"value":339}," is a pointer to a ",{"type":13,"tag":341,"props":342,"children":344},"a",{"href":343},"/man/VkCommandBufferAllocateInfo",[345],{"type":18,"value":346},"VkCommandBufferAllocateInfo",{"type":18,"value":348},"\nstructure describing parameters of the allocation.",{"type":13,"tag":319,"props":350,"children":351},{},[352,358,360,366,368,373,375,381,383,388],{"type":13,"tag":34,"props":353,"children":355},{"className":354},[],[356],{"type":18,"value":357},"pCommandBuffers",{"type":18,"value":359}," is a pointer to an array of ",{"type":13,"tag":341,"props":361,"children":363},{"href":362},"/man/VkCommandBuffer",[364],{"type":18,"value":365},"VkCommandBuffer",{"type":18,"value":367},"\nhandles in which the resulting command buffer objects are returned.\nThe array ",{"type":13,"tag":369,"props":370,"children":372},"normative",{"type":371},"must",[],{"type":18,"value":374}," be at least the length specified by the\n",{"type":13,"tag":34,"props":376,"children":378},{"className":377},[],[379],{"type":18,"value":380},"commandBufferCount",{"type":18,"value":382}," member of ",{"type":13,"tag":34,"props":384,"children":386},{"className":385},[],[387],{"type":18,"value":337},{"type":18,"value":389},".\nEach allocated command buffer begins in the initial state.",{"type":13,"tag":14,"props":391,"children":392},{},[393,398,400,404,406,409,411,416,418,424],{"type":13,"tag":34,"props":394,"children":396},{"className":395},[],[397],{"type":18,"value":4},{"type":18,"value":399}," ",{"type":13,"tag":369,"props":401,"children":403},{"type":402},"can",[],{"type":18,"value":405}," be used to allocate multiple command\nbuffers.\nIf the allocation of any of those command buffers fails, the implementation\n",{"type":13,"tag":369,"props":407,"children":408},{"type":371},[],{"type":18,"value":410}," free all successfully allocated command buffer objects from this\ncommand, set all entries of the ",{"type":13,"tag":34,"props":412,"children":414},{"className":413},[],[415],{"type":18,"value":357},{"type":18,"value":417}," array to ",{"type":13,"tag":34,"props":419,"children":421},{"className":420},[],[422],{"type":18,"value":423},"NULL",{"type":18,"value":425}," and\nreturn the error.",{"type":13,"tag":427,"props":428,"children":429},"note",{},[430],{"type":13,"tag":14,"props":431,"children":432},{},[433,435,440,442,447],{"type":18,"value":434},"Filling ",{"type":13,"tag":34,"props":436,"children":438},{"className":437},[],[439],{"type":18,"value":357},{"type":18,"value":441}," with ",{"type":13,"tag":34,"props":443,"children":445},{"className":444},[],[446],{"type":18,"value":423},{"type":18,"value":448}," values on failure is an exception\nto the default error behavior that output parameters will have undefined:\ncontents.",{"type":13,"tag":14,"props":450,"children":451},{},[452,454,460],{"type":18,"value":453},"When command buffers are first allocated, they are in the\n",{"type":13,"tag":341,"props":455,"children":457},{"href":456},"/chapters/commandbuffers#commandbuffers-lifecycle",[458],{"type":18,"value":459},"initial state",{"type":18,"value":461},".",{"type":13,"tag":463,"props":464,"children":466},"validity-group",{"name":465},"Valid Usage (Implicit)",[467,494,518,549],{"type":13,"tag":468,"props":469,"children":471},"validity-field",{"name":470},"VUID-vkAllocateCommandBuffers-device-parameter",[472],{"type":13,"tag":14,"props":473,"children":474},{},[475,480,481,484,486,492],{"type":13,"tag":34,"props":476,"children":478},{"className":477},[],[479],{"type":18,"value":73},{"type":18,"value":399},{"type":13,"tag":369,"props":482,"children":483},{"type":371},[],{"type":18,"value":485}," be a valid ",{"type":13,"tag":341,"props":487,"children":489},{"href":488},"/man/VkDevice",[490],{"type":18,"value":491},"VkDevice",{"type":18,"value":493}," handle",{"type":13,"tag":468,"props":495,"children":497},{"name":496},"VUID-vkAllocateCommandBuffers-pAllocateInfo-parameter",[498],{"type":13,"tag":14,"props":499,"children":500},{},[501,506,507,510,512,516],{"type":13,"tag":34,"props":502,"children":504},{"className":503},[],[505],{"type":18,"value":337},{"type":18,"value":399},{"type":13,"tag":369,"props":508,"children":509},{"type":371},[],{"type":18,"value":511}," be a valid pointer to a valid ",{"type":13,"tag":341,"props":513,"children":514},{"href":343},[515],{"type":18,"value":346},{"type":18,"value":517}," structure",{"type":13,"tag":468,"props":519,"children":521},{"name":520},"VUID-vkAllocateCommandBuffers-pCommandBuffers-parameter",[522],{"type":13,"tag":14,"props":523,"children":524},{},[525,530,531,534,536,542,543,547],{"type":13,"tag":34,"props":526,"children":528},{"className":527},[],[529],{"type":18,"value":357},{"type":18,"value":399},{"type":13,"tag":369,"props":532,"children":533},{"type":371},[],{"type":18,"value":535}," be a valid pointer to an array of ",{"type":13,"tag":34,"props":537,"children":539},{"className":538},[],[540],{"type":18,"value":541},"pAllocateInfo→commandBufferCount",{"type":18,"value":399},{"type":13,"tag":341,"props":544,"children":545},{"href":362},[546],{"type":18,"value":365},{"type":18,"value":548}," handles",{"type":13,"tag":468,"props":550,"children":552},{"name":551},"VUID-vkAllocateCommandBuffers-pAllocateInfo::commandBufferCount-arraylength",[553],{"type":13,"tag":14,"props":554,"children":555},{},[556,561,562,565,567],{"type":13,"tag":34,"props":557,"children":559},{"className":558},[],[560],{"type":18,"value":541},{"type":18,"value":399},{"type":13,"tag":369,"props":563,"children":564},{"type":371},[],{"type":18,"value":566}," be greater than ",{"type":13,"tag":34,"props":568,"children":570},{"className":569},[],[571],{"type":18,"value":572},"0",{"type":13,"tag":574,"props":575,"children":577},"validity-box",{"name":576},"Host Synchronization",[578],{"type":13,"tag":315,"props":579,"children":580},{},[581],{"type":13,"tag":319,"props":582,"children":583},{},[584,586,592,593,596],{"type":18,"value":585},"Host access to ",{"type":13,"tag":34,"props":587,"children":589},{"className":588},[],[590],{"type":18,"value":591},"pAllocateInfo→commandPool",{"type":18,"value":399},{"type":13,"tag":369,"props":594,"children":595},{"type":371},[],{"type":18,"value":597}," be externally synchronized\n::",{"type":13,"tag":599,"props":600,"children":601},"style",{},[602],{"type":18,"value":603},"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":605},[],"markdown",1729612490627]