1 #ifndef DALI_GRAPHICS_VULKAN_DESCRIPTOR_SET
2 #define DALI_GRAPHICS_VULKAN_DESCRIPTOR_SET
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #include <dali/graphics/vulkan/vulkan-types.h>
34 class DescriptorSet : public VkManaged
36 friend class DescriptorPool;
40 ~DescriptorSet() override;
48 void WriteUniformBuffer( uint32_t binding, Handle<Buffer> buffer, uint32_t offset, uint32_t size );
56 void WriteStorageBuffer( Handle<Buffer> buffer, uint32_t offset, uint32_t size );
61 void WriteImage( Handle<Image> );
65 * @param writeDescriptorSet
67 void Write( vk::WriteDescriptorSet writeDescriptorSet );
70 * Returns VkDescriptorSet associated with this object
71 * @return Descriptor set
73 vk::DescriptorSet GetVkDescriptorSet() const;
77 DescriptorSet( Graphics& graphics, DescriptorPool& pool, vk::DescriptorSet descriptorSet, vk::DescriptorSetAllocateInfo allocateInfo );
80 std::unique_ptr<Impl> mImpl;
83 using DescriptorSetHandle = Handle<DescriptorSet>;
85 class DescriptorPool : public VkManaged
89 static Handle<DescriptorPool> New( Graphics& graphics, const vk::DescriptorPoolCreateInfo& createInfo );
91 ~DescriptorPool() override;
93 vk::DescriptorPool GetVkDescriptorPool() const;
95 std::vector<DescriptorSetHandle> AllocateDescriptorSets( vk::DescriptorSetAllocateInfo allocateInfo );
99 DescriptorPool( Graphics& graphics, const vk::DescriptorPoolCreateInfo& createInfo );
102 std::unique_ptr<Impl> mImpl;
106 class DescriptorSetLayout
110 static std::unique_ptr<DescriptorSetLayout> New( Graphics& graphics, const vk::DescriptorSetLayoutCreateInfo& createInfo );
114 DescriptorSetLayout( Graphics& graphics, const vk::DescriptorSetLayoutCreateInfo& createInfo );
119 std::unique_ptr<Impl> mImpl;
122 } // Namespace Vulkan
124 } // Namespace Graphics
128 #endif // DALI_GRAPHICS_VULKAN_DESCRIPTOR_SET