{"id":398549,"date":"2024-06-29T14:08:24","date_gmt":"2024-06-29T14:08:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=398549"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=398549","title":{"rendered":"<span>Vulkan. \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. Layout \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0431\u0443\u0444\u0435\u0440<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/sc\/qk\/o5\/scqko5z1upafgiqpxyb1buvipbi.png\" data-src=\"https:\/\/habrastorage.org\/webt\/sc\/qk\/o5\/scqko5z1upafgiqpxyb1buvipbi.png\"\/><\/p>\n<p>  \u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c! \u042f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0425\u0430\u0431\u0440 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b Vulkan Tutorial \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a (\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/vulkan-tutorial.com\" rel=\"nofollow noopener noreferrer\">\u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0436\u0443 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u2014 Uniform buffers, \u0438 \u043d\u0430\u0447\u043d\u0443 \u044f \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0430\u0442\u044c\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Descriptor layout and buffer.<\/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 \u0441\u0442\u0430\u0434\u0438\u0438 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430<\/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 (Render passes)<\/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<br \/> \n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/564100\/#frame\">\u0424\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u044b<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/564100\/#buffer\">\u0411\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/567754\/\">\u0420\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/569912\/\">\u041f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 swap chain<\/a><\/li>\n<\/ol>\n<p>  5. <a href=\"https:\/\/habr.com\/ru\/post\/571944\/\">\u0412\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0435 \u0431\u0443\u0444\u0435\u0440\u044b<\/a><\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/571944\/\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/573920\/\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/578956\/\">\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/users\/alexandra_sky\/posts\/\">\u0418\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440<\/a><\/li>\n<\/ol>\n<p>  6. Uniform-\u0431\u0443\u0444\u0435\u0440\u044b<\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/582838\/\">Layout \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0431\u0443\u0444\u0435\u0440<\/a><\/li>\n<li>\u041f\u0443\u043b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0435\u0442\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432<\/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>Layout \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0431\u0443\u0444\u0435\u0440<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"#one\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"#two\">\u0412\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440<\/a><\/li>\n<li><a href=\"#three\">Layout \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432<\/a><\/li>\n<li><a href=\"#four\">Uniform-\u0431\u0443\u0444\u0435\u0440<\/a><\/li>\n<li><a href=\"#five\">\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 uniform-\u0434\u0430\u043d\u043d\u044b\u0445<\/a><\/li>\n<\/ul>\n<p><a name=\"one\"><\/a><\/p>\n<h3>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u043c\u0443 \u0448\u0435\u0439\u0434\u0435\u0440\u0443, \u043d\u043e \u043a\u0430\u043a \u0431\u044b\u0442\u044c \u0441 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438? \u0421 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u044b \u043c\u044b \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0435, \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 3 \u043c\u0430\u0442\u0440\u0438\u0446\u044b: model \u2014 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432 \u043c\u0438\u0440\u043e\u0432\u044b\u0435, view \u2014 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u043c\u0438\u0440\u043e\u0432\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432\u043e view \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u0438 proj \u2014 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430. \u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0443\u0436\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440, \u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043b\u0438\u0448\u043d\u044e\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. <\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 Vulkan, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0442\u0430\u043a\u0438\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u043a\u0430\u043a \u0431\u0443\u0444\u0435\u0440\u044b \u0438 images. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0431\u0443\u0444\u0435\u0440, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u043c\u0443 \u0448\u0435\u0439\u0434\u0435\u0440\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u044d\u0442\u0430\u043f\u043e\u0432:<\/p>\n<ul>\n<li>\u0423\u043a\u0430\u0437\u0430\u043d\u0438\u0435 layout-\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430<\/li>\n<li>\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438\u0437 \u043f\u0443\u043b\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432<\/li>\n<li>\u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 (bind) \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430<\/li>\n<\/ul>\n<p>  \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0438\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432: layout-\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0435\u0442\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 (descriptor set). Layout \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0438\u043f\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430, \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a render pass \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0438\u043f\u044b attachment-\u043e\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0421\u0435\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u0443\u0444\u0435\u0440\u044b \u0438\u043b\u0438 images \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u043a \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c, \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e images \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 render pass-\u043e\u043c. \u0418\u043c\u0435\u043d\u043d\u043e \u0441\u0435\u0442\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0435 \u0431\u0443\u0444\u0435\u0440\u044b \u0438\u043b\u0438 \u0444\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u044b. <\/p>\n<p>  \u0415\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432, \u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 uniform-\u0431\u0443\u0444\u0435\u0440\u043e\u0432 (uniform buffer objects \u0438\u043b\u0438 UBO). \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432, \u043d\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0443 \u043d\u0438\u0445 \u043e\u0434\u0438\u043d. <\/p>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u043c \u0448\u0435\u0439\u0434\u0435\u0440\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<pre><code class=\"cpp\">struct UniformBufferObject {     glm::mat4 model;     glm::mat4 view;     glm::mat4 proj; };<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 <b><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkBuffer.html\" rel=\"nofollow noopener noreferrer\"><code>VkBuffer<\/code><\/a><\/b> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a \u043d\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 uniform-\u0431\u0443\u0444\u0435\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">layout(binding = 0) uniform UniformBufferObject {     mat4 model;     mat4 view;     mat4 proj; } ubo;  void main() {     gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0);     fragColor = inColor; }<\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b model, view \u0438 proj, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435, \u0432\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u0432 3D.<a name=\"two\"><\/a><\/p>\n<h3>\u0412\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440<\/h3>\n<p>  \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c uniform-\u0431\u0443\u0444\u0435\u0440. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 MVP \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0441\u043c. <a href=\"https:\/\/www.opengl-tutorial.org\/beginners-tutorials\/tutorial-3-matrices\/\" rel=\"nofollow noopener noreferrer\">\u0441\u0441\u044b\u043b\u043a\u0443<\/a>.<\/p>\n<pre><code class=\"cpp\">#version 450  layout(binding = 0) uniform UniformBufferObject {     mat4 model;     mat4 view;     mat4 proj; } ubo;  layout(location = 0) in vec2 inPosition; layout(location = 1) in vec3 inColor;  layout(location = 0) out vec3 fragColor;  void main() {     gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0);     fragColor = inColor; }<\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0439 <b><code>uniform<\/code><\/b>, <b><code>in<\/code><\/b> \u0438 <b><code>out<\/code><\/b> \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <b><code>binding<\/code><\/b> \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0435 <b><code>location<\/code><\/b> \u0434\u043b\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. \u041c\u044b \u0443\u043a\u0430\u0436\u0435\u043c \u043d\u0430 \u043d\u0435\u0435 \u0432 layout-\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432. \u0421\u0442\u0440\u043e\u043a\u0430 \u0441 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c <b><code>gl_Position<\/code><\/b> \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0445 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0440\u0430\u0432\u0435\u043d <b><code>1<\/code><\/b>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043f\u0440\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u044d\u043a\u0440\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u042d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u043e\u043b\u0435\u0435 \u0431\u043b\u0438\u0437\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u0434\u0430\u043b\u0435\u043a\u0435.<a name=\"three\"><\/a><\/p>\n<h3>Layout \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432<\/h3>\n<p>  \u041d\u0430\u0448 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2014 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0435 uniform buffer \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 C ++.<\/p>\n<pre><code class=\"cpp\">struct UniformBufferObject {     glm::mat4 model;     glm::mat4 view;     glm::mat4 proj; };<\/code><\/pre>\n<p>  \u041c\u044b \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430 \u0438\u0437 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 GLM. \u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u0445 \u0431\u0438\u043d\u0430\u0440\u043d\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0448\u0435\u0439\u0434\u0435\u0440, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c <b><code>UniformBufferObject<\/code><\/b> \u0432 <b><code><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkBuffer.html\" rel=\"nofollow noopener noreferrer\">VkBuffer<\/a><\/code><\/b> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b><code>memcpy<\/code><\/b>.<\/p>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u043c \u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u0445. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <b><code>createDescriptorSetLayout<\/code><\/b>. \u0415\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0441\u0430\u043c\u044b\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430, \u0442. \u043a. \u043e\u043d\u0430 \u043d\u0430\u043c \u0442\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.<\/p>\n<pre><code class=\"cpp\">void initVulkan() {     ...     createDescriptorSetLayout();     createGraphicsPipeline();     ... }  ...  void createDescriptorSetLayout() {  }<\/code><\/pre>\n<p>  \u041a\u0430\u0436\u0434\u0430\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <b><code><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkDescriptorSetLayoutBinding.html\" rel=\"nofollow noopener noreferrer\">VkDescriptorSetLayoutBinding<\/a><\/code><\/b>.<\/p>\n<pre><code class=\"cpp\">void createDescriptorSetLayout() {     VkDescriptorSetLayoutBinding uboLayoutBinding{};     uboLayoutBinding.binding = 0;     uboLayoutBinding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;     uboLayoutBinding.descriptorCount = 1; }<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u043f\u043e\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 <b><code>binding<\/code><\/b>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0435, \u0438 \u0442\u0438\u043f \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 uniform-\u0431\u0443\u0444\u0435\u0440. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 uniform-\u0431\u0443\u0444\u0435\u0440\u043e\u0432, \u0430 <b><code>descriptorCount<\/code><\/b> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. <br \/>  \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u0441\u0442\u0438 \u0441\u043a\u0435\u043b\u0435\u0442\u0430 \u0432 \u0441\u043a\u0435\u043b\u0435\u0442\u043d\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u041d\u0430\u0448\u0435 MVP \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c uniform-\u0431\u0443\u0444\u0435\u0440\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 <b><code>descriptorCount<\/code><\/b> \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c <b><code>1<\/code><\/b>.<\/p>\n<pre><code class=\"cpp\">uboLayoutBinding.stageFlags = VK_SHADER_STAGE_VERTEX_BIT;<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0430 \u043a\u0430\u043a\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440. \u0412 \u043f\u043e\u043b\u0435 <b><code>stageFlags<\/code><\/b> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <b><code><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkShaderStageFlagBits.html\" rel=\"nofollow noopener noreferrer\">VkShaderStageFlagBits<\/a><\/code><\/b> \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <b>VK_SHADER_STAGE_ALL_GRAPHICS<\/b>. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0441\u0441\u044b\u043b\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430.<\/p>\n<pre><code class=\"cpp\">uboLayoutBinding.pImmutableSamplers = nullptr; \/\/ Optional<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435 <b><code>pImmutableSamplers<\/code><\/b> \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u0443\u0440. \u0418\u0445 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0437\u0436\u0435. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>  \u0412\u0441\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0432 \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 <b><code><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkDescriptorSetLayout.html\" rel=\"nofollow noopener noreferrer\">VkDescriptorSetLayout<\/a><\/code><\/b>. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0447\u043b\u0435\u043d \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0435\u0440\u0435\u0434 <b><code>pipelineLayout<\/code><\/b>:<\/p>\n<pre><code class=\"cpp\">VkDescriptorSetLayout descriptorSetLayout; VkPipelineLayout pipelineLayout;<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b><code><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkCreateDescriptorSetLayout.html\" rel=\"nofollow noopener noreferrer\">vkCreateDescriptorSetLayout<\/a><\/code><\/b>. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <b><code><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkDescriptorSetLayoutCreateInfo.html\" rel=\"nofollow noopener noreferrer\">VkDescriptorSetLayoutCreateInfo<\/a><\/code><\/b>, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0440\u0438\u0432\u044f\u0437\u043e\u043a:<\/p>\n<pre><code class=\"cpp\">VkDescriptorSetLayoutCreateInfo layoutInfo{}; layoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; layoutInfo.bindingCount = 1; layoutInfo.pBindings = &amp;uboLayoutBinding;  if (vkCreateDescriptorSetLayout(device, &amp;layoutInfo, nullptr, &amp;descriptorSetLayout) != VK_SUCCESS) {     throw std::runtime_error(\"failed to create descriptor set layout!\"); }<\/code><\/pre>\n<p>  \u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 layout \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c Vulkan, \u043a\u0430\u043a\u0438\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u043c\u0438. Layout-\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 layout-\u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430. \u0418\u0437\u043c\u0435\u043d\u0438\u043c <b><code><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/VkPipelineLayoutCreateInfo.html\" rel=\"nofollow noopener noreferrer\">VkPipelineLayoutCreateInfo<\/a><\/code><\/b>:<\/p>\n<pre><code class=\"cpp\">VkPipelineLayoutCreateInfo pipelineLayoutInfo{}; pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; pipelineLayoutInfo.setLayoutCount = 1; pipelineLayoutInfo.pSetLayouts = &amp;descriptorSetLayout;<\/code><\/pre>\n<p>  \u0412\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0443\u0434\u0438\u0432\u0438\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e layout-\u043e\u0432 <br \/>  \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432, \u0432\u0435\u0434\u044c \u043e\u0434\u0438\u043d layout \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438. \u041c\u044b \u0435\u0449\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u0443\u043b\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0435\u0442\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>  Layout \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u044b, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<pre><code class=\"cpp\">void cleanup() {     cleanupSwapChain();      vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr);      ... }<\/code><\/pre>\n<p><a name=\"four\"><\/a><\/p>\n<h3>Uniform-\u0431\u0443\u0444\u0435\u0440<\/h3>\n<p>  \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u043c\u0430\u0442\u0440\u0438\u0446. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 uniform-\u0431\u0443\u0444\u0435\u0440 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u0430\u0434\u0440\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u2014 \u043e\u043d \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0434\u0440\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u0438\u043d \u043a\u0430\u0434\u0440 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f, \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a \u0440\u0435\u043d\u0434\u0435\u0440\u0443). \u041c\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u043e\u0439 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u0432 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0444\u0435\u0440\u043e\u0432. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 uniform-\u0431\u0443\u0444\u0435\u0440\u0443 \u043d\u0430 \u043a\u0430\u0434\u0440 \u0438\u043b\u0438 \u043d\u0430 image \u0438\u0437 swap chain. \u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0441\u0441\u044b\u043b\u0430\u0435\u043c\u0441\u044f \u043d\u0430 uniform-\u0431\u0443\u0444\u0435\u0440\u044b \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434, \u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 uniform-\u0431\u0443\u0444\u0435\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e image.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0435 \u0447\u043b\u0435\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f <b><code>uniformBuffers<\/code><\/b> \u0438 <b><code>uniformBuffersMemory<\/code><\/b>:<\/p>\n<pre><code class=\"cpp\">VkBuffer indexBuffer; VkDeviceMemory indexBufferMemory;  std::vector&lt;VkBuffer> uniformBuffers; std::vector&lt;VkDeviceMemory> uniformBuffersMemory;<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <b><code>createUniformBuffers<\/code><\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 <b><code>createIndexBuffer<\/code><\/b> \u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u0431\u0443\u0444\u0435\u0440\u044b:<\/p>\n<pre><code class=\"cpp\">void initVulkan() {     ...     createVertexBuffer();     createIndexBuffer();     createUniformBuffers();     ... }  ...  void createUniformBuffers() {     VkDeviceSize bufferSize = sizeof(UniformBufferObject);      uniformBuffers.resize(swapChainImages.size());     uniformBuffersMemory.resize(swapChainImages.size());      for (size_t i = 0; i &lt; swapChainImages.size(); i++) {         createBuffer(bufferSize, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, uniformBuffers[i], uniformBuffersMemory[i]);     } }<\/code><\/pre>\n<p>  \u041c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u0430\u0434\u0440\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <b><code><a href=\"https:\/\/www.khronos.org\/registry\/vulkan\/specs\/1.2-extensions\/man\/html\/vkMapMemory.html\" rel=\"nofollow noopener noreferrer\">vkMapMemory<\/a><\/code><\/b> \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. Uniform-\u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0444\u0435\u0440, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u0445, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 images \u0432 swap chain, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f swap chain, \u043c\u044b \u0443\u0434\u0430\u043b\u0438\u043c \u0435\u0433\u043e \u0432 <b><code>cleanupSwapChain<\/code><\/b>:<\/p>\n<pre><code class=\"cpp\">void cleanupSwapChain() {     ...      for (size_t i = 0; i &lt; swapChainImages.size(); i++) {         vkDestroyBuffer(device, uniformBuffers[i], nullptr);         vkFreeMemory(device, uniformBuffersMemory[i], nullptr);     } }<\/code><\/pre>\n<p>  \u0418 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 <b><code>recreateSwapChain<\/code><\/b>:<\/p>\n<pre><code class=\"cpp\">void recreateSwapChain() {     ...      createFramebuffers();     createUniformBuffers();     createCommandBuffers(); }<\/code><\/pre>\n<p><a name=\"five\"><\/a><\/p>\n<h3>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 uniform-\u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <b><code>updateUniformBuffer<\/code><\/b> \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u0435\u0435 \u0438\u0437 <b><code>drawFrame<\/code><\/b> \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u043e\u0439 image \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0438\u0437 swap chain:<\/p>\n<pre><code class=\"cpp\">void drawFrame() {     ...      uint32_t imageIndex;     VkResult result = vkAcquireNextImageKHR(device, swapChain, UINT64_MAX, imageAvailableSemaphores[currentFrame], VK_NULL_HANDLE, &amp;imageIndex);      ...      updateUniformBuffer(imageIndex);      VkSubmitInfo submitInfo{};     submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;      ... }  ...  void updateUniformBuffer(uint32_t currentImage) {  }<\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044e \u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">#define GLM_FORCE_RADIANS #include &lt;glm\/glm.hpp> #include &lt;glm\/gtc\/matrix_transform.hpp>  #include &lt;chrono><\/code><\/pre>\n<p>  \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <b><code>glm\/gtc\/matrix_transform.hpp<\/code><\/b> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f model-\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <b><code>glm :: rotate<\/code><\/b>, view-\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <b><code>glm :: lookAt<\/code><\/b>, \u0438 projection-\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <b><code>glm::perspective<\/code><\/b>. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <b><code>GLM_FORCE_RADIANS<\/code><\/b> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u0430\u043a <b><code>glm :: rotate<\/code><\/b>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u0434\u0438\u0430\u043d\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b.<\/p>\n<p>  \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <b><code>chrono<\/code><\/b> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0445\u0440\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0430\u0436\u0430. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0438 \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043a\u0430\u0434\u0440\u043e\u0432.<\/p>\n<pre><code class=\"cpp\">void updateUniformBuffer(uint32_t currentImage) {     static auto startTime = std::chrono::high_resolution_clock::now();      auto currentTime = std::chrono::high_resolution_clock::now();     float time = std::chrono::duration&lt;float, std::chrono::seconds::period>(currentTime - startTime).count(); }<\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <b><code>updateUniformBuffer<\/code><\/b> \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0432\u0440\u0435\u043c\u044f, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0435\u0435 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430, \u043f\u0440\u0438\u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c model, view \u0438 proj \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u0422\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 \u043c\u0438\u0440\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 (model) \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432\u043e\u043a\u0440\u0443\u0433 \u043e\u0441\u0438 Z \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <b><code>time<\/code><\/b>:<\/p>\n<pre><code class=\"cpp\">UniformBufferObject ubo{}; ubo.model = glm::rotate(glm::mat4(1.0f), time * glm::radians(90.0f), glm::vec3(0.0f, 0.0f, 1.0f));<\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <b><code>glm :: rotate<\/code><\/b> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435, \u0443\u0433\u043e\u043b \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438 \u043e\u0441\u044c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 <b><code>glm :: mat4 (1.0f)<\/code><\/b> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0433\u043b\u0430 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f <b><code>time * glm :: radians (90.0f)<\/code><\/b> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443.<\/p>\n<pre><code class=\"cpp\">ubo.view = glm::lookAt(glm::vec3(2.0f, 2.0f, 2.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f));<\/code><\/pre>\n<p>  \u0414\u043b\u044f view-\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044e \u0441\u0432\u0435\u0440\u0445\u0443 \u043f\u043e\u0434 \u0443\u0433\u043b\u043e\u043c \u0432 45 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <b><code>glm :: lookAt<\/code><\/b> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u043e\u0447\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u043c\u0435\u0440\u0430 (eye position), \u0442\u043e\u0447\u043a\u0443, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u043a\u0430\u043c\u0435\u0440\u0430 (center position) \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb \u0434\u043b\u044f \u043a\u0430\u043c\u0435\u0440\u044b (up axis).<\/p>\n<pre><code class=\"cpp\">ubo.proj = glm::perspective(glm::radians(45.0f), swapChainExtent.width \/ (float) swapChainExtent.height, 0.1f, 10.0f);<\/code><\/pre>\n<p>  \u042f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u044e \u0441 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u0435\u043c \u0437\u0440\u0435\u043d\u0438\u044f \u0432 45 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u2014 \u044d\u0442\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u043e\u043d, \u0431\u043b\u0438\u0436\u043d\u044f\u044f \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u043b\u044c\u043d\u044f\u044f \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u044f. \u0412\u0430\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 swap chain, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0439 \u0448\u0438\u0440\u0438\u043d\u044b \u0438 \u0432\u044b\u0441\u043e\u0442\u044b \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043e\u043a\u043d\u0430.<\/p>\n<pre><code class=\"cpp\">ubo.proj[1][1] *= -1;<\/code><\/pre>\n<p>  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e GLM \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u043b\u044f OpenGL, \u0433\u0434\u0435 \u043e\u0441\u044c Y \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u2014 \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044f \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0432\u0432\u0435\u0440\u0445 \u043d\u043e\u0433\u0430\u043c\u0438.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 uniform-\u0431\u0443\u0444\u0435\u0440.<\/p>\n<pre><code class=\"cpp\">void* data; vkMapMemory(device, uniformBuffersMemory[currentImage], 0, sizeof(ubo), 0, &amp;data);     memcpy(data, &amp;ubo, sizeof(ubo)); vkUnmapMemory(device, uniformBuffersMemory[currentImage]);<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f UBO \u2014 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0448\u0435\u0439\u0434\u0435\u0440\u0443. \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c push-\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0433\u043b\u0430\u0432\u0430\u0445.<\/p>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0435\u0442\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u044f\u0436\u0443\u0442 (bind) VkBuffers \u043a \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c uniform-\u0431\u0443\u0444\u0435\u0440\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0448\u0435\u0439\u0434\u0435\u0440 \u043c\u043e\u0433 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439.<\/p>\n<p>  <b><code><a href=\"https:\/\/vulkan-tutorial.com\/code\/21_descriptor_layout.cpp\" rel=\"nofollow noopener noreferrer\">\u041a\u043e\u0434 \u0421++<\/a><\/code><\/b> \/ <b><code><a href=\"https:\/\/vulkan-tutorial.com\/code\/21_shader_ubo.vert\" rel=\"nofollow noopener noreferrer\">\u0412\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440<\/a><\/code><\/b> \/ <b><code><a href=\"https:\/\/vulkan-tutorial.com\/code\/21_shader_ubo.frag\" rel=\"nofollow noopener noreferrer\">\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043d\u044b\u0439 \u0448\u0435\u0439\u0434\u0435\u0440<\/a><\/code><\/b><\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/582838\/\"> https:\/\/habr.com\/ru\/articles\/582838\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/sc\/qk\/o5\/scqko5z1upafgiqpxyb1buvipbi.png\" data-src=\"https:\/\/habrastorage.org\/webt\/sc\/qk\/o5\/scqko5z1upafgiqpxyb1buvipbi.png\"\/><\/p>\n<p>  \u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c! \u042f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0425\u0430\u0431\u0440 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b Vulkan Tutorial \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a (\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/vulkan-tutorial.com\" rel=\"nofollow noopener noreferrer\">\u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0436\u0443 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u2014 Uniform buffers, \u0438 \u043d\u0430\u0447\u043d\u0443 \u044f \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0430\u0442\u044c\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Descriptor layout and buffer.<\/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 \u0441\u0442\u0430\u0434\u0438\u0438 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430<\/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 (Render passes)<\/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<br \/> \n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/564100\/#frame\">\u0424\u0440\u0435\u0439\u043c\u0431\u0443\u0444\u0435\u0440\u044b<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/564100\/#buffer\">\u0411\u0443\u0444\u0435\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/567754\/\">\u0420\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/569912\/\">\u041f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 swap chain<\/a><\/li>\n<\/ol>\n<p>  5. <a href=\"https:\/\/habr.com\/ru\/post\/571944\/\">\u0412\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0435 \u0431\u0443\u0444\u0435\u0440\u044b<\/a><\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/571944\/\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/573920\/\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/578956\/\">\u041f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/users\/alexandra_sky\/posts\/\">\u0418\u043d\u0434\u0435\u043a\u0441\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440<\/a><\/li>\n<\/ol>\n<p>  6. Uniform-\u0431\u0443\u0444\u0435\u0440\u044b<\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/582838\/\">Layout \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0431\u0443\u0444\u0435\u0440<\/a><\/li>\n<li>\u041f\u0443\u043b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0435\u0442\u044b \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432<\/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-398549","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398549","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=398549"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398549\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}