From 6289d92e02398efbebcd8937b03f8a8750b5852b Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 28 May 2023 00:23:47 +0200 Subject: [PATCH] Increase WGPU limits to what's supported by the adapter (#1251) * Increase Wgpu limits * Fix compilation of shaders * Unbreak debug options --- node-graph/gcore/src/raster.rs | 3 +++ node-graph/gcore/src/raster/bbox.rs | 6 ++++-- node-graph/gcore/src/raster/discrete_srgb.rs | 2 +- node-graph/gstd/src/executor.rs | 2 +- node-graph/wgpu-executor/src/context.rs | 6 +++++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/node-graph/gcore/src/raster.rs b/node-graph/gcore/src/raster.rs index 69837775..6d72bd88 100644 --- a/node-graph/gcore/src/raster.rs +++ b/node-graph/gcore/src/raster.rs @@ -15,6 +15,9 @@ pub mod color; pub mod discrete_srgb; pub use adjustments::*; +#[cfg(target_arch = "spirv")] +use num_traits::Float; + pub trait Linear { fn from_f32(x: f32) -> Self; fn to_f32(self) -> f32; diff --git a/node-graph/gcore/src/raster/bbox.rs b/node-graph/gcore/src/raster/bbox.rs index 182cb7f2..4a454853 100644 --- a/node-graph/gcore/src/raster/bbox.rs +++ b/node-graph/gcore/src/raster/bbox.rs @@ -1,7 +1,8 @@ use dyn_any::{DynAny, StaticType}; use glam::{DAffine2, DVec2}; -#[derive(Debug, Clone, DynAny)] +#[cfg_attr(not(target_arch = "spirv"), derive(Debug))] +#[derive(Clone, DynAny)] pub struct AxisAlignedBbox { pub start: DVec2, pub end: DVec2, @@ -45,7 +46,8 @@ impl AxisAlignedBbox { } } -#[derive(Debug, Clone)] +#[cfg_attr(not(target_arch = "spirv"), derive(Debug))] +#[derive(Clone)] pub struct Bbox { pub top_left: DVec2, pub top_right: DVec2, diff --git a/node-graph/gcore/src/raster/discrete_srgb.rs b/node-graph/gcore/src/raster/discrete_srgb.rs index a50cae86..e0749b03 100644 --- a/node-graph/gcore/src/raster/discrete_srgb.rs +++ b/node-graph/gcore/src/raster/discrete_srgb.rs @@ -68,7 +68,7 @@ pub fn float_to_srgb_u8(mut f: f32) -> u8 { // We clamped f to [0, 1], and the integer representations // of the positive finite non-NaN floats are monotonic. // This makes the later LUT lookup panicless. - unsafe { std::hint::unreachable_unchecked() } + unsafe { core::hint::unreachable_unchecked() } } // Compute a piecewise linear interpolation that is always diff --git a/node-graph/gstd/src/executor.rs b/node-graph/gstd/src/executor.rs index 6f9235d5..4744dacc 100644 --- a/node-graph/gstd/src/executor.rs +++ b/node-graph/gstd/src/executor.rs @@ -164,7 +164,7 @@ async fn map_gpu(image: ImageFrame, node: DocumentNode) -> ImageFrame