Update wgpu to 0.16

This commit is contained in:
Héctor Ramón Jiménez 2023-05-02 06:31:22 +02:00 committed by Josh Groves
parent ddaaae295c
commit 80e8465af6
3 changed files with 4 additions and 6 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 = "0.15" wgpu = "0.16"
etagere = "0.2.6" etagere = "0.2.6"
cosmic-text = "0.8" cosmic-text = "0.8"
lru = "0.9" lru = "0.9"

View file

@ -76,7 +76,7 @@ fn vs_main(in_vert: VertexInput) -> VertexOutput {
f32((color & 0xff000000u) >> 24u), f32((color & 0xff000000u) >> 24u),
) / 255.0; ) / 255.0;
var dim = vec2<u32>(0); var dim: vec2<u32> = vec2(0u);
switch in_vert.content_type { switch in_vert.content_type {
case 0u: { case 0u: {
dim = textureDimensions(color_atlas_texture); dim = textureDimensions(color_atlas_texture);

View file

@ -2,7 +2,7 @@ use crate::{
CacheKey, FontSystem, GlyphDetails, GlyphToRender, GpuCacheStatus, Params, PrepareError, CacheKey, FontSystem, GlyphDetails, GlyphToRender, GpuCacheStatus, Params, PrepareError,
RenderError, Resolution, SwashCache, SwashContent, TextArea, TextAtlas, RenderError, Resolution, SwashCache, SwashContent, TextArea, TextAtlas,
}; };
use std::{collections::HashSet, iter, mem::size_of, num::NonZeroU32, slice, sync::Arc}; use std::{collections::HashSet, iter, mem::size_of, slice, sync::Arc};
use wgpu::{ use wgpu::{
Buffer, BufferDescriptor, BufferUsages, DepthStencilState, Device, Extent3d, ImageCopyTexture, Buffer, BufferDescriptor, BufferUsages, DepthStencilState, Device, Extent3d, ImageCopyTexture,
ImageDataLayout, IndexFormat, MultisampleState, Origin3d, Queue, RenderPass, RenderPipeline, ImageDataLayout, IndexFormat, MultisampleState, Origin3d, Queue, RenderPass, RenderPipeline,
@ -147,9 +147,7 @@ impl TextRenderer {
&image.data, &image.data,
ImageDataLayout { ImageDataLayout {
offset: 0, offset: 0,
bytes_per_row: NonZeroU32::new( bytes_per_row: Some(width as u32 * inner.num_atlas_channels as u32),
width as u32 * inner.num_atlas_channels as u32,
),
rows_per_image: None, rows_per_image: None,
}, },
Extent3d { Extent3d {