Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrVkResourceProvider_DEFINED |
| 9 | #define GrVkResourceProvider_DEFINED |
| 10 | |
Greg Daniel | 54bfb18 | 2018-11-20 17:12:36 -0500 | [diff] [blame] | 11 | #include "GrVkVulkan.h" |
| 12 | |
egdaniel | d62e28b | 2016-06-07 08:43:30 -0700 | [diff] [blame] | 13 | #include "GrResourceHandle.h" |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 14 | #include "GrVkDescriptorPool.h" |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 15 | #include "GrVkDescriptorSetManager.h" |
Brian Salomon | 1471df9 | 2018-06-08 10:49:00 -0400 | [diff] [blame] | 16 | #include "GrVkPipelineStateBuilder.h" |
egdaniel | 2feb093 | 2016-06-08 06:48:09 -0700 | [diff] [blame] | 17 | #include "GrVkRenderPass.h" |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 18 | #include "GrVkResource.h" |
Greg Daniel | 7e00022 | 2018-12-03 10:08:21 -0500 | [diff] [blame] | 19 | #include "GrVkSampler.h" |
| 20 | #include "GrVkSamplerYcbcrConversion.h" |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 21 | #include "GrVkUtil.h" |
Ethan Nicholas | 87f340e | 2017-01-03 14:32:01 -0500 | [diff] [blame] | 22 | #include "SkLRUCache.h" |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 23 | #include "SkTArray.h" |
egdaniel | 8b6394c | 2016-03-04 07:35:10 -0800 | [diff] [blame] | 24 | #include "SkTDynamicHash.h" |
egdaniel | af13277 | 2016-03-28 12:39:29 -0700 | [diff] [blame] | 25 | #include "SkTInternalLList.h" |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 26 | |
Ethan Nicholas | bff4e07 | 2018-12-12 18:17:24 +0000 | [diff] [blame^] | 27 | class GrPipeline; |
| 28 | class GrPrimitiveProcessor; |
| 29 | class GrSamplerState; |
egdaniel | bc9b296 | 2016-09-27 08:00:53 -0700 | [diff] [blame] | 30 | class GrVkCopyPipeline; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 31 | class GrVkGpu; |
| 32 | class GrVkPipeline; |
Brian Salomon | 1471df9 | 2018-06-08 10:49:00 -0400 | [diff] [blame] | 33 | class GrVkPipelineState; |
jvanverth | 7ec9241 | 2016-07-06 09:24:57 -0700 | [diff] [blame] | 34 | class GrVkPrimaryCommandBuffer; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 35 | class GrVkRenderTarget; |
jvanverth | 7ec9241 | 2016-07-06 09:24:57 -0700 | [diff] [blame] | 36 | class GrVkSecondaryCommandBuffer; |
egdaniel | 707bbd6 | 2016-07-26 07:19:47 -0700 | [diff] [blame] | 37 | class GrVkUniformHandler; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 38 | |
| 39 | class GrVkResourceProvider { |
| 40 | public: |
| 41 | GrVkResourceProvider(GrVkGpu* gpu); |
| 42 | ~GrVkResourceProvider(); |
| 43 | |
jvanverth | 03509ea | 2016-03-02 13:19:47 -0800 | [diff] [blame] | 44 | // Set up any initial vk objects |
| 45 | void init(); |
| 46 | |
Brian Salomon | ff168d9 | 2018-06-23 15:17:27 -0400 | [diff] [blame] | 47 | GrVkPipeline* createPipeline(const GrPrimitiveProcessor& primProc, |
| 48 | const GrPipeline& pipeline, |
csmartdalton | c633abb | 2016-11-01 08:55:55 -0700 | [diff] [blame] | 49 | const GrStencilSettings& stencil, |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 50 | VkPipelineShaderStageCreateInfo* shaderStageInfo, |
| 51 | int shaderStageCount, |
| 52 | GrPrimitiveType primitiveType, |
Greg Daniel | 99b88e0 | 2018-10-03 15:31:20 -0400 | [diff] [blame] | 53 | VkRenderPass compatibleRenderPass, |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 54 | VkPipelineLayout layout); |
| 55 | |
egdaniel | bc9b296 | 2016-09-27 08:00:53 -0700 | [diff] [blame] | 56 | GrVkCopyPipeline* findOrCreateCopyPipeline(const GrVkRenderTarget* dst, |
| 57 | VkPipelineShaderStageCreateInfo*, |
| 58 | VkPipelineLayout); |
| 59 | |
egdaniel | d62e28b | 2016-06-07 08:43:30 -0700 | [diff] [blame] | 60 | GR_DEFINE_RESOURCE_HANDLE_CLASS(CompatibleRPHandle); |
| 61 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 62 | // Finds or creates a simple render pass that matches the target, increments the refcount, |
egdaniel | d62e28b | 2016-06-07 08:43:30 -0700 | [diff] [blame] | 63 | // and returns. The caller can optionally pass in a pointer to a CompatibleRPHandle. If this is |
| 64 | // non null it will be set to a handle that can be used in the furutre to quickly return a |
| 65 | // compatible GrVkRenderPasses without the need inspecting a GrVkRenderTarget. |
| 66 | const GrVkRenderPass* findCompatibleRenderPass(const GrVkRenderTarget& target, |
| 67 | CompatibleRPHandle* compatibleHandle = nullptr); |
| 68 | // The CompatibleRPHandle must be a valid handle previously set by a call to |
| 69 | // findCompatibleRenderPass(GrVkRenderTarget&, CompatibleRPHandle*). |
| 70 | const GrVkRenderPass* findCompatibleRenderPass(const CompatibleRPHandle& compatibleHandle); |
| 71 | |
egdaniel | 2feb093 | 2016-06-08 06:48:09 -0700 | [diff] [blame] | 72 | // Finds or creates a render pass that matches the target and LoadStoreOps, increments the |
| 73 | // refcount, and returns. The caller can optionally pass in a pointer to a CompatibleRPHandle. |
| 74 | // If this is non null it will be set to a handle that can be used in the furutre to quickly |
| 75 | // return a GrVkRenderPasses without the need inspecting a GrVkRenderTarget. |
egdaniel | d62e28b | 2016-06-07 08:43:30 -0700 | [diff] [blame] | 76 | const GrVkRenderPass* findRenderPass(const GrVkRenderTarget& target, |
egdaniel | 2feb093 | 2016-06-08 06:48:09 -0700 | [diff] [blame] | 77 | const GrVkRenderPass::LoadStoreOps& colorOps, |
egdaniel | 2feb093 | 2016-06-08 06:48:09 -0700 | [diff] [blame] | 78 | const GrVkRenderPass::LoadStoreOps& stencilOps, |
egdaniel | d62e28b | 2016-06-07 08:43:30 -0700 | [diff] [blame] | 79 | CompatibleRPHandle* compatibleHandle = nullptr); |
| 80 | |
egdaniel | 2feb093 | 2016-06-08 06:48:09 -0700 | [diff] [blame] | 81 | // The CompatibleRPHandle must be a valid handle previously set by a call to findRenderPass or |
| 82 | // findCompatibleRenderPass. |
egdaniel | d62e28b | 2016-06-07 08:43:30 -0700 | [diff] [blame] | 83 | const GrVkRenderPass* findRenderPass(const CompatibleRPHandle& compatibleHandle, |
egdaniel | 2feb093 | 2016-06-08 06:48:09 -0700 | [diff] [blame] | 84 | const GrVkRenderPass::LoadStoreOps& colorOps, |
egdaniel | 2feb093 | 2016-06-08 06:48:09 -0700 | [diff] [blame] | 85 | const GrVkRenderPass::LoadStoreOps& stencilOps); |
| 86 | |
Ethan Nicholas | bff4e07 | 2018-12-12 18:17:24 +0000 | [diff] [blame^] | 87 | GrVkPrimaryCommandBuffer* findOrCreatePrimaryCommandBuffer(); |
Ethan Nicholas | 30e6343 | 2018-12-11 16:15:15 -0500 | [diff] [blame] | 88 | void checkCommandBuffers(); |
jvanverth | 7ec9241 | 2016-07-06 09:24:57 -0700 | [diff] [blame] | 89 | |
Ethan Nicholas | bff4e07 | 2018-12-12 18:17:24 +0000 | [diff] [blame^] | 90 | GrVkSecondaryCommandBuffer* findOrCreateSecondaryCommandBuffer(); |
| 91 | void recycleSecondaryCommandBuffer(GrVkSecondaryCommandBuffer* cb); |
| 92 | |
egdaniel | c2dc1b2 | 2016-03-18 13:18:23 -0700 | [diff] [blame] | 93 | // Finds or creates a compatible GrVkDescriptorPool for the requested type and count. |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 94 | // The refcount is incremented and a pointer returned. |
| 95 | // TODO: Currently this will just create a descriptor pool without holding onto a ref itself |
| 96 | // so we currently do not reuse them. Rquires knowing if another draw is currently using |
| 97 | // the GrVkDescriptorPool, the ability to reset pools, and the ability to purge pools out |
| 98 | // of our cache of GrVkDescriptorPools. |
egdaniel | c2dc1b2 | 2016-03-18 13:18:23 -0700 | [diff] [blame] | 99 | GrVkDescriptorPool* findOrCreateCompatibleDescriptorPool(VkDescriptorType type, uint32_t count); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 100 | |
Greg Daniel | 7e00022 | 2018-12-03 10:08:21 -0500 | [diff] [blame] | 101 | // Finds or creates a compatible GrVkSampler based on the GrSamplerState and |
| 102 | // GrVkYcbcrConversionInfo. The refcount is incremented and a pointer returned. |
| 103 | GrVkSampler* findOrCreateCompatibleSampler(const GrSamplerState&, |
| 104 | const GrVkYcbcrConversionInfo& ycbcrInfo); |
| 105 | |
| 106 | // Finds or creates a compatible GrVkSamplerYcbcrConversion based on the GrSamplerState and |
| 107 | // GrVkYcbcrConversionInfo. The refcount is incremented and a pointer returned. |
| 108 | GrVkSamplerYcbcrConversion* findOrCreateCompatibleSamplerYcbcrConversion( |
| 109 | const GrVkYcbcrConversionInfo& ycbcrInfo); |
egdaniel | 8b6394c | 2016-03-04 07:35:10 -0800 | [diff] [blame] | 110 | |
Greg Daniel | 9a51a86 | 2018-11-30 10:18:14 -0500 | [diff] [blame] | 111 | GrVkPipelineState* findOrCreateCompatiblePipelineState( |
| 112 | const GrPipeline&, |
| 113 | const GrPrimitiveProcessor&, |
| 114 | const GrTextureProxy* const primProcProxies[], |
| 115 | GrPrimitiveType, |
| 116 | VkRenderPass compatibleRenderPass); |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 117 | |
Greg Daniel | a754378 | 2017-05-02 14:01:43 -0400 | [diff] [blame] | 118 | void getSamplerDescriptorSetHandle(VkDescriptorType type, |
| 119 | const GrVkUniformHandler&, |
egdaniel | 707bbd6 | 2016-07-26 07:19:47 -0700 | [diff] [blame] | 120 | GrVkDescriptorSetManager::Handle* handle); |
Greg Daniel | a754378 | 2017-05-02 14:01:43 -0400 | [diff] [blame] | 121 | void getSamplerDescriptorSetHandle(VkDescriptorType type, |
| 122 | const SkTArray<uint32_t>& visibilities, |
egdaniel | 4d866df | 2016-08-25 13:52:00 -0700 | [diff] [blame] | 123 | GrVkDescriptorSetManager::Handle* handle); |
egdaniel | 707bbd6 | 2016-07-26 07:19:47 -0700 | [diff] [blame] | 124 | |
| 125 | // Returns the compatible VkDescriptorSetLayout to use for uniform buffers. The caller does not |
| 126 | // own the VkDescriptorSetLayout and thus should not delete it. This function should be used |
| 127 | // when the caller needs the layout to create a VkPipelineLayout. |
| 128 | VkDescriptorSetLayout getUniformDSLayout() const; |
| 129 | |
| 130 | // Returns the compatible VkDescriptorSetLayout to use for a specific sampler handle. The caller |
| 131 | // does not own the VkDescriptorSetLayout and thus should not delete it. This function should be |
| 132 | // used when the caller needs the layout to create a VkPipelineLayout. |
| 133 | VkDescriptorSetLayout getSamplerDSLayout(const GrVkDescriptorSetManager::Handle&) const; |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 134 | |
| 135 | // Returns a GrVkDescriptorSet that can be used for uniform buffers. The GrVkDescriptorSet |
| 136 | // is already reffed for the caller. |
| 137 | const GrVkDescriptorSet* getUniformDescriptorSet(); |
| 138 | |
| 139 | // Returns a GrVkDescriptorSet that can be used for sampler descriptors that are compatible with |
egdaniel | 707bbd6 | 2016-07-26 07:19:47 -0700 | [diff] [blame] | 140 | // the GrVkDescriptorSetManager::Handle passed in. The GrVkDescriptorSet is already reffed for |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 141 | // the caller. |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 142 | const GrVkDescriptorSet* getSamplerDescriptorSet(const GrVkDescriptorSetManager::Handle&); |
egdaniel | 778555c | 2016-05-02 06:50:36 -0700 | [diff] [blame] | 143 | |
egdaniel | 778555c | 2016-05-02 06:50:36 -0700 | [diff] [blame] | 144 | |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 145 | // Signals that the descriptor set passed it, which is compatible with the passed in handle, |
| 146 | // can be reused by the next allocation request. |
| 147 | void recycleDescriptorSet(const GrVkDescriptorSet* descSet, |
| 148 | const GrVkDescriptorSetManager::Handle&); |
| 149 | |
jvanverth | 4c6e47a | 2016-07-22 10:34:52 -0700 | [diff] [blame] | 150 | // Creates or finds free uniform buffer resources of size GrVkUniformBuffer::kStandardSize. |
| 151 | // Anything larger will need to be created and released by the client. |
| 152 | const GrVkResource* findOrCreateStandardUniformBufferResource(); |
| 153 | |
| 154 | // Signals that the resource passed to it (which should be a uniform buffer resource) |
| 155 | // can be reused by the next uniform buffer resource request. |
| 156 | void recycleStandardUniformBufferResource(const GrVkResource*); |
| 157 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 158 | // Destroy any cached resources. To be called before destroying the VkDevice. |
| 159 | // The assumption is that all queues are idle and all command buffers are finished. |
| 160 | // For resource tracing to work properly, this should be called after unrefing all other |
| 161 | // resource usages. |
Jim Van Verth | 09557d7 | 2016-11-07 11:10:21 -0500 | [diff] [blame] | 162 | // If deviceLost is true, then resources will not be checked to see if they've finished |
| 163 | // before deleting (see section 4.2.4 of the Vulkan spec). |
| 164 | void destroyResources(bool deviceLost); |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 165 | |
| 166 | // Abandon any cached resources. To be used when the context/VkDevice is lost. |
| 167 | // For resource tracing to work properly, this should be called after unrefing all other |
| 168 | // resource usages. |
| 169 | void abandonResources(); |
| 170 | |
| 171 | private: |
djsollen | efe46d2 | 2016-04-29 06:41:35 -0700 | [diff] [blame] | 172 | #ifdef SK_DEBUG |
egdaniel | af13277 | 2016-03-28 12:39:29 -0700 | [diff] [blame] | 173 | #define GR_PIPELINE_STATE_CACHE_STATS |
| 174 | #endif |
| 175 | |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 176 | class PipelineStateCache : public ::SkNoncopyable { |
| 177 | public: |
| 178 | PipelineStateCache(GrVkGpu* gpu); |
| 179 | ~PipelineStateCache(); |
| 180 | |
| 181 | void abandon(); |
| 182 | void release(); |
Brian Salomon | ff168d9 | 2018-06-23 15:17:27 -0400 | [diff] [blame] | 183 | GrVkPipelineState* refPipelineState(const GrPrimitiveProcessor&, |
Greg Daniel | 9a51a86 | 2018-11-30 10:18:14 -0500 | [diff] [blame] | 184 | const GrTextureProxy* const primProcProxies[], |
Brian Salomon | ff168d9 | 2018-06-23 15:17:27 -0400 | [diff] [blame] | 185 | const GrPipeline&, |
Greg Daniel | 09eeefb | 2017-10-16 15:15:02 -0400 | [diff] [blame] | 186 | GrPrimitiveType, |
Greg Daniel | 99b88e0 | 2018-10-03 15:31:20 -0400 | [diff] [blame] | 187 | VkRenderPass compatibleRenderPass); |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 188 | |
| 189 | private: |
| 190 | enum { |
| 191 | // We may actually have kMaxEntries+1 PipelineStates in context because we create a new |
| 192 | // PipelineState before evicting from the cache. |
| 193 | kMaxEntries = 128, |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 194 | }; |
| 195 | |
| 196 | struct Entry; |
| 197 | |
Ethan Nicholas | 87f340e | 2017-01-03 14:32:01 -0500 | [diff] [blame] | 198 | struct DescHash { |
| 199 | uint32_t operator()(const GrProgramDesc& desc) const { |
| 200 | return SkOpts::hash_fn(desc.asKey(), desc.keyLength(), 0); |
| 201 | } |
| 202 | }; |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 203 | |
Brian Salomon | 1471df9 | 2018-06-08 10:49:00 -0400 | [diff] [blame] | 204 | SkLRUCache<const GrVkPipelineStateBuilder::Desc, std::unique_ptr<Entry>, DescHash> fMap; |
egdaniel | af13277 | 2016-03-28 12:39:29 -0700 | [diff] [blame] | 205 | |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 206 | GrVkGpu* fGpu; |
egdaniel | af13277 | 2016-03-28 12:39:29 -0700 | [diff] [blame] | 207 | |
| 208 | #ifdef GR_PIPELINE_STATE_CACHE_STATS |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 209 | int fTotalRequests; |
| 210 | int fCacheMisses; |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 211 | #endif |
| 212 | }; |
| 213 | |
egdaniel | d62e28b | 2016-06-07 08:43:30 -0700 | [diff] [blame] | 214 | class CompatibleRenderPassSet { |
| 215 | public: |
| 216 | // This will always construct the basic load store render pass (all attachments load and |
| 217 | // store their data) so that there is at least one compatible VkRenderPass that can be used |
| 218 | // with this set. |
| 219 | CompatibleRenderPassSet(const GrVkGpu* gpu, const GrVkRenderTarget& target); |
| 220 | |
| 221 | bool isCompatible(const GrVkRenderTarget& target) const; |
| 222 | |
| 223 | GrVkRenderPass* getCompatibleRenderPass() const { |
| 224 | // The first GrVkRenderpass should always exist since we create the basic load store |
| 225 | // render pass on create |
| 226 | SkASSERT(fRenderPasses[0]); |
| 227 | return fRenderPasses[0]; |
| 228 | } |
| 229 | |
egdaniel | 2feb093 | 2016-06-08 06:48:09 -0700 | [diff] [blame] | 230 | GrVkRenderPass* getRenderPass(const GrVkGpu* gpu, |
| 231 | const GrVkRenderPass::LoadStoreOps& colorOps, |
egdaniel | 2feb093 | 2016-06-08 06:48:09 -0700 | [diff] [blame] | 232 | const GrVkRenderPass::LoadStoreOps& stencilOps); |
| 233 | |
Ethan Nicholas | bff4e07 | 2018-12-12 18:17:24 +0000 | [diff] [blame^] | 234 | void releaseResources(const GrVkGpu* gpu); |
egdaniel | d62e28b | 2016-06-07 08:43:30 -0700 | [diff] [blame] | 235 | void abandonResources(); |
| 236 | |
| 237 | private: |
| 238 | SkSTArray<4, GrVkRenderPass*> fRenderPasses; |
| 239 | int fLastReturnedIndex; |
| 240 | }; |
| 241 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 242 | GrVkGpu* fGpu; |
| 243 | |
jvanverth | 03509ea | 2016-03-02 13:19:47 -0800 | [diff] [blame] | 244 | // Central cache for creating pipelines |
| 245 | VkPipelineCache fPipelineCache; |
| 246 | |
egdaniel | bc9b296 | 2016-09-27 08:00:53 -0700 | [diff] [blame] | 247 | // Cache of previously created copy pipelines |
| 248 | SkTArray<GrVkCopyPipeline*> fCopyPipelines; |
| 249 | |
egdaniel | d62e28b | 2016-06-07 08:43:30 -0700 | [diff] [blame] | 250 | SkSTArray<4, CompatibleRenderPassSet> fRenderPassArray; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 251 | |
Ethan Nicholas | bff4e07 | 2018-12-12 18:17:24 +0000 | [diff] [blame^] | 252 | // Array of PrimaryCommandBuffers that are currently in flight |
| 253 | SkSTArray<4, GrVkPrimaryCommandBuffer*, true> fActiveCommandBuffers; |
| 254 | // Array of available primary command buffers that are not in flight |
| 255 | SkSTArray<4, GrVkPrimaryCommandBuffer*, true> fAvailableCommandBuffers; |
jvanverth | 7ec9241 | 2016-07-06 09:24:57 -0700 | [diff] [blame] | 256 | |
Ethan Nicholas | bff4e07 | 2018-12-12 18:17:24 +0000 | [diff] [blame^] | 257 | // Array of available secondary command buffers |
| 258 | SkSTArray<16, GrVkSecondaryCommandBuffer*, true> fAvailableSecondaryCommandBuffers; |
egdaniel | 8b6394c | 2016-03-04 07:35:10 -0800 | [diff] [blame] | 259 | |
jvanverth | 4c6e47a | 2016-07-22 10:34:52 -0700 | [diff] [blame] | 260 | // Array of available uniform buffer resources |
egdaniel | 707bbd6 | 2016-07-26 07:19:47 -0700 | [diff] [blame] | 261 | SkSTArray<16, const GrVkResource*, true> fAvailableUniformBufferResources; |
jvanverth | 4c6e47a | 2016-07-22 10:34:52 -0700 | [diff] [blame] | 262 | |
egdaniel | 8b6394c | 2016-03-04 07:35:10 -0800 | [diff] [blame] | 263 | // Stores GrVkSampler objects that we've already created so we can reuse them across multiple |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 264 | // GrVkPipelineStates |
Greg Daniel | 7e00022 | 2018-12-03 10:08:21 -0500 | [diff] [blame] | 265 | SkTDynamicHash<GrVkSampler, GrVkSampler::Key> fSamplers; |
| 266 | |
| 267 | // Stores GrVkSamplerYcbcrConversion objects that we've already created so we can reuse them. |
| 268 | SkTDynamicHash<GrVkSamplerYcbcrConversion, GrVkSamplerYcbcrConversion::Key> fYcbcrConversions; |
egdaniel | 22281c1 | 2016-03-23 13:49:40 -0700 | [diff] [blame] | 269 | |
| 270 | // Cache of GrVkPipelineStates |
| 271 | PipelineStateCache* fPipelineStateCache; |
egdaniel | 778555c | 2016-05-02 06:50:36 -0700 | [diff] [blame] | 272 | |
Greg Daniel | 18f9602 | 2017-05-04 15:09:03 -0400 | [diff] [blame] | 273 | SkSTArray<4, std::unique_ptr<GrVkDescriptorSetManager>> fDescriptorSetManagers; |
egdaniel | a95220d | 2016-07-21 11:50:37 -0700 | [diff] [blame] | 274 | |
egdaniel | 707bbd6 | 2016-07-26 07:19:47 -0700 | [diff] [blame] | 275 | GrVkDescriptorSetManager::Handle fUniformDSHandle; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 276 | }; |
| 277 | |
| 278 | #endif |