Merge branch 'blender2.7'
[blender.git] / intern / cycles / device / device.h
index 08b0e7435fe7b40415f08b85b5455784711a7b17..4db8d10a4aafc0dcbf6b58f3607cdb447efaaa88 100644 (file)
@@ -56,6 +56,14 @@ enum DeviceTypeMask {
        DEVICE_MASK_ALL = ~0
 };
 
+enum DeviceKernelStatus {
+       DEVICE_KERNEL_WAITING_FOR_FEATURE_KERNEL = 0,
+       DEVICE_KERNEL_FEATURE_KERNEL_AVAILABLE,
+       DEVICE_KERNEL_USING_FEATURE_KERNEL,
+       DEVICE_KERNEL_FEATURE_KERNEL_INVALID,
+       DEVICE_KERNEL_UNKNOWN,
+};
+
 #define DEVICE_MASK(type) (DeviceTypeMask)(1 << type)
 
 class DeviceInfo {
@@ -334,6 +342,20 @@ public:
                const DeviceRequestedFeatures& /*requested_features*/)
        { return true; }
 
+       /* Wait for device to become available to upload data and receive tasks
+        * This method is used by the OpenCL device to load the
+        * optimized kernels or when not (yet) available load the
+        * generic kernels (only during foreground rendering) */
+       virtual bool wait_for_availability(
+               const DeviceRequestedFeatures& /*requested_features*/)
+       { return true; }
+       /* Check if there are 'better' kernels available to be used
+        * We can switch over to these kernels
+        * This method is used to determine if we can switch the preview kernels
+        * to regular kernels */
+       virtual DeviceKernelStatus get_active_kernel_switch_state()
+       { return DEVICE_KERNEL_USING_FEATURE_KERNEL; }
+
        /* tasks */
        virtual int get_split_task_count(DeviceTask& task) = 0;
        virtual void task_add(DeviceTask& task) = 0;