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

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

Issue 2361473002: Always use transfer_dst for buffers. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | 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 "GrVkBuffer.h" 8 #include "GrVkBuffer.h"
9 #include "GrVkGpu.h" 9 #include "GrVkGpu.h"
10 #include "GrVkMemory.h" 10 #include "GrVkMemory.h"
(...skipping 27 matching lines...) Expand all
38 case kUniform_Type: 38 case kUniform_Type:
39 bufInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT; 39 bufInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
40 break; 40 break;
41 case kCopyRead_Type: 41 case kCopyRead_Type:
42 bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; 42 bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
43 break; 43 break;
44 case kCopyWrite_Type: 44 case kCopyWrite_Type:
45 bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT; 45 bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT;
46 break; 46 break;
47 } 47 }
48 if (!desc.fDynamic) { 48 bufInfo.usage |= VK_BUFFER_USAGE_TRANSFER_DST_BIT;
49 bufInfo.usage |= VK_BUFFER_USAGE_TRANSFER_DST_BIT;
50 }
51 49
52 bufInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; 50 bufInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
53 bufInfo.queueFamilyIndexCount = 0; 51 bufInfo.queueFamilyIndexCount = 0;
54 bufInfo.pQueueFamilyIndices = nullptr; 52 bufInfo.pQueueFamilyIndices = nullptr;
55 53
56 VkResult err; 54 VkResult err;
57 err = VK_CALL(gpu, CreateBuffer(gpu->device(), &bufInfo, nullptr, &buffer)); 55 err = VK_CALL(gpu, CreateBuffer(gpu->device(), &bufInfo, nullptr, &buffer));
58 if (err) { 56 if (err) {
59 return nullptr; 57 return nullptr;
60 } 58 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 this->internalUnmap(gpu, srcSizeInBytes); 213 this->internalUnmap(gpu, srcSizeInBytes);
216 214
217 return true; 215 return true;
218 } 216 }
219 217
220 void GrVkBuffer::validate() const { 218 void GrVkBuffer::validate() const {
221 SkASSERT(!fResource || kVertex_Type == fDesc.fType || kIndex_Type == fDesc.f Type 219 SkASSERT(!fResource || kVertex_Type == fDesc.fType || kIndex_Type == fDesc.f Type
222 || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType 220 || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType
223 || kUniform_Type == fDesc.fType); 221 || kUniform_Type == fDesc.fType);
224 } 222 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698