Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-13 16:32:44 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-13 16:32:44 +0400
commitdd9c1b7fbf501ef58c9952150698fb5ce3c45903 (patch)
treef52d353e3dc36a33a3a8b6609fa8a2ffe39b2d4c /intern/cycles/device
parentf9642926303ec89679e61076ca9e4b9f0be3afe9 (diff)
Cycles: OpenCL image texture support, fix an attribute node issue and refactor
feature enabling #defines a bit.
Diffstat (limited to 'intern/cycles/device')
-rw-r--r--intern/cycles/device/device.h2
-rw-r--r--intern/cycles/device/device_cpu.cpp1
-rw-r--r--intern/cycles/device/device_cuda.cpp1
-rw-r--r--intern/cycles/device/device_multi.cpp2
-rw-r--r--intern/cycles/device/device_opencl.cpp9
5 files changed, 11 insertions, 4 deletions
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h
index 87f255e54e7..b17abac2a1b 100644
--- a/intern/cycles/device/device.h
+++ b/intern/cycles/device/device.h
@@ -53,6 +53,7 @@ public:
int num;
bool display_device;
bool advanced_shading;
+ bool pack_images;
vector<DeviceInfo> multi_devices;
DeviceInfo()
@@ -62,6 +63,7 @@ public:
num = 0;
display_device = false;
advanced_shading = true;
+ pack_images = false;
}
};
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index 07988d32aff..5f422332cd2 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -260,6 +260,7 @@ void device_cpu_info(vector<DeviceInfo>& devices)
info.id = "CPU";
info.num = 0;
info.advanced_shading = true;
+ info.pack_images = false;
devices.insert(devices.begin(), info);
}
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 0a780e5f576..937dbf2d87c 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -877,6 +877,7 @@ void device_cuda_info(vector<DeviceInfo>& devices)
int major, minor;
cuDeviceComputeCapability(&major, &minor, num);
info.advanced_shading = (major >= 2);
+ info.pack_images = false;
/* if device has a kernel timeout, assume it is used for display */
if(cuDeviceGetAttribute(&attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num) == CUDA_SUCCESS && attr == 1) {
diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp
index 9f7d65e640b..83e69b98f5d 100644
--- a/intern/cycles/device/device_multi.cpp
+++ b/intern/cycles/device/device_multi.cpp
@@ -304,6 +304,7 @@ static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool
int num_added = 0, num_display = 0;
info.advanced_shading = with_advanced_shading;
+ info.pack_images = false;
foreach(DeviceInfo& subinfo, devices) {
if(subinfo.type == type) {
@@ -326,6 +327,7 @@ static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool
info.multi_devices.push_back(subinfo);
if(subinfo.display_device)
info.display_device = true;
+ info.pack_images = info.pack_images || subinfo.pack_images;
num_added++;
}
}
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index 322b7ad3eb9..09235506048 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -212,7 +212,7 @@ public:
{
char version[256];
- int major, minor, req_major = 1, req_minor = 1;
+ int major, minor, req_major = 1, req_minor = 0;
clGetPlatformInfo(cpPlatform, CL_PLATFORM_VERSION, sizeof(version), &version, NULL);
@@ -300,15 +300,15 @@ public:
/* Multi Closure for nVidia cards */
if(platform_name == "NVIDIA CUDA")
- build_options += "-D__KERNEL_SHADING__ -D__MULTI_CLOSURE__ -cl-nv-maxrregcount=24 -cl-nv-verbose ";
+ build_options += "-D__KERNEL_SHADING__ -D__KERNEL_OPENCL_NVIDIA__ -cl-nv-maxrregcount=24 -cl-nv-verbose ";
/* No Float3 for Apple */
else if(platform_name == "Apple")
- build_options += "-D__CL_NO_FLOAT3__ ";
+ build_options += "-D__CL_NO_FLOAT3__ -D__KERNEL_OPENCL_APPLE__ ";
/* Basic shading for AMD cards (non Apple) */
else if(platform_name == "AMD Accelerated Parallel Processing")
- build_options += "-D__KERNEL_SHADING__ -D__CL_NO_FLOAT3__ ";
+ build_options += "-D__CL_NO_FLOAT3__ -D__KERNEL_OPENCL_AMD__ ";
return build_options;
}
@@ -743,6 +743,7 @@ void device_opencl_info(vector<DeviceInfo>& devices)
/* we don't know if it's used for display, but assume it is */
info.display_device = true;
info.advanced_shading = false;
+ info.pack_images = true;
devices.push_back(info);
}