Skip to content

Conversation

@sapphire-arches
Copy link
Contributor

Fixes #275

This is probably a breaking change since at least one public type is affected (rendy_resource::image::ImageViewCreationError)

@sapphire-arches
Copy link
Contributor Author

Note that this also updates the examples from winit-0.20-alpha to winit-0.21, which matches the version used by gfx-hal 0.5.

@sapphire-arches
Copy link
Contributor Author

Looks like this breaks windows, but I don't have a windows machine to debug on. Seems to be a problem with the Cargo features used for gfx_backend_gl, but I'm not sure how to fix that so some help would be appreciated.

@zicklag
Copy link
Contributor

zicklag commented Apr 19, 2020

Hey, I just happened to find this and it turns out I'm working on the gfx-backend-gl crate!

So there are changes that are being backported from hal-0.6 ( master ) that I am working on that should fix that problem ( I think, if it doesn't I should still be able to figure out what's wrong ): gfx-rs/gfx#3216.

I discovered an issue that I have to fix, though, and it might be in the range of a few weeks or so before I fix it ( I don't know, my availability is pretty variable at the moment ).

@str4d
Copy link

str4d commented Oct 4, 2020

Is there a reason that this PR is updating to gfx-rs/gfx@6d10d21, rather than gfx-hal 0.5 etc? I applied the following patch to this branch, and the Windows tests run fine on my machine:

diff --git a/core/Cargo.toml b/core/Cargo.toml
index b6bcce1..8641420 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -26,9 +26,9 @@ vulkan = ["gfx-backend-vulkan"]
 no-slow-safety-checks = []
 
 [dependencies]
-gfx-hal = { git = "https://github.com/gfx-rs/gfx", rev = "6d10d21788fffa6a7ca17888c8d3a4b6265442e7" }
-gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "6d10d21788fffa6a7ca17888c8d3a4b6265442e7", optional = true }
-gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "6d10d21788fffa6a7ca17888c8d3a4b6265442e7", features = ["glutin"], default_features = false, optional = true }
+gfx-hal = { version = "0.5" }
+gfx-backend-empty = { version = "0.5", optional = true }
+gfx-backend-gl = { version = "0.5", features = ["glutin"], default_features = false, optional = true }
 lazy_static = "1.0"
 log = "0.4"
 parking_lot = "0.9"
@@ -37,10 +37,10 @@ thread_profiler = "0.3"
 raw-window-handle = "0.3"
 
 [target.'cfg(all(target_os = "windows", not(target_arch = "wasm32")))'.dependencies]
-gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "6d10d21788fffa6a7ca17888c8d3a4b6265442e7", optional = true }
+gfx-backend-dx12 = { version = "0.5", optional = true }
 
 [target.'cfg(any(all(not(target_arch = "wasm32"), target_os = "macos"), all(target_arch = "aarch64", target_os = "ios")))'.dependencies]
-gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "6d10d21788fffa6a7ca17888c8d3a4b6265442e7", optional = true }
+gfx-backend-metal = { version = "0.5", optional = true }
 
 [target.'cfg(all(any(target_os = "windows", all(unix, not(any(target_os = "macos", target_os = "ios")))), not(target_arch = "wasm32")))'.dependencies]
-gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "6d10d21788fffa6a7ca17888c8d3a4b6265442e7", features = ["x11"], optional = true }
+gfx-backend-vulkan = { version = "0.5", features = ["x11"], optional = true }
diff --git a/descriptor/Cargo.toml b/descriptor/Cargo.toml
index f2375a9..cd19479 100644
--- a/descriptor/Cargo.toml
+++ b/descriptor/Cargo.toml
@@ -11,7 +11,7 @@ categories = ["rendering"]
 description = "Rendy's descriptor allocator"
 
 [dependencies]
-gfx-hal = { git = "https://github.com/gfx-rs/gfx", rev = "6d10d21788fffa6a7ca17888c8d3a4b6265442e7" }
+gfx-hal = { version = "0.5" }
 log = "0.4"
 relevant = { version = "0.4", features = ["log"] }
 smallvec = "1.0"
diff --git a/descriptor/src/allocator.rs b/descriptor/src/allocator.rs
index 248832e..fd106ca 100644
--- a/descriptor/src/allocator.rs
+++ b/descriptor/src/allocator.rs
@@ -77,7 +77,8 @@ unsafe fn allocate_from_pool<B: Backend>(
     let sets_were = allocation.len();
     raw.allocate(std::iter::repeat(layout).take(count as usize), allocation)
         .map_err(|err| match err {
-            AllocationError::OutOfMemory(oom) => oom,
+            AllocationError::Host => OutOfMemory::Host,
+            AllocationError::Device => OutOfMemory::Device,
             err => {
                 // We check pool for free descriptors and sets before calling this function,
                 // so it can't be exhausted.
diff --git a/memory/Cargo.toml b/memory/Cargo.toml
index 5f5d548..b3c709f 100644
--- a/memory/Cargo.toml
+++ b/memory/Cargo.toml
@@ -14,7 +14,7 @@ description = "Rendy's memory manager"
 serde-1 = ["serde", "gfx-hal/serde"]
 
 [dependencies]
-gfx-hal = { git = "https://github.com/gfx-rs/gfx", rev = "6d10d21788fffa6a7ca17888c8d3a4b6265442e7" }
+gfx-hal = { version = "0.5" }
 log = "0.4"
 hibitset = {version = "0.6", default-features = false}
 relevant = { version = "0.4", features = ["log"] }

@str4d
Copy link

str4d commented Oct 4, 2020

I do get the same errors as CI when running this PR as-is. I think that points to a problem in gfx master rather than this PR. Note that the backport PR @zicklag pointed to above subsequently led to them uncovered that GL is currently completely broken in their master: gfx-rs/gfx#3325 (comment)

@ezpuzz ezpuzz merged commit 11da81a into amethyst:master Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port to gfx-hal-0.5

4 participants