diff --git a/Cargo.toml b/Cargo.toml index d1f83d1..8ee5f45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "wgpu_text" authors = ["Leon (Blatko1)"] -version = "27.0.1" +version = "28.0.0" edition = "2024" description = "A simple 2D text renderer for wgpu." license = "MIT" @@ -12,13 +12,13 @@ categories = ["graphics", "rendering"] include = ["src/**/*", "LICENSE", "Cargo.toml", "README.md", ".gitignore"] [dependencies] -wgpu = "27.0.1" +wgpu = "28.0.0" glyph_brush = "0.7.12" log = "0.4.28" bytemuck = { version = "1.24.0", features = ["derive"] } [dev-dependencies] -wgpu = { version = "27.0.1", features = ["spirv"] } +wgpu = { version = "28.0.0", features = ["spirv"] } winit = "0.30.12" pollster = "0.4.0" env_logger = "0.11.8" diff --git a/README.md b/README.md index d3a762d..17fd41c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Add the following to your `Cargo.toml` file: ```toml [dependencies] -wgpu_text = "27.0.1" +wgpu_text = "28.0.0" ``` ## **Usage** diff --git a/examples/custom_target/custom_target.rs b/examples/custom_target/custom_target.rs index 77388da..2674db9 100644 --- a/examples/custom_target/custom_target.rs +++ b/examples/custom_target/custom_target.rs @@ -7,7 +7,7 @@ use camera::Camera; use ctx::Ctx; use glyph_brush::ab_glyph::FontRef; use glyph_brush::{OwnedSection, OwnedText, VerticalAlign}; -use pipeline::{create_pipeline, Vertex}; +use pipeline::{Vertex, create_pipeline}; use std::sync::Arc; use std::time::{Duration, Instant}; use wgpu::util::DeviceExt; @@ -121,7 +121,7 @@ impl ApplicationHandler for State<'_> { address_mode_w: wgpu::AddressMode::ClampToEdge, mag_filter: wgpu::FilterMode::Linear, min_filter: wgpu::FilterMode::Linear, - mipmap_filter: wgpu::FilterMode::Linear, + mipmap_filter: wgpu::MipmapFilterMode::Linear, ..Default::default() }); self.texture_view = Some(texture.create_view(&Default::default())); @@ -367,6 +367,7 @@ impl ApplicationHandler for State<'_> { depth_stencil_attachment: None, timestamp_writes: None, occlusion_query_set: None, + multiview_mask: None, }); brush.draw(&mut rpass); @@ -394,6 +395,7 @@ impl ApplicationHandler for State<'_> { depth_stencil_attachment: None, timestamp_writes: None, occlusion_query_set: None, + multiview_mask: None, }); rpass.set_pipeline(self.pipeline.as_ref().unwrap()); @@ -440,7 +442,9 @@ impl ApplicationHandler for State<'_> { fn main() { if std::env::var("RUST_LOG").is_err() { - unsafe { std::env::set_var("RUST_LOG", "error"); } + unsafe { + std::env::set_var("RUST_LOG", "error"); + } } env_logger::init(); diff --git a/examples/custom_target/pipeline.rs b/examples/custom_target/pipeline.rs index bc9a1b8..69b18c3 100644 --- a/examples/custom_target/pipeline.rs +++ b/examples/custom_target/pipeline.rs @@ -39,7 +39,7 @@ pub fn create_pipeline( let layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("Custom Surface Render Pipeline Layout"), bind_group_layouts, - push_constant_ranges: &[], + immediate_size: 0, }); let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { @@ -74,7 +74,7 @@ pub fn create_pipeline( })], compilation_options: Default::default(), }), - multiview: None, + multiview_mask: None, cache: None, }); pipeline diff --git a/examples/depth.rs b/examples/depth.rs index ec117be..9bb7706 100644 --- a/examples/depth.rs +++ b/examples/depth.rs @@ -2,8 +2,8 @@ mod ctx; use ctx::Ctx; -use glyph_brush::ab_glyph::FontRef; use glyph_brush::OwnedSection; +use glyph_brush::ab_glyph::FontRef; use std::sync::Arc; use std::time::{Duration, Instant}; use wgpu::{DepthStencilState, TextureView}; @@ -268,6 +268,7 @@ impl ApplicationHandler for State<'_> { ), timestamp_writes: None, occlusion_query_set: None, + multiview_mask: None, }); brush.draw(&mut rpass); @@ -287,8 +288,10 @@ impl ApplicationHandler for State<'_> { self.delta_time = Instant::now(); self.fps += 1; if self.fps_update_time.elapsed().as_millis() > 1000 { - window - .set_title(&format!("wgpu-text: 'depth' example, FPS: {}", self.fps)); + window.set_title(&format!( + "wgpu-text: 'depth' example, FPS: {}", + self.fps + )); self.fps = 0; self.fps_update_time = Instant::now(); } @@ -303,7 +306,9 @@ impl ApplicationHandler for State<'_> { fn main() { if std::env::var("RUST_LOG").is_err() { - unsafe { std::env::set_var("RUST_LOG", "error"); } + unsafe { + std::env::set_var("RUST_LOG", "error"); + } } env_logger::init(); diff --git a/examples/performance.rs b/examples/performance.rs index d1bd129..f9e5ebb 100644 --- a/examples/performance.rs +++ b/examples/performance.rs @@ -201,6 +201,7 @@ impl ApplicationHandler for State<'_> { depth_stencil_attachment: None, timestamp_writes: None, occlusion_query_set: None, + multiview_mask: None, }); brush.draw(&mut rpass) @@ -238,7 +239,9 @@ impl ApplicationHandler for State<'_> { fn main() { if std::env::var("RUST_LOG").is_err() { - unsafe { std::env::set_var("RUST_LOG", "error"); } + unsafe { + std::env::set_var("RUST_LOG", "error"); + } } env_logger::init(); diff --git a/examples/simple.rs b/examples/simple.rs index 028d8a6..17864b0 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -2,8 +2,8 @@ mod ctx; use ctx::Ctx; -use glyph_brush::ab_glyph::FontRef; use glyph_brush::OwnedSection; +use glyph_brush::ab_glyph::FontRef; use std::sync::Arc; use std::time::{Duration, Instant}; use wgpu_text::glyph_brush::{ @@ -241,6 +241,7 @@ impl ApplicationHandler for State<'_> { depth_stencil_attachment: None, timestamp_writes: None, occlusion_query_set: None, + multiview_mask: None, }); brush.draw(&mut rpass); @@ -279,7 +280,9 @@ impl ApplicationHandler for State<'_> { // TODO text layout of characters like 'š, ć, ž, đ' doesn't work correctly. fn main() { if std::env::var("RUST_LOG").is_err() { - unsafe { std::env::set_var("RUST_LOG", "error"); } + unsafe { + std::env::set_var("RUST_LOG", "error"); + } } env_logger::init(); diff --git a/src/pipeline.rs b/src/pipeline.rs index ab93dfd..646203a 100644 --- a/src/pipeline.rs +++ b/src/pipeline.rs @@ -1,12 +1,12 @@ use std::num::NonZeroU32; use glyph_brush::{ - ab_glyph::{point, Rect}, Rectangle, + ab_glyph::{Rect, point}, }; use wgpu::util::DeviceExt; -use crate::{cache::Cache, Matrix}; +use crate::{Matrix, cache::Cache}; /// Responsible for drawing text. #[derive(Debug)] @@ -25,7 +25,7 @@ impl Pipeline { render_format: wgpu::TextureFormat, depth_stencil: Option, multisample: wgpu::MultisampleState, - multiview: Option, + multiview_mask: Option, tex_dimensions: (u32, u32), matrix: Matrix, ) -> Pipeline { @@ -45,7 +45,7 @@ impl Pipeline { device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("wgpu-text Render Pipeline Layout"), bind_group_layouts: &[&cache.bind_group_layout], - push_constant_ranges: &[], + immediate_size: 0, }); let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { @@ -74,8 +74,8 @@ impl Pipeline { })], compilation_options: Default::default(), }), - multiview, cache: None, + multiview_mask, }); Self {