Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render-api-v2 further enhancements #107

Closed
JMS55 opened this issue Jul 22, 2020 · 3 comments
Closed

Render-api-v2 further enhancements #107

JMS55 opened this issue Jul 22, 2020 · 3 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@JMS55
Copy link
Contributor

JMS55 commented Jul 22, 2020

Pixel should store and give out Rc<Device> and probably Rc<Queue> as well.

PixelBuilder should have a scaling_renderer_with_input_texture(texture: &TextureView) method, or don't store it in Pixel, and have the user construct it themselves.

@JMS55
Copy link
Contributor Author

JMS55 commented Jul 22, 2020

I'm conflicted on &Device vs Rc vs Arc honestly. I wish there was a good way to let the user choose what they need.

@parasyte
Copy link
Owner

I was thinking about this on the plane the other day. There is no requirement for pixels to own the wgpu context. It just makes using the library very easy by hiding much of the boilerplate.

The wgpu context can borrow structs owned by anything else. It's just a matter of keeping sane lifetimes. This would be exposed through a new method, like pixels::new_with_context. I'll try sketching the API sometime.

@JMS55
Copy link
Contributor Author

JMS55 commented Jul 22, 2020

That also works. I just ran into an issue where I need Arc, so this would be appreciated.

Also note that https://github.com/parasyte/pixels/blob/wip/render-api-v2/src/renderers.rs#L16 should be &Device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants