| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 fStartDS = GrVkUniformHandler::kUniformBufferDescSet; | 55 fStartDS = GrVkUniformHandler::kUniformBufferDescSet; |
| 56 fDSCount = 1; | 56 fDSCount = 1; |
| 57 if (numSamplers) { | 57 if (numSamplers) { |
| 58 fDSCount++; | 58 fDSCount++; |
| 59 fStartDS = SkTMin(fStartDS, (int)GrVkUniformHandler::kSamplerDescSet); | 59 fStartDS = SkTMin(fStartDS, (int)GrVkUniformHandler::kSamplerDescSet); |
| 60 } | 60 } |
| 61 | 61 |
| 62 fVertexUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, vertexUniformSize,
true)); | 62 fVertexUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, vertexUniformSize,
true)); |
| 63 fFragmentUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, fragmentUniformS
ize, true)); | 63 fFragmentUniformBuffer.reset(GrVkUniformBuffer::Create(gpu, fragmentUniformS
ize, true)); |
| 64 | 64 |
| 65 #ifdef SK_DEBUG | |
| 66 fNumSamplers = numSamplers; | 65 fNumSamplers = numSamplers; |
| 67 #endif | |
| 68 } | 66 } |
| 69 | 67 |
| 70 GrVkProgram::~GrVkProgram() { | 68 GrVkProgram::~GrVkProgram() { |
| 71 // Must of freed all GPU resources before this is destroyed | 69 // Must of freed all GPU resources before this is destroyed |
| 72 SkASSERT(!fPipeline); | 70 SkASSERT(!fPipeline); |
| 73 SkASSERT(!fPipelineLayout); | 71 SkASSERT(!fPipelineLayout); |
| 74 SkASSERT(!fSamplers.count()); | 72 SkASSERT(!fSamplers.count()); |
| 75 SkASSERT(!fTextureViews.count()); | 73 SkASSERT(!fTextureViews.count()); |
| 76 SkASSERT(!fTextures.count()); | 74 SkASSERT(!fTextures.count()); |
| 77 } | 75 } |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 } | 428 } |
| 431 } | 429 } |
| 432 | 430 |
| 433 void GrVkProgram::DescriptorPoolManager::abandonGPUResources() { | 431 void GrVkProgram::DescriptorPoolManager::abandonGPUResources() { |
| 434 fDescLayout = VK_NULL_HANDLE; | 432 fDescLayout = VK_NULL_HANDLE; |
| 435 if (fPool) { | 433 if (fPool) { |
| 436 fPool->unrefAndAbandon(); | 434 fPool->unrefAndAbandon(); |
| 437 fPool = nullptr; | 435 fPool = nullptr; |
| 438 } | 436 } |
| 439 } | 437 } |
| OLD | NEW |