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 "GrMesh.h" | 10 #include "GrMesh.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 pipelineState->setData(fGpu, primProc, pipeline); | 328 pipelineState->setData(fGpu, primProc, pipeline); |
329 | 329 |
330 pipelineState->bind(fGpu, fCommandBuffer); | 330 pipelineState->bind(fGpu, fCommandBuffer); |
331 | 331 |
332 GrVkPipeline::SetDynamicState(fGpu, fCommandBuffer, pipeline); | 332 GrVkPipeline::SetDynamicState(fGpu, fCommandBuffer, pipeline); |
333 | 333 |
334 return pipelineState; | 334 return pipelineState; |
335 } | 335 } |
336 | 336 |
337 static void append_sampled_images(const GrProcessor& processor, | 337 static void append_sampled_images(const GrProcessor& processor, |
338 const GrVkGpu* gpu, | 338 GrVkGpu* gpu, |
339 SkTArray<GrVkImage*>* sampledImages) { | 339 SkTArray<GrVkImage*>* sampledImages) { |
340 if (int numTextures = processor.numTextures()) { | 340 if (int numTextures = processor.numTextures()) { |
341 GrVkImage** images = sampledImages->push_back_n(numTextures); | 341 GrVkImage** images = sampledImages->push_back_n(numTextures); |
342 int i = 0; | 342 int i = 0; |
343 do { | 343 do { |
344 const GrTextureAccess& texAccess = processor.textureAccess(i); | 344 const GrTextureAccess& texAccess = processor.textureAccess(i); |
345 GrVkTexture* vkTexture = static_cast<GrVkTexture*>(processor.texture
(i)); | 345 GrVkTexture* vkTexture = static_cast<GrVkTexture*>(processor.texture
(i)); |
346 SkASSERT(vkTexture); | 346 SkASSERT(vkTexture); |
347 const GrTextureParams& params = texAccess.getParams(); | 347 const GrTextureParams& params = texAccess.getParams(); |
348 // Check if we need to regenerate any mip maps | 348 // Check if we need to regenerate any mip maps |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 fGpu->stats()->incNumDraws(); | 428 fGpu->stats()->incNumDraws(); |
429 } while ((nonIdxMesh = iter.next())); | 429 } while ((nonIdxMesh = iter.next())); |
430 } | 430 } |
431 | 431 |
432 // Technically we don't have to call this here (since there is a safety chec
k in | 432 // Technically we don't have to call this here (since there is a safety chec
k in |
433 // pipelineState:setData but this will allow for quicker freeing of resource
s if the | 433 // pipelineState:setData but this will allow for quicker freeing of resource
s if the |
434 // pipelineState sits in a cache for a while. | 434 // pipelineState sits in a cache for a while. |
435 pipelineState->freeTempResources(fGpu); | 435 pipelineState->freeTempResources(fGpu); |
436 } | 436 } |
437 | 437 |
OLD | NEW |