diff --git a/Cargo.lock b/Cargo.lock index 4a353a8..e90b251 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1281,7 +1281,7 @@ dependencies = [ [[package]] name = "gyroflow-core" version = "1.5.3" -source = "git+https://github.com/gyroflow/gyroflow.git?rev=838f1d2#838f1d223d526e86ee7b2e69ce98d137d09b6150" +source = "git+https://github.com/gyroflow/gyroflow.git?rev=3f411b2#3f411b28d60a8cdbf7018147c25fa43194632232" dependencies = [ "ahrs", "akaze", @@ -3129,7 +3129,7 @@ checksum = "5cce2183deb9e7ada727867823fb8bbbc8b56e503801a332d155dde613130e1b" [[package]] name = "stabilize_spirv" version = "0.0.0" -source = "git+https://github.com/gyroflow/gyroflow.git?rev=838f1d2#838f1d223d526e86ee7b2e69ce98d137d09b6150" +source = "git+https://github.com/gyroflow/gyroflow.git?rev=3f411b2#3f411b28d60a8cdbf7018147c25fa43194632232" dependencies = [ "spirv-std", ] diff --git a/Cargo.toml b/Cargo.toml index 9863507..678490b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ ofx = "0.3" log = "0.4" itertools = "0.11" lru = "0.12" -gyroflow-core = { git = "https://github.com/gyroflow/gyroflow.git", default-features = false, rev = "838f1d2", features = ["bundle-lens-profiles"] } +gyroflow-core = { git = "https://github.com/gyroflow/gyroflow.git", default-features = false, rev = "3f411b2", features = ["bundle-lens-profiles"] } #gyroflow-core = { path = "../gyroflow/src/core", default-features = false, features = ["bundle-lens-profiles"] } log-panics = "2.1" rfd = "0.12" diff --git a/src/gyroflow.rs b/src/gyroflow.rs index d6e89b0..b5a4051 100644 --- a/src/gyroflow.rs +++ b/src/gyroflow.rs @@ -112,7 +112,9 @@ struct InstanceData { ever_changed: bool, current_file_info_pending: Arc, - current_file_info: Arc>> + current_file_info: Arc>>, + + opencl_disabled: bool, } impl Drop for InstanceData { fn drop(&mut self) { @@ -467,6 +469,12 @@ impl InstanceData { rfd::MessageDialog::new().set_description("Unable to find Gyroflow app path. Make sure to run Gyroflow app at least once and that version is at least v1.4.3").show(); } } + fn disable_opencl(&mut self) { + if !self.opencl_disabled { + std::env::set_var("NO_OPENCL", "1"); + self.opencl_disabled = true; + } + } } struct PerFrameParams { } @@ -616,6 +624,7 @@ impl Execute for GyroflowPlugin { { None } #[cfg(any(target_os = "macos", target_os = "ios"))] { + instance_data.disable_opencl(); let in_ptr = source_image.get_data()? as *mut metal::MTLBuffer; let out_ptr = output_image.get_data()? as *mut metal::MTLBuffer; let command_queue = in_args.get_metal_command_queue()? as *mut metal::MTLCommandQueue; @@ -642,6 +651,7 @@ impl Execute for GyroflowPlugin { { None } #[cfg(any(target_os = "windows", target_os = "linux"))] { + instance_data.disable_opencl(); let in_ptr = source_image.get_data()? as *mut std::ffi::c_void; let out_ptr = output_image.get_data()? as *mut std::ffi::c_void; @@ -778,7 +788,8 @@ impl Execute for GyroflowPlugin { current_file_info: Arc::new(Mutex::new(None)), current_file_info_pending: Arc::new(AtomicBool::new(false)), reload_values_from_project: false, - ever_changed: false, + ever_changed: false, + opencl_disabled: false, keyframable_params: Arc::new(RwLock::new(KeyframableParams { fov: param_set.parameter("FOV")?, smoothness: param_set.parameter("Smoothness")?,