OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 GrVkResourceProvider_DEFINED | 8 #ifndef GrVkResourceProvider_DEFINED |
9 #define GrVkResourceProvider_DEFINED | 9 #define GrVkResourceProvider_DEFINED |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 const GrVkRenderPass& renderPass, | 42 const GrVkRenderPass& renderPass, |
43 VkPipelineLayout layout); | 43 VkPipelineLayout layout); |
44 | 44 |
45 // Finds or creates a simple render pass that matches the target, increments
the refcount, | 45 // Finds or creates a simple render pass that matches the target, increments
the refcount, |
46 // and returns. | 46 // and returns. |
47 const GrVkRenderPass* findOrCreateCompatibleRenderPass(const GrVkRenderTarge
t& target); | 47 const GrVkRenderPass* findOrCreateCompatibleRenderPass(const GrVkRenderTarge
t& target); |
48 | 48 |
49 GrVkCommandBuffer* createCommandBuffer(); | 49 GrVkCommandBuffer* createCommandBuffer(); |
50 void checkCommandBuffers(); | 50 void checkCommandBuffers(); |
51 | 51 |
52 // Finds or creates a compatible GrVkDescriptorPool for the requested Descri
ptorTypeCount. | 52 // Finds or creates a compatible GrVkDescriptorPool for the requested type a
nd count. |
53 // The refcount is incremented and a pointer returned. | 53 // The refcount is incremented and a pointer returned. |
54 // TODO: Currently this will just create a descriptor pool without holding o
nto a ref itself | 54 // TODO: Currently this will just create a descriptor pool without holding o
nto a ref itself |
55 // so we currently do not reuse them. Rquires knowing if another draw
is currently using | 55 // so we currently do not reuse them. Rquires knowing if another draw
is currently using |
56 // the GrVkDescriptorPool, the ability to reset pools, and the ability
to purge pools out | 56 // the GrVkDescriptorPool, the ability to reset pools, and the ability
to purge pools out |
57 // of our cache of GrVkDescriptorPools. | 57 // of our cache of GrVkDescriptorPools. |
58 GrVkDescriptorPool* findOrCreateCompatibleDescriptorPool( | 58 GrVkDescriptorPool* findOrCreateCompatibleDescriptorPool(VkDescriptorType ty
pe, uint32_t count); |
59 const GrVkDescriptorPool::DescriptorType
Counts& typeCounts); | |
60 | 59 |
61 // Finds or creates a compatible GrVkSampler based on the GrTextureParams. | 60 // Finds or creates a compatible GrVkSampler based on the GrTextureParams. |
62 // The refcount is incremented and a pointer returned. | 61 // The refcount is incremented and a pointer returned. |
63 GrVkSampler* findOrCreateCompatibleSampler(const GrTextureParams&); | 62 GrVkSampler* findOrCreateCompatibleSampler(const GrTextureParams&); |
64 | 63 |
65 // Destroy any cached resources. To be called before destroying the VkDevice
. | 64 // Destroy any cached resources. To be called before destroying the VkDevice
. |
66 // The assumption is that all queues are idle and all command buffers are fi
nished. | 65 // The assumption is that all queues are idle and all command buffers are fi
nished. |
67 // For resource tracing to work properly, this should be called after unrefi
ng all other | 66 // For resource tracing to work properly, this should be called after unrefi
ng all other |
68 // resource usages. | 67 // resource usages. |
69 void destroyResources(); | 68 void destroyResources(); |
(...skipping 15 matching lines...) Expand all Loading... |
85 | 84 |
86 // Array of CommandBuffers that are currently in flight | 85 // Array of CommandBuffers that are currently in flight |
87 SkSTArray<4, GrVkCommandBuffer*> fActiveCommandBuffers; | 86 SkSTArray<4, GrVkCommandBuffer*> fActiveCommandBuffers; |
88 | 87 |
89 // Stores GrVkSampler objects that we've already created so we can reuse the
m across multiple | 88 // Stores GrVkSampler objects that we've already created so we can reuse the
m across multiple |
90 // programs | 89 // programs |
91 SkTDynamicHash<GrVkSampler, uint8_t> fSamplers; | 90 SkTDynamicHash<GrVkSampler, uint8_t> fSamplers; |
92 }; | 91 }; |
93 | 92 |
94 #endif | 93 #endif |
OLD | NEW |