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

Side by Side Diff: tools/kilobench/kilobench.cpp

Issue 1974913003: Implement vulkan fence syncs for nanobench (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: -Address comments and fix compilation of non-vulkan build 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/vk/VkTestContext.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 2016 Google Inc. 2 * Copyright 2016 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 "GrCaps.h" 8 #include "GrCaps.h"
9 #include "GrContextFactory.h" 9 #include "GrContextFactory.h"
10 #include "Benchmark.h" 10 #include "Benchmark.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 // To ensure waiting for the sync actually does something, we check to make sure the we exceed 295 // To ensure waiting for the sync actually does something, we check to make sure the we exceed
296 // some small value 296 // some small value
297 const double kMinElapsed = 1e-6; 297 const double kMinElapsed = 1e-6;
298 bool sanity(double start) const { 298 bool sanity(double start) const {
299 double elapsed = now_ms() - start; 299 double elapsed = now_ms() - start;
300 return elapsed > kMinElapsed; 300 return elapsed > kMinElapsed;
301 } 301 }
302 302
303 void waitFence(SkPlatformGpuFence sync) { 303 void waitFence(SkPlatformGpuFence sync) {
304 SkDEBUGCODE(double start = now_ms()); 304 SkDEBUGCODE(double start = now_ms());
305 fFenceSync->waitFence(sync, false); 305 fFenceSync->waitFence(sync);
306 SkASSERT(sanity(start)); 306 SkASSERT(sanity(start));
307 } 307 }
308 308
309 void timingLoop() { 309 void timingLoop() {
310 // Create a context which shares display lists with the main thread 310 // Create a context which shares display lists with the main thread
311 SkAutoTDelete<GLTestContext> glContext(CreatePlatformGLTestContext(kNone _GrGLStandard, 311 SkAutoTDelete<GLTestContext> glContext(CreatePlatformGLTestContext(kNone _GrGLStandard,
312 fMain Context)); 312 fMain Context));
313 glContext->makeCurrent(); 313 glContext->makeCurrent();
314 314
315 // Basic timing methodology is: 315 // Basic timing methodology is:
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 } 648 }
649 return 0; 649 return 0;
650 } 650 }
651 651
652 #if !defined SK_BUILD_FOR_IOS 652 #if !defined SK_BUILD_FOR_IOS
653 int main(int argc, char** argv) { 653 int main(int argc, char** argv) {
654 SkCommandLineFlags::Parse(argc, argv); 654 SkCommandLineFlags::Parse(argc, argv);
655 return kilobench_main(); 655 return kilobench_main();
656 } 656 }
657 #endif 657 #endif
OLDNEW
« no previous file with comments | « tools/gpu/vk/VkTestContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698