Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions document/migrations/nodes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
mod graphene_core;
mod math_nodes;
mod raster_nodes;

/// The scope input of nodes that came to take the GPU pipeline, the identifier frozen as it was when they did.
fn raster_kernel_pipeline() -> migration_core::NodeInput {
migration_core::NodeInput::Scope("raster_nodes::raster_kernel::RasterKernelPipelineNode".into())
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/black_and_white_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::adjustments::BlackAndWhiteNode"@1 => @2)]
pub fn black_and_white_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(9, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&BlackAndWhiteV1, &contract());
check_undo(&BlackAndWhiteV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/blur_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::filter::BlurNode"@1 => @2)]
pub fn blur_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(4, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&BlurV1, &contract());
check_undo(&BlurV1, &contract());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::adjustments::BrightnessContrastNode"@1 => @2)]
pub fn brightness_contrast_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(5, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&BrightnessContrastV1, &contract());
check_undo(&BrightnessContrastV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/channel_mixer_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::adjustments::ChannelMixerNode"@1 => @2)]
pub fn channel_mixer_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(19, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&ChannelMixerV1, &contract());
check_undo(&ChannelMixerV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/channels_to_image_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::std_nodes::ChannelsToImageNode"@1 => @2)]
pub fn channels_to_image_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(5, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&ChannelsToImageV1, &contract());
check_undo(&ChannelsToImageV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/color_balance_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::adjustments::ColorBalanceNode"@1 => @2)]
pub fn color_balance_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(12, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&ColorBalanceV1, &contract());
check_undo(&ColorBalanceV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/color_lookup_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::adjustments::ColorLookupNode"@1 => @2)]
pub fn color_lookup_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(2, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&ColorLookupV1, &contract());
check_undo(&ColorLookupV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/color_overlay_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::blending_nodes::ColorOverlayNode"@1 => @2)]
pub fn color_overlay_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(4, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&ColorOverlayV1, &contract());
check_undo(&ColorOverlayV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/curves_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::adjustments::CurvesNode"@1 => @2)]
pub fn curves_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(7, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&CurvesV1, &contract());
check_undo(&CurvesV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/dehaze_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::dehaze::DehazeNode"@1 => @2)]
pub fn dehaze_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(2, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&DehazeV1, &contract());
check_undo(&DehazeV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/desaturate_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::adjustments::DesaturateNode"@1 => @2)]
pub fn desaturate_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(2, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&DesaturateV1, &contract());
check_undo(&DesaturateV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/exposure_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::adjustments::ExposureNode"@1 => @2)]
pub fn exposure_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(4, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&ExposureV1, &contract());
check_undo(&ExposureV1, &contract());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::std_nodes::ExtendImageToBoundsNode"@1 => @2)]
pub fn extend_image_to_bounds_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(2, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&ExtendImageToBoundsV1, &contract());
check_undo(&ExtendImageToBoundsV1, &contract());
}
}
25 changes: 25 additions & 0 deletions document/migrations/nodes/src/raster_nodes/gamma_correction_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::raster_kernel_pipeline;
use migration_core::{Inputs, migration};

/// It now also takes GPU rasters, and the GPU pipeline they run on in a new scope input.
#[migration("raster_nodes::adjustments::GammaCorrectionNode"@1 => @2)]
pub fn gamma_correction_v1(inputs: &mut Inputs) {
inputs.push(raster_kernel_pipeline());
}

#[cfg(test)]
mod tests {
use super::*;
use migration_core::literal;
use migration_runner::testing::{SourceContract, check_commutation, check_undo};

fn contract() -> SourceContract {
SourceContract::new(3, |random, _slot| literal(random.below(10) as f64))
}

#[test]
fn rewrites_history() {
check_commutation(&GammaCorrectionV1, &contract());
check_undo(&GammaCorrectionV1, &contract());
}
}
Loading
Loading