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

[WIP, alpha] hal #463

Closed
wants to merge 1 commit into
from

Conversation

@omni-viral
Member

omni-viral commented Oct 27, 2017

#Roadmap.

  • Memory manager
  • Framegraph
  • Initialization
  • Queue orchestration
  • Vertices 2.0
  • Meshes
  • Textures
  • Uniform caches
  • Descriptor pools
  • Camera
  • Basic lighting
  • Flat pass
  • Shaded pass
  • PBR pass
  • Rending system. Halfway there

What's left:

  • Move some code to small PR to be merged earlier.
  • Replace semaphores with other synchronization methods.
  • Fix examples
  • Text rendering.

This change is Reviewable

@torkleyy

A few comments, it's a bit hard to review since you can't see what the actual changes are. I'm gonna clone the branch myself later and create a diff so I can review it better.

amethyst_renderer_new/Cargo.toml
+repository = "https://github.com/amethyst/amethyst"
+
+readme = "README.md"
+license = "MIT OR Apache-2.0"

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

MIT/Apache-2.0

@torkleyy

torkleyy Oct 27, 2017

Member

MIT/Apache-2.0

amethyst_renderer_new/src/back.rs
@@ -0,0 +1,39 @@
+
+#[cfg(feature = "metal")]

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

Shouldn't we at some point allow to dynamically choose the backend? I think for an actual game it's preferable to have one binary which supports all the backends.

@torkleyy

torkleyy Oct 27, 2017

Member

Shouldn't we at some point allow to dynamically choose the backend? I think for an actual game it's preferable to have one binary which supports all the backends.

This comment has been minimized.

@omni-viral

omni-viral Oct 27, 2017

Member

I'll think about it

@omni-viral

omni-viral Oct 27, 2017

Member

I'll think about it

amethyst_renderer_new/src/memory.rs
+
+use back::*;
+
+error_chain! {

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

👍 👍 I scanned the error_chain! source today and I think it's something I want to have in Amethyst.

@torkleyy

torkleyy Oct 27, 2017

Member

👍 👍 I scanned the error_chain! source today and I think it's something I want to have in Amethyst.

amethyst_renderer_new/src/memory.rs
+}
+
+
+/// This allocator is do dumb it can't even free memory

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

maybe "is so dumb"?

@torkleyy

torkleyy Oct 27, 2017

Member

maybe "is so dumb"?

This comment has been minimized.

@omni-viral

omni-viral Oct 27, 2017

Member

correct!

@omni-viral

omni-viral Oct 27, 2017

Member

correct!

amethyst_renderer_new/src/memory.rs
+impl DumbAllocator {
+ pub fn new() -> Self {
+ DumbAllocator {
+ granularity: 268_435_456, // 256 MB

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

Maybe 256 * 1024 * 1024 is better here?

@torkleyy

torkleyy Oct 27, 2017

Member

Maybe 256 * 1024 * 1024 is better here?

amethyst_renderer_new/rustfmt.toml
@@ -0,0 +1,2 @@
+reorder_imported_names = true
+take_source_hints = true

This comment has been minimized.

@Rhuagh

Rhuagh Oct 27, 2017

Member

You can remove this file, the base config for the workspace is applied

@Rhuagh

Rhuagh Oct 27, 2017

Member

You can remove this file, the base config for the workspace is applied

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Oct 27, 2017

Member

I'll make it easier to view changes.

Member

omni-viral commented Oct 27, 2017

I'll make it easier to view changes.

amethyst_renderer/Cargo.toml
categories = ["rendering", "rendering::engine"]
-documentation = "https://www.amethyst.rs/doc/master/amethyst_renderer/"
+documentation = "https://docs.rs/amethyst_renderer/0.1.0/amethyst_renderer/"

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

Is it a good thing to change this? Especially locking the version isn't a good thing IMO.

@torkleyy

torkleyy Oct 27, 2017

Member

Is it a good thing to change this? Especially locking the version isn't a good thing IMO.

This comment has been minimized.

@omni-viral

omni-viral Oct 27, 2017

Member

Old link leads to 404

@omni-viral

omni-viral Oct 27, 2017

Member

Old link leads to 404

This comment has been minimized.

@omni-viral

omni-viral Oct 27, 2017

Member

I think https://docs.rs/amethyst_renderer will be ideal. It will redirect to newest version automatically

@omni-viral

omni-viral Oct 27, 2017

Member

I think https://docs.rs/amethyst_renderer will be ideal. It will redirect to newest version automatically

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

I think the main crate has the correct link

@torkleyy

torkleyy Oct 27, 2017

Member

I think the main crate has the correct link

amethyst_renderer/src/lib.rs
-
-pub mod error;
+pub mod cam;
+pub mod mesh;

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

Why are you removing all my imports? Could we please leave the crate structure flat?

@torkleyy

torkleyy Oct 27, 2017

Member

Why are you removing all my imports? Could we please leave the crate structure flat?

This comment has been minimized.

@omni-viral

omni-viral Oct 27, 2017

Member

This file was written from scratch. I'll add everything required later.

@omni-viral

omni-viral Oct 27, 2017

Member

This file was written from scratch. I'll add everything required later.

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

Okay. Please just make the modules private and reexport everything if that's possible.

@torkleyy

torkleyy Oct 27, 2017

Member

Okay. Please just make the modules private and reexport everything if that's possible.

amethyst_renderer/src/memory.rs
+ }
+}
+
+impl From<OutOfMemory> for Error {

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

Shouldn't this use links in the error-chain macro?

@torkleyy

torkleyy Oct 27, 2017

Member

Shouldn't this use links in the error-chain macro?

This comment has been minimized.

@omni-viral

omni-viral Oct 27, 2017

Member

OutOfMemory isn't Error
links are for other error-chains. For non-chain errors there is foreign_links. But it still required to implement Error

@omni-viral

omni-viral Oct 27, 2017

Member

OutOfMemory isn't Error
links are for other error-chains. For non-chain errors there is foreign_links. But it still required to implement Error

This comment has been minimized.

@torkleyy

torkleyy Oct 27, 2017

Member

And OutOfMemory doesn't implement Error?

@torkleyy

torkleyy Oct 27, 2017

Member

And OutOfMemory doesn't implement Error?

This comment has been minimized.

@omni-viral

omni-viral Oct 27, 2017

Member

Yeap

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Oct 28, 2017

Member

It would be really nice if you could just change what's absolutely necessary, because I don't want to end up with a renderer rewrite 2.0 that rewrites the whole engine (and blocks everything else). If there are things you need to change which don't have anything to do with the internals of the renderer crate, please create another PR if possible.

Member

torkleyy commented Oct 28, 2017

It would be really nice if you could just change what's absolutely necessary, because I don't want to end up with a renderer rewrite 2.0 that rewrites the whole engine (and blocks everything else). If there are things you need to change which don't have anything to do with the internals of the renderer crate, please create another PR if possible.

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Oct 28, 2017

Member

I think the renderer is gonna be mostly rewritten, because hal is such a big change it's kind of required.

Member

Rhuagh commented Oct 28, 2017

I think the renderer is gonna be mostly rewritten, because hal is such a big change it's kind of required.

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Oct 28, 2017

Member

True, but if you had seen the previous renderer rewrite you'd know what I mean. It did change the whole crate, not just the renderer.

Member

torkleyy commented Oct 28, 2017

True, but if you had seen the previous renderer rewrite you'd know what I mean. It did change the whole crate, not just the renderer.

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Oct 28, 2017

Member

Oh I saw, and shuddered :)

Member

Rhuagh commented Oct 28, 2017

Oh I saw, and shuddered :)

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Oct 28, 2017

Member

@torkleyy I try to make render API to look mostly the same.
And I'm going to simplify things where possible 😄
All sophisticated unsafe magic will be hidden inside renderer.

Member

omni-viral commented Oct 28, 2017

@torkleyy I try to make render API to look mostly the same.
And I'm going to simplify things where possible 😄
All sophisticated unsafe magic will be hidden inside renderer.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 28, 2017

Member

This one probably won't be as bad because of how well we've separated out our crates. The last renderer rewrite was functionally a rewrite of the whole project, this one isn't.

Member

Xaeroxe commented Oct 28, 2017

This one probably won't be as bad because of how well we've separated out our crates. The last renderer rewrite was functionally a rewrite of the whole project, this one isn't.

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 11, 2017

Member

I'm really happy to see this PR making progress, keep up the good work @omni-viral!

Member

torkleyy commented Nov 11, 2017

I'm really happy to see this PR making progress, keep up the good work @omni-viral!

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 21, 2017

Member

THIS IS AWESOME!!

Member

torkleyy commented Nov 21, 2017

THIS IS AWESOME!!

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 21, 2017

Member

I'm very confident I can review this in December, in case you didn't already merge it then.

Member

torkleyy commented Nov 21, 2017

I'm very confident I can review this in December, in case you didn't already merge it then.

@Xaeroxe

I like it a lot! Much simplified. A large PR mandates a large review, so here's 19 review comments for you :P

amethyst_renderer_new/src/graph/pass.rs
+//! Pass tells renderer how to convert inputs to image.
+//!
+//! # Definition
+//! Pass - is a box which get some:

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

Might be better to use:

Pass is a trait that takes these inputs
...
...
and provides these outputs:
...
...
@Xaeroxe

Xaeroxe Nov 22, 2017

Member

Might be better to use:

Pass is a trait that takes these inputs
...
...
and provides these outputs:
...
...
amethyst_renderer_new/src/graph/pass.rs
+//! * Push constants
+//! * Outputs
+//! * Attachments
+//! * Results of queries (Let's forget about it for now)

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

Forget about what? I'm not clear what's being said here.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

Forget about what? I'm not clear what's being said here.

This comment has been minimized.

@omni-viral

omni-viral Nov 23, 2017

Member

About queries

@omni-viral

omni-viral Nov 23, 2017

Member

About queries

amethyst_renderer_new/src/graph/pass.rs
+//!
+//! But it gets executed on the GPU.
+//! So instead of writing it as a function and calling with arguments needed
+//! we have to record commands into buffers and send them to the GPU.

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

This isn't 100% true as some passes like UI are pretty CPU driven (out of necessity). I think a more accurate way to describe this might be

The pass prepares and sends data to GPU shader buffers, the shaders will then process the data.
@Xaeroxe

Xaeroxe Nov 22, 2017

Member

This isn't 100% true as some passes like UI are pretty CPU driven (out of necessity). I think a more accurate way to describe this might be

The pass prepares and sends data to GPU shader buffers, the shaders will then process the data.

This comment has been minimized.

@omni-viral

omni-viral Nov 30, 2017

Member

Shaders are only part of pipeline.

@omni-viral

omni-viral Nov 30, 2017

Member

Shaders are only part of pipeline.

