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

Side by Side Diff: tools/gpu/TestContext.cpp

Issue 1965273004: Nanobench running on Vulkan (Closed) Base URL: https://chromium.googlesource.com/skia.git@gltotest
Patch Set: Created 4 years, 7 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 | « tools/gpu/TestContext.h ('k') | tools/gpu/gl/GLTestContext.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 /* 2 /*
3 * Copyright 2016 Google Inc. 3 * Copyright 2016 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "TestContext.h" 9 #include "TestContext.h"
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 void TestContext::swapBuffers() { this->onPlatformSwapBuffers(); } 28 void TestContext::swapBuffers() { this->onPlatformSwapBuffers(); }
29 29
30 void TestContext::waitOnSyncOrSwap() { 30 void TestContext::waitOnSyncOrSwap() {
31 if (!fFenceSync) { 31 if (!fFenceSync) {
32 // Fallback on the platform SwapBuffers method for synchronization. This may have no effect. 32 // Fallback on the platform SwapBuffers method for synchronization. This may have no effect.
33 this->swapBuffers(); 33 this->swapBuffers();
34 return; 34 return;
35 } 35 }
36 36
37 this->submit();
37 if (fFrameFences[fCurrentFenceIdx]) { 38 if (fFrameFences[fCurrentFenceIdx]) {
38 if (!fFenceSync->waitFence(fFrameFences[fCurrentFenceIdx], true)) { 39 if (!fFenceSync->waitFence(fFrameFences[fCurrentFenceIdx], true)) {
39 SkDebugf("WARNING: Wait failed for fence sync. Timings might not be accurate.\n"); 40 SkDebugf("WARNING: Wait failed for fence sync. Timings might not be accurate.\n");
40 } 41 }
41 fFenceSync->deleteFence(fFrameFences[fCurrentFenceIdx]); 42 fFenceSync->deleteFence(fFrameFences[fCurrentFenceIdx]);
42 } 43 }
43 44
44 fFrameFences[fCurrentFenceIdx] = fFenceSync->insertFence(); 45 fFrameFences[fCurrentFenceIdx] = fFenceSync->insertFence();
45 fCurrentFenceIdx = (fCurrentFenceIdx + 1) % SK_ARRAY_COUNT(fFrameFences); 46 fCurrentFenceIdx = (fCurrentFenceIdx + 1) % SK_ARRAY_COUNT(fFrameFences);
46 } 47 }
(...skipping 11 matching lines...) Expand all
58 fFenceSync->deleteFence(fFrameFences[i]); 59 fFenceSync->deleteFence(fFrameFences[i]);
59 fFrameFences[i] = 0; 60 fFrameFences[i] = 0;
60 } 61 }
61 } 62 }
62 delete fFenceSync; 63 delete fFenceSync;
63 fFenceSync = nullptr; 64 fFenceSync = nullptr;
64 } 65 }
65 } 66 }
66 67
67 } 68 }
OLDNEW
« no previous file with comments | « tools/gpu/TestContext.h ('k') | tools/gpu/gl/GLTestContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698