Cycles: Switched CPU cryptomatte to use unordered_map instead of map. cycles_cryptomatte
authorStefan Werner <stefan.werner@tangent-animation.com>
Wed, 11 Jul 2018 10:20:44 +0000 (12:20 +0200)
committerStefan Werner <stefan.werner@tangent-animation.com>
Wed, 11 Jul 2018 10:20:44 +0000 (12:20 +0200)
intern/cycles/device/device_cpu.cpp
intern/cycles/kernel/kernel_globals.h

index e70c3e0d78cb64e4f4051f898bd7b41056f32922..2f70a49d82344578c36bf8fe5259611a5ceec159 100644 (file)
@@ -674,7 +674,7 @@ public:
                return true;
        }
 
-       void path_trace(DeviceTask &task, RenderTile &tile, KernelGlobals *kg, vector<map<float, float> >& coverage_object, vector<map<float, float> >& coverage_material, vector<map<float, float > >& coverage_asset)
+       void path_trace(DeviceTask &task, RenderTile &tile, KernelGlobals *kg, vector<unordered_map<float, float> >& coverage_object, vector<unordered_map<float, float> >& coverage_material, vector<unordered_map<float, float > >& coverage_asset)
        {
                scoped_timer timer(&tile.buffers->render_time);
                kg->coverage_object = kg->coverage_material = NULL;
@@ -776,9 +776,9 @@ public:
                while(task.acquire_tile(this, tile)) {
                        if(tile.task == RenderTile::PATH_TRACE) {
                                /* cryptomatte data. This needs a better place than here. */
-                               vector<map<float, float> >coverage_object;
-                               vector<map<float, float> >coverage_material;
-                               vector<map<float, float> >coverage_asset;
+                               vector<unordered_map<float, float> >coverage_object;
+                               vector<unordered_map<float, float> >coverage_material;
+                               vector<unordered_map<float, float> >coverage_asset;
 
                                if(use_split_kernel) {
                                        device_only_memory<uchar> void_buffer(this, "void_buffer");
index 5276ea4b08bfb59612b6268c2629983838e5df48..b2dedbba37d1b82e19a28131fbc723ea6256c710 100644 (file)
@@ -71,9 +71,9 @@ typedef struct KernelGlobals {
        int decoupled_volume_steps_index;
 
        /* A buffer for storing per-pixel coverage for Cryptomatte. */
-       map<float, float> *coverage_object;
-       map<float, float> *coverage_material;
-       map<float, float> *coverage_asset;
+       unordered_map<float, float> *coverage_object;
+       unordered_map<float, float> *coverage_material;
+       unordered_map<float, float> *coverage_asset;
 
        /* split kernel */
        SplitData split_data;