Merged
Conversation
- Change `wait_for` to return `Result<bool, DeviceError>` (#285) Distinguishes timeout (Ok(false)) from device lost (Err) across all three backends (Vulkan, Metal, GLES). - Add `memory_stats()` API with VK_EXT_memory_budget support (#61) Reports device-local VRAM budget and usage on Vulkan, uses MTLDevice properties on Metal, returns defaults on GLES. - Set VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT on depth+stencil textures (#283) Allows creating texture views with different compatible formats (e.g. Depth32Float view of Depth32FloatStencil8Uint texture). - Handle surface acquire errors gracefully (#290) Replace panic on unexpected vkAcquireNextImageKHR errors with log + empty frame, matching the existing OUT_OF_DATE handling. - Add debug bounds check to BufferPiece::data() (#260) debug_assert that offset doesn't exceed buffer size. - Add Buffer::size() accessor to all backends GLES already had the field; added to Vulkan and Metal. - Implement Display + Error for NotSupportedError and DeviceError https://claude.ai/code/session_01W9jSvpnbXEXmoHFuUVFdUN
- Unify PlatformError into a single opaque struct across all backends, replacing per-backend enum/type-alias definitions. This makes error handling consistent regardless of compilation target. - Add ComputePipelineBase trait with get_workgroup_size(), exposed via hidden_trait on all backends so generic code can query workgroup size. - Add changelog entries for all 0.8 API changes. https://claude.ai/code/session_01W9jSvpnbXEXmoHFuUVFdUN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blade 0.8 API improvements
Summary
PlatformErrorinto a single opaque type shared across all backends (Vulkan, Metal, GLES)ComputePipelineBasetrait withget_workgroup_size()for backend-agnostic compute pipeline usageBuffer::size(),memory_stats())Changes
Unified
PlatformError— Replaces per-backend error types (enumon Vulkan/EGL,type = ()on Metal/Web) with a single opaquePlatformError(String)inlib.rs. Providesloading()andinit()constructors that accept anyDebugtype, and implementsDisplay+Error.ComputePipelineBasetrait — Addsget_workgroup_size() -> [u32; 3]to a trait bound onShaderDevice::ComputePipeline, making it available in generic code. Uses#[hidden_trait::expose]so concrete backend types retain inherent method access.API improvements for release —
Buffer::size(),Context::memory_stats(),Errortrait impls onNotSupportedError/PlatformError, and ergonomic updates across examples and downstream crates (blade-egui,blade-render,blade-util).Test plan
cargo testacross workspace