Skip to content

Commit

Permalink
update wgpu 24.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mitoma committed Jan 20, 2025
1 parent a13ca19 commit eaf2cc9
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 29 deletions.
88 changes: 66 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resolver = "2"

[workspace.dependencies]
thiserror = "2.0"
wgpu = "23.0.0"
wgpu = "24.0.0"
# fork元は winit = "0.29.x" ブランチ。いくつかのパッチを当てたものを使っている。
# patch-1
# wasm で ime support が十分でないのでパッチを当てている。
Expand Down
4 changes: 2 additions & 2 deletions font_rasterizer/src/screen_texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ impl BackgroundImageTexture {
});

queue.write_texture(
wgpu::ImageCopyTexture {
wgpu::TexelCopyTextureInfo {
texture: &texture,
mip_level: 0,
origin: wgpu::Origin3d::ZERO,
aspect: wgpu::TextureAspect::All,
},
&diffuse_rgba,
wgpu::ImageDataLayout {
wgpu::TexelCopyBufferLayout {
offset: 0,
bytes_per_row: Some(4 * width),
rows_per_image: Some(height),
Expand Down
3 changes: 3 additions & 0 deletions ui_support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ pub async fn run_support(support: SimpleStateSupport) {
Err(wgpu::SurfaceError::Timeout) => {
log::warn!("Surface timeout")
}
Err(wgpu::SurfaceError::Other) => {
log::warn!("Surface Other error")
}
}
// 1 フレームごとに時計を更新する(時計のモードが StepByStep の場合のみ意味がある)
increment_fixed_clock(Duration::ZERO);
Expand Down
8 changes: 4 additions & 4 deletions ui_support/src/render_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ impl RenderTarget {
let size = context.window_size;
let u32_size = std::mem::size_of::<u32>() as u32;
encoder.copy_texture_to_buffer(
wgpu::ImageCopyTexture {
wgpu::TexelCopyTextureInfo {
aspect: wgpu::TextureAspect::All,
texture: surface_texture,
mip_level: 0,
origin: wgpu::Origin3d::ZERO,
},
wgpu::ImageCopyBuffer {
wgpu::TexelCopyBufferInfo {
buffer: output_buffer,
layout: wgpu::ImageDataLayout {
layout: wgpu::TexelCopyBufferLayout {
offset: 0,
bytes_per_row: Some(u32_size * size.width),
rows_per_image: Some(size.height),
Expand Down Expand Up @@ -191,7 +191,7 @@ impl RenderState {

// The instance is a handle to our GPU
// BackendBit::PRIMARY => Vulkan + Metal + DX12 + Browser WebGPU
let instance = wgpu::Instance::new(InstanceDescriptor::default());
let instance = wgpu::Instance::new(&InstanceDescriptor::default());

let surface = match &render_target_request {
RenderTargetRequest::Window { window } => {
Expand Down

0 comments on commit eaf2cc9

Please sign in to comment.