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

Side by Side Diff: src/gpu/vk/GrVkUniformBuffer.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 | « src/gpu/vk/GrVkPipelineStateDataManager.cpp ('k') | 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 #ifndef GrVkUniformBuffer_DEFINED 8 #ifndef GrVkUniformBuffer_DEFINED
9 #define GrVkUniformBuffer_DEFINED 9 #define GrVkUniformBuffer_DEFINED
10 10
11 #include "GrVkBuffer.h" 11 #include "GrVkBuffer.h"
12 12
13 class GrVkGpu; 13 class GrVkGpu;
14 14
15 class GrVkUniformBuffer : public GrVkBuffer { 15 class GrVkUniformBuffer : public GrVkBuffer {
16 16
17 public: 17 public:
18 static GrVkUniformBuffer* Create(GrVkGpu* gpu, size_t size, bool dynamic); 18 static GrVkUniformBuffer* Create(GrVkGpu* gpu, size_t size, bool dynamic);
19 19
20 void* map(const GrVkGpu* gpu) { 20 void* map(const GrVkGpu* gpu) {
21 return this->vkMap(gpu); 21 return this->vkMap(gpu);
22 } 22 }
23 void unmap(const GrVkGpu* gpu) { 23 void unmap(const GrVkGpu* gpu) {
24 this->vkUnmap(gpu); 24 this->vkUnmap(gpu);
25 } 25 }
26 bool updateData(const GrVkGpu* gpu, const void* src, size_t srcSizeInBytes) { 26 // The output variable createdNewBuffer must be set to true if a new VkBuffe r is created in
27 return this->vkUpdateData(gpu, src, srcSizeInBytes); 27 // order to upload the data
28 bool updateData(const GrVkGpu* gpu, const void* src, size_t srcSizeInBytes,
29 bool* createdNewBuffer) {
30 return this->vkUpdateData(gpu, src, srcSizeInBytes, createdNewBuffer);
28 } 31 }
29 void release(const GrVkGpu* gpu) { 32 void release(const GrVkGpu* gpu) {
30 this->vkRelease(gpu); 33 this->vkRelease(gpu);
31 } 34 }
32 void abandon() { 35 void abandon() {
33 this->vkAbandon(); 36 this->vkAbandon();
34 } 37 }
35 38
36 private: 39 private:
37 GrVkUniformBuffer(const GrVkBuffer::Desc& desc, const GrVkBuffer::Resource* resource) 40 GrVkUniformBuffer(const GrVkBuffer::Desc& desc, const GrVkBuffer::Resource* resource)
38 : INHERITED(desc, resource) { 41 : INHERITED(desc, resource) {
39 }; 42 };
40 43
41 typedef GrVkBuffer INHERITED; 44 typedef GrVkBuffer INHERITED;
42 }; 45 };
43 46
44 #endif 47 #endif
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkPipelineStateDataManager.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698