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 #include "GrVkResourceProvider.h" | 8 #include "GrVkResourceProvider.h" |
9 | 9 |
10 #include "GrTextureParams.h" | 10 #include "GrTextureParams.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 GrPrimitiveType primitiveType
, | 54 GrPrimitiveType primitiveType
, |
55 const GrVkRenderPass& renderP
ass, | 55 const GrVkRenderPass& renderP
ass, |
56 VkPipelineLayout layout) { | 56 VkPipelineLayout layout) { |
57 | 57 |
58 return GrVkPipeline::Create(fGpu, pipeline, primProc, shaderStageInfo, shade
rStageCount, | 58 return GrVkPipeline::Create(fGpu, pipeline, primProc, shaderStageInfo, shade
rStageCount, |
59 primitiveType, renderPass, layout, fPipelineCach
e); | 59 primitiveType, renderPass, layout, fPipelineCach
e); |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 // To create framebuffers, we first need to create a simple RenderPass that is | 63 // To create framebuffers, we first need to create a simple RenderPass that is |
64 // only used for framebuffer creation. When we actually render we will create | 64 // only used for framebuffer creation. When we actually render we will create |
65 // RenderPasses as needed that are compatible with the framebuffer. | 65 // RenderPasses as needed that are compatible with the framebuffer. |
66 const GrVkRenderPass* | 66 const GrVkRenderPass* |
67 GrVkResourceProvider::findOrCreateCompatibleRenderPass(const GrVkRenderTarget& t
arget) { | 67 GrVkResourceProvider::findOrCreateCompatibleRenderPass(const GrVkRenderTarget& t
arget) { |
68 for (int i = 0; i < fSimpleRenderPasses.count(); ++i) { | 68 for (int i = 0; i < fSimpleRenderPasses.count(); ++i) { |
69 GrVkRenderPass* renderPass = fSimpleRenderPasses[i]; | 69 GrVkRenderPass* renderPass = fSimpleRenderPasses[i]; |
70 if (renderPass->isCompatible(target)) { | 70 if (renderPass->isCompatible(target)) { |
71 renderPass->ref(); | 71 renderPass->ref(); |
72 return renderPass; | 72 return renderPass; |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 GrVkRenderPass* renderPass = new GrVkRenderPass(); | 76 GrVkRenderPass* renderPass = new GrVkRenderPass(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 172 } |
173 fSamplers.reset(); | 173 fSamplers.reset(); |
174 | 174 |
175 fPipelineStateCache->abandon(); | 175 fPipelineStateCache->abandon(); |
176 | 176 |
177 #ifdef SK_TRACE_VK_RESOURCES | 177 #ifdef SK_TRACE_VK_RESOURCES |
178 SkASSERT(0 == GrVkResource::fTrace.count()); | 178 SkASSERT(0 == GrVkResource::fTrace.count()); |
179 #endif | 179 #endif |
180 fPipelineCache = VK_NULL_HANDLE; | 180 fPipelineCache = VK_NULL_HANDLE; |
181 } | 181 } |
OLD | NEW |