From 347844251ec891b9763aebb234252682b940c6d7 Mon Sep 17 00:00:00 2001 From: DrSocalkwe3n Date: Wed, 31 Dec 2025 16:39:44 +0600 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=81=D0=BB=D0=B5=20=D0=BF=D1=80=D0=B5=D0=B4=D1=8B=D0=B4?= =?UTF-8?q?=D1=83=D1=89=D0=B5=D0=B3=D0=BE=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8?= =?UTF-8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Client/Vulkan/VulkanRenderSession.cpp | 84 +++++++++++------------ Src/Client/Vulkan/VulkanRenderSession.hpp | 6 +- Src/Common/Abstract.hpp | 4 ++ 3 files changed, 49 insertions(+), 45 deletions(-) diff --git a/Src/Client/Vulkan/VulkanRenderSession.cpp b/Src/Client/Vulkan/VulkanRenderSession.cpp index fe3301d..9038c27 100644 --- a/Src/Client/Vulkan/VulkanRenderSession.cpp +++ b/Src/Client/Vulkan/VulkanRenderSession.cpp @@ -849,49 +849,49 @@ VulkanRenderSession::VulkanRenderSession(Vulkan *vkInst, IServerSession *serverS &DescriptorPool)); } - // { - // std::vector shaderLayoutBindings = - // { - // { - // .binding = 0, - // .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, - // .descriptorCount = 1, - // .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, - // .pImmutableSamplers = nullptr - // }, { - // .binding = 1, - // .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, - // .descriptorCount = 1, - // .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, - // .pImmutableSamplers = nullptr - // } - // }; + { + std::vector shaderLayoutBindings = + { + { + .binding = 0, + .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, + .descriptorCount = 1, + .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, + .pImmutableSamplers = nullptr + }, { + .binding = 1, + .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + .descriptorCount = 1, + .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, + .pImmutableSamplers = nullptr + } + }; - // const VkDescriptorSetLayoutCreateInfo descriptorLayout = - // { - // .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, - // .pNext = nullptr, - // .flags = 0, - // .bindingCount = (uint32_t) shaderLayoutBindings.size(), - // .pBindings = shaderLayoutBindings.data() - // }; + const VkDescriptorSetLayoutCreateInfo descriptorLayout = + { + .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, + .pNext = nullptr, + .flags = 0, + .bindingCount = (uint32_t) shaderLayoutBindings.size(), + .pBindings = shaderLayoutBindings.data() + }; - // vkAssert(!vkCreateDescriptorSetLayout( - // VkInst->Graphics.Device, &descriptorLayout, nullptr, &MainAtlasDescLayout)); - // } + vkAssert(!vkCreateDescriptorSetLayout( + VkInst->Graphics.Device, &descriptorLayout, nullptr, &MainAtlasDescLayout)); + } - // { - // VkDescriptorSetAllocateInfo ciAllocInfo = - // { - // .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, - // .pNext = nullptr, - // .descriptorPool = DescriptorPool, - // .descriptorSetCount = 1, - // .pSetLayouts = &MainAtlasDescLayout - // }; + { + VkDescriptorSetAllocateInfo ciAllocInfo = + { + .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, + .pNext = nullptr, + .descriptorPool = DescriptorPool, + .descriptorSetCount = 1, + .pSetLayouts = &MainAtlasDescLayout + }; - // vkAssert(!vkAllocateDescriptorSets(VkInst->Graphics.Device, &ciAllocInfo, &MainAtlasDescriptor)); - // } + vkAssert(!vkAllocateDescriptorSets(VkInst->Graphics.Device, &ciAllocInfo, &MainAtlasDescriptor)); + } { std::vector shaderLayoutBindings = @@ -1434,8 +1434,8 @@ VulkanRenderSession::~VulkanRenderSession() { if(MainAtlas_LightMap_PipelineLayout) vkDestroyPipelineLayout(VkInst->Graphics.Device, MainAtlas_LightMap_PipelineLayout, nullptr); - // if(MainAtlasDescLayout) - // vkDestroyDescriptorSetLayout(VkInst->Graphics.Device, MainAtlasDescLayout, nullptr); + if(MainAtlasDescLayout) + vkDestroyDescriptorSetLayout(VkInst->Graphics.Device, MainAtlasDescLayout, nullptr); if(VoxelLightMapDescLayout) vkDestroyDescriptorSetLayout(VkInst->Graphics.Device, VoxelLightMapDescLayout, nullptr); @@ -1853,4 +1853,4 @@ void VulkanRenderSession::updateDescriptor_ChunksLight() { } -} \ No newline at end of file +} diff --git a/Src/Client/Vulkan/VulkanRenderSession.hpp b/Src/Client/Vulkan/VulkanRenderSession.hpp index 790772a..a385b3e 100644 --- a/Src/Client/Vulkan/VulkanRenderSession.hpp +++ b/Src/Client/Vulkan/VulkanRenderSession.hpp @@ -1206,8 +1206,8 @@ class VulkanRenderSession : public IRenderSession { .binding = 1, .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, Данные к атласу */ - // VkDescriptorSetLayout MainAtlasDescLayout = VK_NULL_HANDLE; - // VkDescriptorSet MainAtlasDescriptor = VK_NULL_HANDLE; + VkDescriptorSetLayout MainAtlasDescLayout = VK_NULL_HANDLE; + VkDescriptorSet MainAtlasDescriptor = VK_NULL_HANDLE; /* .binding = 2, .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, Воксельная карта освещения @@ -1265,4 +1265,4 @@ private: void updateDescriptor_ChunksLight(); }; -} \ No newline at end of file +} diff --git a/Src/Common/Abstract.hpp b/Src/Common/Abstract.hpp index ce2f8e5..6e64c5f 100644 --- a/Src/Common/Abstract.hpp +++ b/Src/Common/Abstract.hpp @@ -523,6 +523,10 @@ struct TexturePipeline { std::vector BinTextures; // Чистый код текстурных преобразований, локальные идентификаторы связаны с BinTextures std::u8string Pipeline; + + bool operator==(const TexturePipeline& other) const { + return BinTextures == other.BinTextures && Pipeline == other.Pipeline; + } }; // Компилятор текстурных потоков