parasyte / parasyte/pixels

Remove pixels::SurfaceTexture?

Open
#188 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
2.1k
Forks
147
Avg merge
12m
Merged PRs (30d)
1

Description

Tracking ticket for a public API change proposal. The idea was introduced in https://github.com/parasyte/pixels/issues/185#issuecomment-902416291

wgpu::SurfaceConfiguration contains the same basic information that we need for surface management (mainly the size). We can replace our pixels::SurfaceTexture type with a wgpu::SurfaceConfiguration. It would change the old way of creating a builder:

let surface_texture = SurfaceTexture::new(window_size.width, window_size.height, &window);
let builder = PixelsBuilder::new(width, height, surface_texture);

To the new way:

let surface_config = pixels::surface_config(window_size.width, window_size.height, None);
let builder = PixelsBuilder::new(width, height, &window, surface_config);

Where pixels::surface_config has this function signature:

pub fn surface_config(width: u32, height: u32, format: Option<wgpu::TextureFormat>) -> wgpu::SurfaceConfiguration

The only reason to do this would be to have Pixels own a SurfaceConfiguration instead of creating a new one every time the surface needs to be reconfigured. And of course, exposing the configuration publicly. The pixels::surface_config() helper is optional, and a surface configuration can be created in any way.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing pixels::SurfaceTexture and PixelsBuilder APIs, then compare their surface-management needs with wgpu::SurfaceConfiguration. Check how surfaces are reconfigured and where the configuration is created. Done means replacing the old construction path, exposing the configuration as proposed, and preserving the documented builder usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.