… | |
… | |
1006 | const cl_uint c_u [4] = { r, g, b, a }; |
1006 | const cl_uint c_u [4] = { r, g, b, a }; |
1007 | const cl_int c_s [4] = { r, g, b, a }; |
1007 | const cl_int c_s [4] = { r, g, b, a }; |
1008 | const void *c_fus [3] = { &c_f, &c_u, &c_s }; |
1008 | const void *c_fus [3] = { &c_f, &c_u, &c_s }; |
1009 | static const char fus [] = { 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 1, 1, 1, 0, 0 }; |
1009 | static const char fus [] = { 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 1, 1, 1, 0, 0 }; |
1010 | cl_image_format format; |
1010 | cl_image_format format; |
1011 | NEED_SUCCESS (clGetImageInfo, (img, CL_IMAGE_FORMAT, sizeof (format), &format, 0)); |
1011 | NEED_SUCCESS (GetImageInfo, (img, CL_IMAGE_FORMAT, sizeof (format), &format, 0)); |
1012 | assert (sizeof (fus) == CL_FLOAT + 1 - CL_SNORM_INT8); |
1012 | assert (sizeof (fus) == CL_FLOAT + 1 - CL_SNORM_INT8); |
1013 | if (format.image_channel_data_type < CL_SNORM_INT8 || CL_FLOAT < format.image_channel_data_type) |
1013 | if (format.image_channel_data_type < CL_SNORM_INT8 || CL_FLOAT < format.image_channel_data_type) |
1014 | croak ("enqueue_fill_image: image has unsupported channel type, only opencl 1.2 channel types supported."); |
1014 | croak ("enqueue_fill_image: image has unsupported channel type, only opencl 1.2 channel types supported."); |
1015 | |
1015 | |
1016 | NEED_SUCCESS (EnqueueFillImage, (self, img, c_fus [fus [format.image_channel_data_type]], |
1016 | NEED_SUCCESS (EnqueueFillImage, (self, img, c_fus [fus [format.image_channel_data_type]], |
… | |
… | |
1315 | NEED_SUCCESS (EnqueueMarker, (self, GIMME_V != G_VOID ? &ev : 0)); |
1315 | NEED_SUCCESS (EnqueueMarker, (self, GIMME_V != G_VOID ? &ev : 0)); |
1316 | else |
1316 | else |
1317 | #if CL_VERSION_1_2 |
1317 | #if CL_VERSION_1_2 |
1318 | NEED_SUCCESS (EnqueueMarkerWithWaitList, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
1318 | NEED_SUCCESS (EnqueueMarkerWithWaitList, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
1319 | #else |
1319 | #else |
|
|
1320 | { |
1320 | NEED_SUCCESS (EnqueueWaitForEvents, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); // also a barrier |
1321 | NEED_SUCCESS (EnqueueWaitForEvents, (self, event_list_count, event_list_ptr)); // also a barrier |
|
|
1322 | NEED_SUCCESS (EnqueueMarker, (self, GIMME_V != G_VOID ? &ev : 0)); |
|
|
1323 | } |
1321 | #endif |
1324 | #endif |
1322 | #else |
1325 | #else |
1323 | NEED_SUCCESS (EnqueueMarkerWithWaitList, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
1326 | NEED_SUCCESS (EnqueueMarkerWithWaitList, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
1324 | #endif |
1327 | #endif |
1325 | if (ev) |
1328 | if (ev) |
… | |
… | |
1337 | #if CL_VERSION_1_2 |
1340 | #if CL_VERSION_1_2 |
1338 | NEED_SUCCESS (EnqueueBarrierWithWaitList, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
1341 | NEED_SUCCESS (EnqueueBarrierWithWaitList, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
1339 | #else |
1342 | #else |
1340 | { |
1343 | { |
1341 | if (event_list_count) |
1344 | if (event_list_count) |
1342 | NEED_SUCCESS (EnqueueWaitForEvents, (self, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
1345 | NEED_SUCCESS (EnqueueWaitForEvents, (self, event_list_count, event_list_ptr)); |
1343 | |
1346 | |
1344 | if (GIMME_V != G_VOID) |
1347 | if (GIMME_V != G_VOID) |
1345 | NEED_SUCCESS (EnqueueMarker, (self, &ev)); |
1348 | NEED_SUCCESS (EnqueueMarker, (self, &ev)); |
1346 | } |
1349 | } |
1347 | #endif |
1350 | #endif |