| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 dsAllocateInfo.pNext = nullptr; | 208 dsAllocateInfo.pNext = nullptr; |
| 209 dsAllocateInfo.descriptorPool = fUniformDescPool->descPool(); | 209 dsAllocateInfo.descriptorPool = fUniformDescPool->descPool(); |
| 210 dsAllocateInfo.descriptorSetCount = 1; | 210 dsAllocateInfo.descriptorSetCount = 1; |
| 211 dsAllocateInfo.pSetLayouts = &fUniformDescLayout; | 211 dsAllocateInfo.pSetLayouts = &fUniformDescLayout; |
| 212 GR_VK_CALL_ERRCHECK(fGpu->vkInterface(), AllocateDescriptorSets(fGpu->device
(), | 212 GR_VK_CALL_ERRCHECK(fGpu->vkInterface(), AllocateDescriptorSets(fGpu->device
(), |
| 213 &dsAllocateI
nfo, | 213 &dsAllocateI
nfo, |
| 214 ds)); | 214 ds)); |
| 215 *outPool = fUniformDescPool; | 215 *outPool = fUniformDescPool; |
| 216 } | 216 } |
| 217 | 217 |
| 218 GrVkCommandBuffer* GrVkResourceProvider::createCommandBuffer() { | 218 GrVkPrimaryCommandBuffer* GrVkResourceProvider::createPrimaryCommandBuffer() { |
| 219 GrVkCommandBuffer* cmdBuffer = GrVkCommandBuffer::Create(fGpu, fGpu->cmdPool
()); | 219 GrVkPrimaryCommandBuffer* cmdBuffer = GrVkPrimaryCommandBuffer::Create(fGpu,
fGpu->cmdPool()); |
| 220 fActiveCommandBuffers.push_back(cmdBuffer); | 220 fActiveCommandBuffers.push_back(cmdBuffer); |
| 221 cmdBuffer->ref(); | 221 cmdBuffer->ref(); |
| 222 return cmdBuffer; | 222 return cmdBuffer; |
| 223 } | 223 } |
| 224 | 224 |
| 225 void GrVkResourceProvider::checkCommandBuffers() { | 225 void GrVkResourceProvider::checkCommandBuffers() { |
| 226 for (int i = fActiveCommandBuffers.count()-1; i >= 0; --i) { | 226 for (int i = fActiveCommandBuffers.count()-1; i >= 0; --i) { |
| 227 if (fActiveCommandBuffers[i]->finished(fGpu)) { | 227 if (fActiveCommandBuffers[i]->finished(fGpu)) { |
| 228 fActiveCommandBuffers[i]->unref(fGpu); | 228 fActiveCommandBuffers[i]->unref(fGpu); |
| 229 fActiveCommandBuffers.removeShuffle(i); | 229 fActiveCommandBuffers.removeShuffle(i); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 } | 349 } |
| 350 | 350 |
| 351 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { | 351 void GrVkResourceProvider::CompatibleRenderPassSet::abandonResources() { |
| 352 for (int i = 0; i < fRenderPasses.count(); ++i) { | 352 for (int i = 0; i < fRenderPasses.count(); ++i) { |
| 353 if (fRenderPasses[i]) { | 353 if (fRenderPasses[i]) { |
| 354 fRenderPasses[i]->unrefAndAbandon(); | 354 fRenderPasses[i]->unrefAndAbandon(); |
| 355 fRenderPasses[i] = nullptr; | 355 fRenderPasses[i] = nullptr; |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 } | 358 } |
| OLD | NEW |