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