@@ -117,9 +117,11 @@ def prepareShaders(frag):
117
117
118
118
################################################################################
119
119
120
- def getImageVulkanAndroid (args , frag ):
120
+ def getImageVulkanAndroid (args , frag , skipRender ):
121
121
122
- app = 'vulkan.samples.vulkan_worker'
122
+ app = 'com.graphicsfuzz.vkworker'
123
+ if args .oldworker :
124
+ app = 'vulkan.samples.vulkan_worker'
123
125
124
126
print ('## ' + frag )
125
127
@@ -169,11 +171,14 @@ def getImageVulkanAndroid(args, frag):
169
171
170
172
adb ('push test.vert.spv test.frag.spv test.json /sdcard/graphicsfuzz/' )
171
173
174
+ # Skip render
175
+ if skipRender :
176
+ adb ('shell touch /sdcard/graphicsfuzz/SKIP_RENDER' )
177
+
172
178
# clean all buffers of logcat
173
179
adb ('logcat -b all -c' )
174
180
175
- runtestcmd = 'shell am start'
176
- runtestcmd += ' -n ' + app + '/android.app.NativeActivity'
181
+ runtestcmd = 'shell am start ' + app + '/android.app.NativeActivity'
177
182
178
183
print ('* Will run: ' + runtestcmd )
179
184
adb (runtestcmd )
@@ -224,15 +229,24 @@ def getImageVulkanAndroid(args, frag):
224
229
adb ('shell am force-stop ' + app )
225
230
return 'timeout'
226
231
227
- # Get the image and convert it to PNG
228
- adb ('pull /sdcard/graphicsfuzz/image.ppm' )
229
- if os .path .exists ('image.ppm' ):
230
- subprocess .run ('convert image.ppm image.png' , shell = True )
231
- return 'success'
232
+ # Get the image
233
+ if args .oldworker :
234
+ adb ('pull /sdcard/graphicsfuzz/image.ppm' )
235
+ if os .path .exists ('image.ppm' ):
236
+ subprocess .run ('convert image.ppm image.png' , shell = True )
237
+ return 'success'
238
+ else :
239
+ with open ('log.txt' , 'a' ) as f :
240
+ f .write ('\n WEIRD ERROR: No crash detected but no image found on device ??\n ' )
241
+ return 'unexpected_error'
232
242
else :
233
- with open ('log.txt' , 'a' ) as f :
234
- f .write ('\n WEIRD ERROR: No crash detected but no image found on device ??\n ' )
235
- return 'unexpected_error'
243
+ adb ('pull /sdcard/graphicsfuzz/image.png' )
244
+ if os .path .exists ('image.png' ):
245
+ return 'success'
246
+ else :
247
+ with open ('log.txt' , 'a' ) as f :
248
+ f .write ('\n WEIRD ERROR: No crash detected but no image found on device ??\n ' )
249
+ return 'unexpected_error'
236
250
237
251
################################################################################
238
252
@@ -245,6 +259,8 @@ def doImageJob(args, imageJob):
245
259
246
260
res = tt .ImageJobResult ()
247
261
262
+ skipRender = imageJob .skipRender
263
+
248
264
# Set nice defaults to fields we will not update anyway
249
265
res .passSanityCheck = True
250
266
res .log = 'Start: ' + name + '\n '
@@ -255,7 +271,7 @@ def doImageJob(args, imageJob):
255
271
remove (png )
256
272
remove (log )
257
273
258
- getimageResult = getImageVulkanAndroid (args , fragFile )
274
+ getimageResult = getImageVulkanAndroid (args , fragFile , skipRender )
259
275
260
276
# Try to get our own log file in any case
261
277
if os .path .exists ('log.txt' ):
@@ -361,6 +377,11 @@ def get_service(server, args):
361
377
'--spirvopt' ,
362
378
help = 'Enable spirv-opt with these optimisation flags (e.g. --spirvopt=-O)' )
363
379
380
+ parser .add_argument (
381
+ '--oldworker' ,
382
+ action = 'store_true' ,
383
+ help = 'Use old worker' )
384
+
364
385
args = parser .parse_args ()
365
386
366
387
print ('token: ' + args .token )
0 commit comments