amethyst_renderer_new/src/graph/pass.rs
+//! So instead of writing it as a function and calling with arguments needed
+//! we have to record commands into buffers and send them to the GPU.
+//!
+//! We want a way to define a box which will record all necessarry commands in declarative fasion.

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

*fashion.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

*fashion.

amethyst_renderer_new/src/graph/pass.rs
+//!
+//! We want a way to define a box which will record all necessarry commands in declarative fasion.
+//! In order to feed this box with data we also need define `World -> [Input]` conversion
+//! (in declarative fasion where possible).

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

*fashion

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

*fashion

amethyst_renderer_new/src/staging.rs
+
+use back::*;
+
+pub enum StagingBuffer {

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

What's this for? The line bringing this module in is commented out so should we just get rid of this file?

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

What's this for? The line bringing this module in is commented out so should we just get rid of this file?

This comment has been minimized.

@omni-viral

omni-viral Nov 23, 2017

Member

It's under construction 😄

@omni-viral

omni-viral Nov 23, 2017

Member

It's under construction 😄

amethyst_renderer_new/src/vertex.rs
+}
+unsafe impl Pod for Color {}
+impl Attribute for Color {
+ const NAME: &'static str = "1_color";

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

why not "color"?

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

why not "color"?

This comment has been minimized.

@omni-viral

omni-viral Nov 23, 2017

Member

Attribute values (name + format) should be in strict order. Forcing it with name prefix was fast fix. It'll go away.

@omni-viral

omni-viral Nov 23, 2017

Member

Attribute values (name + format) should be in strict order. Forcing it with name prefix was fast fix. It'll go away.

This comment has been minimized.

@omni-viral

omni-viral Nov 23, 2017

Member

The order is Position -> Color -> Normal -> Tangent -> TexCoord.
Buffers can only contain those attributes in sorted order. And Mesh has to contain Buffers in sorted order. Why? To bind mesh for O(n + k) insted of O(n*k).

@omni-viral

omni-viral Nov 23, 2017

Member

The order is Position -> Color -> Normal -> Tangent -> TexCoord.
Buffers can only contain those attributes in sorted order. And Mesh has to contain Buffers in sorted order. Why? To bind mesh for O(n + k) insted of O(n*k).

This comment has been minimized.

@torkleyy

torkleyy Nov 23, 2017

Member

Then maybe it would be better to have a separate constant for the order?

@torkleyy

torkleyy Nov 23, 2017

Member

Then maybe it would be better to have a separate constant for the order?

This comment has been minimized.

@omni-viral

omni-viral Nov 23, 2017

Member

@torkleyy Correct. Prefixing names is for fast-fixing

@omni-viral

omni-viral Nov 23, 2017

Member

@torkleyy Correct. Prefixing names is for fast-fixing

amethyst_renderer_new/src/vertex.rs
+}
+unsafe impl Pod for Normal {}
+impl Attribute for Normal {
+ const NAME: &'static str = "2_normal";

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

why not "normal"?

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

why not "normal"?

amethyst_renderer_new/src/vertex.rs
+}
+unsafe impl Pod for Tangent {}
+impl Attribute for Tangent {
+ const NAME: &'static str = "3_tangent";

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

Same as above

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

Same as above

amethyst_renderer_new/src/vertex.rs
+}
+unsafe impl Pod for TexCoord {}
+impl Attribute for TexCoord {
+ const NAME: &'static str = "4_tex_coord";

This comment has been minimized.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

Same as above.

@Xaeroxe

Xaeroxe Nov 22, 2017

Member

Same as above.

amethyst_renderer_new/src/graph/pass.rs
+ /// Reflects [`Pass::draw`] function
+ ///
+ /// [`Pass::draw`]: trait.Pass.html#tymethod.draw
+ fn draw<'a>(&mut self, cbuf: &mut B::CommandBuffer, world: &'a World);

This comment has been minimized.

@torkleyy

torkleyy Nov 23, 2017

Member

Why have a lifetime here?

@torkleyy

torkleyy Nov 23, 2017

Member

Why have a lifetime here?

This comment has been minimized.

@omni-viral

omni-viral Nov 25, 2017

Member

No reason

@omni-viral

omni-viral Nov 25, 2017

Member

No reason

@kvark kvark self-assigned this Nov 26, 2017

@omni-viral omni-viral changed the title from [WIP, early, pre-alpha] hal to [WIP, alpha] hal Nov 28, 2017

@msiglreith

Wheew, that's quite a large PR. Just a few notes from my side regarding some internal stuff. I haven't looked trough the whole code.

amethyst_renderer_new/src/graph/mod.rs
+ swapchain.present(queue, &presents);
+
+ // Wait defice to finish the work
+ device.wait_for_fences(&[finish], WaitFor::All, !0);

This comment has been minimized.

@msiglreith

msiglreith Nov 28, 2017

Contributor

There should be multiple fences to reduce waiting time on the GPU. Currently it's CPU -> (submit) -> GPU -> (wait) -> CPU. This requires multiple command buffers per frame, etc. The main point is to reduce the time the CPU waits on the GPU to finish processing the currently requested frame. That's a pretty crucial design point imo to achieve good performance.

@msiglreith

msiglreith Nov 28, 2017

Contributor

There should be multiple fences to reduce waiting time on the GPU. Currently it's CPU -> (submit) -> GPU -> (wait) -> CPU. This requires multiple command buffers per frame, etc. The main point is to reduce the time the CPU waits on the GPU to finish processing the currently requested frame. That's a pretty crucial design point imo to achieve good performance.

This comment has been minimized.

@omni-viral

omni-viral Nov 28, 2017

Member

What pattern of using fences I should follow?
I was thinking of waiting for fence before rendering next frame instead of after.
I'm not sure if starting rendering next frame before previous is complete is a good idea.

@omni-viral

omni-viral Nov 28, 2017

Member

What pattern of using fences I should follow?
I was thinking of waiting for fence before rendering next frame instead of after.
I'm not sure if starting rendering next frame before previous is complete is a good idea.

This comment has been minimized.

@msiglreith

msiglreith Nov 28, 2017

Contributor

gpu
I made a small figure which visualizes the issue, I think. The current implementation introduces a stall between GPU-CPU due to the wait for the fence. The general proposal is to buffer a few frames (basically following double/tripple buffering of the swapchain) to give the GPU time to catch up and reducing the waiting time on the fence. In the figure I used frame3 waits unitl frame0 has finished on the GPU and can then re-use data (in particular, command pools, query buffers, etc.) of frame0. The drawback here is that this makes synchronization a bit trickier as fences ensure that objects can be safely accessed again. So, each frame in the chain requires an own command pool for example.

@msiglreith

msiglreith Nov 28, 2017

Contributor

gpu
I made a small figure which visualizes the issue, I think. The current implementation introduces a stall between GPU-CPU due to the wait for the fence. The general proposal is to buffer a few frames (basically following double/tripple buffering of the swapchain) to give the GPU time to catch up and reducing the waiting time on the fence. In the figure I used frame3 waits unitl frame0 has finished on the GPU and can then re-use data (in particular, command pools, query buffers, etc.) of frame0. The drawback here is that this makes synchronization a bit trickier as fences ensure that objects can be safely accessed again. So, each frame in the chain requires an own command pool for example.

