Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: src/gpu/vk/GrVkCommandBuffer.cpp

Issue 1852413002: Implement blit image for copySurface in Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkCommandBuffer.h ('k') | src/gpu/vk/GrVkGpu.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 this->addResource(dstImage->resource()); 246 this->addResource(dstImage->resource());
247 GR_VK_CALL(gpu->vkInterface(), CmdCopyImage(fCmdBuffer, 247 GR_VK_CALL(gpu->vkInterface(), CmdCopyImage(fCmdBuffer,
248 srcImage->textureImage(), 248 srcImage->textureImage(),
249 srcLayout, 249 srcLayout,
250 dstImage->textureImage(), 250 dstImage->textureImage(),
251 dstLayout, 251 dstLayout,
252 copyRegionCount, 252 copyRegionCount,
253 copyRegions)); 253 copyRegions));
254 } 254 }
255 255
256 void GrVkCommandBuffer::blitImage(const GrVkGpu* gpu,
257 GrVkImage* srcImage,
258 VkImageLayout srcLayout,
259 GrVkImage* dstImage,
260 VkImageLayout dstLayout,
261 uint32_t blitRegionCount,
262 const VkImageBlit* blitRegions,
263 VkFilter filter) {
264 SkASSERT(fIsActive);
265 SkASSERT(!fActiveRenderPass);
266 this->addResource(srcImage->resource());
267 this->addResource(dstImage->resource());
268 GR_VK_CALL(gpu->vkInterface(), CmdBlitImage(fCmdBuffer,
269 srcImage->textureImage(),
270 srcLayout,
271 dstImage->textureImage(),
272 dstLayout,
273 blitRegionCount,
274 blitRegions,
275 filter));
276 }
277
256 void GrVkCommandBuffer::copyImageToBuffer(const GrVkGpu* gpu, 278 void GrVkCommandBuffer::copyImageToBuffer(const GrVkGpu* gpu,
257 GrVkImage* srcImage, 279 GrVkImage* srcImage,
258 VkImageLayout srcLayout, 280 VkImageLayout srcLayout,
259 GrVkTransferBuffer* dstBuffer, 281 GrVkTransferBuffer* dstBuffer,
260 uint32_t copyRegionCount, 282 uint32_t copyRegionCount,
261 const VkBufferImageCopy* copyRegions) { 283 const VkBufferImageCopy* copyRegions) {
262 SkASSERT(fIsActive); 284 SkASSERT(fIsActive);
263 SkASSERT(!fActiveRenderPass); 285 SkASSERT(!fActiveRenderPass);
264 this->addResource(srcImage->resource()); 286 this->addResource(srcImage->resource());
265 this->addResource(dstBuffer->resource()); 287 this->addResource(dstBuffer->resource());
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 458 }
437 459
438 void GrVkCommandBuffer::setBlendConstants(const GrVkGpu* gpu, 460 void GrVkCommandBuffer::setBlendConstants(const GrVkGpu* gpu,
439 const float blendConstants[4]) { 461 const float blendConstants[4]) {
440 SkASSERT(fIsActive); 462 SkASSERT(fIsActive);
441 if (memcmp(blendConstants, fCachedBlendConstant, 4 * sizeof(float))) { 463 if (memcmp(blendConstants, fCachedBlendConstant, 4 * sizeof(float))) {
442 GR_VK_CALL(gpu->vkInterface(), CmdSetBlendConstants(fCmdBuffer, blendCon stants)); 464 GR_VK_CALL(gpu->vkInterface(), CmdSetBlendConstants(fCmdBuffer, blendCon stants));
443 memcpy(fCachedBlendConstant, blendConstants, 4 * sizeof(float)); 465 memcpy(fCachedBlendConstant, blendConstants, 4 * sizeof(float));
444 } 466 }
445 } 467 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkCommandBuffer.h ('k') | src/gpu/vk/GrVkGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698