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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 void GrVkGpuCommandBuffer::onClear(GrRenderTarget* target, const SkIRect& rect,
GrColor color) { | 183 void GrVkGpuCommandBuffer::onClear(GrRenderTarget* target, const SkIRect& rect,
GrColor color) { |
184 // parent class should never let us get here with no RT | 184 // parent class should never let us get here with no RT |
185 SkASSERT(target); | 185 SkASSERT(target); |
186 | 186 |
187 VkClearColorValue vkColor; | 187 VkClearColorValue vkColor; |
188 GrColorToRGBAFloat(color, vkColor.float32); | 188 GrColorToRGBAFloat(color, vkColor.float32); |
189 | 189 |
190 GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(target); | 190 GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(target); |
191 | 191 |
192 if (fIsEmpty) { | 192 if (fIsEmpty && rect.width() == target->width() && rect.height() == target->
height()) { |
193 // We will change the render pass to do a clear load instead | 193 // We will change the render pass to do a clear load instead |
194 GrVkRenderPass::LoadStoreOps vkColorOps(VK_ATTACHMENT_LOAD_OP_CLEAR, | 194 GrVkRenderPass::LoadStoreOps vkColorOps(VK_ATTACHMENT_LOAD_OP_CLEAR, |
195 VK_ATTACHMENT_STORE_OP_STORE); | 195 VK_ATTACHMENT_STORE_OP_STORE); |
196 GrVkRenderPass::LoadStoreOps vkStencilOps(VK_ATTACHMENT_LOAD_OP_LOAD, | 196 GrVkRenderPass::LoadStoreOps vkStencilOps(VK_ATTACHMENT_LOAD_OP_LOAD, |
197 VK_ATTACHMENT_STORE_OP_STORE); | 197 VK_ATTACHMENT_STORE_OP_STORE); |
198 GrVkRenderPass::LoadStoreOps vkResolveOps(VK_ATTACHMENT_LOAD_OP_LOAD, | 198 GrVkRenderPass::LoadStoreOps vkResolveOps(VK_ATTACHMENT_LOAD_OP_LOAD, |
199 VK_ATTACHMENT_STORE_OP_STORE); | 199 VK_ATTACHMENT_STORE_OP_STORE); |
200 | 200 |
201 const GrVkRenderPass* oldRP = fRenderPass; | 201 const GrVkRenderPass* oldRP = fRenderPass; |
202 | 202 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 fGpu->stats()->incNumDraws(); | 388 fGpu->stats()->incNumDraws(); |
389 } while ((nonIdxMesh = iter.next())); | 389 } while ((nonIdxMesh = iter.next())); |
390 } | 390 } |
391 | 391 |
392 // Technically we don't have to call this here (since there is a safety chec
k in | 392 // Technically we don't have to call this here (since there is a safety chec
k in |
393 // pipelineState:setData but this will allow for quicker freeing of resource
s if the | 393 // pipelineState:setData but this will allow for quicker freeing of resource
s if the |
394 // pipelineState sits in a cache for a while. | 394 // pipelineState sits in a cache for a while. |
395 pipelineState->freeTempResources(fGpu); | 395 pipelineState->freeTempResources(fGpu); |
396 } | 396 } |
397 | 397 |
OLD | NEW |