@@ -172,7 +172,8 @@ int main(int argc, const char *argv[])
172
172
}
173
173
174
174
// At least one device supports CL-GL interop, so init the test.
175
- if ( glEnv->Init ( &argc, (char **)argv, CL_FALSE ) ) {
175
+ if (glEnv->Init (&argc, (char **)argv, CL_FALSE))
176
+ {
176
177
log_error (" Failed to initialize the GL environment for this test.\n " );
177
178
error = -1 ;
178
179
goto cleanup;
@@ -282,38 +283,45 @@ int main(int argc, const char *argv[])
282
283
}
283
284
284
285
// OpenGL 3.2 tests. ////////////////////////////////////////////////////////
285
- if ((argc==1 ) || first_32_testname) {
286
- // Create a context to use and then grab a device (or devices) from it
287
- sCurrentContext = glEnv->CreateCLContext ();
288
- if ( sCurrentContext == NULL ) {
289
- log_error ( " ERROR: Unable to obtain CL context from GL\n " );
290
- error = -1 ;
291
- goto cleanup;
292
- }
286
+ if ((argc == 1 ) || first_32_testname)
287
+ {
288
+ // Create a context to use and then grab a device (or devices) from it
289
+ sCurrentContext = glEnv->CreateCLContext ();
290
+ if (sCurrentContext == NULL )
291
+ {
292
+ log_error (" ERROR: Unable to obtain CL context from GL\n " );
293
+ error = -1 ;
294
+ goto cleanup;
295
+ }
293
296
294
- size_t numDevices = 0 ;
295
- cl_device_id deviceIDs[ 16 ];
297
+ size_t numDevices = 0 ;
298
+ cl_device_id deviceIDs[16 ];
296
299
297
- error = clGetContextInfo ( sCurrentContext , CL_CONTEXT_DEVICES, 0 , NULL , &numDevices);
298
- if ( error != CL_SUCCESS ) {
299
- print_error ( error, " Unable to get device count from context" );
300
- error = -1 ;
301
- goto cleanup;
302
- }
303
- numDevices /= sizeof (cl_device_id );
300
+ error = clGetContextInfo (sCurrentContext , CL_CONTEXT_DEVICES, 0 , NULL ,
301
+ &numDevices);
302
+ if (error != CL_SUCCESS)
303
+ {
304
+ print_error (error, " Unable to get device count from context" );
305
+ error = -1 ;
306
+ goto cleanup;
307
+ }
308
+ numDevices /= sizeof (cl_device_id );
304
309
305
- if (numDevices < 1 ) {
306
- log_error (" No devices found.\n " );
307
- error = -1 ;
308
- goto cleanup;
309
- }
310
+ if (numDevices < 1 )
311
+ {
312
+ log_error (" No devices found.\n " );
313
+ error = -1 ;
314
+ goto cleanup;
315
+ }
310
316
311
- error = clGetContextInfo ( sCurrentContext , CL_CONTEXT_DEVICES, sizeof ( deviceIDs ), deviceIDs, NULL );
312
- if ( error != CL_SUCCESS ) {
313
- print_error ( error, " Unable to get device list from context" );
314
- error = -1 ;
315
- goto cleanup;
316
- }
317
+ error = clGetContextInfo (sCurrentContext , CL_CONTEXT_DEVICES,
318
+ sizeof (deviceIDs), deviceIDs, NULL );
319
+ if (error != CL_SUCCESS)
320
+ {
321
+ print_error (error, " Unable to get device list from context" );
322
+ error = -1 ;
323
+ goto cleanup;
324
+ }
317
325
318
326
#ifdef GLES3
319
327
int argc_ = (first_32_testname) ? 1 + (argc - first_32_testname) : argc;
0 commit comments