Skip to content

Commit

Permalink
update to wgpu 0.20.0 (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
EggShark authored Apr 29, 2024
1 parent 3e281d1 commit 670140e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ repository = "https://github.com/grovesNL/glyphon"
license = "MIT OR Apache-2.0 OR Zlib"

[dependencies]
wgpu = { version = "0.19", default-features = false, features = ["wgsl"] }
wgpu = { version = "0.20", default-features = false, features = ["wgsl"] }
etagere = "0.2.10"
cosmic-text = "0.11"
lru = { version = "0.12.1", default-features = false }
rustc-hash = "1.1"

[dev-dependencies]
winit = { version = "0.29.10", features = ["rwh_05"] }
wgpu = { version = "0.19", default-features = true }
wgpu = { version = "0.20", default-features = true }
pollster = "0.3.0"
16 changes: 10 additions & 6 deletions examples/hello-world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ async fn run() {
// Set up window
let (width, height) = (800, 600);
let event_loop = EventLoop::new().unwrap();
let window = Arc::new(WindowBuilder::new()
.with_inner_size(LogicalSize::new(width as f64, height as f64))
.with_title("glyphon hello world")
.build(&event_loop)
.unwrap());
let window = Arc::new(
WindowBuilder::new()
.with_inner_size(LogicalSize::new(width as f64, height as f64))
.with_title("glyphon hello world")
.build(&event_loop)
.unwrap(),
);
let size = window.inner_size();
let scale_factor = window.scale_factor();

Expand All @@ -51,7 +53,9 @@ async fn run() {
.await
.unwrap();

let surface = instance.create_surface(window.clone()).expect("Create surface");
let surface = instance
.create_surface(window.clone())
.expect("Create surface");
let swapchain_format = TextureFormat::Bgra8UnormSrgb;
let mut config = SurfaceConfiguration {
usage: TextureUsages::RENDER_ATTACHMENT,
Expand Down
14 changes: 8 additions & 6 deletions src/text_atlas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use wgpu::{
BindGroup, BindGroupDescriptor, BindGroupEntry, BindGroupLayout, BindGroupLayoutEntry,
BindingResource, BindingType, BlendState, BufferBindingType, ColorTargetState, ColorWrites,
DepthStencilState, Device, Extent3d, FilterMode, FragmentState, ImageCopyTexture,
ImageDataLayout, MultisampleState, Origin3d, PipelineLayout, PipelineLayoutDescriptor,
PrimitiveState, Queue, RenderPipeline, RenderPipelineDescriptor, Sampler, SamplerBindingType,
SamplerDescriptor, ShaderModule, ShaderModuleDescriptor, ShaderSource, ShaderStages, Texture,
TextureAspect, TextureDescriptor, TextureDimension, TextureFormat, TextureSampleType,
TextureUsages, TextureView, TextureViewDescriptor, TextureViewDimension, VertexFormat,
VertexState,
ImageDataLayout, MultisampleState, Origin3d, PipelineCompilationOptions, PipelineLayout,
PipelineLayoutDescriptor, PrimitiveState, Queue, RenderPipeline, RenderPipelineDescriptor,
Sampler, SamplerBindingType, SamplerDescriptor, ShaderModule, ShaderModuleDescriptor,
ShaderSource, ShaderStages, Texture, TextureAspect, TextureDescriptor, TextureDimension,
TextureFormat, TextureSampleType, TextureUsages, TextureView, TextureViewDescriptor,
TextureViewDimension, VertexFormat, VertexState,
};

type Hasher = BuildHasherDefault<FxHasher>;
Expand Down Expand Up @@ -502,6 +502,7 @@ impl TextAtlas {
module: &self.shader,
entry_point: "vs_main",
buffers: &self.vertex_buffers,
compilation_options: PipelineCompilationOptions::default(),
},
fragment: Some(FragmentState {
module: &self.shader,
Expand All @@ -511,6 +512,7 @@ impl TextAtlas {
blend: Some(BlendState::ALPHA_BLENDING),
write_mask: ColorWrites::default(),
})],
compilation_options: PipelineCompilationOptions::default(),
}),
primitive: PrimitiveState::default(),
depth_stencil: depth_stencil.clone(),
Expand Down

0 comments on commit 670140e

Please sign in to comment.