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 "GrVkProgram.h" | 8 #include "GrVkProgram.h" |
9 | 9 |
10 #include "GrPipeline.h" | 10 #include "GrPipeline.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 fPipeline = nullptr; | 99 fPipeline = nullptr; |
100 } | 100 } |
101 | 101 |
102 if (fPipelineLayout) { | 102 if (fPipelineLayout) { |
103 GR_VK_CALL(gpu->vkInterface(), DestroyPipelineLayout(gpu->device(), | 103 GR_VK_CALL(gpu->vkInterface(), DestroyPipelineLayout(gpu->device(), |
104 fPipelineLayout, | 104 fPipelineLayout, |
105 nullptr)); | 105 nullptr)); |
106 fPipelineLayout = VK_NULL_HANDLE; | 106 fPipelineLayout = VK_NULL_HANDLE; |
107 } | 107 } |
108 | 108 |
109 if (fVertexUniformBuffer) { | |
110 fVertexUniformBuffer->release(gpu); | |
111 } | |
112 | |
113 if (fFragmentUniformBuffer) { | |
114 fFragmentUniformBuffer->release(gpu); | |
115 } | |
116 | |
117 fSamplerPoolManager.freeGPUResources(gpu); | 109 fSamplerPoolManager.freeGPUResources(gpu); |
118 fUniformPoolManager.freeGPUResources(gpu); | 110 fUniformPoolManager.freeGPUResources(gpu); |
119 | 111 |
120 this->freeTempResources(gpu); | 112 this->freeTempResources(gpu); |
121 } | 113 } |
122 | 114 |
123 void GrVkProgram::abandonGPUResources() { | 115 void GrVkProgram::abandonGPUResources() { |
124 fPipeline->unrefAndAbandon(); | 116 fPipeline->unrefAndAbandon(); |
125 fPipeline = nullptr; | 117 fPipeline = nullptr; |
126 | 118 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 } | 422 } |
431 } | 423 } |
432 | 424 |
433 void GrVkProgram::DescriptorPoolManager::abandonGPUResources() { | 425 void GrVkProgram::DescriptorPoolManager::abandonGPUResources() { |
434 fDescLayout = VK_NULL_HANDLE; | 426 fDescLayout = VK_NULL_HANDLE; |
435 if (fPool) { | 427 if (fPool) { |
436 fPool->unrefAndAbandon(); | 428 fPool->unrefAndAbandon(); |
437 fPool = nullptr; | 429 fPool = nullptr; |
438 } | 430 } |
439 } | 431 } |
OLD | NEW |