Skip to content

Commit

Permalink
Fix incorrect wgpu mixing
Browse files Browse the repository at this point in the history
  • Loading branch information
DJMcNab committed Jul 3, 2024
1 parent 34a23e4 commit 2f062f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions vello/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ mod shaders;
mod wgpu_engine;

#[cfg(feature = "wgpu")]
use std::num::NonZeroUsize;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
use std::{
num::NonZeroUsize,
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
};

/// Styling and composition primitives.
Expand Down Expand Up @@ -124,16 +126,15 @@ pub use shaders::FullShaders;

#[cfg(feature = "wgpu")]
use vello_encoding::Resolver;
use wgpu::SubmissionIndex;
#[cfg(feature = "wgpu")]
use wgpu_engine::{ExternalResource, WgpuEngine};

/// Temporary export, used in `with_winit` for stats
pub use vello_encoding::BumpAllocators;
#[cfg(feature = "wgpu")]
use wgpu::{
Buffer, BufferUsages, Device, PipelineCompilationOptions, Queue, SurfaceTexture, TextureFormat,
TextureView,
Buffer, BufferUsages, Device, PipelineCompilationOptions, Queue, SubmissionIndex,
SurfaceTexture, TextureFormat, TextureView,
};
#[cfg(all(feature = "wgpu", feature = "wgpu-profiler"))]
use wgpu_profiler::{GpuProfiler, GpuProfilerSettings};
Expand Down Expand Up @@ -239,6 +240,7 @@ pub enum Error {
#[allow(dead_code)] // this can be unused when wgpu feature is not used
pub(crate) type Result<T, E = Error> = std::result::Result<T, E>;

#[cfg(feature = "wgpu")]
type BumpSubmission = (SubmissionIndex, Buffer, Arc<AtomicBool>);

/// Renders a scene into a texture or surface.
Expand Down
2 changes: 1 addition & 1 deletion vello_encoding/src/estimate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! This utility provides conservative size estimation for buffer allocations backing
//! GPU bump memory. This estimate relies on heuristics and naturally overestimates.
use super::{BumpAllocatorMemory, BumpAllocators, Transform};
use super::{BumpAllocators, Transform};
use peniko::kurbo::{Cap, Join, PathEl, Point, Stroke, Vec2};

const RSQRT_OF_TOL: f64 = 2.2360679775; // tol = 0.2
Expand Down

0 comments on commit 2f062f2

Please sign in to comment.