OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrVkCommandBuffer.h" | 8 #include "GrVkCommandBuffer.h" |
9 | 9 |
10 #include "GrVkFramebuffer.h" | 10 #include "GrVkFramebuffer.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 const GrVkRenderTarget& target) { | 97 const GrVkRenderTarget& target) { |
98 SkASSERT(fIsActive); | 98 SkASSERT(fIsActive); |
99 SkASSERT(!fActiveRenderPass); | 99 SkASSERT(!fActiveRenderPass); |
100 VkRenderPassBeginInfo beginInfo; | 100 VkRenderPassBeginInfo beginInfo; |
101 VkSubpassContents contents; | 101 VkSubpassContents contents; |
102 renderPass->getBeginInfo(target, &beginInfo, &contents); | 102 renderPass->getBeginInfo(target, &beginInfo, &contents); |
103 GR_VK_CALL(gpu->vkInterface(), CmdBeginRenderPass(fCmdBuffer, &beginInfo, co
ntents)); | 103 GR_VK_CALL(gpu->vkInterface(), CmdBeginRenderPass(fCmdBuffer, &beginInfo, co
ntents)); |
104 fActiveRenderPass = renderPass; | 104 fActiveRenderPass = renderPass; |
105 this->addResource(renderPass); | 105 this->addResource(renderPass); |
106 target.addResources(*this); | 106 target.addResources(*this); |
107 | |
108 } | 107 } |
109 | 108 |
110 void GrVkCommandBuffer::endRenderPass(const GrVkGpu* gpu) { | 109 void GrVkCommandBuffer::endRenderPass(const GrVkGpu* gpu) { |
111 SkASSERT(fIsActive); | 110 SkASSERT(fIsActive); |
112 SkASSERT(fActiveRenderPass); | 111 SkASSERT(fActiveRenderPass); |
113 GR_VK_CALL(gpu->vkInterface(), CmdEndRenderPass(fCmdBuffer)); | 112 GR_VK_CALL(gpu->vkInterface(), CmdEndRenderPass(fCmdBuffer)); |
114 fActiveRenderPass = nullptr; | 113 fActiveRenderPass = nullptr; |
115 } | 114 } |
116 | 115 |
117 void GrVkCommandBuffer::submitToQueue(const GrVkGpu* gpu, VkQueue queue, GrVkGpu
::SyncQueue sync) { | 116 void GrVkCommandBuffer::submitToQueue(const GrVkGpu* gpu, VkQueue queue, GrVkGpu
::SyncQueue sync) { |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 SkASSERT(!fActiveRenderPass); | 287 SkASSERT(!fActiveRenderPass); |
289 this->addResource(image->resource()); | 288 this->addResource(image->resource()); |
290 GR_VK_CALL(gpu->vkInterface(), CmdClearColorImage(fCmdBuffer, | 289 GR_VK_CALL(gpu->vkInterface(), CmdClearColorImage(fCmdBuffer, |
291 image->textureImage(), | 290 image->textureImage(), |
292 image->currentLayout(), | 291 image->currentLayout(), |
293 color, | 292 color, |
294 subRangeCount, | 293 subRangeCount, |
295 subRanges)); | 294 subRanges)); |
296 } | 295 } |
297 | 296 |
| 297 void GrVkCommandBuffer::clearDepthStencilImage(const GrVkGpu* gpu, |
| 298 GrVkImage* image, |
| 299 const VkClearDepthStencilValue* c
olor, |
| 300 uint32_t subRangeCount, |
| 301 const VkImageSubresourceRange* su
bRanges) { |
| 302 SkASSERT(fIsActive); |
| 303 SkASSERT(!fActiveRenderPass); |
| 304 this->addResource(image->resource()); |
| 305 GR_VK_CALL(gpu->vkInterface(), CmdClearDepthStencilImage(fCmdBuffer, |
| 306 image->textureImage
(), |
| 307 image->currentLayou
t(), |
| 308 color, |
| 309 subRangeCount, |
| 310 subRanges)); |
| 311 } |
| 312 |
298 void GrVkCommandBuffer::clearAttachments(const GrVkGpu* gpu, | 313 void GrVkCommandBuffer::clearAttachments(const GrVkGpu* gpu, |
299 int numAttachments, | 314 int numAttachments, |
300 const VkClearAttachment* attachments, | 315 const VkClearAttachment* attachments, |
301 int numRects, | 316 int numRects, |
302 const VkClearRect* clearRects) const { | 317 const VkClearRect* clearRects) const { |
303 SkASSERT(fIsActive); | 318 SkASSERT(fIsActive); |
304 SkASSERT(fActiveRenderPass); | 319 SkASSERT(fActiveRenderPass); |
305 SkASSERT(numAttachments > 0); | 320 SkASSERT(numAttachments > 0); |
306 SkASSERT(numRects > 0); | 321 SkASSERT(numRects > 0); |
307 #ifdef SK_DEBUG | 322 #ifdef SK_DEBUG |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 uint32_t firstVertex, | 377 uint32_t firstVertex, |
363 uint32_t firstInstance) const { | 378 uint32_t firstInstance) const { |
364 SkASSERT(fIsActive); | 379 SkASSERT(fIsActive); |
365 SkASSERT(fActiveRenderPass); | 380 SkASSERT(fActiveRenderPass); |
366 GR_VK_CALL(gpu->vkInterface(), CmdDraw(fCmdBuffer, | 381 GR_VK_CALL(gpu->vkInterface(), CmdDraw(fCmdBuffer, |
367 vertexCount, | 382 vertexCount, |
368 instanceCount, | 383 instanceCount, |
369 firstVertex, | 384 firstVertex, |
370 firstInstance)); | 385 firstInstance)); |
371 } | 386 } |
OLD | NEW |