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

Improve locking safety for Registry #32

Merged
merged 2 commits into from
Dec 2, 2018
Merged

Improve locking safety for Registry #32

merged 2 commits into from
Dec 2, 2018

Conversation

kvark
Copy link
Member

@kvark kvark commented Nov 27, 2018

This isn't ideal: we shouldn't be mutably locking anything for adding/removing objects in local path. But at least it makes it safe, for now.

@kvark kvark requested a review from grovesNL November 27, 2018 16:08
@kvark
Copy link
Member Author

kvark commented Nov 27, 2018

To clarify, even though parts of this PR are to be scrapped, at least the change of lock() -> read() + write() will likely to stay.

Copy link
Collaborator

@grovesNL grovesNL left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

Agreed, it would be good to fix local.

@@ -10,4 +10,5 @@ authors = [
default = []

[dependencies]
cbindgen = { git = "https://github.com/eqrion/cbindgen.git" }
#cbindgen = "0.6.7"
cbindgen = { git = "https://github.com/eqrion/cbindgen" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could also use my branch for now if we're blocked by the header changes

@@ -7,7 +7,6 @@ use hal;


bitflags! {
#[repr(transparent)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume this is temporary?

Copy link
Member Author

Choose a reason for hiding this comment

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

accidental...


pub struct Items<T> {
next_id: Id,
next_id: u32,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why Id -> u32 here?

Copy link
Member Author

Choose a reason for hiding this comment

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

refactor artifact :)

@@ -35,11 +32,11 @@ impl<T> super::Items<T> for Items<T> {
id
}

fn get(&self, id: Id) -> super::Item<T> {
fn get(&self, id: Id) -> & T {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: space

@kvark
Copy link
Member Author

kvark commented Dec 2, 2018

Thanks for the review! All the concerns should be addressed now.
bors r=grovesNL

bors bot added a commit that referenced this pull request Dec 2, 2018
32: Improve locking safety for Registry r=grovesNL a=kvark

This isn't ideal: we shouldn't be mutably locking anything for adding/removing objects in `local` path. But at least it makes it safe, for now.

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
@bors
Copy link
Contributor

bors bot commented Dec 2, 2018

Build succeeded

@bors bors bot merged commit f4bb190 into gfx-rs:master Dec 2, 2018
@kvark kvark deleted the registry branch December 2, 2018 21:08
mitchmindtree pushed a commit to mitchmindtree/wgpu that referenced this pull request Feb 23, 2020
32: Add conversion matrix from OpenGL to wgpu r=kvark a=dragly

The matrices in the examples are given in an OpenGL-like coordinate system,
while a Vulkan-like coordinate system is used by wgpu. This was previously
partially corrected in the shader and by flipping the up axis of the camera,
but left the x-axis mirrored in the final result.

This change adds a conversion matrix to framework.rs that can be used
to convert from OpenGL to wgpu. This also allows us to set the
winding-order to counter-clockwise, which matches the ordering in the data.

Co-authored-by: Svenn-Arne Dragly <dragly@cognite.com>
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
kvark added a commit to kvark/wgpu that referenced this pull request Jun 3, 2021
32: Add conversion matrix from OpenGL to wgpu r=kvark a=dragly

The matrices in the examples are given in an OpenGL-like coordinate system,
while a Vulkan-like coordinate system is used by wgpu. This was previously
partially corrected in the shader and by flipping the up axis of the camera,
but left the x-axis mirrored in the final result.

This change adds a conversion matrix to framework.rs that can be used
to convert from OpenGL to wgpu. This also allows us to set the
winding-order to counter-clockwise, which matches the ordering in the data.

Co-authored-by: Svenn-Arne Dragly <dragly@cognite.com>
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants