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

Move gl device implementation into separate crate #80

Closed
brendanzab opened this issue Jul 7, 2014 · 9 comments · Fixed by #598
Closed

Move gl device implementation into separate crate #80

brendanzab opened this issue Jul 7, 2014 · 9 comments · Fixed by #598

Comments

@brendanzab
Copy link
Contributor

I am having trouble understanding it. It would be great if it were more decoupled from the common device interface.

@kvark kvark added the refactor label Jul 7, 2014
@brendanzab brendanzab assigned emberian and unassigned emberian Jul 20, 2014
@emberian
Copy link
Contributor

This is going to involve some heavy refactoring, and I think it should wait until Rust has associated types. The problem is that the BackEnd implementation conceptually defines all of the types that are needed to interact with it, but the trait itself lives in device. So, device needs types from the backend, the backend needs the trait from device... it's more than the trait, though, it's most of the API. Without associated types, can't make any progress.

@brendanzab
Copy link
Contributor Author

Could we create a mocked up trait specification to allow us to transition in the future?

@emberian
Copy link
Contributor

emberian commented Nov 3, 2014

@bjz I believe this is done, currently.

@brendanzab
Copy link
Contributor Author

It isn't - it is currently in a separate directory, but not actually a separate crate: https://github.com/gfx-rs/gfx-rs/blob/master/src/device/lib.rs#L43

@emberian
Copy link
Contributor

emberian commented Nov 4, 2014

Ah, yes.

@kvark
Copy link
Member

kvark commented Jan 30, 2015

@bjz I believe you are working on this one?
Edit: is it still blocked?

@brendanzab
Copy link
Contributor Author

I was working on it, but was blocked by the associated item stuff.

@kvark
Copy link
Member

kvark commented Jan 30, 2015

Posting your comment, assuming it was about this issue:

Arg, trying to get associated types working with handles
but I am running into issues
I end up needing to pass the Device as a type parameter around
and the CommandBuffer trait needs the handle types
so CommandBuffer needs Device as a type parameter
but that ends in type checker recursion and blowing up rustc's stack
😔

@kvark
Copy link
Member

kvark commented Jan 30, 2015

@bjz So you are running into a type dependency recursion? Come back to gitter, when you have a moment, to share more info. Perhaps, you could push your branch for me to check out.

@kvark kvark self-assigned this Feb 24, 2015
adamnemecek pushed a commit to adamnemecek/gfx that referenced this issue Apr 1, 2021
80: Typed mapping of buffers r=kvark a=swiftcoder

Add a sprinkling of generics to remove the need for unsafe code to typecast slices resulting from mapping buffers.

Co-authored-by: Tristam MacDonald <tristam@trist.am>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants