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

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

Issue 2112653002: Add static buffer support (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 5 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/GrVkResourceProvider.cpp ('k') | src/gpu/vk/GrVkUniformBuffer.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 "GrVkTransferBuffer.h" 8 #include "GrVkTransferBuffer.h"
9 #include "GrVkGpu.h" 9 #include "GrVkGpu.h"
10 #include "SkTraceMemoryDump.h" 10 #include "SkTraceMemoryDump.h"
11 11
12 12
13 GrVkTransferBuffer* GrVkTransferBuffer::Create(GrVkGpu* gpu, size_t size, GrVkBu ffer::Type type) { 13 GrVkTransferBuffer* GrVkTransferBuffer::Create(GrVkGpu* gpu, size_t size, GrVkBu ffer::Type type) {
14 GrVkBuffer::Desc desc; 14 GrVkBuffer::Desc desc;
15 desc.fDynamic = false; 15 desc.fDynamic = true;
16 SkASSERT(GrVkBuffer::kCopyRead_Type == type || GrVkBuffer::kCopyWrite_Type = = type); 16 SkASSERT(GrVkBuffer::kCopyRead_Type == type || GrVkBuffer::kCopyWrite_Type = = type);
17 desc.fType = type; 17 desc.fType = type;
18 desc.fSizeInBytes = size; 18 desc.fSizeInBytes = size;
19 19
20 const GrVkBuffer::Resource* bufferResource = GrVkBuffer::Create(gpu, desc); 20 const GrVkBuffer::Resource* bufferResource = GrVkBuffer::Create(gpu, desc);
21 if (!bufferResource) { 21 if (!bufferResource) {
22 return nullptr; 22 return nullptr;
23 } 23 }
24 24
25 GrVkTransferBuffer* buffer = new GrVkTransferBuffer(gpu, desc, bufferResourc e); 25 GrVkTransferBuffer* buffer = new GrVkTransferBuffer(gpu, desc, bufferResourc e);
(...skipping 26 matching lines...) Expand all
52 INHERITED::onAbandon(); 52 INHERITED::onAbandon();
53 } 53 }
54 54
55 void GrVkTransferBuffer::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, 55 void GrVkTransferBuffer::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
56 const SkString& dumpName) const { 56 const SkString& dumpName) const {
57 SkString buffer_id; 57 SkString buffer_id;
58 buffer_id.appendU64((uint64_t)this->buffer()); 58 buffer_id.appendU64((uint64_t)this->buffer());
59 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "vk_buffer", 59 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "vk_buffer",
60 buffer_id.c_str()); 60 buffer_id.c_str());
61 } 61 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkResourceProvider.cpp ('k') | src/gpu/vk/GrVkUniformBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698