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

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

Issue 1872553005: Don't create new descriptor set for vulkan uniforms every draw (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 | 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // convenience routine for raw buffer creation 66 // convenience routine for raw buffer creation
67 static const Resource* Create(const GrVkGpu* gpu, 67 static const Resource* Create(const GrVkGpu* gpu,
68 const Desc& descriptor); 68 const Desc& descriptor);
69 69
70 GrVkBuffer(const Desc& desc, const GrVkBuffer::Resource* resource) 70 GrVkBuffer(const Desc& desc, const GrVkBuffer::Resource* resource)
71 : fDesc(desc), fResource(resource), fMapPtr(nullptr) { 71 : fDesc(desc), fResource(resource), fMapPtr(nullptr) {
72 } 72 }
73 73
74 void* vkMap(const GrVkGpu* gpu); 74 void* vkMap(const GrVkGpu* gpu);
75 void vkUnmap(const GrVkGpu* gpu); 75 void vkUnmap(const GrVkGpu* gpu);
76 bool vkUpdateData(const GrVkGpu* gpu, const void* src, size_t srcSizeInBytes ); 76 // If the caller passes in a non null createdNewBuffer, this function will s et the bool to true
77 // if it creates a new VkBuffer to upload the data to.
78 bool vkUpdateData(const GrVkGpu* gpu, const void* src, size_t srcSizeInBytes ,
79 bool* createdNewBuffer = nullptr);
77 80
78 void vkAbandon(); 81 void vkAbandon();
79 void vkRelease(const GrVkGpu* gpu); 82 void vkRelease(const GrVkGpu* gpu);
80 83
81 private: 84 private:
82 void validate() const; 85 void validate() const;
83 bool vkIsMapped() const; 86 bool vkIsMapped() const;
84 87
85 Desc fDesc; 88 Desc fDesc;
86 const Resource* fResource; 89 const Resource* fResource;
87 void* fMapPtr; 90 void* fMapPtr;
88 91
89 typedef SkNoncopyable INHERITED; 92 typedef SkNoncopyable INHERITED;
90 }; 93 };
91 94
92 #endif 95 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/vk/GrVkBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698