[{"data":1,"prerenderedAt":277},["ShallowReactive",2],{"4lLPUeV6VC":3},{"title":4,"description":5,"parent":6,"type":7,"xrefs":8,"body":10,"_type":276,"_id":4},"VkSwapchainKHR","Opaque handle to a swapchain object","VK_KHR_swapchain","handles",[9],"vkQueuePresentKHR",{"type":11,"children":12,"toc":274},"root",[13,29,107,132,148,178,210,255,260,268],{"type":14,"tag":15,"props":16,"children":17},"element","p",{},[18,21,27],{"type":19,"value":20},"text","A swapchain object (a.k.a.\nswapchain) provides the ability to present rendering results to a surface.\nSwapchain objects are represented by ",{"type":14,"tag":22,"props":23,"children":25},"code",{"className":24},[],[26],{"type":19,"value":4},{"type":19,"value":28}," handles:",{"type":14,"tag":30,"props":31,"children":32},"code-group",{},[33,63],{"type":14,"tag":34,"props":35,"children":41},"pre",{"className":36,"code":37,"filename":38,"language":39,"meta":40,"style":40},"language-c shiki shiki-themes github-light-default github-dark-default","VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR)\n","C","c","",[42],{"type":14,"tag":22,"props":43,"children":44},{"__ignoreMap":40},[45],{"type":14,"tag":46,"props":47,"children":50},"span",{"class":48,"line":49},"line",1,[51,57],{"type":14,"tag":46,"props":52,"children":54},{"style":53},"--shiki-default:#8250DF;--shiki-dark:#D2A8FF",[55],{"type":19,"value":56},"VK_DEFINE_NON_DISPATCHABLE_HANDLE",{"type":14,"tag":46,"props":58,"children":60},{"style":59},"--shiki-default:#1F2328;--shiki-dark:#E6EDF3",[61],{"type":19,"value":62},"(VkSwapchainKHR)\n",{"type":14,"tag":34,"props":64,"children":69},{"className":65,"code":66,"filename":67,"language":68,"meta":40,"style":40},"language-rs shiki shiki-themes github-light-default github-dark-default","#[repr(transparent)]\npub struct SwapchainKHR(_);\n","Rust","rs",[70],{"type":14,"tag":22,"props":71,"children":72},{"__ignoreMap":40},[73,81],{"type":14,"tag":46,"props":74,"children":75},{"class":48,"line":49},[76],{"type":14,"tag":46,"props":77,"children":78},{"style":59},[79],{"type":19,"value":80},"#[repr(transparent)]\n",{"type":14,"tag":46,"props":82,"children":84},{"class":48,"line":83},2,[85,91,96,102],{"type":14,"tag":46,"props":86,"children":88},{"style":87},"--shiki-default:#CF222E;--shiki-dark:#FF7B72",[89],{"type":19,"value":90},"pub",{"type":14,"tag":46,"props":92,"children":93},{"style":87},[94],{"type":19,"value":95}," struct",{"type":14,"tag":46,"props":97,"children":99},{"style":98},"--shiki-default:#953800;--shiki-dark:#FFA657",[100],{"type":19,"value":101}," SwapchainKHR",{"type":14,"tag":46,"props":103,"children":104},{"style":59},[105],{"type":19,"value":106},"(_);\n",{"type":14,"tag":15,"props":108,"children":109},{},[110,112,118,120,125,127,130],{"type":19,"value":111},"A swapchain is an abstraction for an array of presentable images that are\nassociated with a surface.\nThe presentable images are represented by ",{"type":14,"tag":22,"props":113,"children":115},{"className":114},[],[116],{"type":19,"value":117},"VkImage",{"type":19,"value":119}," objects created by\nthe platform.\nOne image (which ",{"type":14,"tag":121,"props":122,"children":124},"normative",{"type":123},"can",[],{"type":19,"value":126}," be an array image for multiview/stereoscopic-3D\nsurfaces) is displayed at a time, but multiple images ",{"type":14,"tag":121,"props":128,"children":129},{"type":123},[],{"type":19,"value":131}," be queued for\npresentation.\nAn application renders to the image, and then queues the image for\npresentation to the surface.",{"type":14,"tag":15,"props":133,"children":134},{},[135,137,141,143,146],{"type":19,"value":136},"A native window ",{"type":14,"tag":121,"props":138,"children":140},{"type":139},"cannot",[],{"type":19,"value":142}," be associated with more than one non-retired\nswapchain at a time.\nFurther, swapchains ",{"type":14,"tag":121,"props":144,"children":145},{"type":139},[],{"type":19,"value":147}," be created for native windows that have a\nnon-Vulkan graphics API surface associated with them.",{"type":14,"tag":149,"props":150,"children":151},"note",{},[152,157,168],{"type":14,"tag":15,"props":153,"children":154},{},[155],{"type":19,"value":156},"The presentation engine is an abstraction for the platform’s compositor or\ndisplay engine.",{"type":14,"tag":15,"props":158,"children":159},{},[160,162,166],{"type":19,"value":161},"The presentation engine ",{"type":14,"tag":121,"props":163,"children":165},{"type":164},"may",[],{"type":19,"value":167}," be synchronous or asynchronous with respect to\nthe application and/or logical device.",{"type":14,"tag":15,"props":169,"children":170},{},[171,173,176],{"type":19,"value":172},"Some implementations ",{"type":14,"tag":121,"props":174,"children":175},{"type":164},[],{"type":19,"value":177}," use the device’s graphics queue or dedicated\npresentation hardware to perform presentation.",{"type":14,"tag":15,"props":179,"children":180},{},[181,183,186,188,192,194,201,203,208],{"type":19,"value":182},"The presentable images of a swapchain are owned by the presentation engine.\nAn application ",{"type":14,"tag":121,"props":184,"children":185},{"type":123},[],{"type":19,"value":187}," acquire use of a presentable image from the presentation\nengine.\nUse of a presentable image ",{"type":14,"tag":121,"props":189,"children":191},{"type":190},"must",[],{"type":19,"value":193}," occur only after the image is returned by\n",{"type":14,"tag":195,"props":196,"children":198},"a",{"href":197},"/man/vkAcquireNextImageKHR",[199],{"type":19,"value":200},"vkAcquireNextImageKHR",{"type":19,"value":202},", and before it is released by\n",{"type":14,"tag":195,"props":204,"children":206},{"href":205},"/man/vkQueuePresentKHR",[207],{"type":19,"value":9},{"type":19,"value":209},".\nThis includes transitioning the image layout and rendering commands.",{"type":14,"tag":15,"props":211,"children":212},{},[213,215,218,220,224,226,229,231,234,236,240,242,245,247,253],{"type":19,"value":214},"An application ",{"type":14,"tag":121,"props":216,"children":217},{"type":123},[],{"type":19,"value":219}," acquire use of a presentable image with\n",{"type":14,"tag":195,"props":221,"children":222},{"href":197},[223],{"type":19,"value":200},{"type":19,"value":225},".\nAfter acquiring a presentable image and before modifying it, the application\n",{"type":14,"tag":121,"props":227,"children":228},{"type":190},[],{"type":19,"value":230}," use a synchronization primitive to ensure that the presentation engine\nhas finished reading from the image.\nThe application ",{"type":14,"tag":121,"props":232,"children":233},{"type":123},[],{"type":19,"value":235}," then transition the image’s layout, queue rendering\ncommands to it, etc.\nFinally, the application presents the image with ",{"type":14,"tag":195,"props":237,"children":238},{"href":205},[239],{"type":19,"value":9},{"type":19,"value":241},",\nwhich releases the acquisition of the image.\nThe application ",{"type":14,"tag":121,"props":243,"children":244},{"type":123},[],{"type":19,"value":246}," also release the acquisition of the image through\n",{"type":14,"tag":195,"props":248,"children":250},{"href":249},"/man/vkReleaseSwapchainImagesEXT",[251],{"type":19,"value":252},"vkReleaseSwapchainImagesEXT",{"type":19,"value":254},", if the image is not in use by the device,\nand skip the present operation.",{"type":14,"tag":15,"props":256,"children":257},{},[258],{"type":19,"value":259},"The presentation engine controls the order in which presentable images are\nacquired for use by the application.",{"type":14,"tag":149,"props":261,"children":262},{},[263],{"type":14,"tag":15,"props":264,"children":265},{},[266],{"type":19,"value":267},"This allows the platform to handle situations which require out-of-order\nreturn of images after presentation.\nAt the same time, it allows the application to generate command buffers\nreferencing all of the images in the swapchain at initialization time,\nrather than in its main loop.",{"type":14,"tag":269,"props":270,"children":271},"style",{},[272],{"type":19,"value":273},"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":40,"searchDepth":83,"depth":83,"links":275},[],"markdown",1729612483885]