Skip to content

Commit ecded70

Browse files
committed
Skip timer query tests if results are zero on Apple
1 parent 8634d95 commit ecded70

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

test/test_backend.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,8 @@ UTEST( Backend, TimerQueryBasic )
10641064

10651065
// Now we should have a result
10661066
float time = vhGetTimerQueryTime( timerID );
1067+
if ( time == 0.0f ) { UTEST_SKIP( "Timestamp queries not producing results on this device/backend" ); }
1068+
#endif // __APPLE__
10671069
EXPECT_GT( time, 0.0f );
10681070
vhFinish();
10691071
}
@@ -1098,8 +1100,13 @@ UTEST( Backend, TimerQueryMultiple )
10981100
g_vhDevice->waitForIdle();
10991101
}
11001102

1101-
EXPECT_GT( vhGetTimerQueryTime( timer1 ), 0.0f );
1102-
EXPECT_GT( vhGetTimerQueryTime( timer2 ), 0.0f );
1103+
float t1 = vhGetTimerQueryTime( timer1 );
1104+
float t2 = vhGetTimerQueryTime( timer2 );
1105+
#ifdef __APPLE__ // MoltenVK headless seems to create queries that don't work. timestampValidBits returns 0.
1106+
if ( t1 == 0.0f || t2 == 0.0f ) { UTEST_SKIP( "Timestamp queries not producing results on this device/backend" ); }
1107+
#endif // __APPLE__
1108+
EXPECT_GT( t1, 0.0f );
1109+
EXPECT_GT( t2, 0.0f );
11031110
vhFinish();
11041111
}
11051112

0 commit comments

Comments
 (0)