Repository navigation
v0.5.1
Pre-release
Pre-release
The most significant change in this version is unlocking all-GPU rendering: we can start with a shape on the CPU, then perform a full rendering pipeline (including shading and post-processing) entirely on the GPU. The APIs were codesigned along with Halfspace, with a goal of moving its heavy work to the GPU for native-equivalent performance on the web.
As such, this release includes many changes to fidget::wgpu, which I break out into a separate section below. It also includes a bunch of other changes!
- In
fidget::raster, reorganizeRenderConfigto separate out the render settings (transform, size, etc) from evaluation settings (thread count, cancellation, etc); the latter are now in a newEvalConfig. - Add
ztofidget::raster::pixel::RenderConfigto set the Z evaluation level - Move
PartialEqimplementation fromTreetoTreeOp; switch toOrderedFloatsemantics so that pointer comparisons are valid. Previously, theEqimplementation onTreewas invalid (due to non-reflexiveNaNcomparisons), but it's now fixed. - Add a
Hashimplementation toTreeandTreeOp, again usingOrderedFloatsemantics. This allows trees to be stored in hashmaps; thanks to @virtualritz for the suggestion! - Move more VM functions onto
GradandInterval(out of the VM implementation); add aFloatExttrait which adds them tof32as well. - Fix a JIT bug in the gradient evaluator on Windows, where we assumed that input
&[Grad]slices were aligned to 16 bytes. This caused a Access Violation error code when running the JITted function (0xC0000005). - Add fast path for interval trigonometry functions when
lower == upper - Add new
randandmixopcodes, which can be used for deterministic pseudo-random number generation. There are also examples of single-octave and multi-octave Perlin noise in the repository showing how these can be used. - Switch to using
f32everywhere. Fidget's evaluators always usedf32internally, but other components (e.g. constants in aContext) weref64. Usingf32everywhere makes this more consistent, and lets us remove a bunch of annoying workarounds (e.g epsilons scattered throughout the evaluator test suite).- As a side effect, the evaluator test suite now confirms that evaluators agree exactly with the canonical operator definition. This required removing the JIT implementation for
modulo, which was not exactly in agreement with the non-JIT implementation.
- As a side effect, the evaluator test suite now confirms that evaluators agree exactly with the canonical operator definition. This required removing the JIT implementation for
fidget::wgpu changes
This section may not be all-inclusive; sorry! I did warn you that fidget::wgpu was "even more experimental than the rest of Fidget"!.
fidget::wgpunow uses theRenderConfigtype fromfidget::rasterinstead of its own, slightly-differentRenderConfig. This was, in fact, the motivation for the reorganization!- Render size in
fidget::wgpu::voxelis now set by theRenderConfig, instead of by theBuffersobject. This means that buffers are generated without a size, and resized when passed to render functions. Functions which do resizing have a new possible error variant if the render size is too large for WGPU buffers. - Removed size from many buffer construction functions in
fidget::wgpu::voxel, since they're resized when used in evaluation. - Add
fidget::wgpu::buf::DepthImageBuffer, which is a flexible image buffer taking aVoxelSize(so that it preserves depth).
- Render size in
- Add
fidget::wgpu::pixelmodule for 2D rasterization on the GPU. This is sometimes slower than the CPU evaluator for very complex expressions, but is blazingly fast for simpler expressions. Plus, it allows for an all-GPU evaluation architecture when embedding Fidget into other applications.- The
fidget::wgpu::pixel::effectsmodule is also new; it includes merging and color evaluation for 2D images.
- The
- Move
fidget_wgpu::effectstofidget_wgpu::voxel::effects - Add evaluation of per-pixel colors to
fidget_wgpu::voxel::effects; seefidget_wgpu::voxel::effects::Context::submit_coloras the main entry point.- Move
ShapeColorBuffersconstruction to top-levelGpuobject
- Move
VarMapnow implementsDebugVarMap::has_free_varschecks whether there are non-XYZ vars in the mapRawDistancePixelnow implementszerocopy::IntoBytes- Restored
RawDistancePixel::distanceto get a distance value; it's now a simpleOption<f32>(not the previous weirdResult<f32, PixelFill>). submit*functions in WebGPU voxel rendering no longer take an optionaloutparameter; callers should instead useGpu::copyandGpu::map(along withGpu::read_buffer_forto generate the host-readable buffer)- More reorganization of
fidget::wgpubuffer APIs - Remove timestamps from
fidget::wgpupixel and voxel rendering; they will come back in a new form at some point in the future - Make
RenderShapenot store GPU objects, so it can be constructed independently throughRenderShape::new(and shared between threads). - Similarly, make
ShapeColorBuffersnot store GPU objects, so it can be constructed independently throughShapeColorBuffers::new(and shared between threads). - Rename the workspace buffer objects from
BufferstoWorkspace(e.g.fidget::wgpu::voxel::Buffers) to more clearly reflect their usage. - Bump to
wgpu 30.0.1