27 for (
int slot = 0; slot < num_slots; slot++) {
29#ifdef __ATOMIC_PASS_WRITE__
31 if (id_buffer[slot].x ==
ID_NONE) {
35 if (old_id !=
ID_NONE && old_id !=
id) {
43 else if (id_buffer[slot].x ==
id || slot == num_slots - 1) {
49 if (id_buffer[slot].x ==
ID_NONE) {
50 id_buffer[slot].x = id;
51 id_buffer[slot].y = weight;
56 else if (id_buffer[slot].x ==
id || slot == num_slots - 1) {
57 id_buffer[slot].y += weight;
67 for (
int slot = 1; slot < num_slots; ++slot) {
68 if (id_buffer[slot].x ==
ID_NONE) {
73 while (i > 0 && id_buffer[i].y > id_buffer[i - 1].y) {
75 id_buffer[i] = id_buffer[i - 1];
76 id_buffer[i - 1] =
swap;
87 const int pass_stride =
kernel_data.film.pass_stride;
#define atomic_compare_and_swap_float(p, old_val, new_val)
#define atomic_add_and_fetch_float(p, x)
CCL_NAMESPACE_BEGIN struct CryptoPassBufferElement CryptoPassBufferElement
ccl_device_inline void film_sort_cryptomatte_slots(ccl_global float *buffer, int num_slots)
ccl_device_inline void film_write_cryptomatte_slots(ccl_global float *buffer, int num_slots, float id, float weight)
ccl_device_inline void film_cryptomatte_post(KernelGlobals kg, ccl_global float *render_buffer, int pixel_index)
#define kernel_assert(cond)
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define ccl_device_inline
#define CCL_NAMESPACE_END
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int ccl_global float * render_buffer
unsigned __int64 uint64_t