{"id":325289,"date":"2021-06-22T15:00:20","date_gmt":"2021-06-22T15:00:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325289"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325289","title":{"rendered":"Vulkan. \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u042f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430\u043c\u0438 \u0432 \u0438\u0436\u0435\u0432\u0441\u043a\u043e\u0439 IT-\u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 CG Tribe \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0443\u0440\u043e\u043a\u043e\u0432 Vulkan Tutorial \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a. \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/vulkan-tutorial.com\" rel=\"nofollow noopener noreferrer\">\u0437\u0434\u0435\u0441\u044c<\/a>. <\/p>\n<p>  \u041c\u043e\u044f \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0432\u0443\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0430 Drawing, \u2014 Framebuffers \u0438 Command buffers. <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">1. <a href=\"http:\/\/habr.com\/ru\/post\/462137\/\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<p>  2. <a href=\"http:\/\/habr.com\/ru\/post\/524992\/\">\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440<\/a><\/p>\n<p>  3. <a href=\"https:\/\/habr.com\/ru\/post\/526320\/\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/a><\/p>\n<p>  4. <a href=\"https:\/\/habr.com\/ru\/post\/531196\/\">\u0420\u0438\u0441\u0443\u0435\u043c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a<\/a><\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/531196\/\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/a><br \/> \n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/531196\/#base\">\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/531196\/#two\">\u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 (instance)<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/535342\/\">\u0421\u043b\u043e\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/537208\/#phys\">\u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/537208\/#logic\">\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u0438<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435<br \/> \n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/539174\/\">Window surface<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/542942\/\">Swap chain<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/543288\/\">Image views<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/547576\/\">\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 (pipeline)<\/a> <br \/> \n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/547576\/\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/547576\/#shader\">\u0428\u0435\u0439\u0434\u0435\u0440\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/554492\/\">\u041d\u0435\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u044d\u0442\u0430\u043f\u044b<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/560816\/\">\u041f\u0440\u043e\u0445\u043e\u0434\u044b \u0440\u0435\u043d\u0434\u0435\u0440\u0430<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/560816\/#conclusion\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430<\/li>\n<li>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430<\/li>\n<\/ol>\n<p>  5. \u0411\u0443\u0444\u0435\u0440\u044b \u0432\u0435\u0440\u0448\u0438\u043d<\/p>\n<ol>\n<li>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0432\u0435\u0440\u0448\u0438\u043d<\/li>\n<li>Staging \u0431\u0443\u0444\u0435\u0440<\/li>\n<li>\u0411\u0443\u0444\u0435\u0440 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432<\/li>\n<\/ol>\n<p>  6. Uniform-\u0431\u0443\u0444\u0435\u0440\u044b<\/p>\n<ol>\n<li>\u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 layout \u0438 \u0431\u0443\u0444\u0435\u0440\u0430<\/li>\n<li>\u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043f\u0443\u043b\u0430 \u0438 sets<\/li>\n<\/ol>\n<p>  7. \u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<ol>\n<li>\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/li>\n<li>Image view \u0438 image sampler<\/li>\n<li>\u041a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 image sampler<\/li>\n<\/ol>\n<p>  8. \u0411\u0443\u0444\u0435\u0440 \u0433\u043b\u0443\u0431\u0438\u043d\u044b<\/p>\n<p>  9. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/p>\n<p>  10. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u0438\u043f-\u043a\u0430\u0440\u0442<\/p>\n<p>  11. Multisampling<\/p>\n<p>  FAQ<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438  <\/div>\n<\/p><\/div>\n<h2>\u0424\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u044b<\/h2>\n<p>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0433\u043b\u0430\u0432\u0430\u0445 \u043c\u044b \u043c\u043d\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u0430\u0445 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043f\u0440\u043e\u0445\u043e\u0434 \u0440\u0435\u043d\u0434\u0435\u0440\u0430 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c, \u0447\u0442\u043e \u0438 image \u0438\u0437 swap chain. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0430\u043c \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043b\u0438.<\/p>\n<p>  \u0411\u0443\u0444\u0435\u0440\u044b (attachments), \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u0441\u044b\u043b\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0432 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkFramebuffer.html\" rel=\"nofollow noopener noreferrer\">VkFramebuffer<\/a><\/b>. \u041e\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkImageView.html\" rel=\"nofollow noopener noreferrer\">VkImageView<\/a><\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0442\u0430\u0440\u0433\u0435\u0442\u044b. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0431\u0443\u0444\u0435\u0440: \u0431\u0443\u0444\u0435\u0440 \u0446\u0432\u0435\u0442\u0430. \u041e\u0434\u043d\u0430\u043a\u043e swap chain \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e image, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442 swap chain \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e image \u0438\u0437 swap chain \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0439 \u043d\u0430\u0441 image.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0447\u043b\u0435\u043d \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code class=\"cpp\">std::vector&lt;VkFramebuffer&gt; swapChainFramebuffers;<\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <b><code>createFramebuffers<\/code><\/b> \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u0435\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430. \u0412\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430:<\/p>\n<pre><code class=\"cpp\">void initVulkan() {     createInstance();     setupDebugMessenger();     createSurface();     pickPhysicalDevice();     createLogicalDevice();     createSwapChain();     createImageViews();     createRenderPass();     createGraphicsPipeline();     createFramebuffers(); }  ...  void createFramebuffers() {  }<\/code><\/pre>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">void createFramebuffers() {     swapChainFramebuffers.resize(swapChainImageViews.size()); }<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043e\u0431\u043e\u0439\u0434\u0435\u043c \u0432\u0441\u0435 image views \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438\u0437 \u043d\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u044b:<\/p>\n<pre><code class=\"cpp\">for (size_t i = 0; i &lt; swapChainImageViews.size(); i++) {     VkImageView attachments[] = {         swapChainImageViews[i]     };      VkFramebufferCreateInfo framebufferInfo{};     framebufferInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;     framebufferInfo.renderPass = renderPass;     framebufferInfo.attachmentCount = 1;     framebufferInfo.pAttachments = attachments;     framebufferInfo.width = swapChainExtent.width;     framebufferInfo.height = swapChainExtent.height;     framebufferInfo.layers = 1;      if (vkCreateFramebuffer(device, &amp;framebufferInfo, nullptr, &amp;swapChainFramebuffers[i]) != VK_SUCCESS) {         throw std::runtime_error(&quot;failed to create framebuffer!&quot;);     } }<\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0441 \u043a\u0430\u043a\u0438\u043c <b><code>renderPass<\/code><\/b> \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c. \u0424\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0430\u043c\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u043d\u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u0442\u0438\u043f \u0431\u0443\u0444\u0435\u0440\u043e\u0432.<\/p>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <b><code>attachmentCount<\/code><\/b> \u0438 <b><code>pAttachments<\/code><\/b> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkImageView.html\" rel=\"nofollow noopener noreferrer\">VkImageView<\/a><\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e <b><code>pAttachments<\/code><\/b>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0430.<\/p>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <b><code>width<\/code><\/b> \u0438 <b><code>height<\/code><\/b> \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u0412 \u043f\u043e\u043b\u0435 <b><code>layers<\/code><\/b> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0435\u0432 \u0434\u043b\u044f images. \u041d\u0430\u0448\u0438 images \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 layers = <b><code>1<\/code><\/b>.<\/p>\n<p>  \u0424\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u044b \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 image views \u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u043e\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0430, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430:<\/p>\n<pre><code class=\"cpp\">void cleanup() {     for (auto framebuffer : swapChainFramebuffers) {         vkDestroyFramebuffer(device, framebuffer, nullptr);     }      ... }<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u0443\u0436\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <b><a href=\"https:\/\/vulkan-tutorial.com\/code\/13_framebuffers.cpp\" rel=\"nofollow noopener noreferrer\">\u041a\u043e\u0434 C++<\/a><\/b> \/ <b><a href=\"https:\/\/vulkan-tutorial.com\/code\/09_shader_base.vert\" rel=\"nofollow noopener noreferrer\">\u0412\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440<\/a><\/b> \/ <b><a href=\"https:\/\/vulkan-tutorial.com\/code\/09_shader_base.frag\" rel=\"nofollow noopener noreferrer\">\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440<\/a><\/b><\/p>\n<p>  <\/p>\n<h2>\u0411\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"#one\">\u041f\u0443\u043b \u043a\u043e\u043c\u0430\u043d\u0434<\/a><\/li>\n<li><a href=\"#two\">\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434<\/a><\/li>\n<li><a href=\"#three\">\u0417\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434<\/a><\/li>\n<li><a href=\"#four\">\u041d\u0430\u0447\u0430\u043b\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0430<\/a><\/li>\n<li><a href=\"#five\">\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f<\/a><\/li>\n<li><a href=\"#six\">\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435<\/a><\/li>\n<\/ul>\n<p>  \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 Vulkan, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0412\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0431\u0443\u0444\u0435\u0440. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u0430\u0445. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0432\u0430\u043c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c Vulkan, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<a name=\"one\"><\/a><\/p>\n<h3>\u041f\u0443\u043b \u043a\u043e\u043c\u0430\u043d\u0434<\/h3>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u043b \u043a\u043e\u043c\u0430\u043d\u0434. \u041f\u0443\u043b \u043a\u043e\u043c\u0430\u043d\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u043e\u0432. <\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0447\u043b\u0435\u043d \u043a\u043b\u0430\u0441\u0441\u0430 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkCommandPool.html\" rel=\"nofollow noopener noreferrer\">VkCommandPool<\/a><\/b>.<\/p>\n<pre><code class=\"cpp\">VkCommandPool commandPool;<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <b><code>createCommandPool<\/code><\/b> \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u0435\u0435 \u0438\u0437 <b><code>initVulkan<\/code><\/b> \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u043e\u0432.<\/p>\n<pre><code class=\"cpp\">void initVulkan() {     createInstance();     setupDebugMessenger();     createSurface();     pickPhysicalDevice();     createLogicalDevice();     createSwapChain();     createImageViews();     createRenderPass();     createGraphicsPipeline();     createFramebuffers();     createCommandPool(); }  ...  void createCommandPool() {  }<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">QueueFamilyIndices queueFamilyIndices = findQueueFamilies(physicalDevice);  VkCommandPoolCreateInfo poolInfo{}; poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; poolInfo.queueFamilyIndex = queueFamilyIndices.graphicsFamily.value(); poolInfo.flags = 0; \/\/ Optional<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434, \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041f\u0443\u043b \u043a\u043e\u043c\u0430\u043d\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0431\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0444\u043b\u0430\u0433\u0430 \u0434\u043b\u044f \u043f\u0443\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<ul>\n<li><b><code>VK_COMMAND_POOL_CREATE_TRANSIENT_BIT<\/code><\/b>: \u0445\u0438\u043d\u0442, \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0449\u0438\u0439 Vulkan, \u0447\u0442\u043e \u0431\u0443\u0444\u0435\u0440\u044b \u0438\u0437 \u043f\u0443\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0447\u0430\u0441\u0442\u043e \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f (\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0443\u043b\u0430 \u043f\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438)<\/li>\n<li><b><code>VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT<\/code><\/b>: \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0431\u0443\u0444\u0435\u0440\u044b \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e; \u0435\u0441\u043b\u0438 \u0444\u043b\u0430\u0433 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435 \u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e<\/li>\n<\/ul>\n<p>  \u041c\u044b \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0431\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0435\u043c \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0445 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u044d\u0442\u0438\u0445 \u0444\u043b\u0430\u0433\u043e\u0432 \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442.<\/p>\n<pre><code class=\"cpp\">if (vkCreateCommandPool(device, &amp;poolInfo, nullptr, &amp;commandPool) != VK_SUCCESS) {     throw std::runtime_error(&quot;failed to create command pool!&quot;); }<\/code><\/pre>\n<p>  \u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0443\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkCreateCommandPool.html\" rel=\"nofollow noopener noreferrer\">vkCreateCommandPool<\/a><\/b>. \u0412 \u043d\u0435\u0439 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0443\u043b \u043d\u0443\u0436\u043d\u043e \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435:<\/p>\n<pre><code class=\"cpp\">void cleanup() {     vkDestroyCommandPool(device, commandPool, nullptr);      ... }<\/code><\/pre>\n<p><a name=\"ttwo\"><\/a><\/p>\n<h3>\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043d\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkFramebuffer.html\" rel=\"nofollow noopener noreferrer\">VkFrameBuffer<\/a><\/b>, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e image \u0438\u0437 swap chain. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkCommandBuffer.html\" rel=\"nofollow noopener noreferrer\">VkCommandBuffer<\/a><\/b> \u0432 \u0432\u0438\u0434\u0435 \u0447\u043b\u0435\u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0430. \u041f\u043e\u0441\u043b\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0443\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u0431\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u044f\u0432\u043d\u0430\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0430.<\/p>\n<pre><code class=\"cpp\">std::vector&lt;VkCommandBuffer&gt; commandBuffers;<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <b><code>createCommandBuffers<\/code><\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e image \u0438\u0437 swap chain.<\/p>\n<pre><code class=\"cpp\">void initVulkan() {     createInstance();     setupDebugMessenger();     createSurface();     pickPhysicalDevice();     createLogicalDevice();     createSwapChain();     createImageViews();     createRenderPass();     createGraphicsPipeline();     createFramebuffers();     createCommandPool();     createCommandBuffers(); }  ...  void createCommandBuffers() {     commandBuffers.resize(swapChainFramebuffers.size()); }<\/code><\/pre>\n<p>  \u0411\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkAllocateCommandBuffers.html\" rel=\"nofollow noopener noreferrer\">vkAllocateCommandBuffers<\/a><\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkCommandBufferAllocateInfo.html\" rel=\"nofollow noopener noreferrer\">VkCommandBufferAllocateInfo<\/a><\/b> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. \u0412 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u043b \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0443\u0444\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">VkCommandBufferAllocateInfo allocInfo{}; allocInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO; allocInfo.commandPool = commandPool; allocInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; allocInfo.commandBufferCount = (uint32_t) commandBuffers.size();  if (vkAllocateCommandBuffers(device, &amp;allocInfo, commandBuffers.data()) != VK_SUCCESS) {     throw std::runtime_error(&quot;failed to allocate command buffers!&quot;); }<\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b><code>level<\/code><\/b> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u043c\u0438 \u0438\u043b\u0438 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0431\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<ul>\n<li><b><code>VK_COMMAND_BUFFER_LEVEL_PRIMARY<\/code><\/b>: \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0435 \u0431\u0443\u0444\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u043e \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434.<\/li>\n<li><b><code>VK_COMMAND_BUFFER_LEVEL_SECONDARY<\/code><\/b>: \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u0431\u0443\u0444\u0435\u0440\u044b \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434.<\/li>\n<\/ul>\n<p>  \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u0431\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434, \u0445\u043e\u0442\u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 \u043d\u0438\u0445 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u043c \u0431\u0443\u0444\u0435\u0440\u0435.<a name=\"three\"><\/a><\/p>\n<h3>\u0417\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434<\/h3>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u0441 \u0432\u044b\u0437\u043e\u0432\u0430 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkBeginCommandBuffer.html\" rel=\"nofollow noopener noreferrer\">vkBeginCommandBuffer<\/a><\/b>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkCommandBufferBeginInfo.html\" rel=\"nofollow noopener noreferrer\">VkCommandBufferBeginInfo<\/a><\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430.<\/p>\n<pre><code class=\"cpp\">for (size_t i = 0; i &lt; commandBuffers.size(); i++) {     VkCommandBufferBeginInfo beginInfo{};     beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;     beginInfo.flags = 0; \/\/ Optional     beginInfo.pInheritanceInfo = nullptr; \/\/ Optional      if (vkBeginCommandBuffer(commandBuffers[i], &amp;beginInfo) != VK_SUCCESS) {         throw std::runtime_error(&quot;failed to begin recording command buffer!&quot;);     } }<\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b><code>flags<\/code><\/b> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0444\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li><b><code>VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT<\/code><\/b>: \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0443\u0444\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/li>\n<li><b><code>VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT<\/code><\/b>: \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0430.<\/li>\n<li><b><code>VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT<\/code><\/b>: \u0431\u0443\u0444\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432 \u0435\u0449\u0451 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f.<\/li>\n<\/ul>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0444\u043b\u0430\u0433\u043e\u0432 \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b><code>pInheritanceInfo<\/code><\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434. \u041e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0435 \u0438\u0437 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u0443\u0444\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0443\u0436\u0435 \u0431\u044b\u043b \u0437\u0430\u043f\u0438\u0441\u0430\u043d, \u0432\u044b\u0437\u043e\u0432 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkBeginCommandBuffer.html\" rel=\"nofollow noopener noreferrer\">vkBeginCommandBuffer<\/a><\/b> \u043d\u0435\u044f\u0432\u043d\u043e \u0441\u0431\u0440\u043e\u0441\u0438\u0442 \u0435\u0433\u043e. \u041d\u0435\u043b\u044c\u0437\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u0443\u0436\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440.<a name=\"four\"><\/a><\/p>\n<h3>\u041d\u0430\u0447\u0430\u043b\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0430<\/h3>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430, \u043d\u0430\u0447\u0430\u0432 \u043f\u0440\u043e\u0445\u043e\u0434 \u0440\u0435\u043d\u0434\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkCmdBeginRenderPass.html\" rel=\"nofollow noopener noreferrer\">vkCmdBeginRenderPass<\/a><\/b>. \u041f\u0440\u043e\u0445\u043e\u0434 \u0440\u0435\u043d\u0434\u0435\u0440\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkRenderPassBeginInfo.html\" rel=\"nofollow noopener noreferrer\">VkRenderPassBeginInfo<\/a><\/b>.<\/p>\n<pre><code class=\"cpp\">VkRenderPassBeginInfo renderPassInfo{}; renderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; renderPassInfo.renderPass = renderPass; renderPassInfo.framebuffer = swapChainFramebuffers[i];<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0445\u043e\u0434 \u0440\u0435\u043d\u0434\u0435\u0440\u0430 \u0438 \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e image \u0438\u0437 swap chain, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430.<\/p>\n<pre><code class=\"cpp\">renderPassInfo.renderArea.offset = {0, 0}; renderPassInfo.renderArea.extent = swapChainExtent;<\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430. \u041e\u0431\u043b\u0430\u0441\u0442\u044c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 (render area) \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0448\u0435\u0439\u0434\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u0438\u043a\u0441\u0435\u043b\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0431\u0443\u0444\u0435\u0440\u043e\u0432.<\/p>\n<pre><code class=\"cpp\">VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f}; renderPassInfo.clearValueCount = 1; renderPassInfo.pClearValues = &amp;clearColor;<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <b><code>VK_ATTACHMENT_LOAD_OP_CLEAR<\/code><\/b>. \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440 \u0447\u0435\u0440\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c \u0441\u043e 100% \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0447\u043d\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434 \u0440\u0435\u043d\u0434\u0435\u0440\u0430. <\/p>\n<pre><code class=\"cpp\">vkCmdBeginRenderPass(commandBuffers[i], &amp;renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);<\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0443 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkCmd.html\" rel=\"nofollow noopener noreferrer\">vkCmd<\/a><\/b>. \u0412\u0441\u0435 \u043e\u043d\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <b><code>void<\/code><\/b>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438.<\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u2014 \u0431\u0443\u0444\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u0430. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043f\u043e\u0434\u043f\u0440\u043e\u0445\u043e\u0434\u0435 (subpass). \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u0437 \u0434\u0432\u0443\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/p>\n<ul>\n<li><b><code>VK_SUBPASS_CONTENTS_INLINE<\/code><\/b>: \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434 \u0431\u0435\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432.<\/li>\n<li><b><code>VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS<\/code><\/b>: \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u0438\u0437 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434.<\/li>\n<\/ul>\n<p>  \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u0431\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<a name=\"five\"><\/a><\/p>\n<h3>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">vkCmdBindPipeline(commandBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, graphicsPipeline);<\/code><\/pre>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u2014 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a:<\/p>\n<pre><code class=\"cpp\">vkCmdDraw(commandBuffers[i], 3, 1, 0, 0);<\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkCmdDraw.html\" rel=\"nofollow noopener noreferrer\">vkCmdDraw<\/a><\/b> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u043a\u0440\u043e\u043c\u043d\u043e, \u043d\u043e \u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435. \u041f\u043e\u043c\u0438\u043c\u043e \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li><b><code>vertexCount<\/code><\/b>: \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440, \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 3 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430.<\/li>\n<li><b><code>instanceCount<\/code><\/b>: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (instanced rendering); \u043f\u0435\u0440\u0435\u0434\u0430\u0439\u0442\u0435 <b><code>1<\/code><\/b>, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/li>\n<li><b><code>firstVertex<\/code><\/b>: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u043c \u0431\u0443\u0444\u0435\u0440\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <b><code>gl_VertexIndex<\/code><\/b>.<\/li>\n<li><b><code>firstInstance<\/code><\/b>: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <b><code>gl_InstanceIndex<\/code><\/b>.<\/li>\n<\/ul>\n<p><a name=\"six\"><\/a>  <\/p>\n<h3>\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0445\u043e\u0434 \u0440\u0435\u043d\u0434\u0435\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">vkCmdEndRenderPass(commandBuffers[i]);<\/code><\/pre>\n<p>  \u0418 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<pre><code class=\"cpp\">if (vkEndCommandBuffer(commandBuffers[i]) != VK_SUCCESS) {     throw std::runtime_error(&quot;failed to record command buffer!&quot;); }<\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430, \u0433\u0434\u0435 image \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0437 swap chain, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434, \u0430 \u0437\u0430\u0442\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 image \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 swap chain \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d.<\/p>\n<p>  <b><a href=\"https:\/\/vulkan-tutorial.com\/code\/14_command_buffers.cpp\" rel=\"nofollow noopener noreferrer\">\u041a\u043e\u0434 C++<\/a><\/b> \/ <b><a href=\"https:\/\/vulkan-tutorial.com\/code\/09_shader_base.vert\" rel=\"nofollow noopener noreferrer\">\u0412\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440<\/a><\/b> \/ <b><a href=\"https:\/\/vulkan-tutorial.com\/code\/09_shader_base.frag\" rel=\"nofollow noopener noreferrer\">\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440<\/a><\/b><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/564100\/\"> https:\/\/habr.com\/ru\/post\/564100\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u042f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430\u043c\u0438 \u0432 \u0438\u0436\u0435\u0432\u0441\u043a\u043e\u0439 IT-\u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 CG Tribe \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0443\u0440\u043e\u043a\u043e\u0432 Vulkan Tutorial \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a. \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/vulkan-tutorial.com\" rel=\"nofollow noopener noreferrer\">\u0437\u0434\u0435\u0441\u044c<\/a>. <\/p>\n<p>  \u041c\u043e\u044f \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0432\u0443\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0430 Drawing, \u2014 Framebuffers \u0438 Command buffers. <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">1. <a href=\"http:\/\/habr.com\/ru\/post\/462137\/\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/a><\/p>\n<p>  2. <a href=\"http:\/\/habr.com\/ru\/post\/524992\/\">\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440<\/a><\/p>\n<p>  3. <a href=\"https:\/\/habr.com\/ru\/post\/526320\/\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/a><\/p>\n<p>  4. <a href=\"https:\/\/habr.com\/ru\/post\/531196\/\">\u0420\u0438\u0441\u0443\u0435\u043c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a<\/a><\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/531196\/\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/a><br \/> \n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/531196\/#base\">\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/531196\/#two\">\u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 (instance)<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/535342\/\">\u0421\u043b\u043e\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/537208\/#phys\">\u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/537208\/#logic\">\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u0438<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435<br \/> \n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/539174\/\">Window surface<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/542942\/\">Swap chain<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/543288\/\">Image views<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/547576\/\">\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 (pipeline)<\/a> <br \/> \n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/547576\/\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/547576\/#shader\">\u0428\u0435\u0439\u0434\u0435\u0440\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/554492\/\">\u041d\u0435\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u044d\u0442\u0430\u043f\u044b<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/560816\/\">\u041f\u0440\u043e\u0445\u043e\u0434\u044b \u0440\u0435\u043d\u0434\u0435\u0440\u0430<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/560816\/#conclusion\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430<\/li>\n<li>\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430<\/li>\n<\/ol>\n<p>  5. \u0411\u0443\u0444\u0435\u0440\u044b \u0432\u0435\u0440\u0448\u0438\u043d<\/p>\n<ol>\n<li>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0432\u0435\u0440\u0448\u0438\u043d<\/li>\n<li>Staging \u0431\u0443\u0444\u0435\u0440<\/li>\n<li>\u0411\u0443\u0444\u0435\u0440 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432<\/li>\n<\/ol>\n<p>  6. Uniform-\u0431\u0443\u0444\u0435\u0440\u044b<\/p>\n<ol>\n<li>\u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 layout \u0438 \u0431\u0443\u0444\u0435\u0440\u0430<\/li>\n<li>\u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043f\u0443\u043b\u0430 \u0438 sets<\/li>\n<\/ol>\n<p>  7. \u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<ol>\n<li>\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/li>\n<li>Image view \u0438 image sampler<\/li>\n<li>\u041a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 image sampler<\/li>\n<\/ol>\n<p>  8. \u0411\u0443\u0444\u0435\u0440 \u0433\u043b\u0443\u0431\u0438\u043d\u044b<\/p>\n<p>  9. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/p>\n<p>  10. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u0438\u043f-\u043a\u0430\u0440\u0442<\/p>\n<p>  11. Multisampling<\/p>\n<p>  FAQ  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-325289","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=325289"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325289\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}