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; + } }; // Компилятор текстурных потоков