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

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

Issue 2029763002: Create free list heap for suballocation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments; clean up debug code Created 4 years, 6 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 | « include/gpu/vk/GrVkTypes.h ('k') | src/gpu/vk/GrVkBuffer.cpp » ('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 #ifndef GrVkBuffer_DEFINED 8 #ifndef GrVkBuffer_DEFINED
9 #define GrVkBuffer_DEFINED 9 #define GrVkBuffer_DEFINED
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 protected: 48 protected:
49 struct Desc { 49 struct Desc {
50 size_t fSizeInBytes; 50 size_t fSizeInBytes;
51 Type fType; // vertex buffer, index buffer, etc. 51 Type fType; // vertex buffer, index buffer, etc.
52 bool fDynamic; 52 bool fDynamic;
53 }; 53 };
54 54
55 class Resource : public GrVkResource { 55 class Resource : public GrVkResource {
56 public: 56 public:
57 Resource(VkBuffer buf, const GrVkAlloc& alloc) 57 Resource(VkBuffer buf, const GrVkAlloc& alloc, Type type)
58 : INHERITED(), fBuffer(buf), fAlloc(alloc) {} 58 : INHERITED(), fBuffer(buf), fAlloc(alloc), fType(type) {}
59 59
60 VkBuffer fBuffer; 60 VkBuffer fBuffer;
61 GrVkAlloc fAlloc; 61 GrVkAlloc fAlloc;
62 Type fType;
62 63
63 private: 64 private:
64 void freeGPUData(const GrVkGpu* gpu) const; 65 void freeGPUData(const GrVkGpu* gpu) const;
65 66
66 typedef GrVkResource INHERITED; 67 typedef GrVkResource INHERITED;
67 }; 68 };
68 69
69 // convenience routine for raw buffer creation 70 // convenience routine for raw buffer creation
70 static const Resource* Create(const GrVkGpu* gpu, 71 static const Resource* Create(const GrVkGpu* gpu,
71 const Desc& descriptor); 72 const Desc& descriptor);
(...skipping 17 matching lines...) Expand all
89 bool vkIsMapped() const; 90 bool vkIsMapped() const;
90 91
91 Desc fDesc; 92 Desc fDesc;
92 const Resource* fResource; 93 const Resource* fResource;
93 void* fMapPtr; 94 void* fMapPtr;
94 95
95 typedef SkNoncopyable INHERITED; 96 typedef SkNoncopyable INHERITED;
96 }; 97 };
97 98
98 #endif 99 #endif
OLDNEW
« no previous file with comments | « include/gpu/vk/GrVkTypes.h ('k') | src/gpu/vk/GrVkBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698