Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ base64 = "0.21"
bitflags = "2"
bytemuck = { version = "1", features = ["derive"] }
choir = "0.7"
egui = "0.29"
glam = { version = "0.28", features = ["mint"] }
egui = "0.32"
glam = { version = "0.30", features = ["mint"] }
gltf = { version = "1.1", default-features = false }
log = "0.4"
mint = "0.5"
naga = { version = "25.0", features = ["wgsl-in"] }
profiling = "1"
slab = "0.4"
strum = { version = "0.26", features = ["derive"] }
strum = { version = "0.27", features = ["derive"] }
web-sys = "0.3.60"
winit = { version = "0.30" }

Expand All @@ -46,7 +46,7 @@ readme = "docs/README.md"
[dependencies]
blade-asset = { version = "0.2", path = "blade-asset" }
blade-egui = { version = "0.6", path = "blade-egui" }
blade-graphics = { version = "0.6", path = "blade-graphics" }
blade-graphics = { version = "0.7", path = "blade-graphics" }
blade-helpers = { version = "0.1", path = "blade-helpers" }
blade-util = { version = "0.2", path = "blade-util" }
base64 = { workspace = true }
Expand All @@ -72,10 +72,10 @@ blade-macros = { version = "0.3", path = "blade-macros" }
bytemuck = { workspace = true }
choir = { workspace = true }
egui = { workspace = true }
egui-winit = { version = "0.29", default-features = false, features = [
egui-winit = { version = "0.32", default-features = false, features = [
"links",
] }
transform-gizmo-egui = "0.4"
transform-gizmo-egui = "0.7"
env_logger = "0.11"
glam = { workspace = true }
log = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion blade-egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/kvark/blade"
[lib]

[dependencies]
blade-graphics = { version = "0.6", path = "../blade-graphics" }
blade-graphics = { version = "0.7", path = "../blade-graphics" }
blade-macros = { version = "0.3", path = "../blade-macros" }
blade-util = { version = "0.2", path = "../blade-util" }
egui = { workspace = true, features = ["bytemuck"] }
Expand Down
21 changes: 1 addition & 20 deletions blade-egui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
const SHADER_SOURCE: &'static str = include_str!("../shader.wgsl");

use blade_util::{BufferBelt, BufferBeltDescriptor};
use std::{
collections::hash_map::{Entry, HashMap},
mem::size_of,
ptr,
};
use std::collections::hash_map::{Entry, HashMap};

#[repr(C)]
#[derive(Clone, Copy, bytemuck::Zeroable, bytemuck::Pod)]
Expand Down Expand Up @@ -250,21 +246,6 @@ impl GuiPainter {
for &(texture_id, ref image_delta) in textures_delta.set.iter() {
let src = match image_delta.image {
egui::ImageData::Color(ref c) => self.belt.alloc_pod(c.pixels.as_slice(), context),
egui::ImageData::Font(ref a) => {
let color_iter = a.srgba_pixels(None);
let stage = self.belt.alloc(
(color_iter.len() * size_of::<egui::Color32>()) as u64,
context,
);
let mut ptr = stage.data() as *mut egui::Color32;
for color in color_iter {
unsafe {
ptr::write(ptr, color);
ptr = ptr.offset(1);
}
}
stage
}
};

let image_size = image_delta.image.size();
Expand Down
6 changes: 3 additions & 3 deletions blade-graphics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blade-graphics"
version = "0.6.0"
version = "0.7.0"
edition = "2021"
description = "Graphics abstraction for Blade"
keywords = ["graphics"]
Expand All @@ -12,7 +12,7 @@ repository = "https://github.com/kvark/blade"
[dependencies]
bitflags = { workspace = true }
bytemuck = { workspace = true }
codespan-reporting = "0.11"
codespan-reporting = "0.12"
hidden-trait = "0.1"
log = { workspace = true }
mint = { workspace = true }
Expand Down Expand Up @@ -104,7 +104,7 @@ naga = { workspace = true, features = ["spv-out"] }
slab = { workspace = true }

[target.'cfg(any(gles, target_arch = "wasm32"))'.dependencies]
glow = "0.14"
glow = "0.16"
naga = { workspace = true, features = ["glsl-out"] }

[target.'cfg(all(gles, not(target_arch = "wasm32")))'.dependencies]
Expand Down
6 changes: 3 additions & 3 deletions blade-graphics/src/shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ impl super::Shader {
}
}

pub fn resolve_constants(
&self,
pub fn resolve_constants<'a>(
&'a self,
constants: &super::PipelineConstants,
) -> (naga::Module, Cow<naga::valid::ModuleInfo>) {
) -> (naga::Module, Cow<'a, naga::valid::ModuleInfo>) {
let (module, info) =
naga::back::pipeline_constants::process_overrides(&self.module, &self.info, constants)
.unwrap();
Expand Down
10 changes: 5 additions & 5 deletions blade-graphics/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ pub fn emit_annotated_error<E: Error>(ann_err: &naga::WithSpan<E>, filename: &st
}

impl super::TextureFormat {
pub fn block_info(&self) -> super::TexelBlockInfo {
fn uncompressed(size: u8) -> super::TexelBlockInfo {
pub const fn block_info(&self) -> super::TexelBlockInfo {
const fn uncompressed(size: u8) -> super::TexelBlockInfo {
super::TexelBlockInfo {
dimensions: (1, 1),
size,
}
}
fn cx_bc(size: u8) -> super::TexelBlockInfo {
const fn cx_bc(size: u8) -> super::TexelBlockInfo {
super::TexelBlockInfo {
dimensions: (4, 4),
size,
Expand Down Expand Up @@ -112,15 +112,15 @@ impl super::TextureFormat {
}

impl super::TextureColor {
pub fn stencil_clear_value(&self) -> u32 {
pub const fn stencil_clear_value(&self) -> u32 {
match self {
crate::TextureColor::TransparentBlack => 0,
crate::TextureColor::OpaqueBlack => !0,
crate::TextureColor::White => !0,
}
}

pub fn depth_clear_value(&self) -> f32 {
pub const fn depth_clear_value(&self) -> f32 {
match self {
crate::TextureColor::TransparentBlack => 0.0,
crate::TextureColor::OpaqueBlack => 0.0,
Expand Down
2 changes: 1 addition & 1 deletion blade-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ proc-macro2 = "1"
quote = "1.0"

[dev-dependencies]
blade-graphics = { version = "0.6", path = "../blade-graphics" }
blade-graphics = { version = "0.7", path = "../blade-graphics" }
blade-asset = { version = "0.2", path = "../blade-asset" }
bytemuck = { workspace = true }
mint = { workspace = true }
2 changes: 1 addition & 1 deletion blade-render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ asset = [
[dependencies]
base64 = { workspace = true, optional = true }
bitflags = { workspace = true }
blade-graphics = { version = "0.6", path = "../blade-graphics" }
blade-graphics = { version = "0.7", path = "../blade-graphics" }
blade-asset = { version = "0.2", path = "../blade-asset" }
blade-macros = { version = "0.3", path = "../blade-macros" }
bytemuck = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion blade-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/kvark/blade"
[lib]

[dependencies]
blade-graphics = { version = "0.6", path = "../blade-graphics" }
blade-graphics = { version = "0.7", path = "../blade-graphics" }
bytemuck = { workspace = true }
log = { workspace = true }
profiling = { workspace = true }
Expand Down
4 changes: 3 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Changelog for *Blade* project

## blade-graphics-0.7 (TBD)
## blade-graphics-0.7 (27 Sep 2025)

- graphics
- pipeline constants API
- allow buffer bindings for uniform data
- supported MSAA samples are now returned in context `Capabilities`
- Vulkan:
- improve correctness of present synchronization

## blade-graphics-0.6, blade-util-0.2, blade-egui-0.6, blade-render-0.4, blade-0.3 (21 Dec 2024)

Expand Down
Loading