| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 fPipelineCache = VK_NULL_HANDLE; | 50 fPipelineCache = VK_NULL_HANDLE; |
| 51 } | 51 } |
| 52 | 52 |
| 53 // Init uniform descriptor objects | 53 // Init uniform descriptor objects |
| 54 fDescriptorSetManagers.emplace_back(fGpu, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER)
; | 54 fDescriptorSetManagers.emplace_back(fGpu, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER)
; |
| 55 SkASSERT(1 == fDescriptorSetManagers.count()); | 55 SkASSERT(1 == fDescriptorSetManagers.count()); |
| 56 fUniformDSHandle = GrVkDescriptorSetManager::Handle(0); | 56 fUniformDSHandle = GrVkDescriptorSetManager::Handle(0); |
| 57 } | 57 } |
| 58 | 58 |
| 59 GrVkPipeline* GrVkResourceProvider::createPipeline(const GrPipeline& pipeline, | 59 GrVkPipeline* GrVkResourceProvider::createPipeline(const GrPipeline& pipeline, |
| 60 const GrStencilSettings& sten
cil, |
| 60 const GrPrimitiveProcessor& p
rimProc, | 61 const GrPrimitiveProcessor& p
rimProc, |
| 61 VkPipelineShaderStageCreateIn
fo* shaderStageInfo, | 62 VkPipelineShaderStageCreateIn
fo* shaderStageInfo, |
| 62 int shaderStageCount, | 63 int shaderStageCount, |
| 63 GrPrimitiveType primitiveType
, | 64 GrPrimitiveType primitiveType
, |
| 64 const GrVkRenderPass& renderP
ass, | 65 const GrVkRenderPass& renderP
ass, |
| 65 VkPipelineLayout layout) { | 66 VkPipelineLayout layout) { |
| 66 | 67 |
| 67 return GrVkPipeline::Create(fGpu, pipeline, primProc, shaderStageInfo, shade
rStageCount, | 68 return GrVkPipeline::Create(fGpu, pipeline, stencil, primProc, shaderStageIn
fo, |
| 68 primitiveType, renderPass, layout, fPipelineCach
e); | 69 shaderStageCount, primitiveType, renderPass, lay
out, |
| 70 fPipelineCache); |
| 69 } | 71 } |
| 70 | 72 |
| 71 GrVkCopyPipeline* GrVkResourceProvider::findOrCreateCopyPipeline( | 73 GrVkCopyPipeline* GrVkResourceProvider::findOrCreateCopyPipeline( |
| 72 const GrVkRenderTarget* dst, | 74 const GrVkRenderTarget* dst, |
| 73 VkPipelineShaderStageCreateInfo* shaderStageInfo, | 75 VkPipelineShaderStageCreateInfo* shaderStageInfo, |
| 74 VkPipelineLayout pipelineLayout) { | 76 VkPipelineLayout pipelineLayout) { |
| 75 // Find or Create a compatible pipeline | 77 // Find or Create a compatible pipeline |
| 76 GrVkCopyPipeline* pipeline = nullptr; | 78 GrVkCopyPipeline* pipeline = nullptr; |
| 77 for (int i = 0; i < fCopyPipelines.count() && !pipeline; ++i) { | 79 for (int i = 0; i < fCopyPipelines.count() && !pipeline; ++i) { |
| 78 if (fCopyPipelines[i]->isCompatible(*dst->simpleRenderPass())) { | 80 if (fCopyPipelines[i]->isCompatible(*dst->simpleRenderPass())) { |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 } | 474 } |
| 473 | 475 |
| 474 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { | 476 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { |
| 475 for (int i = 0; i < fRenderPasses.count(); ++i) { | 477 for (int i = 0; i < fRenderPasses.count(); ++i) { |
| 476 if (fRenderPasses[i]) { | 478 if (fRenderPasses[i]) { |
| 477 fRenderPasses[i]->unrefAndAbandon(); | 479 fRenderPasses[i]->unrefAndAbandon(); |
| 478 fRenderPasses[i] = nullptr; | 480 fRenderPasses[i] = nullptr; |
| 479 } | 481 } |
| 480 } | 482 } |
| 481 } | 483 } |
| OLD | NEW |