From 858eab2395347237aaf4e74d04932a3787a80d70 Mon Sep 17 00:00:00 2001 From: Schell Carl Scivally Date: Sun, 12 Jan 2025 09:31:37 +1300 Subject: [PATCH] pin wgpu and spirv-std, reconcile glam dep --- crates/renderling/src/atlas/cpu.rs | 8 ++++---- crates/renderling/src/context.rs | 6 +++--- crates/renderling/src/stage/cpu.rs | 4 ++-- crates/renderling/src/texture.rs | 20 ++++++++++---------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/crates/renderling/src/atlas/cpu.rs b/crates/renderling/src/atlas/cpu.rs index 8ac5041..a711c74 100644 --- a/crates/renderling/src/atlas/cpu.rs +++ b/crates/renderling/src/atlas/cpu.rs @@ -529,14 +529,14 @@ impl StagedResources { // write the new image from the CPU to the new texture runtime.queue.write_texture( - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture: &new_texture_array.texture, mip_level: 0, origin, aspect: wgpu::TextureAspect::All, }, &bytes, - wgpu::TexelCopyBufferLayout { + wgpu::ImageDataLayout { offset: 0, bytes_per_row: Some(4 * size_px.x), rows_per_image: Some(size_px.y), @@ -551,7 +551,7 @@ impl StagedResources { // copy the frame from the old texture to the new texture // in a new destination encoder.copy_texture_to_texture( - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture: &old_texture_array.texture, mip_level: 0, origin: wgpu::Origin3d { @@ -561,7 +561,7 @@ impl StagedResources { }, aspect: wgpu::TextureAspect::All, }, - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture: &new_texture_array.texture, mip_level: 0, origin: wgpu::Origin3d { diff --git a/crates/renderling/src/context.rs b/crates/renderling/src/context.rs index cac9317..770fa11 100644 --- a/crates/renderling/src/context.rs +++ b/crates/renderling/src/context.rs @@ -170,7 +170,7 @@ fn new_instance(backends: Option) -> wgpu::Instance { ); // BackendBit::PRIMARY => Vulkan + Metal + DX12 + Browser WebGPU let backends = backends.unwrap_or(wgpu::Backends::PRIMARY); - let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { + let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { backends, ..Default::default() }); @@ -338,9 +338,9 @@ impl Frame { // Copy the data from the surface texture to the buffer encoder.copy_texture_to_buffer( texture.as_image_copy(), - wgpu::TexelCopyBufferInfo { + wgpu::ImageCopyBuffer { buffer: &buffer, - layout: wgpu::TexelCopyBufferLayout { + layout: wgpu::ImageDataLayout { offset: 0, bytes_per_row: Some(dimensions.padded_bytes_per_row as u32), rows_per_image: None, diff --git a/crates/renderling/src/stage/cpu.rs b/crates/renderling/src/stage/cpu.rs index 3535f6c..b0ef9ac 100644 --- a/crates/renderling/src/stage/cpu.rs +++ b/crates/renderling/src/stage/cpu.rs @@ -864,13 +864,13 @@ impl Stage { }); let bloom_mix_texture = self.bloom.get_mix_texture(); encoder.copy_texture_to_texture( - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture: &self.hdr_texture.read().unwrap().texture, mip_level: 0, origin: wgpu::Origin3d { x: 0, y: 0, z: 0 }, aspect: wgpu::TextureAspect::All, }, - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture: &bloom_mix_texture.texture, mip_level: 0, origin: wgpu::Origin3d { x: 0, y: 0, z: 0 }, diff --git a/crates/renderling/src/texture.rs b/crates/renderling/src/texture.rs index 597298f..06a0d16 100644 --- a/crates/renderling/src/texture.rs +++ b/crates/renderling/src/texture.rs @@ -106,13 +106,13 @@ impl Texture { let index = i * mip_levels as usize + mip_level; let texture = &face_textures[index].texture; encoder.copy_texture_to_texture( - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture, mip_level: 0, origin: wgpu::Origin3d::ZERO, aspect: wgpu::TextureAspect::All, }, - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture: &cubemap_texture, mip_level: mip_level as u32, origin: wgpu::Origin3d { @@ -195,14 +195,14 @@ impl Texture { if !data.is_empty() { queue.write_texture( - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture: &texture, mip_level: 0, origin: wgpu::Origin3d::ZERO, aspect: wgpu::TextureAspect::All, }, data, - wgpu::TexelCopyBufferLayout { + wgpu::ImageDataLayout { offset: 0, bytes_per_row: Some(color_channels * color_channel_bytes * width), rows_per_image: None, @@ -331,14 +331,14 @@ impl Texture { }); queue.write_texture( - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture: &texture, mip_level: 0, origin: wgpu::Origin3d::ZERO, aspect: wgpu::TextureAspect::All, }, img.as_bytes(), - wgpu::TexelCopyBufferLayout { + wgpu::ImageDataLayout { offset: 0, bytes_per_row: Some(channels * dimensions.0), rows_per_image: Some(dimensions.1), @@ -393,14 +393,14 @@ impl Texture { }); runtime.queue.write_texture( - wgpu::TexelCopyTextureInfo { + wgpu::ImageCopyTexture { texture: &texture, mip_level: 0, origin: wgpu::Origin3d::ZERO, aspect: wgpu::TextureAspect::All, }, img.deref(), - wgpu::TexelCopyBufferLayout { + wgpu::ImageDataLayout { offset: 0, bytes_per_row: Some(P::CHANNEL_COUNT as u32 * dimensions.0), rows_per_image: Some(dimensions.1), @@ -558,9 +558,9 @@ impl Texture { // Copy the data from the surface texture to the buffer encoder.copy_texture_to_buffer( source, - wgpu::TexelCopyBufferInfo { + wgpu::ImageCopyBuffer { buffer: &buffer, - layout: wgpu::TexelCopyBufferLayout { + layout: wgpu::ImageDataLayout { offset: 0, bytes_per_row: Some(dimensions.padded_bytes_per_row as u32), rows_per_image: None,