OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrVkImage_DEFINED | 8 #ifndef GrVkImage_DEFINED |
9 #define GrVkImage_DEFINED | 9 #define GrVkImage_DEFINED |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 VkDeviceMemory textureMemory() const { return fResource->fAlloc; } | 81 VkDeviceMemory textureMemory() const { return fResource->fAlloc; } |
82 const Resource* resource() const { return fResource; } | 82 const Resource* resource() const { return fResource; } |
83 bool isLinearTiled() const { | 83 bool isLinearTiled() const { |
84 return SkToBool(fResource->fFlags & Resource::kLinearTiling_Flag); | 84 return SkToBool(fResource->fFlags & Resource::kLinearTiling_Flag); |
85 } | 85 } |
86 | 86 |
87 VkImageLayout currentLayout() const { return fCurrentLayout; } | 87 VkImageLayout currentLayout() const { return fCurrentLayout; } |
88 | 88 |
89 void setImageLayout(const GrVkGpu* gpu, | 89 void setImageLayout(const GrVkGpu* gpu, |
90 VkImageLayout newLayout, | 90 VkImageLayout newLayout, |
91 VkAccessFlags srcAccessMask, | |
92 VkAccessFlags dstAccessMask, | 91 VkAccessFlags dstAccessMask, |
93 VkPipelineStageFlags srcStageMask, | |
94 VkPipelineStageFlags dstStageMask, | 92 VkPipelineStageFlags dstStageMask, |
95 bool byRegion) { | |
96 this->setImageLayout(gpu, newLayout, srcAccessMask, dstAccessMask, | |
97 srcStageMask, dstStageMask, 0, fResource->fLevelCou
nt, byRegion); | |
98 } | |
99 | |
100 void setImageLayout(const GrVkGpu* gpu, | |
101 VkImageLayout newLayout, | |
102 VkAccessFlags srcAccessMask, | |
103 VkAccessFlags dstAccessMask, | |
104 VkPipelineStageFlags srcStageMask, | |
105 VkPipelineStageFlags dstStageMask, | |
106 uint32_t baseMipLevel, | |
107 uint32_t levelCount, | |
108 bool byRegion); | 93 bool byRegion); |
109 | 94 |
110 struct ImageDesc { | 95 struct ImageDesc { |
111 VkImageType fImageType; | 96 VkImageType fImageType; |
112 VkFormat fFormat; | 97 VkFormat fFormat; |
113 uint32_t fWidth; | 98 uint32_t fWidth; |
114 uint32_t fHeight; | 99 uint32_t fHeight; |
115 uint32_t fLevels; | 100 uint32_t fLevels; |
116 uint32_t fSamples; | 101 uint32_t fSamples; |
117 VkImageTiling fImageTiling; | 102 VkImageTiling fImageTiling; |
(...skipping 18 matching lines...) Expand all Loading... |
136 | 121 |
137 void releaseImage(const GrVkGpu* gpu); | 122 void releaseImage(const GrVkGpu* gpu); |
138 void abandonImage(); | 123 void abandonImage(); |
139 | 124 |
140 const Resource* fResource; | 125 const Resource* fResource; |
141 | 126 |
142 VkImageLayout fCurrentLayout; | 127 VkImageLayout fCurrentLayout; |
143 }; | 128 }; |
144 | 129 |
145 #endif | 130 #endif |
OLD | NEW |