diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-28 15:36:08 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-28 15:36:08 +0300 |
commit | 4690281b17a9b302bd86484703b2389e371c8f07 (patch) | |
tree | 9b60f7ebe59910102c39d84a7d5a106c5517fd4a /intern/cycles/device/device_cuda.cpp | |
parent | 3fba620858fa5bf44bec3124c61f6cc2e40356b0 (diff) |
Cycles: Add implementation of clip extension mode
For now there's no OpenCL support, it'll come later.
Diffstat (limited to 'intern/cycles/device/device_cuda.cpp')
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 9703b786289..a47d4edeb56 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -513,13 +513,19 @@ public: cuda_assert(cuTexRefSetFlags(texref, CU_TRSF_READ_AS_INTEGER)); } - if(extension == EXTENSION_REPEAT) { - cuda_assert(cuTexRefSetAddressMode(texref, 0, CU_TR_ADDRESS_MODE_WRAP)); - cuda_assert(cuTexRefSetAddressMode(texref, 1, CU_TR_ADDRESS_MODE_WRAP)); - } - else { - cuda_assert(cuTexRefSetAddressMode(texref, 0, CU_TR_ADDRESS_MODE_CLAMP)); - cuda_assert(cuTexRefSetAddressMode(texref, 1, CU_TR_ADDRESS_MODE_CLAMP)); + switch(extension) { + case EXTENSION_REPEAT: + cuda_assert(cuTexRefSetAddressMode(texref, 0, CU_TR_ADDRESS_MODE_WRAP)); + cuda_assert(cuTexRefSetAddressMode(texref, 1, CU_TR_ADDRESS_MODE_WRAP)); + break; + case EXTENSION_EXTEND: + cuda_assert(cuTexRefSetAddressMode(texref, 0, CU_TR_ADDRESS_MODE_CLAMP)); + cuda_assert(cuTexRefSetAddressMode(texref, 1, CU_TR_ADDRESS_MODE_CLAMP)); + break; + case EXTENSION_CLIP: + cuda_assert(cuTexRefSetAddressMode(texref, 0, CU_TR_ADDRESS_MODE_BORDER)); + cuda_assert(cuTexRefSetAddressMode(texref, 1, CU_TR_ADDRESS_MODE_BORDER)); + break; } cuda_assert(cuTexRefSetFormat(texref, format, mem.data_elements)); |