• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2016 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // ImageVk.h:
7 //    Defines the class interface for ImageVk, implementing ImageImpl.
8 //
9 
10 #ifndef LIBANGLE_RENDERER_VULKAN_IMAGEVK_H_
11 #define LIBANGLE_RENDERER_VULKAN_IMAGEVK_H_
12 
13 #include "libANGLE/renderer/ImageImpl.h"
14 #include "libANGLE/renderer/vulkan/vk_helpers.h"
15 
16 namespace rx
17 {
18 
19 class ExternalImageSiblingVk : public ExternalImageSiblingImpl
20 {
21   public:
ExternalImageSiblingVk()22     ExternalImageSiblingVk() {}
~ExternalImageSiblingVk()23     ~ExternalImageSiblingVk() override {}
24 
25     virtual vk::ImageHelper *getImage() const = 0;
26 
27     virtual void release(RendererVk *renderer) = 0;
28 };
29 
30 class ImageVk : public ImageImpl
31 {
32   public:
33     ImageVk(const egl::ImageState &state, const gl::Context *context);
34     ~ImageVk() override;
35     void onDestroy(const egl::Display *display) override;
36 
37     egl::Error initialize(const egl::Display *display) override;
38 
39     angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
40 
getImage()41     vk::ImageHelper *getImage() const { return mImage; }
getImageTextureType()42     gl::TextureType getImageTextureType() const { return mImageTextureType; }
getImageLevel()43     uint32_t getImageLevel() const { return mImageLevel; }
getImageLayer()44     uint32_t getImageLayer() const { return mImageLayer; }
45 
46   private:
47     gl::TextureType mImageTextureType;
48     uint32_t mImageLevel;
49     uint32_t mImageLayer;
50 
51     bool mOwnsImage;
52     vk::ImageHelper *mImage;
53 
54     std::vector<vk::Shared<vk::Fence>> mImageLastUseFences;
55 
56     const gl::Context *mContext;
57 };
58 
59 }  // namespace rx
60 
61 #endif  // LIBANGLE_RENDERER_VULKAN_IMAGEVK_H_
62