diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-28 14:51:10 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-28 15:14:24 +0300 |
commit | 3fba620858fa5bf44bec3124c61f6cc2e40356b0 (patch) | |
tree | 41aaddb8ad9fdd6b964a62b85129a703d626d5f8 /intern/cycles/device | |
parent | 29ebb56f4d8b99ca3038c7a3d0ed794ef77ee7f9 (diff) |
Cycles: Prepare for more image extension types support
Basically just replace boolean periodic flag with extension type enum in the
device API.
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/device.h | 4 | ||||
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 7 | ||||
-rw-r--r-- | intern/cycles/device/device_multi.cpp | 8 | ||||
-rw-r--r-- | intern/cycles/device/device_network.cpp | 13 | ||||
-rw-r--r-- | intern/cycles/device/device_opencl.cpp | 2 |
6 files changed, 24 insertions, 14 deletions
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index ea1e20d1500..3c0fb880948 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -173,10 +173,10 @@ public: virtual void tex_alloc(const char * /*name*/, device_memory& /*mem*/, InterpolationType interpolation = INTERPOLATION_NONE, - bool periodic = false) + ExtensionType extension = EXTENSION_REPEAT) { (void)interpolation; /* Ignored. */ - (void)periodic; /* Ignored. */ + (void)extension; /* Ignored. */ }; virtual void tex_free(device_memory& /*mem*/) {}; diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index ec82b3805c4..f06963c146e 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -126,7 +126,7 @@ public: void tex_alloc(const char *name, device_memory& mem, InterpolationType interpolation, - bool periodic) + ExtensionType extension) { VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes."; kernel_tex_copy(&kernel_globals, @@ -136,7 +136,7 @@ public: mem.data_height, mem.data_depth, interpolation, - periodic); + extension); mem.device_pointer = mem.data_pointer; mem.device_size = mem.memory_size(); stats.mem_alloc(mem.device_size); diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 4a9c27f5429..9703b786289 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -416,7 +416,10 @@ public: cuda_pop_context(); } - void tex_alloc(const char *name, device_memory& mem, InterpolationType interpolation, bool periodic) + void tex_alloc(const char *name, + device_memory& mem, + InterpolationType interpolation, + ExtensionType extension) { /* todo: support 3D textures, only CPU for now */ VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes."; @@ -510,7 +513,7 @@ public: cuda_assert(cuTexRefSetFlags(texref, CU_TRSF_READ_AS_INTEGER)); } - if(periodic) { + if(extension == EXTENSION_REPEAT) { cuda_assert(cuTexRefSetAddressMode(texref, 0, CU_TR_ADDRESS_MODE_WRAP)); cuda_assert(cuTexRefSetAddressMode(texref, 1, CU_TR_ADDRESS_MODE_WRAP)); } diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp index c61e550151f..8fb841b2b0d 100644 --- a/intern/cycles/device/device_multi.cpp +++ b/intern/cycles/device/device_multi.cpp @@ -169,13 +169,17 @@ public: sub.device->const_copy_to(name, host, size); } - void tex_alloc(const char *name, device_memory& mem, InterpolationType interpolation, bool periodic) + void tex_alloc(const char *name, + device_memory& mem, + InterpolationType + interpolation, + ExtensionType extension) { VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes."; foreach(SubDevice& sub, devices) { mem.device_pointer = 0; - sub.device->tex_alloc(name, mem, interpolation, periodic); + sub.device->tex_alloc(name, mem, interpolation, extension); sub.ptr_map[unique_ptr] = mem.device_pointer; } diff --git a/intern/cycles/device/device_network.cpp b/intern/cycles/device/device_network.cpp index 1d6066c94dc..d1f941ad9f2 100644 --- a/intern/cycles/device/device_network.cpp +++ b/intern/cycles/device/device_network.cpp @@ -163,7 +163,10 @@ public: snd.write_buffer(host, size); } - void tex_alloc(const char *name, device_memory& mem, InterpolationType interpolation, bool periodic) + void tex_alloc(const char *name, + device_memory& mem, + InterpolationType interpolation, + ExtensionType extension) { VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes."; @@ -178,7 +181,7 @@ public: snd.add(name_string); snd.add(mem); snd.add(interpolation); - snd.add(periodic); + snd.add(extension); snd.write(); snd.write_buffer((void*)mem.data_pointer, mem.memory_size()); } @@ -571,13 +574,13 @@ protected: network_device_memory mem; string name; InterpolationType interpolation; - bool periodic; + ExtensionType extension_typr; device_ptr client_pointer; rcv.read(name); rcv.read(mem); rcv.read(interpolation); - rcv.read(periodic); + rcv.read(extension); lock.unlock(); client_pointer = mem.device_pointer; @@ -593,7 +596,7 @@ protected: rcv.read_buffer((uint8_t*)mem.data_pointer, data_size); - device->tex_alloc(name.c_str(), mem, interpolation, periodic); + device->tex_alloc(name.c_str(), mem, interpolation, extension); pointer_mapping_insert(client_pointer, mem.device_pointer); } diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 0cc49e846cc..fee9a8a803d 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -1179,7 +1179,7 @@ public: void tex_alloc(const char *name, device_memory& mem, InterpolationType /*interpolation*/, - bool /*periodic*/) + ExtensionType /*extension*/) { VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes."; mem_alloc(mem, MEM_READ_ONLY); |