{"id":318292,"date":"2021-02-19T15:01:10","date_gmt":"2021-02-19T15:01:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=318292"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=318292","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. Image view"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u041a\u0442\u043e \u0435\u0449\u0435 \u0441\u043e \u043c\u043d\u043e\u0439 \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c, \u044f \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0438\u0437 \u0438\u0436\u0435\u0432\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 CGTribe, \u0438 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043a Vulkan API (<a href=\"https:\/\/vulkan-tutorial.com\" rel=\"nofollow noopener noreferrer\">vulkan-tutorial.com<\/a>). <\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0433\u043b\u0430\u0432\u044b Image view \u0438\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 Drawing a triangle, \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0430 Presentation.<\/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>Image views<\/li>\n<\/ul>\n<\/li>\n<li>\u041e\u0441\u043d\u043e\u0432\u044b \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430 (pipeline)<\/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>Image views<\/h2>\n<p>  \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkImage.html\" rel=\"nofollow noopener noreferrer\">VkImage<\/a> \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 <a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkImageView.html\" rel=\"nofollow noopener noreferrer\">VkImageView<\/a> \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435. Image view \u2014 \u044d\u0442\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0432\u0437\u0433\u043b\u044f\u0434 \u0432 image. \u041e\u043d \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c image \u0438 \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c image \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. <\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <b><code>createImageViews<\/code><\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 image view \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e image \u0432 swap chain, \u0447\u0442\u043e\u0431\u044b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0446\u0432\u0435\u0442\u0430 (color target). <\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0447\u043b\u0435\u043d \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f image views:<\/p>\n<pre><code class=\"cpp\">std::vector&lt;VkImageView&gt; swapChainImageViews;<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <b><code>createImageView<\/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 swap chain.<\/p>\n<pre><code class=\"cpp\">void initVulkan() {     createInstance();     setupDebugMessenger();     createSurface();     pickPhysicalDevice();     createLogicalDevice();     createSwapChain();     createImageViews(); }  void createImageViews() {  }<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u2014 \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, \u0447\u0442\u043e\u0431\u044b \u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0435 image views.<\/p>\n<pre><code class=\"cpp\">void createImageViews() {     swapChainImageViews.resize(swapChainImages.size());  }<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 image \u0438\u0437 swap chain.<\/p>\n<pre><code class=\"cpp\">for (size_t i = 0; i &lt; swapChainImages.size(); i++) {  }<\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f image view \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkImageViewCreateInfo.html\" rel=\"nofollow noopener noreferrer\">VkImageViewCreateInfo<\/a>. \u041f\u0435\u0440\u0432\u044b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<pre><code class=\"cpp\">VkImageViewCreateInfo createInfo{}; createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; createInfo.image = swapChainImages[i];<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u044f <b><code>viewType<\/code><\/b> \u0438 <b><code>format<\/code><\/b> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 image. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b><code>viewType<\/code><\/b> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a 1D, 2D, 3D \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u0438\u043b\u0438 cube maps.<\/p>\n<pre><code class=\"cpp\">createInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; createInfo.format = swapChainImageFormat;<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435 <b><code>components<\/code><\/b> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u0432\u044b\u0435 \u043a\u0430\u043d\u0430\u043b\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0446\u0432\u0435\u0442\u043e\u0432\u044b\u0435 \u043a\u0430\u043d\u0430\u043b\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 <b><code>r<\/code><\/b> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443. \u0418\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c <b><code>1<\/code><\/b> \u0438\u043b\u0438 <b><code>0<\/code><\/b> \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0434\u043b\u044f \u0430\u043b\u044c\u0444\u0430 \u043a\u0430\u043d\u0430\u043b\u0430. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<pre><code class=\"cpp\">createInfo.components.r = VK_COMPONENT_SWIZZLE_IDENTITY; createInfo.components.g = VK_COMPONENT_SWIZZLE_IDENTITY; createInfo.components.b = VK_COMPONENT_SWIZZLE_IDENTITY; createInfo.components.a = VK_COMPONENT_SWIZZLE_IDENTITY;<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435 <b><code>subresourceRange<\/code><\/b> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c image \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u041d\u0430\u0448\u0438 images \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 1 \u0441\u043b\u043e\u044f \u0431\u0435\u0437 \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0446\u0432\u0435\u0442\u0430.<\/p>\n<pre><code class=\"cpp\">createInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; createInfo.subresourceRange.baseMipLevel = 0; createInfo.subresourceRange.levelCount = 1; createInfo.subresourceRange.baseArrayLayer = 0; createInfo.subresourceRange.layerCount = 1;<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441\u043e \u0441\u0442\u0435\u0440\u0435\u043e\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c swap chain \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u044f\u043c\u0438. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e image \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e image views \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0433\u043b\u0430\u0437\u0430. <\/p>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f image view \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkCreateImageView.html\" rel=\"nofollow noopener noreferrer\">vkCreateImageView<\/a>:<\/p>\n<pre><code class=\"cpp\">if (vkCreateImageView(device, &amp;createInfo, nullptr, &amp;swapChainImageViews[i]) != VK_SUCCESS) {     throw std::runtime_error(&quot;failed to create image views!&quot;); }<\/code><\/pre>\n<p>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <b><code>VkImage<\/code><\/b>, image views \u0431\u044b\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u043d\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u0447\u0442\u043e\u0431\u044b \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c \u0438\u0445 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<pre><code class=\"cpp\">void cleanup() {     for (auto imageView : swapChainImageViews) {         vkDestroyImageView(device, imageView, nullptr);     }      ... }<\/code><\/pre>\n<p>  \u041d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e image view, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c image \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b, \u043e\u0434\u043d\u0430\u043a\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c image \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 render target, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440. \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440.<\/p>\n<p>  <a href=\"https:\/\/vulkan-tutorial.com\/code\/07_image_views.cpp\" rel=\"nofollow noopener noreferrer\">C++<\/a><\/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\/543288\/\"> https:\/\/habr.com\/ru\/post\/543288\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u041a\u0442\u043e \u0435\u0449\u0435 \u0441\u043e \u043c\u043d\u043e\u0439 \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c, \u044f \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0438\u0437 \u0438\u0436\u0435\u0432\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 CGTribe, \u0438 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043a Vulkan API (<a href=\"https:\/\/vulkan-tutorial.com\" rel=\"nofollow noopener noreferrer\">vulkan-tutorial.com<\/a>). <\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0433\u043b\u0430\u0432\u044b Image view \u0438\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 Drawing a triangle, \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0430 Presentation.<\/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>Image views<\/li>\n<\/ul>\n<\/li>\n<li>\u041e\u0441\u043d\u043e\u0432\u044b \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430 (pipeline)<\/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-318292","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318292","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=318292"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318292\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}