Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Don't use COPY_SRC for surface in WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
darthdeus committed Sep 19, 2023
1 parent aa4dfad commit 8ba2554
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ comfy is free and open source and dual licensed under MIT and Apache 2.0 license

Examples

- [ ] .as_srgb() surface view
- [ ] get rid of .as_world_size() for sizes
- [ ] generate wasm examples
- [x] generate webms for website
Expand Down
9 changes: 7 additions & 2 deletions comfy-wgpu/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,14 @@ impl WgpuRenderer {

let render_texture_format = wgpu::TextureFormat::Rgba16Float;

#[cfg(not(target_arch = "wasm32"))]
let surface_usage = wgpu::TextureUsages::RENDER_ATTACHMENT |
wgpu::TextureUsages::COPY_SRC;
#[cfg(target_arch = "wasm32")]
let surface_usage = wgpu::TextureUsages::RENDER_ATTACHMENT;

let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT |
wgpu::TextureUsages::COPY_SRC,
usage: surface_usage,
format: monitor_surface_format,
width: size.width,
height: size.height,
Expand Down

0 comments on commit 8ba2554

Please sign in to comment.