Revert "update to wgpu 0.20.0 (#93)"

This reverts commit 670140e2a1.
This commit is contained in:
Héctor Ramón Jiménez 2024-05-08 19:25:00 +02:00
parent 883b9170b4
commit 0a688982e9
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 12 additions and 18 deletions

View file

@ -8,7 +8,7 @@ repository = "https://github.com/grovesNL/glyphon"
license = "MIT OR Apache-2.0 OR Zlib" license = "MIT OR Apache-2.0 OR Zlib"
[dependencies] [dependencies]
wgpu = { version = "0.20", default-features = false, features = ["wgsl"] } wgpu = { version = "0.19", default-features = false, features = ["wgsl"] }
etagere = "0.2.10" etagere = "0.2.10"
cosmic-text = "0.11" cosmic-text = "0.11"
lru = { version = "0.12.1", default-features = false } lru = { version = "0.12.1", default-features = false }
@ -16,5 +16,5 @@ rustc-hash = "1.1"
[dev-dependencies] [dev-dependencies]
winit = { version = "0.29.10", features = ["rwh_05"] } winit = { version = "0.29.10", features = ["rwh_05"] }
wgpu = { version = "0.20", default-features = true } wgpu = { version = "0.19", default-features = true }
pollster = "0.3.0" pollster = "0.3.0"

View file

@ -25,13 +25,11 @@ async fn run() {
// Set up window // Set up window
let (width, height) = (800, 600); let (width, height) = (800, 600);
let event_loop = EventLoop::new().unwrap(); let event_loop = EventLoop::new().unwrap();
let window = Arc::new( let window = Arc::new(WindowBuilder::new()
WindowBuilder::new()
.with_inner_size(LogicalSize::new(width as f64, height as f64)) .with_inner_size(LogicalSize::new(width as f64, height as f64))
.with_title("glyphon hello world") .with_title("glyphon hello world")
.build(&event_loop) .build(&event_loop)
.unwrap(), .unwrap());
);
let size = window.inner_size(); let size = window.inner_size();
let scale_factor = window.scale_factor(); let scale_factor = window.scale_factor();
@ -53,9 +51,7 @@ async fn run() {
.await .await
.unwrap(); .unwrap();
let surface = instance let surface = instance.create_surface(window.clone()).expect("Create surface");
.create_surface(window.clone())
.expect("Create surface");
let swapchain_format = TextureFormat::Bgra8UnormSrgb; let swapchain_format = TextureFormat::Bgra8UnormSrgb;
let mut config = SurfaceConfiguration { let mut config = SurfaceConfiguration {
usage: TextureUsages::RENDER_ATTACHMENT, usage: TextureUsages::RENDER_ATTACHMENT,

View file

@ -4,10 +4,10 @@ use wgpu::{
BindGroup, BindGroupDescriptor, BindGroupEntry, BindGroupLayout, BindGroupLayoutEntry, BindGroup, BindGroupDescriptor, BindGroupEntry, BindGroupLayout, BindGroupLayoutEntry,
BindingResource, BindingType, BlendState, Buffer, BufferBindingType, ColorTargetState, BindingResource, BindingType, BlendState, Buffer, BufferBindingType, ColorTargetState,
ColorWrites, DepthStencilState, Device, FilterMode, FragmentState, MultisampleState, ColorWrites, DepthStencilState, Device, FilterMode, FragmentState, MultisampleState,
PipelineCompilationOptions, PipelineLayout, PipelineLayoutDescriptor, PrimitiveState, PipelineLayout, PipelineLayoutDescriptor, PrimitiveState, PrimitiveTopology, RenderPipeline,
PrimitiveTopology, RenderPipeline, RenderPipelineDescriptor, Sampler, SamplerBindingType, RenderPipelineDescriptor, Sampler, SamplerBindingType, SamplerDescriptor, ShaderModule,
SamplerDescriptor, ShaderModule, ShaderModuleDescriptor, ShaderSource, ShaderStages, ShaderModuleDescriptor, ShaderSource, ShaderStages, TextureFormat, TextureSampleType,
TextureFormat, TextureSampleType, TextureView, TextureViewDimension, VertexFormat, VertexState, TextureView, TextureViewDimension, VertexFormat, VertexState,
}; };
use std::borrow::Cow; use std::borrow::Cow;
@ -220,7 +220,6 @@ impl Cache {
module: shader, module: shader,
entry_point: "vs_main", entry_point: "vs_main",
buffers: vertex_buffers, buffers: vertex_buffers,
compilation_options: PipelineCompilationOptions::default(),
}, },
fragment: Some(FragmentState { fragment: Some(FragmentState {
module: shader, module: shader,
@ -230,7 +229,6 @@ impl Cache {
blend: Some(BlendState::ALPHA_BLENDING), blend: Some(BlendState::ALPHA_BLENDING),
write_mask: ColorWrites::default(), write_mask: ColorWrites::default(),
})], })],
compilation_options: PipelineCompilationOptions::default(),
}), }),
primitive: PrimitiveState { primitive: PrimitiveState {
topology: PrimitiveTopology::TriangleStrip, topology: PrimitiveTopology::TriangleStrip,