amethyst_renderer_new/src/graph/build.rs
+ }
+ }
+
+ pub fn build(

This comment has been minimized.

@msiglreith

msiglreith Nov 28, 2017

Contributor

The definition of a pass seems quite focused on Vulkan's renderpass concept. If I understand it correctly a pass is defined here as one renderpass with one subpass and pipeline. I would advise a lower level implementation which focuses purely on scheduling tasks and reducing the amount of synchronization handling for users writing rendering code. It might be tricky here to extend the current implementation to support compute and further optimizations.

@msiglreith

msiglreith Nov 28, 2017

Contributor

The definition of a pass seems quite focused on Vulkan's renderpass concept. If I understand it correctly a pass is defined here as one renderpass with one subpass and pipeline. I would advise a lower level implementation which focuses purely on scheduling tasks and reducing the amount of synchronization handling for users writing rendering code. It might be tricky here to extend the current implementation to support compute and further optimizations.

This comment has been minimized.

@omni-viral

omni-viral Nov 28, 2017

Member

The concept of Pass is quite abstract here. It's a function-like thing that can have Behavior-like (from FRP) arguments (attachments and buffers) and return Behavior-like result.
What you see in this method is mapping of general concept to RenderPasses.
It's tricky to implement this so I started with simples unoptimized solution. I'll try to make it faster in next iterations.

@omni-viral

omni-viral Nov 28, 2017

Member

The concept of Pass is quite abstract here. It's a function-like thing that can have Behavior-like (from FRP) arguments (attachments and buffers) and return Behavior-like result.
What you see in this method is mapping of general concept to RenderPasses.
It's tricky to implement this so I started with simples unoptimized solution. I'll try to make it faster in next iterations.

amethyst_renderer_new/src/graph/build.rs
+ let descriptor_set_layout = device.create_descriptor_set_layout(pass.bindings());
+
+ // Create `PipelineLayout` from single `DescriptorSetLayout`
+ let pipeline_layout = device.create_pipeline_layout(&[&descriptor_set_layout]);

This comment has been minimized.

@msiglreith

msiglreith Nov 28, 2017

Contributor

Pipeline layouts and pipelines are not necessarily strongly-coupled. A pipeline layout can be compatible with multiple pipelines. Switching (non-compatible) pipeline layouts introduces costs due to rebinding descriptor sets and push constants.

@msiglreith

msiglreith Nov 28, 2017

Contributor

Pipeline layouts and pipelines are not necessarily strongly-coupled. A pipeline layout can be compatible with multiple pipelines. Switching (non-compatible) pipeline layouts introduces costs due to rebinding descriptor sets and push constants.

This comment has been minimized.

@omni-viral

omni-viral Nov 28, 2017

Member

But how often different pipelines can share pipeline layout?
Doesn't pipeline layout defines bindigs interface of shaders?
How often different shaders share bindings interface?

@omni-viral

omni-viral Nov 28, 2017

Member

But how often different pipelines can share pipeline layout?
Doesn't pipeline layout defines bindigs interface of shaders?
How often different shaders share bindings interface?

This comment has been minimized.

@msiglreith

msiglreith Nov 28, 2017

Contributor

Yes, it defines the interface but can be a superset (some sort of 'uberlayout'). There is always a tradeoff between both approaches: minimal pipeline layout vs 'uberlayout'. Which to choose depends on the available pipelines. It might be interesting when having a lot of similar materials with lightly varying pipelines. I would say that expecially latest gen architectures can live with only a few pipeline layouts by using large descriptor sets, only bound once, but I'm not an expert.

@msiglreith

msiglreith Nov 28, 2017

Contributor

Yes, it defines the interface but can be a superset (some sort of 'uberlayout'). There is always a tradeoff between both approaches: minimal pipeline layout vs 'uberlayout'. Which to choose depends on the available pipelines. It might be interesting when having a lot of similar materials with lightly varying pipelines. I would say that expecially latest gen architectures can live with only a few pipeline layouts by using large descriptor sets, only bound once, but I'm not an expert.

This comment has been minimized.

@omni-viral

omni-viral Nov 28, 2017

Member

This makes sense but I'd like to hide such details from user. So I need to magically create super-layout for few consecutive passes.

@omni-viral

omni-viral Nov 28, 2017

Member

This makes sense but I'd like to hide such details from user. So I need to magically create super-layout for few consecutive passes.

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 29, 2017

Member

Reviewed 4 of 17 files at r1, 5 of 18 files at r2, 2 of 20 files at r3, 1 of 6 files at r5, 2 of 24 files at r6.
Review status: 13 of 34 files reviewed at latest revision, 34 unresolved discussions, some commit checks failed.


amethyst_renderer_new/Cargo.toml, line 15 at r7 (raw file):

readme = "README.md"
license = "MIT OR Apache-2.0"

Should be "MIT/Apache-2.0"


amethyst_renderer_new/Cargo.toml, line 27 at r7 (raw file):

[dependencies]
amethyst_core = { path = "../amethyst_core" }

Don't forget to specify versions here.


amethyst_renderer_new/rustfmt.toml, line 1 at r7 (raw file):

reorder_imported_names = true

Do we really need one config per crate?


amethyst_renderer_new/src/relevant.rs, line 2 at r7 (raw file):

/// Type that can't be silently dropped.

Types don't get dropped.


amethyst_renderer_new/src/relevant.rs, line 4 at r7 (raw file):

/// Type that can't be silently dropped.
/// If structure has field with type `Relevant`
/// than this structure can't be silently dropped either.

"than" should be "then", but I'd probably rewrite the sentence as "If a structure has a Disposable value, it can't be automatically dropped either."


amethyst_renderer_new/src/relevant.rs, line 12 at r7 (raw file):

///
#[derive(Clone, Debug, PartialOrd, PartialEq, Ord, Eq, Hash)]
pub struct Relevant;

Rename to Disposable?


amethyst_renderer_new/src/relevant.rs, line 23 at r7 (raw file):

impl Drop for Relevant {
    fn drop(&mut self) {
        panic!("This type can't be dropped")

This really isn't something I want the user to deal with, I hope we can keep this fully internal.


amethyst_renderer_new/src/utils.rs, line 4 at r7 (raw file):

#[inline(always)]
pub fn is_slice_sorted<T>(slice: &[T]) -> bool

This seems very expensive for what it's doing. I don't know where it's used, but if it's necessary I'd recommend to just check if x_n < x_n+1 holds for every n from 0 to len - 2.


amethyst_renderer_new/src/utils.rs, line 14 at r7 (raw file):

#[inline(always)]
pub fn is_slice_sorted_by_key<T, K, F>(slice: &[T], f: F) -> bool

Same as above.


examples/hal/hal.vert, line 2 at r7 (raw file):

#version 450 core
#extension GL_ARB_separate_shader_objects : enable

Is this something we should recommend for all shaders until there is a good shading solution (cross-API, eventually in Rust) available?


examples/hal/main.rs, line 37 at r7 (raw file):

use renderer::vertex::PosColor;

fn main() {

How much of this low-level code will the user need to set up a basic game in the final iteration?


Comments from Reviewable

Member

torkleyy commented Nov 29, 2017

Reviewed 4 of 17 files at r1, 5 of 18 files at r2, 2 of 20 files at r3, 1 of 6 files at r5, 2 of 24 files at r6.
Review status: 13 of 34 files reviewed at latest revision, 34 unresolved discussions, some commit checks failed.


amethyst_renderer_new/Cargo.toml, line 15 at r7 (raw file):

readme = "README.md"
license = "MIT OR Apache-2.0"

Should be "MIT/Apache-2.0"


amethyst_renderer_new/Cargo.toml, line 27 at r7 (raw file):

[dependencies]
amethyst_core = { path = "../amethyst_core" }

Don't forget to specify versions here.


amethyst_renderer_new/rustfmt.toml, line 1 at r7 (raw file):

reorder_imported_names = true

Do we really need one config per crate?


amethyst_renderer_new/src/relevant.rs, line 2 at r7 (raw file):

/// Type that can't be silently dropped.

Types don't get dropped.


amethyst_renderer_new/src/relevant.rs, line 4 at r7 (raw file):

/// Type that can't be silently dropped.
/// If structure has field with type `Relevant`
/// than this structure can't be silently dropped either.

"than" should be "then", but I'd probably rewrite the sentence as "If a structure has a Disposable value, it can't be automatically dropped either."


amethyst_renderer_new/src/relevant.rs, line 12 at r7 (raw file):

///
#[derive(Clone, Debug, PartialOrd, PartialEq, Ord, Eq, Hash)]
pub struct Relevant;

Rename to Disposable?


amethyst_renderer_new/src/relevant.rs, line 23 at r7 (raw file):

impl Drop for Relevant {
    fn drop(&mut self) {
        panic!("This type can't be dropped")

This really isn't something I want the user to deal with, I hope we can keep this fully internal.


amethyst_renderer_new/src/utils.rs, line 4 at r7 (raw file):

#[inline(always)]
pub fn is_slice_sorted<T>(slice: &[T]) -> bool

This seems very expensive for what it's doing. I don't know where it's used, but if it's necessary I'd recommend to just check if x_n < x_n+1 holds for every n from 0 to len - 2.


amethyst_renderer_new/src/utils.rs, line 14 at r7 (raw file):

#[inline(always)]
pub fn is_slice_sorted_by_key<T, K, F>(slice: &[T], f: F) -> bool

Same as above.


examples/hal/hal.vert, line 2 at r7 (raw file):

#version 450 core
#extension GL_ARB_separate_shader_objects : enable

Is this something we should recommend for all shaders until there is a good shading solution (cross-API, eventually in Rust) available?


examples/hal/main.rs, line 37 at r7 (raw file):

use renderer::vertex::PosColor;

fn main() {

How much of this low-level code will the user need to set up a basic game in the final iteration?


Comments from Reviewable

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 29, 2017

Member

So I've reviewed the easy files now so that I can concentrate on the other stuff. Is there some strategy you'd recommend for reviewing? Or some high-level overview that would make it easier?

FYI, I reviewed on https://reviewable.io, so it's probably easier to respond there.

Member

torkleyy commented Nov 29, 2017

So I've reviewed the easy files now so that I can concentrate on the other stuff. Is there some strategy you'd recommend for reviewing? Or some high-level overview that would make it easier?

FYI, I reviewed on https://reviewable.io, so it's probably easier to respond there.

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Nov 29, 2017

Member

Review status: 13 of 34 files reviewed at latest revision, 34 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/utils.rs, line 4 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This seems very expensive for what it's doing. I don't know where it's used, but if it's necessary I'd recommend to just check if x_n < x_n+1 holds for every n from 0 to len - 2.

This is very expensive of large N. But used only in debug_assert! for really small slices.
But I agree that it should be optimized to be O(n).


examples/hal/hal.vert, line 2 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Is this something we should recommend for all shaders until there is a good shading solution (cross-API, eventually in Rust) available?

I have no opinion on that yet.


examples/hal/main.rs, line 37 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

How much of this low-level code will the user need to set up a basic game in the final iteration?

None.
The user will fill configuration structure (or even deserialize it) and call build.


Comments from Reviewable

Member

omni-viral commented Nov 29, 2017

Review status: 13 of 34 files reviewed at latest revision, 34 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/utils.rs, line 4 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This seems very expensive for what it's doing. I don't know where it's used, but if it's necessary I'd recommend to just check if x_n < x_n+1 holds for every n from 0 to len - 2.

This is very expensive of large N. But used only in debug_assert! for really small slices.
But I agree that it should be optimized to be O(n).


examples/hal/hal.vert, line 2 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Is this something we should recommend for all shaders until there is a good shading solution (cross-API, eventually in Rust) available?

I have no opinion on that yet.


examples/hal/main.rs, line 37 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

How much of this low-level code will the user need to set up a basic game in the final iteration?

None.
The user will fill configuration structure (or even deserialize it) and call build.


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Nov 29, 2017

Member

https://reviewable.io is so slow on my laptop.

Member

omni-viral commented Nov 29, 2017

https://reviewable.io is so slow on my laptop.

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Nov 29, 2017

Member

Review status: 13 of 34 files reviewed at latest revision, 34 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/relevant.rs, line 12 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Rename to Disposable?

The name comes from here


amethyst_renderer_new/src/relevant.rs, line 23 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This really isn't something I want the user to deal with, I hope we can keep this fully internal.

All higher-level types with Relevant values inside will do magic tricks in their Drop implementation to make user's life easier. But at cost in runtime.
For example Mesh can send Buffers back to the allocator over shared mpsc if user doesn't do that manually.
It adds some overhead but leaves user with a choice.


Comments from Reviewable

Member

omni-viral commented Nov 29, 2017

Review status: 13 of 34 files reviewed at latest revision, 34 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/relevant.rs, line 12 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Rename to Disposable?

The name comes from here


amethyst_renderer_new/src/relevant.rs, line 23 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This really isn't something I want the user to deal with, I hope we can keep this fully internal.

All higher-level types with Relevant values inside will do magic tricks in their Drop implementation to make user's life easier. But at cost in runtime.
For example Mesh can send Buffers back to the allocator over shared mpsc if user doesn't do that manually.
It adds some overhead but leaves user with a choice.


Comments from Reviewable

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 29, 2017

Member

@omni-viral It's slow for you? On my laptop it's faster than GH. For such a large PR you should just ensure you're using single-file mode.

Member

torkleyy commented Nov 29, 2017

@omni-viral It's slow for you? On my laptop it's faster than GH. For such a large PR you should just ensure you're using single-file mode.

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 29, 2017

Member

Review status: 13 of 34 files reviewed at latest revision, 32 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/relevant.rs, line 12 at r7 (raw file):

Previously, omni-viral (Zakarum) wrote…

The name comes from here

At least the name isn't very obvious for me, but maybe it's more known to other people.


amethyst_renderer_new/src/graph/pass.rs, line 53 at r2 (raw file):

Previously, omni-viral (Zakarum) wrote…

It vice versa. I want all passes to be Debug to print messages inside the engine where I only have Box<AnyPass<B>>.
So AnyPass has to be Debug. But AnyPass is private trait. I can't bound types to it in public methods. Instead public methods has Pass bound and AnyPass is implemented for all Passes. But Pass needs Debug bound in order to implement AnyPass for all types that implements Pass.

Have no idea if someone could actually understand what I was trying to say here 😄

I did :)


Comments from Reviewable

Member

torkleyy commented Nov 29, 2017

Review status: 13 of 34 files reviewed at latest revision, 32 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/relevant.rs, line 12 at r7 (raw file):

Previously, omni-viral (Zakarum) wrote…

The name comes from here

At least the name isn't very obvious for me, but maybe it's more known to other people.


amethyst_renderer_new/src/graph/pass.rs, line 53 at r2 (raw file):

Previously, omni-viral (Zakarum) wrote…

It vice versa. I want all passes to be Debug to print messages inside the engine where I only have Box<AnyPass<B>>.
So AnyPass has to be Debug. But AnyPass is private trait. I can't bound types to it in public methods. Instead public methods has Pass bound and AnyPass is implemented for all Passes. But Pass needs Debug bound in order to implement AnyPass for all types that implements Pass.

Have no idea if someone could actually understand what I was trying to say here 😄

I did :)


Comments from Reviewable

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 29, 2017

Member

Reviewed 1 of 18 files at r2, 3 of 20 files at r3, 10 of 24 files at r6, 8 of 12 files at r7.
Review status: 30 of 34 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/epoch.rs, line 9 at r7 (raw file):

use relevant::Relevant;

/// Epoch identifier.

Missing usage example / overview.


amethyst_renderer_new/src/epoch.rs, line 109 at r7 (raw file):

    /// Make all new `Ec` from this to be valid
    /// until specifyed `Epoch` expired

specified


amethyst_renderer_new/src/epoch.rs, line 159 at r7 (raw file):

}

pub struct DeletionQueue<T> {

Missing docs


amethyst_renderer_new/src/hal.rs, line 132 at r7 (raw file):

        adapter: Adapter<B>,
    ) -> (B::Device, Factory<B>, CommandCenter<B>) {
        println!("Try adapter: {:?}", adapter.info);

Yet again, we should really set up logging.


amethyst_renderer_new/src/mesh.rs, line 25 at r7 (raw file):

    errors {
        Incompatible {
            description("Incompatible"),

I don't think that this is any more descriptive than the defaults.


amethyst_renderer_new/src/mesh.rs, line 562 at r7 (raw file):

                vertex.0.push((&self.vbufs[index].buffer, 0));
                last = index;
                assert!(vertex_count == None || vertex_count == Some(self.vbufs[index].len));

nit: should be is_none


amethyst_renderer_new/src/mesh.rs, line 566 at r7 (raw file):

            } else {
                // Can't bind
                return Err(ErrorKind::Incompatible.into());

Can't you use bail! here? Or is that for string errors only?


amethyst_renderer_new/src/shaders.rs, line 247 at r7 (raw file):

    use std::fs::File;
    use std::io::Read;
    let mut file = File::open(path).chain_err(|| {

Only allowing shaders to be stored as a file is too restrictive.


amethyst_renderer_new/src/memory/mod.rs, line 160 at r7 (raw file):

    /// Returns tag value.
    /// This is unsafe as the caller must ensure that
    /// memory was freed

This is unclear.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

    unsafe {
        forget(vec);
        Vec::from_raw_parts(p as *mut Y, (s * tsize) / ysize, (c * tsize) / ysize)

As far as I know, this is currently unspecified behavior in Rust. That means it works, but it's not guaranteed that it's supported by all Rust compilers in the future.


Comments from Reviewable

Member

torkleyy commented Nov 29, 2017

Reviewed 1 of 18 files at r2, 3 of 20 files at r3, 10 of 24 files at r6, 8 of 12 files at r7.
Review status: 30 of 34 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/epoch.rs, line 9 at r7 (raw file):

use relevant::Relevant;

/// Epoch identifier.

Missing usage example / overview.


amethyst_renderer_new/src/epoch.rs, line 109 at r7 (raw file):

    /// Make all new `Ec` from this to be valid
    /// until specifyed `Epoch` expired

specified


amethyst_renderer_new/src/epoch.rs, line 159 at r7 (raw file):

}

pub struct DeletionQueue<T> {

Missing docs


amethyst_renderer_new/src/hal.rs, line 132 at r7 (raw file):

        adapter: Adapter<B>,
    ) -> (B::Device, Factory<B>, CommandCenter<B>) {
        println!("Try adapter: {:?}", adapter.info);

Yet again, we should really set up logging.


amethyst_renderer_new/src/mesh.rs, line 25 at r7 (raw file):

    errors {
        Incompatible {
            description("Incompatible"),

I don't think that this is any more descriptive than the defaults.


amethyst_renderer_new/src/mesh.rs, line 562 at r7 (raw file):

                vertex.0.push((&self.vbufs[index].buffer, 0));
                last = index;
                assert!(vertex_count == None || vertex_count == Some(self.vbufs[index].len));

nit: should be is_none


amethyst_renderer_new/src/mesh.rs, line 566 at r7 (raw file):

            } else {
                // Can't bind
                return Err(ErrorKind::Incompatible.into());

Can't you use bail! here? Or is that for string errors only?


amethyst_renderer_new/src/shaders.rs, line 247 at r7 (raw file):

    use std::fs::File;
    use std::io::Read;
    let mut file = File::open(path).chain_err(|| {

Only allowing shaders to be stored as a file is too restrictive.


amethyst_renderer_new/src/memory/mod.rs, line 160 at r7 (raw file):

    /// Returns tag value.
    /// This is unsafe as the caller must ensure that
    /// memory was freed

This is unclear.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

    unsafe {
        forget(vec);
        Vec::from_raw_parts(p as *mut Y, (s * tsize) / ysize, (c * tsize) / ysize)

As far as I know, this is currently unspecified behavior in Rust. That means it works, but it's not guaranteed that it's supported by all Rust compilers in the future.


Comments from Reviewable

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 29, 2017

Member

@omni-viral What I've seen so far looks great, but it's lacking documentation both for important details and as overview.

Member

torkleyy commented Nov 29, 2017

@omni-viral What I've seen so far looks great, but it's lacking documentation both for important details and as overview.

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Nov 30, 2017

Member

lacking documentation

That's where I could use some help 😏

Member

omni-viral commented Nov 30, 2017

lacking documentation

That's where I could use some help 😏

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 30, 2017

Member

Thing is my own overview isn't complete yet, but it's a requirement for providing a good review.

Member

torkleyy commented Nov 30, 2017

Thing is my own overview isn't complete yet, but it's a requirement for providing a good review.

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Nov 30, 2017

Member

Review status: 13 of 35 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/mesh.rs, line 25 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

I don't think that this is any more descriptive than the defaults.

There are defaults? 😄


amethyst_renderer_new/src/mesh.rs, line 566 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Can't you use bail! here? Or is that for string errors only?

Can. Thanks!


amethyst_renderer_new/src/graph/pass.rs, line 53 at r2 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

I did :)

Phew 😄


amethyst_renderer_new/src/hal/build.rs, line 132 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Yet again, we should really set up logging.

But not in scope of this PR.
If logging will be setup before this PR gets merged I'd replace print-logging with proper one.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

As far as I know, this is currently unspecified behavior in Rust. That means it works, but it's not guaranteed that it's supported by all Rust compilers in the future.

I'm not sure how rustc can be changed so this will be broken.
If you are against this code you should also be against gfx_hal::memory::cast_slice.
Or your only concern is that it is Vec and it's totally OK for slices?
In that case I can replace Vec<T> with Box<[T]>


amethyst_renderer_new/rustfmt.toml, line 1 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Do we really need one config per crate?

Nope.


Comments from Reviewable

Member

omni-viral commented Nov 30, 2017

Review status: 13 of 35 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/mesh.rs, line 25 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

I don't think that this is any more descriptive than the defaults.

There are defaults? 😄


amethyst_renderer_new/src/mesh.rs, line 566 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Can't you use bail! here? Or is that for string errors only?

Can. Thanks!


amethyst_renderer_new/src/graph/pass.rs, line 53 at r2 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

I did :)

Phew 😄


amethyst_renderer_new/src/hal/build.rs, line 132 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Yet again, we should really set up logging.

But not in scope of this PR.
If logging will be setup before this PR gets merged I'd replace print-logging with proper one.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

As far as I know, this is currently unspecified behavior in Rust. That means it works, but it's not guaranteed that it's supported by all Rust compilers in the future.

I'm not sure how rustc can be changed so this will be broken.
If you are against this code you should also be against gfx_hal::memory::cast_slice.
Or your only concern is that it is Vec and it's totally OK for slices?
In that case I can replace Vec<T> with Box<[T]>


amethyst_renderer_new/rustfmt.toml, line 1 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Do we really need one config per crate?

Nope.


Comments from Reviewable

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Nov 30, 2017

Member

amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Previously, omni-viral (Zakarum) wrote…

I'm not sure how rustc can be changed so this will be broken.
If you are against this code you should also be against gfx_hal::memory::cast_slice.
Or your only concern is that it is Vec and it's totally OK for slices?
In that case I can replace Vec<T> with Box<[T]>

At the very least the cast_pod_vec function should be marked as unsafe, as this could cause wild behavior. Not all representations of Pod types are valid representations of other Pod types. I actually think this specific line is probably OK though as vectors are guaranteed to form contiguous data. This is effectively a mass transmute though, which is very unsafe.


Comments from Reviewable

Member

Xaeroxe commented Nov 30, 2017

amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Previously, omni-viral (Zakarum) wrote…

I'm not sure how rustc can be changed so this will be broken.
If you are against this code you should also be against gfx_hal::memory::cast_slice.
Or your only concern is that it is Vec and it's totally OK for slices?
In that case I can replace Vec<T> with Box<[T]>

At the very least the cast_pod_vec function should be marked as unsafe, as this could cause wild behavior. Not all representations of Pod types are valid representations of other Pod types. I actually think this specific line is probably OK though as vectors are guaranteed to form contiguous data. This is effectively a mass transmute though, which is very unsafe.


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Nov 30, 2017

Member

Review status: 12 of 35 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Not all representations of Pod types are valid representations of other Pod types

T: Pod means that any bit sequence of appropriate size is valid T


Comments from Reviewable

Member

omni-viral commented Nov 30, 2017

Review status: 12 of 35 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Not all representations of Pod types are valid representations of other Pod types

T: Pod means that any bit sequence of appropriate size is valid T


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Nov 30, 2017

Member

Review status: 12 of 35 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Previously, omni-viral (Zakarum) wrote…

Not all representations of Pod types are valid representations of other Pod types

T: Pod means that any bit sequence of appropriate size is valid T

And this function ensures size and alignment restriction also.
That's why I consider it safe.


Comments from Reviewable

Member

omni-viral commented Nov 30, 2017

Review status: 12 of 35 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Previously, omni-viral (Zakarum) wrote…

Not all representations of Pod types are valid representations of other Pod types

T: Pod means that any bit sequence of appropriate size is valid T

And this function ensures size and alignment restriction also.
That's why I consider it safe.


Comments from Reviewable

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 30, 2017

Member

Review status: 12 of 35 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

you should also be against

I guess I am.

I'm not sure how rustc can be changed so this will be broken.

This is not limited to rustc: e.g. GCC Rust could force strict aliasing.

I actually think this specific line is probably OK

Sorry, I don't think that helps.

That's why I consider it safe.

You'd be surprised how much undefined behavior there is in languages like C and some of them are still there for unsafe Rust code. And while this code currently works, it's not something one should rely on because it's unspecified.


Comments from Reviewable

Member

torkleyy commented Nov 30, 2017

Review status: 12 of 35 files reviewed at latest revision, 42 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

you should also be against

I guess I am.

I'm not sure how rustc can be changed so this will be broken.

This is not limited to rustc: e.g. GCC Rust could force strict aliasing.

I actually think this specific line is probably OK

Sorry, I don't think that helps.

That's why I consider it safe.

You'd be surprised how much undefined behavior there is in languages like C and some of them are still there for unsafe Rust code. And while this code currently works, it's not something one should rely on because it's unspecified.


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Nov 30, 2017

Member

Review status: 12 of 35 files reviewed at latest revision, 39 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

you should also be against

I guess I am.

I'm not sure how rustc can be changed so this will be broken.

This is not limited to rustc: e.g. GCC Rust could force strict aliasing.

I actually think this specific line is probably OK

Sorry, I don't think that helps.

That's why I consider it safe.

You'd be surprised how much undefined behavior there is in languages like C and some of them are still there for unsafe Rust code. And while this code currently works, it's not something one should rely on because it's unspecified.

IIRC strict aliasing rules can't hurt you here.
As this function don't dereference pointers. And there is no aliasing before and after it.

gfx_hal::memory::cast_slice is OK with strict aliasing as it used shared references.
So you can't write to one slice and wait that it will affect another.
To see effects from strict aliasing optimizations you'll need convert & into &mut (under unsafe). And there is no wonder you'll have UB.


Comments from Reviewable

Member

omni-viral commented Nov 30, 2017

Review status: 12 of 35 files reviewed at latest revision, 39 unresolved discussions, some commit checks failed.


amethyst_renderer_new/src/memory/mod.rs, line 273 at r7 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

you should also be against

I guess I am.

I'm not sure how rustc can be changed so this will be broken.

This is not limited to rustc: e.g. GCC Rust could force strict aliasing.

I actually think this specific line is probably OK

Sorry, I don't think that helps.

That's why I consider it safe.

You'd be surprised how much undefined behavior there is in languages like C and some of them are still there for unsafe Rust code. And while this code currently works, it's not something one should rely on because it's unspecified.

IIRC strict aliasing rules can't hurt you here.
As this function don't dereference pointers. And there is no aliasing before and after it.

gfx_hal::memory::cast_slice is OK with strict aliasing as it used shared references.
So you can't write to one slice and wait that it will affect another.
To see effects from strict aliasing optimizations you'll need convert & into &mut (under unsafe). And there is no wonder you'll have UB.


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Dec 12, 2017

Member

Review status: 73 of 80 files reviewed at latest revision, 79 unresolved discussions, some commit checks failed.


amethyst_renderer/src/epoch.rs, line 129 at r13 (raw file):

Previously, kvark (Dzmitry Malyshau) wrote…

"spcified"

Done.


amethyst_renderer/src/vertex.rs, line 357 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

missing tangent

Done.


amethyst_renderer/src/command/mod.rs, line 17 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

When can I have ComputeExecution? :)

Do you need it already? For now you can use GeneralExecution.


amethyst_renderer/src/command/mod.rs, line 93 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

span don't seem to exist in code below?

Outdated comments. Fixed.


amethyst_renderer/src/graph/build.rs, line 34 at r13 (raw file):

Previously, kvark (Dzmitry Malyshau) wrote…

the type is called XXXView (single) but it contains a slice of views?

Done.


amethyst_renderer/src/graph/mod.rs, line 307 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

I'm not sure what singnal is but it sounds like a lot of fun! ;)

There were also some witches. But I drove them away.
I need to install some spellchecker.


examples/hal/flat.rs, line 1 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

We may want to supply some simple passes inside the actual renderer crate for the poor users :)

I think we can supply them in main crate.
But I have no strong opinion on this.


examples/hal/main.rs, line 1 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

Shouldn't this example be inside the renderer crate?

Actually it may be removed when our existing examples will use hal.


src/lib.rs, line 76 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

Hmm?

Temporary solution 😄
I will uncomment it back once those modules will compile.


Comments from Reviewable

Member

omni-viral commented Dec 12, 2017

Review status: 73 of 80 files reviewed at latest revision, 79 unresolved discussions, some commit checks failed.


amethyst_renderer/src/epoch.rs, line 129 at r13 (raw file):

Previously, kvark (Dzmitry Malyshau) wrote…

"spcified"

Done.


amethyst_renderer/src/vertex.rs, line 357 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

missing tangent

Done.


amethyst_renderer/src/command/mod.rs, line 17 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

When can I have ComputeExecution? :)

Do you need it already? For now you can use GeneralExecution.


amethyst_renderer/src/command/mod.rs, line 93 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

span don't seem to exist in code below?

Outdated comments. Fixed.


amethyst_renderer/src/graph/build.rs, line 34 at r13 (raw file):

Previously, kvark (Dzmitry Malyshau) wrote…

the type is called XXXView (single) but it contains a slice of views?

Done.


amethyst_renderer/src/graph/mod.rs, line 307 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

I'm not sure what singnal is but it sounds like a lot of fun! ;)

There were also some witches. But I drove them away.
I need to install some spellchecker.


examples/hal/flat.rs, line 1 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

We may want to supply some simple passes inside the actual renderer crate for the poor users :)

I think we can supply them in main crate.
But I have no strong opinion on this.


examples/hal/main.rs, line 1 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

Shouldn't this example be inside the renderer crate?

Actually it may be removed when our existing examples will use hal.


src/lib.rs, line 76 at r15 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

Hmm?

Temporary solution 😄
I will uncomment it back once those modules will compile.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 12, 2017

Member

Review status: 73 of 80 files reviewed at latest revision, 73 unresolved discussions, some commit checks failed.


amethyst_renderer/src/cam.rs, line 87 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

What the benefit?

Guarantee we use the same version for core::Transform and for renderer.


amethyst_renderer/src/lib.rs, line 24 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

Either that or user will have to add backends as dependencies with correct versions.
If we will rexport only gfx_backend_XXX::Backend the user will have to import backend crate for doing platform specific stuff. Well, maybe the later is appropriate as if user write platform specific code he can import correct dependencies.

Yeah, I don't really understand the use case for having the backend crates reexported.


amethyst_renderer/src/mesh.rs, line 359 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

It may become handy if the origins of the mesh and collision shape (or anything else with origin) will be different.

Possibly, I just don't see it used very often


amethyst_renderer/src/renderer.rs, line 30 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

I's more like builder struct rather than config.

Hmm, ok. I just felt it should be kept close to the Window, because you can't pump events from winit without the Window.


amethyst_renderer/src/system.rs, line 1 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

I'm thinking of moving input and windowing out of renderer responsibility.

Yeah, that would be optimal, but that also means we need to move winit::Window out from the renderer.


amethyst_renderer/src/texture.rs, line 1 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

I'll add it to TODOs.
I think that with new API you can do skinning without placing matrices into texture.

Possibly.


amethyst_renderer/src/command/mod.rs, line 17 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

Do you need it already? For now you can use GeneralExecution.

Na, it was just Compute is used further down :)


examples/hal/flat.rs, line 1 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

I think we can supply them in main crate.
But I have no strong opinion on this.

Main crate should be kept to minimal imho.


Comments from Reviewable

Member

Rhuagh commented Dec 12, 2017

Review status: 73 of 80 files reviewed at latest revision, 73 unresolved discussions, some commit checks failed.


amethyst_renderer/src/cam.rs, line 87 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

What the benefit?

Guarantee we use the same version for core::Transform and for renderer.


amethyst_renderer/src/lib.rs, line 24 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

Either that or user will have to add backends as dependencies with correct versions.
If we will rexport only gfx_backend_XXX::Backend the user will have to import backend crate for doing platform specific stuff. Well, maybe the later is appropriate as if user write platform specific code he can import correct dependencies.

Yeah, I don't really understand the use case for having the backend crates reexported.


amethyst_renderer/src/mesh.rs, line 359 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

It may become handy if the origins of the mesh and collision shape (or anything else with origin) will be different.

Possibly, I just don't see it used very often


amethyst_renderer/src/renderer.rs, line 30 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

I's more like builder struct rather than config.

Hmm, ok. I just felt it should be kept close to the Window, because you can't pump events from winit without the Window.


amethyst_renderer/src/system.rs, line 1 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

I'm thinking of moving input and windowing out of renderer responsibility.

Yeah, that would be optimal, but that also means we need to move winit::Window out from the renderer.


amethyst_renderer/src/texture.rs, line 1 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

I'll add it to TODOs.
I think that with new API you can do skinning without placing matrices into texture.

Possibly.


amethyst_renderer/src/command/mod.rs, line 17 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

Do you need it already? For now you can use GeneralExecution.

Na, it was just Compute is used further down :)


examples/hal/flat.rs, line 1 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

I think we can supply them in main crate.
But I have no strong opinion on this.

Main crate should be kept to minimal imho.


Comments from Reviewable

@omni-viral omni-viral changed the base branch from develop to feature/hal-integration Dec 17, 2017

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 17, 2017

Member

Reviewed 1 of 33 files at r3, 5 of 39 files at r6, 2 of 31 files at r11, 7 of 107 files at r15, 7 of 36 files at r16.
Review status: 57 of 84 files reviewed at latest revision, 73 unresolved discussions, some commit checks failed.


Comments from Reviewable

Member

Rhuagh commented Dec 17, 2017

Reviewed 1 of 33 files at r3, 5 of 39 files at r6, 2 of 31 files at r11, 7 of 107 files at r15, 7 of 36 files at r16.
Review status: 57 of 84 files reviewed at latest revision, 73 unresolved discussions, some commit checks failed.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 17, 2017

Member

Reviewed 1 of 107 files at r15, 1 of 36 files at r16.
Review status: 58 of 84 files reviewed at latest revision, 73 unresolved discussions, some commit checks failed.


Comments from Reviewable

Member

Rhuagh commented Dec 17, 2017

Reviewed 1 of 107 files at r15, 1 of 36 files at r16.
Review status: 58 of 84 files reviewed at latest revision, 73 unresolved discussions, some commit checks failed.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 17, 2017

Member

Reviewed 1 of 64 files at r13, 2 of 107 files at r15, 11 of 36 files at r16.
Review status: 69 of 84 files reviewed at latest revision, 72 unresolved discussions, some commit checks failed.


Comments from Reviewable

Member

Rhuagh commented Dec 17, 2017

Reviewed 1 of 64 files at r13, 2 of 107 files at r15, 11 of 36 files at r16.
Review status: 69 of 84 files reviewed at latest revision, 72 unresolved discussions, some commit checks failed.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 17, 2017

Member

Reviewed 4 of 107 files at r15, 5 of 36 files at r16.
Review status: 74 of 84 files reviewed at latest revision, 72 unresolved discussions, some commit checks failed.


Comments from Reviewable

Member

Rhuagh commented Dec 17, 2017

Reviewed 4 of 107 files at r15, 5 of 36 files at r16.
Review status: 74 of 84 files reviewed at latest revision, 72 unresolved discussions, some commit checks failed.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 17, 2017

Member

Reviewed 1 of 107 files at r15, 2 of 36 files at r16.
Review status: 76 of 84 files reviewed at latest revision, 72 unresolved discussions, some commit checks failed.


Comments from Reviewable

Member

Rhuagh commented Dec 17, 2017

Reviewed 1 of 107 files at r15, 2 of 36 files at r16.
Review status: 76 of 84 files reviewed at latest revision, 72 unresolved discussions, some commit checks failed.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 17, 2017

Member

Reviewed 1 of 31 files at r11, 7 of 107 files at r15, 10 of 36 files at r16.
Review status: all files reviewed at latest revision, 71 unresolved discussions, some commit checks failed.


Comments from Reviewable

Member

Rhuagh commented Dec 17, 2017

Reviewed 1 of 31 files at r11, 7 of 107 files at r15, 10 of 36 files at r16.
Review status: all files reviewed at latest revision, 71 unresolved discussions, some commit checks failed.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 17, 2017

Member

Reviewed 3 of 39 files at r6, 2 of 31 files at r11, 7 of 107 files at r15, 11 of 11 files at r17.
Review status: all files reviewed at latest revision, 72 unresolved discussions.


Cargo.toml, line 106 at r17 (raw file):

name = "pong_tutorial_02"
path = "examples/pong_tutorial_02/main.rs"
name = "hal"

This looks broken.


Comments from Reviewable

Member

Rhuagh commented Dec 17, 2017

Reviewed 3 of 39 files at r6, 2 of 31 files at r11, 7 of 107 files at r15, 11 of 11 files at r17.
Review status: all files reviewed at latest revision, 72 unresolved discussions.


Cargo.toml, line 106 at r17 (raw file):

name = "pong_tutorial_02"
path = "examples/pong_tutorial_02/main.rs"
name = "hal"

This looks broken.


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Dec 17, 2017

Member

Review status: 84 of 85 files reviewed at latest revision, 72 unresolved discussions.


Cargo.toml, line 106 at r17 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

This looks broken.

Done.


Comments from Reviewable

Member

omni-viral commented Dec 17, 2017

Review status: 84 of 85 files reviewed at latest revision, 72 unresolved discussions.


Cargo.toml, line 106 at r17 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

This looks broken.

Done.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 19, 2017

Member

Reviewed 1 of 1 files at r18.
Review status: all files reviewed at latest revision, 71 unresolved discussions.


Comments from Reviewable

Member

Rhuagh commented Dec 19, 2017

Reviewed 1 of 1 files at r18.
Review status: all files reviewed at latest revision, 71 unresolved discussions.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 21, 2017

Member

Reviewed 2 of 31 files at r11, 10 of 108 files at r15, 2 of 37 files at r16, 18 of 18 files at r19.
Review status: all files reviewed at latest revision, 75 unresolved discussions.


amethyst_renderer/src/cirque.rs, line 32 at r19 (raw file):

    }

    pub fn get(&mut self, span: Range<Epoch>) -> Option<CirqueRef<T>> {

Some documentation would be good here, describing the invariants of this function. I'm unsure if the first check is correct.


amethyst_renderer/src/cirque.rs, line 49 at r19 (raw file):

    }

    pub fn get_or_try_insert<F, E>(&mut self, span: Range<Epoch>, mut f: F) -> Result<CirqueRef<T>, E>

Same as above.


amethyst_renderer/src/epoch.rs, line 84 at r19 (raw file):

or >= ?


amethyst_renderer/src/epoch.rs, line 138 at r19 (raw file):

    #[inline]
    pub unsafe fn get_unsafe<'a>(&self, until: Epoch) -> Option<&'a T> {
        if self.valid_until >= until {

This differs from the valid_until function above. Is that intentional?


Comments from Reviewable

Member

Rhuagh commented Dec 21, 2017

Reviewed 2 of 31 files at r11, 10 of 108 files at r15, 2 of 37 files at r16, 18 of 18 files at r19.
Review status: all files reviewed at latest revision, 75 unresolved discussions.


amethyst_renderer/src/cirque.rs, line 32 at r19 (raw file):

    }

    pub fn get(&mut self, span: Range<Epoch>) -> Option<CirqueRef<T>> {

Some documentation would be good here, describing the invariants of this function. I'm unsure if the first check is correct.


amethyst_renderer/src/cirque.rs, line 49 at r19 (raw file):

    }

    pub fn get_or_try_insert<F, E>(&mut self, span: Range<Epoch>, mut f: F) -> Result<CirqueRef<T>, E>

Same as above.


amethyst_renderer/src/epoch.rs, line 84 at r19 (raw file):

or >= ?


amethyst_renderer/src/epoch.rs, line 138 at r19 (raw file):

    #[inline]
    pub unsafe fn get_unsafe<'a>(&self, until: Epoch) -> Option<&'a T> {
        if self.valid_until >= until {

This differs from the valid_until function above. Is that intentional?


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 29, 2017

Member

Reviewed 1 of 31 files at r11, 10 of 108 files at r15, 1 of 38 files at r16, 1 of 20 files at r19, 31 of 31 files at r20.
Review status: all files reviewed at latest revision, 74 unresolved discussions.


Comments from Reviewable

Member

Rhuagh commented Dec 29, 2017

Reviewed 1 of 31 files at r11, 10 of 108 files at r15, 1 of 38 files at r16, 1 of 20 files at r19, 31 of 31 files at r20.
Review status: all files reviewed at latest revision, 74 unresolved discussions.


Comments from Reviewable

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Dec 29, 2017

Member

Reviewed 2 of 33 files at r12, 1 of 108 files at r15, 3 of 31 files at r20.
Review status: all files reviewed at latest revision, 80 unresolved discussions.


Cargo.toml, line 46 at r20 (raw file):

[dev-dependencies]
#amethyst_gltf = { path = "amethyst_gltf", version = "0.1" }

Just marking as unresolved, so we don't forget to fix it.


Cargo.toml, line 47 at r20 (raw file):

[dev-dependencies]
#amethyst_gltf = { path = "amethyst_gltf", version = "0.1" }
error-chain = "0.11"

Not too related to this PR, but maybe we should be using failure?


amethyst_renderer/src/cirque.rs, line 7 at r20 (raw file):

#[derive(Debug)]
pub struct Cirque<T> {

Please add docs what this type is for.


amethyst_renderer/src/cirque.rs, line 18 at r20 (raw file):

    }

    pub fn create<I>(iter: I) -> Self

Please rename to from_iter.


amethyst_renderer/src/cirque.rs, line 35 at r20 (raw file):

        if self.values
            .front()
            .map(|&(until, _)| until >= span.start)

I also don't understand this check. Please add some comments or docs here.


amethyst_renderer/src/epoch.rs, line 167 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

Nope. For Eh it should be T: Send + Sync. For Ec it's ok.

I agree, please add a Send bound.


amethyst_renderer/src/epoch.rs, line 92 at r20 (raw file):

#[derive(Debug)]
pub struct Ec<T> {
    ptr: *const T,

Cells should be invariant over T I think.


amethyst_renderer/src/epoch.rs, line 125 at r20 (raw file):

    /// Returns `Some` if `Ec` hasn't expired yet
    /// (`CurrentEpoch::now()` is "earlier" than `self.valid_until()`).
    /// Returns `None` otherwise.

Ah, finally some docs. Nice!


amethyst_renderer/src/epoch.rs, line 141 at r20 (raw file):

    /// Returns `None` otherwise.
    #[inline]
    pub unsafe fn get_span<'a>(&self, span: Range<Epoch>) -> Option<&'a T> {

This is marked as unsafe, thus needs to document what guarantees the user needs to uphold.


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

}

#[cfg(not(target_pointer_width = "64"))]

Is this a good idea? Can't we support 32-bit?


Comments from Reviewable

Member

torkleyy commented Dec 29, 2017

Reviewed 2 of 33 files at r12, 1 of 108 files at r15, 3 of 31 files at r20.
Review status: all files reviewed at latest revision, 80 unresolved discussions.


Cargo.toml, line 46 at r20 (raw file):

[dev-dependencies]
#amethyst_gltf = { path = "amethyst_gltf", version = "0.1" }

Just marking as unresolved, so we don't forget to fix it.


Cargo.toml, line 47 at r20 (raw file):

[dev-dependencies]
#amethyst_gltf = { path = "amethyst_gltf", version = "0.1" }
error-chain = "0.11"

Not too related to this PR, but maybe we should be using failure?


amethyst_renderer/src/cirque.rs, line 7 at r20 (raw file):

#[derive(Debug)]
pub struct Cirque<T> {

Please add docs what this type is for.


amethyst_renderer/src/cirque.rs, line 18 at r20 (raw file):

    }

    pub fn create<I>(iter: I) -> Self

Please rename to from_iter.


amethyst_renderer/src/cirque.rs, line 35 at r20 (raw file):

        if self.values
            .front()
            .map(|&(until, _)| until >= span.start)

I also don't understand this check. Please add some comments or docs here.


amethyst_renderer/src/epoch.rs, line 167 at r15 (raw file):

Previously, omni-viral (Zakarum) wrote…

Nope. For Eh it should be T: Send + Sync. For Ec it's ok.

I agree, please add a Send bound.


amethyst_renderer/src/epoch.rs, line 92 at r20 (raw file):

#[derive(Debug)]
pub struct Ec<T> {
    ptr: *const T,

Cells should be invariant over T I think.


amethyst_renderer/src/epoch.rs, line 125 at r20 (raw file):

    /// Returns `Some` if `Ec` hasn't expired yet
    /// (`CurrentEpoch::now()` is "earlier" than `self.valid_until()`).
    /// Returns `None` otherwise.

Ah, finally some docs. Nice!


amethyst_renderer/src/epoch.rs, line 141 at r20 (raw file):

    /// Returns `None` otherwise.
    #[inline]
    pub unsafe fn get_span<'a>(&self, span: Range<Epoch>) -> Option<&'a T> {

This is marked as unsafe, thus needs to document what guarantees the user needs to uphold.


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

}

#[cfg(not(target_pointer_width = "64"))]

Is this a good idea? Can't we support 32-bit?


Comments from Reviewable

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Dec 29, 2017

Member

Forget about that note about variance, I just realized it's immutable only, so it should be correct.

Member

torkleyy commented Dec 29, 2017

Forget about that note about variance, I just realized it's immutable only, so it should be correct.

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Dec 29, 2017

Member

Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 212 at r20 (raw file):

    #[inline]
    fn dispose(self, current: &CurrentEpoch) -> Result<T, Self> {
        if self.valid_until.epoch() <= current.now() {

This does not require an atomic operation.


amethyst_renderer/src/epoch.rs, line 315 at r20 (raw file):

    fn advance_to(&self, other: Epoch) {
        let value = other.0 as usize;
        if self.0.load(Ordering::Relaxed) < value {

Err..we need to acquire a lock here if I'm not completely mistaken. This line can lead to severe memory bugs.


amethyst_renderer/src/epoch.rs, line 316 at r20 (raw file):

        let value = other.0 as usize;
        if self.0.load(Ordering::Relaxed) < value {
            self.0.store(value as usize, Ordering::Relaxed); // TODO: Use `fetch_add`.

This isn't correct, it can cause a race condition.


Comments from Reviewable

Member

torkleyy commented Dec 29, 2017

Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 212 at r20 (raw file):

    #[inline]
    fn dispose(self, current: &CurrentEpoch) -> Result<T, Self> {
        if self.valid_until.epoch() <= current.now() {

This does not require an atomic operation.


amethyst_renderer/src/epoch.rs, line 315 at r20 (raw file):

    fn advance_to(&self, other: Epoch) {
        let value = other.0 as usize;
        if self.0.load(Ordering::Relaxed) < value {

Err..we need to acquire a lock here if I'm not completely mistaken. This line can lead to severe memory bugs.


amethyst_renderer/src/epoch.rs, line 316 at r20 (raw file):

        let value = other.0 as usize;
        if self.0.load(Ordering::Relaxed) < value {
            self.0.store(value as usize, Ordering::Relaxed); // TODO: Use `fetch_add`.

This isn't correct, it can cause a race condition.


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Dec 29, 2017

Member

Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 84 at r19 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

or >= ?

valid_until() returns first epoch when value may be invalidated.
Therefore it must be bigger then specified.


amethyst_renderer/src/epoch.rs, line 138 at r19 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

This differs from the valid_until function above. Is that intentional?

Yeap.
valid_until is the point in time when it may already be invalid.
span.end is the point in time when it won't be in use.


amethyst_renderer/src/epoch.rs, line 125 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Ah, finally some docs. Nice!

=^_^=


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Is this a good idea? Can't we support 32-bit?

We should. But it requires AtomicU64 which is only available in nightly.


Comments from Reviewable

Member

omni-viral commented Dec 29, 2017

Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 84 at r19 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

or >= ?

valid_until() returns first epoch when value may be invalidated.
Therefore it must be bigger then specified.


amethyst_renderer/src/epoch.rs, line 138 at r19 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

This differs from the valid_until function above. Is that intentional?

Yeap.
valid_until is the point in time when it may already be invalid.
span.end is the point in time when it won't be in use.


amethyst_renderer/src/epoch.rs, line 125 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Ah, finally some docs. Nice!

=^_^=


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Is this a good idea? Can't we support 32-bit?

We should. But it requires AtomicU64 which is only available in nightly.


Comments from Reviewable

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Dec 29, 2017

Member

Review status: all files reviewed at latest revision, 82 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 138 at r19 (raw file):

Previously, omni-viral (Zakarum) wrote…

Yeap.
valid_until is the point in time when it may already be invalid.
span.end is the point in time when it won't be in use.

Ah that makes sense. Please add this to the documentation above.


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

Previously, omni-viral (Zakarum) wrote…

We should. But it requires AtomicU64 which is only available in nightly.

Just casting it to a u64 isn't an option? Using AtomicU64 can cause severe performance problems on 32-bit platforms.


Comments from Reviewable

Member

torkleyy commented Dec 29, 2017

Review status: all files reviewed at latest revision, 82 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 138 at r19 (raw file):

Previously, omni-viral (Zakarum) wrote…

Yeap.
valid_until is the point in time when it may already be invalid.
span.end is the point in time when it won't be in use.

Ah that makes sense. Please add this to the documentation above.


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

Previously, omni-viral (Zakarum) wrote…

We should. But it requires AtomicU64 which is only available in nightly.

Just casting it to a u64 isn't an option? Using AtomicU64 can cause severe performance problems on 32-bit platforms.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 29, 2017

Member

Review status: 80 of 100 files reviewed at latest revision, 81 unresolved discussions.


Cargo.toml, line 47 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Not too related to this PR, but maybe we should be using failure?

Let's take this as a separate discussion.


amethyst_renderer/src/epoch.rs, line 138 at r19 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Ah that makes sense. Please add this to the documentation above.

I agree, documentation is enough then


Comments from Reviewable

Member

Rhuagh commented Dec 29, 2017

Review status: 80 of 100 files reviewed at latest revision, 81 unresolved discussions.


Cargo.toml, line 47 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Not too related to this PR, but maybe we should be using failure?

Let's take this as a separate discussion.


amethyst_renderer/src/epoch.rs, line 138 at r19 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Ah that makes sense. Please add this to the documentation above.

I agree, documentation is enough then


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 29, 2017

Member

Reviewed 5 of 108 files at r15, 2 of 31 files at r20, 18 of 20 files at r21.
Review status: 98 of 100 files reviewed at latest revision, 83 unresolved discussions.


amethyst_animation/Cargo.toml, line 25 at r21 (raw file):

minterpolate = "0.2"
serde = { version = "1.0", features = ["derive"] }
specs = { version = "0.10", git = "https://github.com/slide-rs/specs.git" }

Why use the git version?


amethyst_renderer/src/graph/pass.rs, line 114 at r21 (raw file):

    ///
    /// * binding `DescriptorSet`s
    /// * recording `Graphics` commands to `CommandBuffer`

These docs are identical to draw_inline below, that doesn't seem right?


Comments from Reviewable

Member

Rhuagh commented Dec 29, 2017

Reviewed 5 of 108 files at r15, 2 of 31 files at r20, 18 of 20 files at r21.
Review status: 98 of 100 files reviewed at latest revision, 83 unresolved discussions.


amethyst_animation/Cargo.toml, line 25 at r21 (raw file):

minterpolate = "0.2"
serde = { version = "1.0", features = ["derive"] }
specs = { version = "0.10", git = "https://github.com/slide-rs/specs.git" }

Why use the git version?


amethyst_renderer/src/graph/pass.rs, line 114 at r21 (raw file):

    ///
    /// * binding `DescriptorSet`s
    /// * recording `Graphics` commands to `CommandBuffer`

These docs are identical to draw_inline below, that doesn't seem right?


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Dec 29, 2017

Member

Reviewed 2 of 108 files at r15, 2 of 20 files at r21.
Review status: all files reviewed at latest revision, 83 unresolved discussions.


Comments from Reviewable

Member

Rhuagh commented Dec 29, 2017

Reviewed 2 of 108 files at r15, 2 of 20 files at r21.
Review status: all files reviewed at latest revision, 83 unresolved discussions.


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Dec 31, 2017

Member

Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_animation/Cargo.toml, line 25 at r21 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

Why use the git version?

Entry API.


amethyst_renderer/src/epoch.rs, line 212 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This does not require an atomic operation.

This one doesn't


amethyst_renderer/src/epoch.rs, line 315 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Err..we need to acquire a lock here if I'm not completely mistaken. This line can lead to severe memory bugs.

The whole point of using atomics here is to not acquire locks.
Current code works because all parallel advance_to are called with same other argument.
I don't know how to guarantee it yet.


amethyst_renderer/src/epoch.rs, line 316 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This isn't correct, it can cause a race condition.

It can in general.


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Just casting it to a u64 isn't an option? Using AtomicU64 can cause severe performance problems on 32-bit platforms.

No. We need to store u64 in counter so that it wouldn't overflow in any reasonable time.
u32 will overflow in days.
u64 won't overflow in millennia.
And we need to perform atomic operations on it.


Comments from Reviewable

Member

omni-viral commented Dec 31, 2017

Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_animation/Cargo.toml, line 25 at r21 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

Why use the git version?

Entry API.


amethyst_renderer/src/epoch.rs, line 212 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This does not require an atomic operation.

This one doesn't


amethyst_renderer/src/epoch.rs, line 315 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Err..we need to acquire a lock here if I'm not completely mistaken. This line can lead to severe memory bugs.

The whole point of using atomics here is to not acquire locks.
Current code works because all parallel advance_to are called with same other argument.
I don't know how to guarantee it yet.


amethyst_renderer/src/epoch.rs, line 316 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This isn't correct, it can cause a race condition.

It can in general.


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Just casting it to a u64 isn't an option? Using AtomicU64 can cause severe performance problems on 32-bit platforms.

No. We need to store u64 in counter so that it wouldn't overflow in any reasonable time.
u32 will overflow in days.
u64 won't overflow in millennia.
And we need to perform atomic operations on it.


Comments from Reviewable

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Dec 31, 2017

Member

Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 315 at r20 (raw file):

Previously, omni-viral (Zakarum) wrote…

The whole point of using atomics here is to not acquire locks.
Current code works because all parallel advance_to are called with same other argument.
I don't know how to guarantee it yet.

With locks I was talking about atomics, actually.


amethyst_renderer/src/epoch.rs, line 316 at r20 (raw file):

Previously, omni-viral (Zakarum) wrote…

It can in general.

This doesn't establish any sort of happens-before relation, so how and why do you think it works?


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

Previously, omni-viral (Zakarum) wrote…

No. We need to store u64 in counter so that it wouldn't overflow in any reasonable time.
u32 will overflow in days.
u64 won't overflow in millennia.
And we need to perform atomic operations on it.

Yeah, I know. Still, it's an alternative.


Comments from Reviewable

Member

torkleyy commented Dec 31, 2017

Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 315 at r20 (raw file):

Previously, omni-viral (Zakarum) wrote…

The whole point of using atomics here is to not acquire locks.
Current code works because all parallel advance_to are called with same other argument.
I don't know how to guarantee it yet.

With locks I was talking about atomics, actually.


amethyst_renderer/src/epoch.rs, line 316 at r20 (raw file):

Previously, omni-viral (Zakarum) wrote…

It can in general.

This doesn't establish any sort of happens-before relation, so how and why do you think it works?


amethyst_renderer/src/epoch.rs, line 325 at r20 (raw file):

Previously, omni-viral (Zakarum) wrote…

No. We need to store u64 in counter so that it wouldn't overflow in any reasonable time.
u32 will overflow in days.
u64 won't overflow in millennia.
And we need to perform atomic operations on it.

Yeah, I know. Still, it's an alternative.


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Jan 5, 2018

Member

Review status: all files reviewed at latest revision, 82 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 316 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This doesn't establish any sort of happens-before relation, so how and why do you think it works?

Because Relaxed (Monotonic in LLVM) is enough here.
This atomic operations doesn't need to protect any other memory operation.


Comments from Reviewable

Member

omni-viral commented Jan 5, 2018

Review status: all files reviewed at latest revision, 82 unresolved discussions.


amethyst_renderer/src/epoch.rs, line 316 at r20 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

This doesn't establish any sort of happens-before relation, so how and why do you think it works?

Because Relaxed (Monotonic in LLVM) is enough here.
This atomic operations doesn't need to protect any other memory operation.


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Jan 10, 2018

Member

Reviewed 1 of 31 files at r11, 1 of 33 files at r12, 10 of 108 files at r15, 1 of 20 files at r19, 2 of 31 files at r20, 22 of 22 files at r22.
Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_renderer/src/cirque.rs, line 66 at r22 (raw file):

    /// Get constant entry for `span`.
    /// If queue is not empty - marks the last item in queue to be in use until `span.end`
    /// and returns mutable reference to it.

I think this should say immutable?


Comments from Reviewable

Member

Rhuagh commented Jan 10, 2018

Reviewed 1 of 31 files at r11, 1 of 33 files at r12, 10 of 108 files at r15, 1 of 20 files at r19, 2 of 31 files at r20, 22 of 22 files at r22.
Review status: all files reviewed at latest revision, 83 unresolved discussions.


amethyst_renderer/src/cirque.rs, line 66 at r22 (raw file):

    /// Get constant entry for `span`.
    /// If queue is not empty - marks the last item in queue to be in use until `span.end`
    /// and returns mutable reference to it.

I think this should say immutable?


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Jan 17, 2018

Member

Reviewed 5 of 39 files at r6, 3 of 31 files at r11, 14 of 108 files at r15, 82 of 82 files at r23.
Review status: all files reviewed at latest revision, 82 unresolved discussions.


Comments from Reviewable

Member

Rhuagh commented Jan 17, 2018

Reviewed 5 of 39 files at r6, 3 of 31 files at r11, 14 of 108 files at r15, 82 of 82 files at r23.
Review status: all files reviewed at latest revision, 82 unresolved discussions.


Comments from Reviewable

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Jan 18, 2018

Member

@omni-viral Looks like you have a lot of commits in here merged from prior PRs. Looks like this could use a rebase.

Member

Xaeroxe commented Jan 18, 2018

@omni-viral Looks like you have a lot of commits in here merged from prior PRs. Looks like this could use a rebase.

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Jan 18, 2018

Member

@Xaeroxe indeed. But they aren't merged. I rebased to "develop". But this PR is created against "hal-integration"

Member

omni-viral commented Jan 18, 2018

@Xaeroxe indeed. But they aren't merged. I rebased to "develop". But this PR is created against "hal-integration"

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Jan 18, 2018

Member

Reviewed 2 of 83 files at r23, 2 of 39 files at r24, 2 of 21 files at r25.
Review status: 109 of 146 files reviewed at latest revision, 86 unresolved discussions.


amethyst_core/Cargo.toml, line 21 at r25 (raw file):

error-chain = "0.11"
fnv = "1.0"
hibitset = { version = "0.4.1" }

No need for an inline table.x


amethyst_core/src/events_pump.rs, line 3 at r25 (raw file):

use shrev::EventChannel;

Does this file belong into this PR? As I've requested before, could you please extract some parts from your PR and create a separate PR that we can merge right now? That would help reviewers of this PR by reducing the number of files and you don't have to rebase if we change files.


amethyst_renderer/Cargo.toml, line 33 at r24 (raw file):

fnv = "1.0"
gfx-hal = { version = "0.1.0", features = ["mint", "serde"], path = "/Users/zakarum/pet/gfx/src/hal" }
hibitset = { version = "0.4.1" }

No need for an inline table anymore.xxx


amethyst_renderer/Cargo.toml, line 43 at r24 (raw file):

shred = "0.5"
specs = { version = "0.10", git = "https://github.com/slide-rs/specs.git" }
thread_profiler = { version = "0.1" }

No need for an inline table.


amethyst_renderer/src/camera.rs, line 96 at r25 (raw file):

}

impl From<Camera> for [[f32; 4]; 4] {

Why create a From implementation instead of a method?


Comments from Reviewable

Member

torkleyy commented Jan 18, 2018

Reviewed 2 of 83 files at r23, 2 of 39 files at r24, 2 of 21 files at r25.
Review status: 109 of 146 files reviewed at latest revision, 86 unresolved discussions.


amethyst_core/Cargo.toml, line 21 at r25 (raw file):

error-chain = "0.11"
fnv = "1.0"
hibitset = { version = "0.4.1" }

No need for an inline table.x


amethyst_core/src/events_pump.rs, line 3 at r25 (raw file):

use shrev::EventChannel;

Does this file belong into this PR? As I've requested before, could you please extract some parts from your PR and create a separate PR that we can merge right now? That would help reviewers of this PR by reducing the number of files and you don't have to rebase if we change files.


amethyst_renderer/Cargo.toml, line 33 at r24 (raw file):

fnv = "1.0"
gfx-hal = { version = "0.1.0", features = ["mint", "serde"], path = "/Users/zakarum/pet/gfx/src/hal" }
hibitset = { version = "0.4.1" }

No need for an inline table anymore.xxx


amethyst_renderer/Cargo.toml, line 43 at r24 (raw file):

shred = "0.5"
specs = { version = "0.10", git = "https://github.com/slide-rs/specs.git" }
thread_profiler = { version = "0.1" }

No need for an inline table.


amethyst_renderer/src/camera.rs, line 96 at r25 (raw file):

}

impl From<Camera> for [[f32; 4]; 4] {

Why create a From implementation instead of a method?


Comments from Reviewable

@omni-viral omni-viral changed the base branch from feature/hal-integration to develop Jan 18, 2018

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Jan 19, 2018

Member

Review status: 38 of 99 files reviewed at latest revision, 86 unresolved discussions, some commit checks failed.


amethyst_core/src/events_pump.rs, line 3 at r25 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Does this file belong into this PR? As I've requested before, could you please extract some parts from your PR and create a separate PR that we can merge right now? That would help reviewers of this PR by reducing the number of files and you don't have to rebase if we change files.

That would require quite a bit of restructuring of the old renderer unfortunately


Comments from Reviewable

Member

Rhuagh commented Jan 19, 2018

Review status: 38 of 99 files reviewed at latest revision, 86 unresolved discussions, some commit checks failed.


amethyst_core/src/events_pump.rs, line 3 at r25 (raw file):

Previously, torkleyy (Thomas Schaller) wrote…

Does this file belong into this PR? As I've requested before, could you please extract some parts from your PR and create a separate PR that we can merge right now? That would help reviewers of this PR by reducing the number of files and you don't have to rebase if we change files.

That would require quite a bit of restructuring of the old renderer unfortunately


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Jan 19, 2018

Member

Reviewed 5 of 40 files at r6, 3 of 31 files at r11, 2 of 67 files at r13, 22 of 111 files at r15, 1 of 22 files at r19, 2 of 32 files at r20, 11 of 39 files at r24, 6 of 21 files at r25, 52 of 52 files at r26.
Review status: all files reviewed at latest revision, 87 unresolved discussions, some commit checks failed.


amethyst_renderer/src/upload.rs, line 53 at r26 (raw file):

        offset: u64,
        data: D,
    ) -> Result<Self, ::failure::Error>

If possible, can we use imports instead?


Comments from Reviewable

Member

Rhuagh commented Jan 19, 2018

Reviewed 5 of 40 files at r6, 3 of 31 files at r11, 2 of 67 files at r13, 22 of 111 files at r15, 1 of 22 files at r19, 2 of 32 files at r20, 11 of 39 files at r24, 6 of 21 files at r25, 52 of 52 files at r26.
Review status: all files reviewed at latest revision, 87 unresolved discussions, some commit checks failed.


amethyst_renderer/src/upload.rs, line 53 at r26 (raw file):

        offset: u64,
        data: D,
    ) -> Result<Self, ::failure::Error>

If possible, can we use imports instead?


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Jan 19, 2018

Member

Review status: all files reviewed at latest revision, 87 unresolved discussions, some commit checks failed.


amethyst_renderer/src/upload.rs, line 53 at r26 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

If possible, can we use imports instead?

I'll try 😄


Comments from Reviewable

Member

omni-viral commented Jan 19, 2018

Review status: all files reviewed at latest revision, 87 unresolved discussions, some commit checks failed.


amethyst_renderer/src/upload.rs, line 53 at r26 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

If possible, can we use imports instead?

I'll try 😄


Comments from Reviewable

@omni-viral

This comment has been minimized.

Show comment
Hide comment
@omni-viral

omni-viral Jan 19, 2018

Member

Review status: all files reviewed at latest revision, 87 unresolved discussions, some commit checks failed.


amethyst_core/src/events_pump.rs, line 3 at r25 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

That would require quite a bit of restructuring of the old renderer unfortunately

You can just not use it with old renderer 😸


Comments from Reviewable

Member

omni-viral commented Jan 19, 2018

Review status: all files reviewed at latest revision, 87 unresolved discussions, some commit checks failed.


amethyst_core/src/events_pump.rs, line 3 at r25 (raw file):

Previously, Rhuagh (Simon Rönnberg) wrote…

That would require quite a bit of restructuring of the old renderer unfortunately

You can just not use it with old renderer 😸


Comments from Reviewable

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Jan 19, 2018

Member

Review status: all files reviewed at latest revision, 87 unresolved discussions, some commit checks failed.


amethyst_core/src/events_pump.rs, line 3 at r25 (raw file):

Previously, omni-viral (Zakarum) wrote…

You can just not use it with old renderer 😸

Or we use it from the inside the old renderer.


Comments from Reviewable

Member

Rhuagh commented Jan 19, 2018

Review status: all files reviewed at latest revision, 87 unresolved discussions, some commit checks failed.


amethyst_core/src/events_pump.rs, line 3 at r25 (raw file):

Previously, omni-viral (Zakarum) wrote…

You can just not use it with old renderer 😸

Or we use it from the inside the old renderer.


Comments from Reviewable

@kvark kvark referenced this pull request in gfx-rs/gfx Feb 1, 2018

Open

[meta] HAL integration tracking #1790

0 of 4 tasks complete

@omni-viral omni-viral closed this Feb 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment