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

Add default for texture format #675

Merged
merged 1 commit into from
Oct 16, 2020

Conversation

enfipy
Copy link
Contributor

@enfipy enfipy commented Oct 13, 2020

Some android devices can't work with Bgra TextureFormat - so we can replace it with default() that will return TextureFormat depending on the target os.

@karroffel karroffel added the A-Rendering Drawing game state to the screen label Oct 14, 2020
Copy link
Member

@joshuajbouw joshuajbouw left a comment

Choose a reason for hiding this comment

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

Saw the discussion about this in chat. Makes perfect sense to have this improvement. Though, I'm not sure if having a cfg! check in default is the correct "rusty way" to do things. Typically you would want the cfg! say, for the entire function itself or in a function to choose whats right. Typically you would want the Default to be consistent across platforms I would think.

Though, consensus seems to say its ok in Rust chat.

@joshuajbouw
Copy link
Member

Please rebase

@enfipy enfipy force-pushed the add-default-for-texture-format branch from b44b38e to ffa6d5b Compare October 16, 2020 08:45
@enfipy
Copy link
Contributor Author

enfipy commented Oct 16, 2020

Done. Also, I updated TextureFormat into wgpu::TextureFormat and noticed weird WgpuFrom/WgpuInto - why not standard From/Into?

@cart
Copy link
Member

cart commented Oct 16, 2020

The compiler yells at us when we try to impl From or Into for these types:

image

@cart cart merged commit 7ba4584 into bevyengine:master Oct 16, 2020
@enfipy enfipy deleted the add-default-for-texture-format branch October 16, 2020 20:38
@enfipy enfipy mentioned this pull request Oct 18, 2020
joshuajbouw pushed a commit to joshuajbouw/bevy that referenced this pull request Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants