| 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 "GrVkGpuCommandBuffer.h" | 8 #include "GrVkGpuCommandBuffer.h" |
| 9 | 9 |
| 10 #include "GrFixedClip.h" | 10 #include "GrFixedClip.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 int meshCount) { | 388 int meshCount) { |
| 389 if (!meshCount) { | 389 if (!meshCount) { |
| 390 return; | 390 return; |
| 391 } | 391 } |
| 392 GrRenderTarget* rt = pipeline.getRenderTarget(); | 392 GrRenderTarget* rt = pipeline.getRenderTarget(); |
| 393 GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(rt); | 393 GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(rt); |
| 394 const GrVkRenderPass* renderPass = vkRT->simpleRenderPass(); | 394 const GrVkRenderPass* renderPass = vkRT->simpleRenderPass(); |
| 395 SkASSERT(renderPass); | 395 SkASSERT(renderPass); |
| 396 | 396 |
| 397 prepare_sampled_images(primProc, fGpu); | 397 prepare_sampled_images(primProc, fGpu); |
| 398 for (int i = 0; i < pipeline.numFragmentProcessors(); ++i) { | 398 GrFragmentProcessor::Iter iter(pipeline); |
| 399 prepare_sampled_images(pipeline.getFragmentProcessor(i), fGpu); | 399 while (const GrFragmentProcessor* fp = iter.next()) { |
| 400 prepare_sampled_images(*fp, fGpu); |
| 400 } | 401 } |
| 401 prepare_sampled_images(pipeline.getXferProcessor(), fGpu); | 402 prepare_sampled_images(pipeline.getXferProcessor(), fGpu); |
| 402 | 403 |
| 403 GrPrimitiveType primitiveType = meshes[0].primitiveType(); | 404 GrPrimitiveType primitiveType = meshes[0].primitiveType(); |
| 404 sk_sp<GrVkPipelineState> pipelineState = this->prepareDrawState(pipeline, | 405 sk_sp<GrVkPipelineState> pipelineState = this->prepareDrawState(pipeline, |
| 405 primProc, | 406 primProc, |
| 406 primitiveTyp
e, | 407 primitiveTyp
e, |
| 407 *renderPass)
; | 408 *renderPass)
; |
| 408 if (!pipelineState) { | 409 if (!pipelineState) { |
| 409 return; | 410 return; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 fGpu->stats()->incNumDraws(); | 452 fGpu->stats()->incNumDraws(); |
| 452 } while ((nonIdxMesh = iter.next())); | 453 } while ((nonIdxMesh = iter.next())); |
| 453 } | 454 } |
| 454 | 455 |
| 455 // Technically we don't have to call this here (since there is a safety chec
k in | 456 // Technically we don't have to call this here (since there is a safety chec
k in |
| 456 // pipelineState:setData but this will allow for quicker freeing of resource
s if the | 457 // pipelineState:setData but this will allow for quicker freeing of resource
s if the |
| 457 // pipelineState sits in a cache for a while. | 458 // pipelineState sits in a cache for a while. |
| 458 pipelineState->freeTempResources(fGpu); | 459 pipelineState->freeTempResources(fGpu); |
| 459 } | 460 } |
| 460 | 461 |
| OLD | NEW |