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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 GR_VK_CALL(gpu->vkInterface(), CmdCopyImage(fCmdBuffer, | 253 GR_VK_CALL(gpu->vkInterface(), CmdCopyImage(fCmdBuffer, |
254 srcImage->textureImage(), | 254 srcImage->textureImage(), |
255 srcLayout, | 255 srcLayout, |
256 dstImage->textureImage(), | 256 dstImage->textureImage(), |
257 dstLayout, | 257 dstLayout, |
258 copyRegionCount, | 258 copyRegionCount, |
259 copyRegions)); | 259 copyRegions)); |
260 } | 260 } |
261 | 261 |
262 void GrVkCommandBuffer::blitImage(const GrVkGpu* gpu, | 262 void GrVkCommandBuffer::blitImage(const GrVkGpu* gpu, |
263 GrVkImage* srcImage, | 263 const GrVkImage::Resource* srcImage, |
264 VkImageLayout srcLayout, | 264 VkImageLayout srcLayout, |
265 GrVkImage* dstImage, | 265 const GrVkImage::Resource* dstImage, |
266 VkImageLayout dstLayout, | 266 VkImageLayout dstLayout, |
267 uint32_t blitRegionCount, | 267 uint32_t blitRegionCount, |
268 const VkImageBlit* blitRegions, | 268 const VkImageBlit* blitRegions, |
269 VkFilter filter) { | 269 VkFilter filter) { |
270 SkASSERT(fIsActive); | 270 SkASSERT(fIsActive); |
271 SkASSERT(!fActiveRenderPass); | 271 SkASSERT(!fActiveRenderPass); |
272 this->addResource(srcImage->resource()); | 272 this->addResource(srcImage); |
273 this->addResource(dstImage->resource()); | 273 this->addResource(dstImage); |
274 GR_VK_CALL(gpu->vkInterface(), CmdBlitImage(fCmdBuffer, | 274 GR_VK_CALL(gpu->vkInterface(), CmdBlitImage(fCmdBuffer, |
275 srcImage->textureImage(), | 275 srcImage->fImage, |
276 srcLayout, | 276 srcLayout, |
277 dstImage->textureImage(), | 277 dstImage->fImage, |
278 dstLayout, | 278 dstLayout, |
279 blitRegionCount, | 279 blitRegionCount, |
280 blitRegions, | 280 blitRegions, |
281 filter)); | 281 filter)); |
282 } | 282 } |
283 | 283 |
284 void GrVkCommandBuffer::copyImageToBuffer(const GrVkGpu* gpu, | 284 void GrVkCommandBuffer::copyImageToBuffer(const GrVkGpu* gpu, |
285 GrVkImage* srcImage, | 285 GrVkImage* srcImage, |
286 VkImageLayout srcLayout, | 286 VkImageLayout srcLayout, |
287 GrVkTransferBuffer* dstBuffer, | 287 GrVkTransferBuffer* dstBuffer, |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 } | 463 } |
464 | 464 |
465 void GrVkCommandBuffer::setBlendConstants(const GrVkGpu* gpu, | 465 void GrVkCommandBuffer::setBlendConstants(const GrVkGpu* gpu, |
466 const float blendConstants[4]) { | 466 const float blendConstants[4]) { |
467 SkASSERT(fIsActive); | 467 SkASSERT(fIsActive); |
468 if (memcmp(blendConstants, fCachedBlendConstant, 4 * sizeof(float))) { | 468 if (memcmp(blendConstants, fCachedBlendConstant, 4 * sizeof(float))) { |
469 GR_VK_CALL(gpu->vkInterface(), CmdSetBlendConstants(fCmdBuffer, blendCon
stants)); | 469 GR_VK_CALL(gpu->vkInterface(), CmdSetBlendConstants(fCmdBuffer, blendCon
stants)); |
470 memcpy(fCachedBlendConstant, blendConstants, 4 * sizeof(float)); | 470 memcpy(fCachedBlendConstant, blendConstants, 4 * sizeof(float)); |
471 } | 471 } |
472 } | 472 } |
OLD | NEW |