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

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

Issue 1897373002: Fix createBuffer 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 | « 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 "GrVkGpu.h" 8 #include "GrVkGpu.h"
9 9
10 #include "GrContextOptions.h" 10 #include "GrContextOptions.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 /////////////////////////////////////////////////////////////////////////////// 174 ///////////////////////////////////////////////////////////////////////////////
175 GrBuffer* GrVkGpu::onCreateBuffer(size_t size, GrBufferType type, GrAccessPatter n accessPattern, 175 GrBuffer* GrVkGpu::onCreateBuffer(size_t size, GrBufferType type, GrAccessPatter n accessPattern,
176 const void* data) { 176 const void* data) {
177 GrBuffer* buff; 177 GrBuffer* buff;
178 switch (type) { 178 switch (type) {
179 case kVertex_GrBufferType: 179 case kVertex_GrBufferType:
180 SkASSERT(kDynamic_GrAccessPattern == accessPattern || 180 SkASSERT(kDynamic_GrAccessPattern == accessPattern ||
181 kStatic_GrAccessPattern == accessPattern); 181 kStatic_GrAccessPattern == accessPattern);
182 buff = GrVkVertexBuffer::Create(this, size, kDynamic_GrAccessPattern == accessPattern); 182 buff = GrVkVertexBuffer::Create(this, size, kDynamic_GrAccessPattern == accessPattern);
183 break;
183 case kIndex_GrBufferType: 184 case kIndex_GrBufferType:
184 SkASSERT(kDynamic_GrAccessPattern == accessPattern || 185 SkASSERT(kDynamic_GrAccessPattern == accessPattern ||
185 kStatic_GrAccessPattern == accessPattern); 186 kStatic_GrAccessPattern == accessPattern);
186 buff = GrVkIndexBuffer::Create(this, size, kDynamic_GrAccessPattern == accessPattern); 187 buff = GrVkIndexBuffer::Create(this, size, kDynamic_GrAccessPattern == accessPattern);
188 break;
187 case kXferCpuToGpu_GrBufferType: 189 case kXferCpuToGpu_GrBufferType:
188 SkASSERT(kStream_GrAccessPattern == accessPattern); 190 SkASSERT(kStream_GrAccessPattern == accessPattern);
189 buff = GrVkTransferBuffer::Create(this, size, GrVkBuffer::kCopyRead_ Type); 191 buff = GrVkTransferBuffer::Create(this, size, GrVkBuffer::kCopyRead_ Type);
192 break;
190 case kXferGpuToCpu_GrBufferType: 193 case kXferGpuToCpu_GrBufferType:
191 SkASSERT(kStream_GrAccessPattern == accessPattern); 194 SkASSERT(kStream_GrAccessPattern == accessPattern);
192 buff = GrVkTransferBuffer::Create(this, size, GrVkBuffer::kCopyWrite _Type); 195 buff = GrVkTransferBuffer::Create(this, size, GrVkBuffer::kCopyWrite _Type);
196 break;
193 default: 197 default:
194 SkFAIL("Unknown buffer type."); 198 SkFAIL("Unknown buffer type.");
195 return nullptr; 199 return nullptr;
196 } 200 }
197 if (data && buff) { 201 if (data && buff) {
198 buff->updateData(data, size); 202 buff->updateData(data, size);
199 } 203 }
200 return buff; 204 return buff;
201 } 205 }
202 206
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 aglSwapBuffers(aglGetCurrentContext()); 1590 aglSwapBuffers(aglGetCurrentContext());
1587 int set_a_break_pt_here = 9; 1591 int set_a_break_pt_here = 9;
1588 aglSwapBuffers(aglGetCurrentContext()); 1592 aglSwapBuffers(aglGetCurrentContext());
1589 #elif defined(SK_BUILD_FOR_WIN32) 1593 #elif defined(SK_BUILD_FOR_WIN32)
1590 SwapBuf(); 1594 SwapBuf();
1591 int set_a_break_pt_here = 9; 1595 int set_a_break_pt_here = 9;
1592 SwapBuf(); 1596 SwapBuf();
1593 #endif 1597 #endif
1594 #endif 1598 #endif
1595 } 1599 }
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