From 365f37a3ae10e7aff407b84050f77da10820866e Mon Sep 17 00:00:00 2001 From: bungoboingo Date: Thu, 10 Nov 2022 14:43:38 -0800 Subject: Added conditional configurations for WASM target for gradients & storage buffers, since storage buffers are not supported on wgpu WASM target at the moment. --- graphics/src/triangle.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'graphics/src/triangle.rs') diff --git a/graphics/src/triangle.rs b/graphics/src/triangle.rs index 04ff6d21..8b41bfc4 100644 --- a/graphics/src/triangle.rs +++ b/graphics/src/triangle.rs @@ -1,5 +1,7 @@ //! Draw geometry using meshes of triangles. -use crate::{Color, Gradient}; +use crate::Color; +#[cfg(not(target_arch = "wasm32"))] +use crate::Gradient; use bytemuck::{Pod, Zeroable}; @@ -27,6 +29,7 @@ pub struct Vertex2D { pub enum Style { /// Fill a primitive with a solid color. Solid(Color), + #[cfg(not(target_arch = "wasm32"))] /// Fill a primitive with an interpolated color. Gradient(Gradient), } @@ -37,6 +40,7 @@ impl From for Style { } } +#[cfg(not(target_arch = "wasm32"))] impl From for Style { fn from(gradient: Gradient) -> Self { Self::Gradient(gradient) -- cgit