1 #ifndef DALI_GRAPHICS_VULKAN_IMAGE_VIEW
2 #define DALI_GRAPHICS_VULKAN_IMAGE_VIEW
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>
33 class ImageView : public VkManaged
38 * Creates ImageView according to the given spec
44 static RefCountedImageView New( Graphics& graphics, const RefCountedImage& image, const vk::ImageViewCreateInfo& createInfo);
47 ~ImageView() override;
53 vk::ImageView GetVkHandle() const;
56 * Returns bound ImageRef
59 RefCountedImage GetImage() const;
65 uint32_t GetLayerCount() const;
71 uint32_t GetMipLevelCount() const;
77 vk::ImageAspectFlags GetImageAspectMask() const;
79 const ImageView& ConstRef();
83 operator vk::ImageView*();
85 bool OnDestroy() override;
86 //TODO: Use the graphics class to manage lifetime.
89 ImageView( Graphics& graphics,
90 RefCountedImage image,
91 vk::ImageViewCreateInfo createInfo );
95 RefCountedImage mImage;
96 vk::ImageViewCreateInfo mCreateInfo;
97 vk::ImageView mImageView;
101 } //namespace Graphics
104 #endif //DALI_GRAPHICS_VULKAN_IMAGE_VIEW