Skip to content

Commit

Permalink
Update app-surface to v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili committed Jan 27, 2025
1 parent ca521ec commit 2b9b116
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 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 @@ -20,7 +20,7 @@ version = "0.25"
default-features = false

[workspace.dependencies]
app-surface = "1.4.2"
app-surface = "1.5.0"
# app-surface = { path = "../idroid/wgpu-in-app/app-surface", default-features = false }
bytemuck = { version = "1.21", features = ["derive"] }
cfg-if = "1"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ cargo run-wasm --bin tutorial1-window --features webgl
Chrome 113+、Microsoft Edge 113+ 及 Arc 浏览器均已默认支持 WebGPU 功能。

### Safari

Safari 18 (macOS 15) 已经默认开启了 WebGPU 功能。

macOS 14- 系统上,需安装 [Safari Technology Preview 185+](https://www.webkit.org/blog/14879/webgpu-now-available-for-testing-in-safari-technology-preview/),从顶部菜单栏选择 `开发 -> 功能标志` , 搜索并勾选 `WebGPU`:
Expand All @@ -90,7 +91,7 @@ macOS 14- 系统上,需安装 [Safari Technology Preview 185+](https://www.web

## 关于译者

我是一名移动端架构师, 有多年使用 OpenGL / WebGL, Metal 的实践经验。2018 年开始接触 WebGPU,目前正积极地参与到 [wgpu 开源项目的开发与完善](/~https://github.com/gfx-rs/wgpu/commits?author=jinleili)之中,并且已于两年前在 AppStore 上架了基于 wgpu 实现的毛笔书法模拟 App [字习 Pro](https://apps.apple.com/cn/app/字习-pro/id1507339788)
我是一名移动端架构师, 有多年使用 OpenGL / WebGL, Metal 的实践经验。2018 年开始接触 WebGPU,目前正积极地参与到 [wgpu 开源项目的开发与完善](/~https://github.com/gfx-rs/wgpu/commits?author=jinleili)之中,并且已于 2020 年在 AppStore 上架了基于 wgpu 实现的毛笔书法模拟 App [字习 Pro](https://apps.apple.com/cn/app/字习-pro/id1507339788)

## 加入 wgpu 微信学习交流群

Expand Down
10 changes: 5 additions & 5 deletions code/intermediate/hdr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ impl WgpuApp {
// 再更新 projection, hdr, depth_texture
self.projection.resize(self.size.width, self.size.height);
self.hdr
.resize(self.app.device.as_ref(), self.size.width, self.size.height);
.resize(&self.app.device, self.size.width, self.size.height);
self.depth_texture = texture::Texture::create_depth_texture(
self.app.device.as_ref(),
&self.app.device,
&self.app.config,
"depth_texture",
);
Expand Down Expand Up @@ -260,8 +260,8 @@ impl WgpuAppAction for WgpuApp {
let surface_format = app.config.format.remove_srgb_suffix();
app.ctx.update_config_format(surface_format);

let device = app.device.as_ref();
let queue = app.queue.as_ref();
let device = &app.device;
let queue = &app.queue;
let config = &app.config;

let texture_bind_group_layout =
Expand Down Expand Up @@ -671,7 +671,7 @@ impl WgpuAppAction for WgpuApp {
.app
.get_current_frame_view(Some(self.app.config.format.add_srgb_suffix()));

let device = self.app.device.as_ref();
let device = &self.app.device;
let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor {
label: Some("Render Encoder"),
});
Expand Down
2 changes: 1 addition & 1 deletion code/utils/src/load_texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub async fn from_path(
format,
};

(any_tex, default_sampler(app.device.as_ref()))
(any_tex, default_sampler(&app.device))
}

fn load_from_img(
Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ cargo run-wasm --bin tutorial2-surface --features webgl
Chrome 113+、Microsoft Edge 113+ 及 Arc 浏览器均已默认支持 WebGPU 功能。

### Safari

Safari 18 (macOS 15) 已经默认开启了 WebGPU 功能。

macOS 14- 系统上,需安装 [Safari Technology Preview 185+](https://www.webkit.org/blog/14879/webgpu-now-available-for-testing-in-safari-technology-preview/),从顶部菜单栏选择 `开发 -> 功能标志` , 搜索并勾选 `WebGPU`:
Expand All @@ -87,7 +88,7 @@ macOS 14- 系统上,需安装 [Safari Technology Preview 185+](https://www.web

## 关于译者

我是一名移动端架构师,有多年使用 OpenGL / WebGL, Metal 的实践经验。2018 年开始接触 WebGPU,目前正积极地参与到 [wgpu 开源项目的开发与完善](/~https://github.com/gfx-rs/wgpu/commits?author=jinleili)之中,并且已于两年前在 AppStore 上架了基于 wgpu 实现的毛笔书法模拟 App [字习 Pro](https://apps.apple.com/cn/app/字习-pro/id1507339788)
我是一名移动端架构师,有多年使用 OpenGL / WebGL, Metal 的实践经验。2018 年开始接触 WebGPU,目前正积极地参与到 [wgpu 开源项目的开发与完善](/~https://github.com/gfx-rs/wgpu/commits?author=jinleili)之中,并且已于 2020 年在 AppStore 上架了基于 wgpu 实现的毛笔书法模拟 App [字习 Pro](https://apps.apple.com/cn/app/字习-pro/id1507339788)

## 加入 wgpu 微信学习交流群

Expand Down

0 comments on commit 2b9b116

Please sign in to comment.