Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd optional serialization support, version bumps, formatting fixes #1234
Conversation
torkleyy
reviewed
Apr 21, 2017
|
Seems we're getting serialization support for several libraries at the moment, nice. I just took a quick look as I don't have much time and I'm not very familiar with this code base yet. |
| @@ -51,7 +51,7 @@ script: | |||
| - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export LD_LIBRARY_PATH=$LIBRARY_PATH ; fi | |||
| - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cargo build --features vulkan; else cargo build; fi | |||
| - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cargo build --features metal; else cargo build; fi | |||
| - cargo test --all | |||
| - cargo test --all --features serialize | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ebkalderon
Apr 21, 2017
Author
Contributor
Given that the feature only makes the types derive from Serialize /Deserialize and nothing more, it just has to compile correctly to pass. But if you really want, I can duplicate the line to re-run all tests without it.
This comment has been minimized.
This comment has been minimized.
torkleyy
Apr 21, 2017
Contributor
Just a thought, you can leave it as is. We could also add the extra test later, should we implement anything more advanced.
This comment has been minimized.
This comment has been minimized.
| test_script: | ||
| - cargo test --all --features vulkan | ||
| - cargo test --all --features "vulkan serialize" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@kvark Alright, I've updated the PR and it's ready for review! |
kvark
requested changes
Apr 21, 2017
|
Thanks, looks great! A few fixes are needed before we proceed. |
| pub struct Buffer<R: Resources, T>(RawBuffer<R>, PhantomData<T>); | ||
|
|
||
| impl<R: Resources, T> cmp::PartialEq for Buffer<R, T> { | ||
| fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } | ||
| } | ||
|
|
||
| impl<R: Resources, T> cmp::Eq for Buffer<R, T> {} |
This comment has been minimized.
This comment has been minimized.
kvark
Apr 21, 2017
Member
we shouldn't be removing this line. The difference with derive is that we don't require T: Eq here, which is essential
This comment has been minimized.
This comment has been minimized.
| winit = "0.5.1" | ||
| gfx_core = { path = "src/core", version = "0.6" } | ||
| env_logger = "0.4" | ||
| glutin = "0.7" |
This comment has been minimized.
This comment has been minimized.
kvark
Apr 21, 2017
Member
you shouldn't strip the patch version from here - it is likely for a reason
This comment has been minimized.
This comment has been minimized.
ebkalderon
Apr 21, 2017
Author
Contributor
According to semantic versioning, the patch number is for backwards-compatible bug fixes only. By removing the patch version from the Cargo.toml, we can get these bug fixes whenever they come out, so we don't have to manually increment the version number over and over again.
This comment has been minimized.
This comment has been minimized.
kvark
Apr 21, 2017
•
Member
I think you are misreading the spec slightly. For 0.x.y, AFAIK, x is considered a "major" and y as "minor". Adding features just requires you to bump the patch version then (a "minor"), as long as it's backwards compatible. If something depends on new features, it needs to have the patch version specified for that minimal version (what we have). cargo update would still use the newer patch versions, if available, but it will guarantee we'll not get lower ones.
| @@ -30,9 +30,10 @@ name = "gfx" | |||
| path = "src/lib.rs" | |||
|
|
|||
| [features] | |||
| serialize = ["draw_state/serialize"] | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| winit = "0.5.2" | ||
| gfx_core = { path = "../../core", version = "0.6" } | ||
| gfx_device_dx11 = { path = "../../backend/dx11", version = "0.5" } | ||
| winit = "0.5" |
This comment has been minimized.
This comment has been minimized.
| @@ -13,27 +13,27 @@ default = [] | |||
| sdl = ["gfx_window_sdl"] | |||
| vulkan = ["gfx_device_vulkan", "gfx_device_vulkanll", "gfx_window_vulkan"] | |||
| metal = ["gfx_device_metal", "gfx_window_metal"] | |||
| serialize = ["gfx_core/serialize"] | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I think we are ready. Thank you!
@homu r+
… On Apr 21, 2017, at 16:12, Eyal Kalderon ***@***.***> wrote:
@ebkalderon commented on this pull request.
In src/render/Cargo.toml:
> @@ -30,9 +30,10 @@ name = "gfx"
path = "src/lib.rs"
[features]
+serialize = ["draw_state/serialize"]
Correct, I'll fix that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
homu
added a commit
that referenced
this pull request
Apr 21, 2017
This comment has been minimized.
This comment has been minimized.
|
@kvark So the PR is complete! Commenting here, as requested. |
This comment has been minimized.
This comment has been minimized.
|
|
ebkalderon commentedApr 21, 2017
•
edited
Added
serializefeature togfx_appandgfx_core, courtesy ofdraw_state0.7.0 (fixes #1229)Copy{Buffer,BufferTexture,TextureBuffer}ResulttypesChanged
#[derive]statementsEqimplementation to#[derive]instead#[derive(Debug)]gfxis now up to 0.15.0)Fixed
CopyErrorandCopy{Buffer,BufferTexture,TextureBuffer}Resulttypes fromgfxCC @kvark