Skip to content

Conversation

TrueDoctor
Copy link
Member

No description provided.

Copy link
Member

@timon-schelling timon-schelling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please wait until I have my desktop PRs merged, before you rebase

///
/// Creates a new WGPU texture with RGBA8UnormSrgb format and uploads the provided
/// image data. The texture is configured for binding, copying, and source operations.
fn upload_to_texture(device: &std::sync::Arc<wgpu::Device>, queue: &std::sync::Arc<wgpu::Queue>, image: &Raster<CPU>) -> wgpu::Texture {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little annoyed that upload and download look so different, but I guess not much we can do. A function is the correct abstraction for upload and a helper struct for download.

@TrueDoctor TrueDoctor changed the title Convert texture Implement Convert trait to convert between CPU and GPU images Sep 25, 2025
@TrueDoctor TrueDoctor merged commit 7227016 into master Sep 25, 2025
3 of 4 checks passed
@TrueDoctor TrueDoctor deleted the convert-texture branch September 25, 2025 18:54
TrueDoctor added a commit that referenced this pull request Sep 25, 2025
* Add upload texture trait

* Make convert trait use explicit converter

* Add gpu texture download implementation

* Add footprint to convert trait

* Cleanup texture upload / download

* Download wgpu textures aligned

* abstract texture download into converter helper

* rename module

not only doing uploads anymore
conversion looks like a ok name

* Remove into_iter call and intermediate vector allocation

---------

Co-authored-by: Timon Schelling <[email protected]>
TrueDoctor added a commit that referenced this pull request Sep 26, 2025
* Add upload texture trait

* Make convert trait use explicit converter

* Add gpu texture download implementation

* Add footprint to convert trait

* Cleanup texture upload / download

* Download wgpu textures aligned

* abstract texture download into converter helper

* rename module

not only doing uploads anymore
conversion looks like a ok name

* Remove into_iter call and intermediate vector allocation

---------

Co-authored-by: Timon Schelling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants