Merge pull request #1 from devrangel/upgrade-wgpu-24
Upgrade `wgpu` to `24`
This commit is contained in:
commit
73be1c53ad
4 changed files with 13 additions and 12 deletions
|
@ -7,7 +7,7 @@ repository = "https://github.com/iced-rs/cryoglyph"
|
||||||
license = "MIT OR Apache-2.0 OR Zlib"
|
license = "MIT OR Apache-2.0 OR Zlib"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wgpu = { version = "23", default-features = false, features = ["wgsl"] }
|
wgpu = { version = "24", default-features = false, features = ["wgsl"] }
|
||||||
etagere = "0.2.10"
|
etagere = "0.2.10"
|
||||||
cosmic-text = "0.12"
|
cosmic-text = "0.12"
|
||||||
lru = { version = "0.12.1", default-features = false }
|
lru = { version = "0.12.1", default-features = false }
|
||||||
|
@ -15,5 +15,5 @@ rustc-hash = "2.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
winit = "0.29"
|
winit = "0.29"
|
||||||
wgpu = "23"
|
wgpu = "24"
|
||||||
pollster = "0.4"
|
pollster = "0.4"
|
||||||
|
|
|
@ -36,7 +36,7 @@ async fn run() {
|
||||||
let scale_factor = window.scale_factor();
|
let scale_factor = window.scale_factor();
|
||||||
|
|
||||||
// Set up surface
|
// Set up surface
|
||||||
let instance = Instance::new(InstanceDescriptor::default());
|
let instance = Instance::new(&InstanceDescriptor::default());
|
||||||
let adapter = instance
|
let adapter = instance
|
||||||
.request_adapter(&RequestAdapterOptions::default())
|
.request_adapter(&RequestAdapterOptions::default())
|
||||||
.await
|
.await
|
||||||
|
|
|
@ -6,9 +6,10 @@ use lru::LruCache;
|
||||||
use rustc_hash::FxHasher;
|
use rustc_hash::FxHasher;
|
||||||
use std::{collections::HashSet, hash::BuildHasherDefault, sync::Arc};
|
use std::{collections::HashSet, hash::BuildHasherDefault, sync::Arc};
|
||||||
use wgpu::{
|
use wgpu::{
|
||||||
BindGroup, DepthStencilState, Device, Extent3d, ImageCopyTexture, ImageDataLayout,
|
BindGroup, DepthStencilState, Device, Extent3d, MultisampleState, Origin3d, Queue,
|
||||||
MultisampleState, Origin3d, Queue, RenderPipeline, Texture, TextureAspect, TextureDescriptor,
|
RenderPipeline, TexelCopyBufferLayout, TexelCopyTextureInfo, Texture, TextureAspect,
|
||||||
TextureDimension, TextureFormat, TextureUsages, TextureView, TextureViewDescriptor,
|
TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, TextureView,
|
||||||
|
TextureViewDescriptor,
|
||||||
};
|
};
|
||||||
|
|
||||||
type Hasher = BuildHasherDefault<FxHasher>;
|
type Hasher = BuildHasherDefault<FxHasher>;
|
||||||
|
@ -163,7 +164,7 @@ impl InnerAtlas {
|
||||||
let height = image.placement.height as usize;
|
let height = image.placement.height as usize;
|
||||||
|
|
||||||
queue.write_texture(
|
queue.write_texture(
|
||||||
ImageCopyTexture {
|
TexelCopyTextureInfo {
|
||||||
texture: &self.texture,
|
texture: &self.texture,
|
||||||
mip_level: 0,
|
mip_level: 0,
|
||||||
origin: Origin3d {
|
origin: Origin3d {
|
||||||
|
@ -174,7 +175,7 @@ impl InnerAtlas {
|
||||||
aspect: TextureAspect::All,
|
aspect: TextureAspect::All,
|
||||||
},
|
},
|
||||||
&image.data,
|
&image.data,
|
||||||
ImageDataLayout {
|
TexelCopyBufferLayout {
|
||||||
offset: 0,
|
offset: 0,
|
||||||
bytes_per_row: Some(width as u32 * self.kind.num_channels() as u32),
|
bytes_per_row: Some(width as u32 * self.kind.num_channels() as u32),
|
||||||
rows_per_image: None,
|
rows_per_image: None,
|
||||||
|
|
|
@ -6,8 +6,8 @@ use std::{num::NonZeroU64, slice, sync::Arc};
|
||||||
use wgpu::util::StagingBelt;
|
use wgpu::util::StagingBelt;
|
||||||
use wgpu::{
|
use wgpu::{
|
||||||
Buffer, BufferDescriptor, BufferUsages, CommandEncoder, DepthStencilState, Device, Extent3d,
|
Buffer, BufferDescriptor, BufferUsages, CommandEncoder, DepthStencilState, Device, Extent3d,
|
||||||
ImageCopyTexture, ImageDataLayout, MultisampleState, Origin3d, Queue, RenderPass,
|
MultisampleState, Origin3d, Queue, RenderPass, RenderPipeline, TexelCopyBufferLayout,
|
||||||
RenderPipeline, TextureAspect, COPY_BUFFER_ALIGNMENT,
|
TexelCopyTextureInfo, TextureAspect, COPY_BUFFER_ALIGNMENT,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A text renderer that uses cached glyphs to render text into an existing render pass.
|
/// A text renderer that uses cached glyphs to render text into an existing render pass.
|
||||||
|
@ -130,7 +130,7 @@ impl TextRenderer {
|
||||||
let atlas_min = allocation.rectangle.min;
|
let atlas_min = allocation.rectangle.min;
|
||||||
|
|
||||||
queue.write_texture(
|
queue.write_texture(
|
||||||
ImageCopyTexture {
|
TexelCopyTextureInfo {
|
||||||
texture: &inner.texture,
|
texture: &inner.texture,
|
||||||
mip_level: 0,
|
mip_level: 0,
|
||||||
origin: Origin3d {
|
origin: Origin3d {
|
||||||
|
@ -141,7 +141,7 @@ impl TextRenderer {
|
||||||
aspect: TextureAspect::All,
|
aspect: TextureAspect::All,
|
||||||
},
|
},
|
||||||
&image.data,
|
&image.data,
|
||||||
ImageDataLayout {
|
TexelCopyBufferLayout {
|
||||||
offset: 0,
|
offset: 0,
|
||||||
bytes_per_row: Some(width as u32 * inner.num_channels() as u32),
|
bytes_per_row: Some(width as u32 * inner.num_channels() as u32),
|
||||||
rows_per_image: None,
|
rows_per_image: None,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue