Code Monkey home page Code Monkey logo

gfx-hal-tutorials's People

Contributors

human9 avatar icefoxen avatar mistodon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gfx-hal-tutorials's Issues

Linux/Vulkan: Vulkan backend dependency needs "features" setting

Hi, thanks for doing these tutorials! :)

I'm starting to run through these tutorials, and I got to the point in Part 1 where we create graphics resources:

let (instance, surface, adapter) = {
    let instance = backend::Instance::create(APP_NAME, 1)
        .expect("Backend not supported");

    let surface = unsafe {
        instance
            .create_surface(&window)
            .expect("Failed to create surface for window")
    };

    let adapter = instance.enumerate_adapters().remove(0);

    (instance, surface, adapter)
};

I got the following error:

thread 'main' panicked at 'Failed to create surface for window:
UnsupportedWindowHandle', src/main.rs:50:13

(which corresponds to the instance.create_surface().expect() line).

I took a look at the Vulkan backend code, and realized that the match branches in create_surface are all guarded by #[cfg(all(feature = "FOO", ...))]

I saw my system was trying to use the Xlib window handle, so I threw in features = ["x11"] to my Vulkan backend dependencies in Cargo.toml:

[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies.backend]
package = "gfx-backend-vulkan"
features = ["x11"]
version = "=0.5.1"

And it started working again. However, this is probably not the way to solve it for all Vulkan users :) I'm not sure what the correct way to solve this is, so I'm leaving this issue here instead.

shaderc-rs update

Hi,

The package for the shader compilation says it's deprecated, I got tutorial 1 working using shaderc instead. Would you be interested in a pull request to update?

[SOLVED]part00-triangle panics on building under Linux+Vulkan

I ran the code on Linux Ubuntu 18.10. I have rustc 1.30.1 and rustup 1.14.0(1e51b07cc 2018-10-04) installed. everything is just as it is in the tutorial but still I get this error message:

Updating git repository `https://github.com/gfx-rs/gfx`
Updating crates.io index                                                    

Compiling cc v1.0.25
Compiling semver-parser v0.7.0
Compiling proc-macro2 v0.4.24
Compiling bitflags v1.0.4
Compiling libc v0.2.44
Compiling unicode-xid v0.1.0
Compiling gcc v0.3.55
Compiling lazy_static v1.2.0
Compiling core-foundation-sys v0.6.2
Compiling downcast-rs v1.0.3
Compiling void v1.0.2
Compiling rand_core v0.3.0
Compiling pkg-config v0.3.14
Compiling failure_derive v0.1.3
Compiling nix v0.11.0
Compiling foreign-types-shared v0.1.1
Compiling stable_deref_trait v1.1.1
Compiling scopeguard v0.3.3
Compiling cfg-if v0.1.6
Compiling remove_dir_all v0.5.1
Compiling rustc-demangle v0.1.9
Compiling block v0.1.6
Compiling byteorder v1.2.7
Compiling percent-encoding v1.0.1
Compiling gfx-backend-metal v0.1.0 (https://github.com/gfx-rs/gfx?rev=d428a5d5#d428a5d5)
Compiling xml-rs v0.7.0
Compiling semver v0.9.0
Compiling libloading v0.5.0
Compiling backtrace-sys v0.1.24
Compiling spirv_cross v0.10.1
Compiling unreachable v1.0.0
Compiling rand_isaac v0.1.1
Compiling rand_hc v0.1.0
Compiling rand_xorshift v0.1.0
Compiling rand_core v0.2.2
Compiling objc_exception v0.1.1
Compiling foreign-types v0.3.2
Compiling owning_ref v0.4.0
Compiling log v0.4.6
Compiling x11-dl v2.18.3
Compiling fxhash v0.2.1
error: failed to run custom build command for gfx-backend-metal v0.1.0 (https://github.com/gfx-rs/gfx?rev=d428a5d5#d428a5d5)
process didn't exit successfully: /home/wolfman13/Game Dev/Rust/Tutorials/gfx-triangle/target/debug/build/gfx-backend-metal-88c05fb0bf7b314f/build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-changed=/home/wolfman13/.cargo/git/checkouts/gfx-e86e7f3ebdbc4218/d428a5d/src/backend/metal/shaders
cargo:rerun-if-changed=/home/wolfman13/.cargo/git/checkouts/gfx-e86e7f3ebdbc4218/d428a5d/src/backend/metal/shaders/fill.metal

--- stderr
thread 'main' panicked at 'failed to execute metal compiler: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:1009:5
note: Run with RUST_BACKTRACE=1 for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

Can anyone please help :(

link error with the code for part1

Hi,
I recently updated to Rust 1.43 while typing in your code(slow but that is the way to learn) and compiling to perform checks. I started getting the following link errors on Windows 10 and do not know how to proceed at this point.

libspirv_cross-540902a585abd075.rlib(wrapper.o) : error LNK2001: unresolved external symbol __CxxFrameHandler4
libspirv_cross-540902a585abd075.rlib(spirv_msl.o) : error LNK2001: unresolved external symbol __CxxFrameHandler4
F:\users\fdemi\rust\Graphics\gfx-hal\gfx_hal_try1\target\debug\deps\gfx_hal_tutorials.exe : fatal error LNK1120: 1 unresolved externals

I know that _CXX** are windows symbols.

I am learning Rust while taking your tutorials. I do notice the rlib's have a bit of a different format.

Not sure how to proceed. Maybe see how to rollback Rust to an earlier version?

part01-resizing panics on resize under Linux+Vulkan

Pretty much what it says, I run part01-resizing with a Vulkan backend, and on resize I get the following:

thread 'main' panicked at 'Present failed: ()', libcore/result.rs:945:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:511
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:426
   6: rust_begin_unwind
             at libstd/panicking.rs:337
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:92
   8: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:26
   9: <core::result::Result<T, E>>::expect
             at /checkout/src/libcore/result.rs:809
  10: part01_resizing::main
             at src/bin/part01-resizing.rs:313
  11: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  12: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  13: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  14: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  15: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  16: main
  17: __libc_start_main
  18: _start

This line appears to be swapchain.present(&mut queue_group.queues[0], frame_index, &[]).expect("Present failed");. Haven't fiddled around with it further yet.

Black window in part-2 with OpenGL backend and x11

Hello,

I have encountered the following issue in part-2 of the tutorial:
A black window appears when I'm trying to run the program. There are no errors on the console, neither during compilation, nor during runtime.

Environment:
Linux OS with X11

Hardware:

OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 5500 (BDW GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.2.3
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.2.3
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.2.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 920M/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 418.113
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 418.113
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:

As I have no access to a Vulkan-capable hardware, I switched to the gl backend. Also, I have added the x11 feature to the Cargo.toml file as follows:

[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies.backend]
package = "gfx-backend-gl"
version = "=0.6.1"
features = ["x11"]

With both rendering devices mentioned above, I get a black window, no triangles are shown. The part-1 of the tutorial worked correctly.

I have also tried to upgrade all dependencies in Cargo.toml to the currently available most up-to-date versions. This didn't fix the issue, while part-1 of the tutorial still worked.

Note: after upgrading winit, let dpi = event_loop.primary_monitor().scale_factor(); has to be changed to something like let dpi = event_loop.primary_monitor().unwrap().scale_factor();, as the event_loop.primary_monitor() method now returns an Option.

Now, as I get no errors at all, I have absolutely no clue where to even start with debugging the code.

runtime error on windows (exit code: 0xc000041d)

hello,

i followed the first part of the tutorials and the triangle example works on Linux (using the vulkan backend) but on Windows (dx12), the window opens up as blank, does not respond, then it closes and I get the aforementioned exit code. there are no logs, or anything in the console that could potentially give me a clue on what is happening.

i know that my PC does support dx12. the GPU is a GeForce 635M with the default drivers you get from the nvidia utility for this GPU.

sorry if the info i'm giving is lacking, but that's about it :|

i appreciate any help.

no license

As far as I can see there's no license file and no license entry in the Cargo.toml file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.