Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: gpu/vulkan/vulkan_image_view.h

Issue 1829163003: Added initial implementation of the Vulkan Context Provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vk_surface_patch
Patch Set: Block off vulkan_cc with enable_vulkan (not relevant in future patch) Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/vulkan/vulkan_device_queue.cc ('k') | gpu/vulkan/vulkan_image_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GPU_VULKAN_VULKAN_IMAGE_VIEW_H_ 5 #ifndef GPU_VULKAN_VULKAN_IMAGE_VIEW_H_
6 #define GPU_VULKAN_VULKAN_IMAGE_VIEW_H_ 6 #define GPU_VULKAN_VULKAN_IMAGE_VIEW_H_
7 7
8 #include <vulkan/vulkan.h> 8 #include <vulkan/vulkan.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 11
12 namespace gpu { 12 namespace gpu {
13 13
14 class VulkanDeviceQueue;
15
14 class VulkanImageView { 16 class VulkanImageView {
15 public: 17 public:
16 enum ImageType { 18 enum ImageType {
17 IMAGE_TYPE_COLOR, 19 IMAGE_TYPE_COLOR,
18 IMAGE_TYPE_DEPTH, 20 IMAGE_TYPE_DEPTH,
19 IMAGE_TYPE_STENCIL, 21 IMAGE_TYPE_STENCIL,
20 IMAGE_TYPE_DEPTH_STENCIL, 22 IMAGE_TYPE_DEPTH_STENCIL,
21 23
22 NUM_IMAGE_TYPES, 24 NUM_IMAGE_TYPES,
23 IMAGE_TYPE_INVALID = -1, 25 IMAGE_TYPE_INVALID = -1,
24 }; 26 };
25 27
26 VulkanImageView(); 28 explicit VulkanImageView(VulkanDeviceQueue* device_queue);
27 ~VulkanImageView(); 29 ~VulkanImageView();
28 30
29 bool Initialize(VkImage image, 31 bool Initialize(VkImage image,
30 VkImageViewType image_view_type, 32 VkImageViewType image_view_type,
31 ImageType image_type, 33 ImageType image_type,
32 VkFormat format, 34 VkFormat format,
33 uint32_t width, 35 uint32_t width,
34 uint32_t height, 36 uint32_t height,
35 uint32_t base_mip_level, 37 uint32_t base_mip_level,
36 uint32_t num_mips, 38 uint32_t num_mips,
37 uint32_t base_layer_level, 39 uint32_t base_layer_level,
38 uint32_t num_layers); 40 uint32_t num_layers);
39 void Destroy(); 41 void Destroy();
40 42
41 ImageType image_type() const { return image_type_; } 43 ImageType image_type() const { return image_type_; }
42 VkImageView handle() const { return handle_; } 44 VkImageView handle() const { return handle_; }
43 VkFormat format() const { return format_; } 45 VkFormat format() const { return format_; }
44 uint32_t width() const { return width_; } 46 uint32_t width() const { return width_; }
45 uint32_t height() const { return height_; } 47 uint32_t height() const { return height_; }
46 uint32_t mips() const { return mips_; } 48 uint32_t mips() const { return mips_; }
47 uint32_t layers() const { return layers_; } 49 uint32_t layers() const { return layers_; }
48 50
49 private: 51 private:
52 VulkanDeviceQueue* device_queue_ = nullptr;
50 ImageType image_type_ = IMAGE_TYPE_INVALID; 53 ImageType image_type_ = IMAGE_TYPE_INVALID;
51 VkImageView handle_ = VK_NULL_HANDLE; 54 VkImageView handle_ = VK_NULL_HANDLE;
52 VkFormat format_ = VK_FORMAT_UNDEFINED; 55 VkFormat format_ = VK_FORMAT_UNDEFINED;
53 uint32_t width_ = 0; 56 uint32_t width_ = 0;
54 uint32_t height_ = 0; 57 uint32_t height_ = 0;
55 uint32_t mips_ = 0; 58 uint32_t mips_ = 0;
56 uint32_t layers_ = 0; 59 uint32_t layers_ = 0;
57 60
58 DISALLOW_COPY_AND_ASSIGN(VulkanImageView); 61 DISALLOW_COPY_AND_ASSIGN(VulkanImageView);
59 }; 62 };
60 63
61 } // namespace gpu 64 } // namespace gpu
62 65
63 #endif // GPU_VULKAN_VULKAN_IMAGE_VIEW_H_ 66 #endif // GPU_VULKAN_VULKAN_IMAGE_VIEW_H_
OLDNEW
« no previous file with comments | « gpu/vulkan/vulkan_device_queue.cc ('k') | gpu/vulkan/vulkan_image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698