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

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

Issue 2344323002: Refactor vulkan buffer mapping and unmapping (Closed)
Patch Set: inner->internal Created 4 years, 3 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/GrVkGpu.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); 18 static GrVkUniformBuffer* Create(GrVkGpu* gpu, size_t size);
19 static const GrVkResource* CreateResource(GrVkGpu* gpu, size_t size); 19 static const GrVkResource* CreateResource(GrVkGpu* gpu, size_t size);
20 static const size_t kStandardSize = 256; 20 static const size_t kStandardSize = 256;
21 21
22 void* map(const GrVkGpu* gpu) { 22 void* map(GrVkGpu* gpu) {
23 return this->vkMap(gpu); 23 return this->vkMap(gpu);
24 } 24 }
25 void unmap(GrVkGpu* gpu) { 25 void unmap(GrVkGpu* gpu) {
26 this->vkUnmap(gpu); 26 this->vkUnmap(gpu);
27 } 27 }
28 // The output variable createdNewBuffer must be set to true if a new VkBuffe r is created in 28 // The output variable createdNewBuffer must be set to true if a new VkBuffe r is created in
29 // order to upload the data 29 // order to upload the data
30 bool updateData(GrVkGpu* gpu, const void* src, size_t srcSizeInBytes, 30 bool updateData(GrVkGpu* gpu, const void* src, size_t srcSizeInBytes,
31 bool* createdNewBuffer) { 31 bool* createdNewBuffer) {
32 return this->vkUpdateData(gpu, src, srcSizeInBytes, createdNewBuffer); 32 return this->vkUpdateData(gpu, src, srcSizeInBytes, createdNewBuffer);
(...skipping 16 matching lines...) Expand all
49 const GrVkBuffer::Desc& descripto r) override; 49 const GrVkBuffer::Desc& descripto r) override;
50 50
51 GrVkUniformBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc, 51 GrVkUniformBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc,
52 const GrVkUniformBuffer::Resource* resource) 52 const GrVkUniformBuffer::Resource* resource)
53 : INHERITED(desc, resource) {} 53 : INHERITED(desc, resource) {}
54 54
55 typedef GrVkBuffer INHERITED; 55 typedef GrVkBuffer INHERITED;
56 }; 56 };
57 57
58 #endif 58 #endif
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698