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

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

Issue 2128273002: Only check resource tracking on program shutdown, not context shutdown (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | src/gpu/vk/GrVkResource.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 "GrVkBuffer.h" 8 #include "GrVkBuffer.h"
9 #include "GrVkGpu.h" 9 #include "GrVkGpu.h"
10 #include "GrVkMemory.h" 10 #include "GrVkMemory.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 void GrVkBuffer::vkUnmap(GrVkGpu* gpu) { 148 void GrVkBuffer::vkUnmap(GrVkGpu* gpu) {
149 VALIDATE(); 149 VALIDATE();
150 SkASSERT(this->vkIsMapped()); 150 SkASSERT(this->vkIsMapped());
151 151
152 if (fDesc.fDynamic) { 152 if (fDesc.fDynamic) {
153 VK_CALL(gpu, UnmapMemory(gpu->device(), this->alloc().fMemory)); 153 VK_CALL(gpu, UnmapMemory(gpu->device(), this->alloc().fMemory));
154 } else { 154 } else {
155 gpu->updateBuffer(this, fMapPtr, this->size()); 155 gpu->updateBuffer(this, fMapPtr, this->size());
156 delete (unsigned char*) fMapPtr; 156 delete [] (unsigned char*)fMapPtr;
157 } 157 }
158 158
159 fMapPtr = nullptr; 159 fMapPtr = nullptr;
160 } 160 }
161 161
162 bool GrVkBuffer::vkIsMapped() const { 162 bool GrVkBuffer::vkIsMapped() const {
163 VALIDATE(); 163 VALIDATE();
164 return SkToBool(fMapPtr); 164 return SkToBool(fMapPtr);
165 } 165 }
166 166
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 VK_CALL(gpu, UnmapMemory(gpu->device(), alloc.fMemory)); 199 VK_CALL(gpu, UnmapMemory(gpu->device(), alloc.fMemory));
200 200
201 return true; 201 return true;
202 } 202 }
203 203
204 void GrVkBuffer::validate() const { 204 void GrVkBuffer::validate() const {
205 SkASSERT(!fResource || kVertex_Type == fDesc.fType || kIndex_Type == fDesc.f Type 205 SkASSERT(!fResource || kVertex_Type == fDesc.fType || kIndex_Type == fDesc.f Type
206 || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType 206 || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType
207 || kUniform_Type == fDesc.fType); 207 || kUniform_Type == fDesc.fType);
208 } 208 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/vk/GrVkResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698