[{"data":1,"prerenderedAt":540},["ShallowReactive",2],{"4XAB54mjB8":3},{"title":4,"description":5,"parent":6,"type":7,"xrefs":8,"body":9,"_type":539,"_id":4},"vkTrimCommandPool","Trim a command pool","VK_VERSION_1_1","protos",[],{"type":10,"children":11,"toc":537},"root",[12,20,267,302,307,402,507,531],{"type":13,"tag":14,"props":15,"children":16},"element","p",{},[17],{"type":18,"value":19},"text","To trim a command pool, call:",{"type":13,"tag":21,"props":22,"children":23},"code-group",{},[24,118],{"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 vkTrimCommandPoolKHR(\n VkDevice device,\n VkCommandPool commandPool,\n VkCommandPoolTrimFlags flags);\n","C","c","",[33],{"type":13,"tag":34,"props":35,"children":36},"code",{"__ignoreMap":31},[37,61,81,99],{"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}," vkTrimCommandPoolKHR",{"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],{"type":13,"tag":38,"props":86,"children":87},{"style":57},[88],{"type":18,"value":89}," VkCommandPool ",{"type":13,"tag":38,"props":91,"children":92},{"style":72},[93],{"type":18,"value":94},"commandPool",{"type":13,"tag":38,"props":96,"children":97},{"style":57},[98],{"type":18,"value":80},{"type":13,"tag":38,"props":100,"children":102},{"class":40,"line":101},4,[103,108,113],{"type":13,"tag":38,"props":104,"children":105},{"style":57},[106],{"type":18,"value":107}," VkCommandPoolTrimFlags ",{"type":13,"tag":38,"props":109,"children":110},{"style":72},[111],{"type":18,"value":112},"flags",{"type":13,"tag":38,"props":114,"children":115},{"style":57},[116],{"type":18,"value":117},");\n",{"type":13,"tag":25,"props":119,"children":124},{"className":120,"code":121,"filename":122,"language":123,"meta":31,"style":31},"language-rs shiki shiki-themes github-light-default github-dark-default","pub fn trim_command_pool_khr(\n device: crate :: vk :: vk::Device,\n command_pool: vk::CommandPool,\n flags: vk::CommandPoolTrimFlags,\n);\n","Rust","rs",[125],{"type":13,"tag":34,"props":126,"children":127},{"__ignoreMap":31},[128,150,201,230,259],{"type":13,"tag":38,"props":129,"children":130},{"class":40,"line":41},[131,136,141,146],{"type":13,"tag":38,"props":132,"children":133},{"style":45},[134],{"type":18,"value":135},"pub",{"type":13,"tag":38,"props":137,"children":138},{"style":45},[139],{"type":18,"value":140}," fn",{"type":13,"tag":38,"props":142,"children":143},{"style":51},[144],{"type":18,"value":145}," trim_command_pool_khr",{"type":13,"tag":38,"props":147,"children":148},{"style":57},[149],{"type":18,"value":60},{"type":13,"tag":38,"props":151,"children":152},{"class":40,"line":63},[153,158,163,168,173,178,183,188,192,197],{"type":13,"tag":38,"props":154,"children":155},{"style":57},[156],{"type":18,"value":157}," device",{"type":13,"tag":38,"props":159,"children":160},{"style":45},[161],{"type":18,"value":162},":",{"type":13,"tag":38,"props":164,"children":165},{"style":45},[166],{"type":18,"value":167}," crate",{"type":13,"tag":38,"props":169,"children":170},{"style":45},[171],{"type":18,"value":172}," ::",{"type":13,"tag":38,"props":174,"children":175},{"style":57},[176],{"type":18,"value":177}," vk ",{"type":13,"tag":38,"props":179,"children":180},{"style":45},[181],{"type":18,"value":182},"::",{"type":13,"tag":38,"props":184,"children":185},{"style":72},[186],{"type":18,"value":187}," vk",{"type":13,"tag":38,"props":189,"children":190},{"style":45},[191],{"type":18,"value":182},{"type":13,"tag":38,"props":193,"children":194},{"style":72},[195],{"type":18,"value":196},"Device",{"type":13,"tag":38,"props":198,"children":199},{"style":57},[200],{"type":18,"value":80},{"type":13,"tag":38,"props":202,"children":203},{"class":40,"line":83},[204,209,213,217,221,226],{"type":13,"tag":38,"props":205,"children":206},{"style":57},[207],{"type":18,"value":208}," command_pool",{"type":13,"tag":38,"props":210,"children":211},{"style":45},[212],{"type":18,"value":162},{"type":13,"tag":38,"props":214,"children":215},{"style":72},[216],{"type":18,"value":187},{"type":13,"tag":38,"props":218,"children":219},{"style":45},[220],{"type":18,"value":182},{"type":13,"tag":38,"props":222,"children":223},{"style":72},[224],{"type":18,"value":225},"CommandPool",{"type":13,"tag":38,"props":227,"children":228},{"style":57},[229],{"type":18,"value":80},{"type":13,"tag":38,"props":231,"children":232},{"class":40,"line":101},[233,238,242,246,250,255],{"type":13,"tag":38,"props":234,"children":235},{"style":57},[236],{"type":18,"value":237}," flags",{"type":13,"tag":38,"props":239,"children":240},{"style":45},[241],{"type":18,"value":162},{"type":13,"tag":38,"props":243,"children":244},{"style":72},[245],{"type":18,"value":187},{"type":13,"tag":38,"props":247,"children":248},{"style":45},[249],{"type":18,"value":182},{"type":13,"tag":38,"props":251,"children":252},{"style":72},[253],{"type":18,"value":254},"CommandPoolTrimFlags",{"type":13,"tag":38,"props":256,"children":257},{"style":57},[258],{"type":18,"value":80},{"type":13,"tag":38,"props":260,"children":262},{"class":40,"line":261},5,[263],{"type":13,"tag":38,"props":264,"children":265},{"style":57},[266],{"type":18,"value":117},{"type":13,"tag":268,"props":269,"children":270},"ul",{},[271,282,292],{"type":13,"tag":272,"props":273,"children":274},"li",{},[275,280],{"type":13,"tag":34,"props":276,"children":278},{"className":277},[],[279],{"type":18,"value":75},{"type":18,"value":281}," is the logical device that owns the command pool.",{"type":13,"tag":272,"props":283,"children":284},{},[285,290],{"type":13,"tag":34,"props":286,"children":288},{"className":287},[],[289],{"type":18,"value":94},{"type":18,"value":291}," is the command pool to trim.",{"type":13,"tag":272,"props":293,"children":294},{},[295,300],{"type":13,"tag":34,"props":296,"children":298},{"className":297},[],[299],{"type":18,"value":112},{"type":18,"value":301}," is reserved for future use.",{"type":13,"tag":14,"props":303,"children":304},{},[305],{"type":18,"value":306},"Trimming a command pool recycles unused memory from the command pool back to\nthe system.\nCommand buffers allocated from the pool are not affected by the command.",{"type":13,"tag":308,"props":309,"children":310},"note",{},[311,316,330,350,360,373],{"type":13,"tag":14,"props":312,"children":313},{},[314],{"type":18,"value":315},"This command provides applications with some control over the internal\nmemory allocations used by command pools.",{"type":13,"tag":14,"props":317,"children":318},{},[319,321,328],{"type":18,"value":320},"Unused memory normally arises from command buffers that have been recorded\nand later reset, such that they are no longer using the memory.\nOn reset, a command buffer can return memory to its command pool, but the\nonly way to release memory from a command pool to the system requires\ncalling ",{"type":13,"tag":322,"props":323,"children":325},"a",{"href":324},"/man/vkResetCommandPool",[326],{"type":18,"value":327},"vkResetCommandPool",{"type":18,"value":329},", which cannot be executed while any command\nbuffers from that pool are still in use.\nSubsequent recording operations into command buffers will reuse this memory\nbut since total memory requirements fluctuate over time, unused memory can\naccumulate.",{"type":13,"tag":14,"props":331,"children":332},{},[333,335,340,342,348],{"type":18,"value":334},"In this situation, trimming a command pool ",{"type":13,"tag":336,"props":337,"children":339},"normative",{"type":338},"may",[],{"type":18,"value":341}," be useful to return unused\nmemory back to the system, returning the total outstanding memory allocated\nby the pool back to a more ",{"type":13,"tag":34,"props":343,"children":345},{"className":344},[],[346],{"type":18,"value":347},"average",{"type":18,"value":349}," value.",{"type":13,"tag":14,"props":351,"children":352},{},[353,355,358],{"type":18,"value":354},"Implementations utilize many internal allocation strategies that make it\nimpossible to guarantee that all unused memory is released back to the\nsystem.\nFor instance, an implementation of a command pool ",{"type":13,"tag":336,"props":356,"children":357},{"type":338},[],{"type":18,"value":359}," involve allocating\nmemory in bulk from the system and sub-allocating from that memory.\nIn such an implementation any live command buffer that holds a reference to\na bulk allocation would prevent that allocation from being freed, even if\nonly a small proportion of the bulk allocation is in use.",{"type":13,"tag":14,"props":361,"children":362},{},[363,365,371],{"type":18,"value":364},"In most cases trimming will result in a reduction in allocated but unused\nmemory, but it does not guarantee the ",{"type":13,"tag":34,"props":366,"children":368},{"className":367},[],[369],{"type":18,"value":370},"ideal",{"type":18,"value":372}," behavior.",{"type":13,"tag":14,"props":374,"children":375},{},[376,378,381,383,387,389,392,394,400],{"type":18,"value":377},"Trimming ",{"type":13,"tag":336,"props":379,"children":380},{"type":338},[],{"type":18,"value":382}," be an expensive operation, and ",{"type":13,"tag":336,"props":384,"children":386},{"type":385},"should",[],{"type":18,"value":388}," not be called\nfrequently.\nTrimming ",{"type":13,"tag":336,"props":390,"children":391},{"type":385},[],{"type":18,"value":393}," be treated as a way to relieve memory pressure after\napplication-known points when there exists enough unused memory that the\ncost of trimming is ",{"type":13,"tag":34,"props":395,"children":397},{"className":396},[],[398],{"type":18,"value":399},"worth",{"type":18,"value":401}," it.",{"type":13,"tag":403,"props":404,"children":406},"validity-group",{"name":405},"Valid Usage (Implicit)",[407,436,460,484],{"type":13,"tag":408,"props":409,"children":411},"validity-field",{"name":410},"VUID-vkTrimCommandPool-device-parameter",[412],{"type":13,"tag":14,"props":413,"children":414},{},[415,420,422,426,428,434],{"type":13,"tag":34,"props":416,"children":418},{"className":417},[],[419],{"type":18,"value":75},{"type":18,"value":421}," ",{"type":13,"tag":336,"props":423,"children":425},{"type":424},"must",[],{"type":18,"value":427}," be a valid ",{"type":13,"tag":322,"props":429,"children":431},{"href":430},"/man/VkDevice",[432],{"type":18,"value":433},"VkDevice",{"type":18,"value":435}," handle",{"type":13,"tag":408,"props":437,"children":439},{"name":438},"VUID-vkTrimCommandPool-commandPool-parameter",[440],{"type":13,"tag":14,"props":441,"children":442},{},[443,448,449,452,453,459],{"type":13,"tag":34,"props":444,"children":446},{"className":445},[],[447],{"type":18,"value":94},{"type":18,"value":421},{"type":13,"tag":336,"props":450,"children":451},{"type":424},[],{"type":18,"value":427},{"type":13,"tag":322,"props":454,"children":456},{"href":455},"/man/VkCommandPool",[457],{"type":18,"value":458},"VkCommandPool",{"type":18,"value":435},{"type":13,"tag":408,"props":461,"children":463},{"name":462},"VUID-vkTrimCommandPool-flags-zerobitmask",[464],{"type":13,"tag":14,"props":465,"children":466},{},[467,472,473,476,478],{"type":13,"tag":34,"props":468,"children":470},{"className":469},[],[471],{"type":18,"value":112},{"type":18,"value":421},{"type":13,"tag":336,"props":474,"children":475},{"type":424},[],{"type":18,"value":477}," be ",{"type":13,"tag":34,"props":479,"children":481},{"className":480},[],[482],{"type":18,"value":483},"0",{"type":13,"tag":408,"props":485,"children":487},{"name":486},"VUID-vkTrimCommandPool-commandPool-parent",[488],{"type":13,"tag":14,"props":489,"children":490},{},[491,496,497,500,502],{"type":13,"tag":34,"props":492,"children":494},{"className":493},[],[495],{"type":18,"value":94},{"type":18,"value":421},{"type":13,"tag":336,"props":498,"children":499},{"type":424},[],{"type":18,"value":501}," have been created, allocated, or retrieved from ",{"type":13,"tag":34,"props":503,"children":505},{"className":504},[],[506],{"type":18,"value":75},{"type":13,"tag":508,"props":509,"children":511},"validity-box",{"name":510},"Host Synchronization",[512],{"type":13,"tag":268,"props":513,"children":514},{},[515],{"type":13,"tag":272,"props":516,"children":517},{},[518,520,525,526,529],{"type":18,"value":519},"Host access to ",{"type":13,"tag":34,"props":521,"children":523},{"className":522},[],[524],{"type":18,"value":94},{"type":18,"value":421},{"type":13,"tag":336,"props":527,"children":528},{"type":424},[],{"type":18,"value":530}," be externally synchronized\n::",{"type":13,"tag":532,"props":533,"children":534},"style",{},[535],{"type":18,"value":536},"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":538},[],"markdown",1725732623815]