vulkano | Safe and rich Rust wrapper around the Vulkan API

 by   vulkano-rs Rust Version: v0.33.0 License: Apache-2.0

kandi X-RAY | vulkano Summary

kandi X-RAY | vulkano Summary

vulkano is a Rust library. vulkano has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

We started collecting this list just recently, and will be appreciated if you help us by contributing(opening a PR) into README.md. We would love to help you keep your project in sync with the most recent changes in Vulkano if you give us feedback by adding your project into this list.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              vulkano has a medium active ecosystem.
              It has 3835 star(s) with 406 fork(s). There are 61 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 102 open issues and 694 have been closed. On average issues are closed in 556 days. There are 11 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of vulkano is v0.33.0

            kandi-Quality Quality

              vulkano has 0 bugs and 0 code smells.

            kandi-Security Security

              vulkano has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              vulkano code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              vulkano is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              vulkano releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 17298 lines of code, 0 functions and 1 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vulkano
            Get all kandi verified functions for this library.

            vulkano Key Features

            No Key Features are available at this moment for vulkano.

            vulkano Examples and Code Snippets

            No Code Snippets are available at this moment for vulkano.

            Community Discussions

            QUESTION

            Tell the Rust compiler that the lifetime of a parameter is always identical to a struct's lifetime
            Asked 2021-Dec-04 at 13:22

            Sorry if this is obvious, I'm starting out with Rust.

            I'm trying to implement a simple Composition relationship (one object is the single owner of another one, and the inner object is destroyed automatically when the outer object dies).

            I originally thought it would be as simple as declaring a struct like this:

            ...

            ANSWER

            Answered 2021-Dec-03 at 16:13

            You can use a bound on Self:

            Source https://stackoverflow.com/questions/70217287

            QUESTION

            How can I make a variable borrow for 'static?
            Asked 2021-Nov-09 at 00:51

            In vulkano, to create a CPUAccessibleBuffer you need give it some data and the CPUAccessibleBuffer::from_data function requires the data to have the 'static lifetime.

            I have some data in &[u8] array (created at runtime) that I would like to pass to that function.

            However, it errors with this message

            ...

            ANSWER

            Answered 2021-Nov-09 at 00:51

            Make a constant with static lifetime:

            Source https://stackoverflow.com/questions/69888071

            QUESTION

            "cannot return value referencing local variable" when returning PhysicalDevice (Vulkano)
            Asked 2021-Jun-14 at 20:54

            I know this is a Rust newbie problem, but I actually can't wrap my head around it. I need to pass around a PhysicalDevice from the Vulkano library. The problem is, PhysicalDevice holds a reference:

            ...

            ANSWER

            Answered 2021-Jun-14 at 20:54

            So the reason for the error message is that instance is a local variable in your instantiate function. Because you aren't moving its ownership to the return value, it will be dropped at the end of the function.

            But then if it gets dropped, any reference to it would be invalid. That's why Rust doesn't let you return something holding a reference to the local variable.

            First, your struct is redundant, because PhysicalDevice already holds a reference for the instance. Even without the local variable problem, I think you'd run into an ownership problem.

            Second, let's say you rewrite and get rid of your InstanceInfo struct and instead you want to just return a PhysicalDevice<'static>. Well if that's what you promise to the compiler, then you have to make sure that the instance you create will live for as long as the program lives.

            You can do that either by having instance be a static variable of your module, or by creating it at the very beginning of the program and then simply pass a reference ot it around.

            For example

            Source https://stackoverflow.com/questions/67976699

            QUESTION

            How do I create an AutoCommandBufferBuilder in vulkano-rs "0.23.0"?
            Asked 2021-Jun-07 at 21:55

            I am following along the examples in the vulkano-rs website and at the section where it says to create an AutoCommandBufferBuilder, it says to use AutoCommandBufferBuilder::new() to create it.

            However, in the latest version of vulkano-rs - 0.23.0 - this method is missing.

            If I downgrade to version 0.22.0, the method exists.

            So, how do I create an AutoCommandBuffer in the latest version of vulkano-rs?

            ...

            ANSWER

            Answered 2021-Jun-07 at 21:55

            From vulkano-rs/vulkano#1527:

            AutoCommandBufferBuilder::new renamed to AutoCommandBufferBuilder::primary/secondary. For primary form there is a new additional 3rd parameter. Use CommandBufferUsage::MultipleSubmit for this parameter to fulfill the same behavior you previously had with old new constructor.

            Source https://stackoverflow.com/questions/67862021

            QUESTION

            Vulkan API calls to GPU drivers
            Asked 2021-May-28 at 07:56

            Background:
            I have been eyeing writing an application which needs very basic but fast graphics (just drawing lines and squares), and I'm probably going to use a library such as GLFW, or Vulkano if i'm going with Rust.

            I want to understand a specific, and I guess quite practical, detail of the Vulkan API. I understand that GPUs can be quite a complicated topic, but I want to emphasize that I don't have any background in low-level graphics or Vulkan, so I understand if my question cannot be answered, or if my question does not even make sense. I'll try my best to use the correct terminology. I have to admit, I'm not the best at skimming through and looking at large amounts of source code I don't quite understand and still grasp the overall concept, which is why I hope I can find my answer here. I've tried looking at the source code for Vulkan and Mesa drivers, but it bore no fruit.

            ORIGINAL Question:
            I want to understand how an API call is propagated to the GPU driver.

            I have searched around, but couldn't find the specifics I am searching for. The closest posts I've found are these two:
            https://softwareengineering.stackexchange.com/questions/279069/how-does-a-program-talk-to-a-graphics-card
            https://superuser.com/questions/461022/how-does-the-cpu-and-gpu-interact-in-displaying-computer-graphics

            They both mention something similar to "In order to make the GPU do something, you have to make a call via a supported API". I know that, but neither of the two dig into the specifics of how that API call is made. Hopefully, the diagram below illustrates my question.

            ...

            ANSWER

            Answered 2021-May-26 at 14:02

            You are looking for the Vulkan-Loader/LoaderAndLayerInterface.md documentation.

            The app interfaces with The Loader (sometimes called Vulkan RT, or Vulkan Runtime). That is the vulkan-1.dll (or so).

            The Loader also has vulkan-1.lib, which is classic dll shim. It is where the loading of core version and WSI commands happens, but you can skip the lib and do it all manually directly from the dll using vkGetInstanceProcAddr.

            Then you have ICDs (Installable Client Drivers). Those are something like nvoglv64.dll, and you can have more of them on your PC (e.g. Intel iGPU + NV). The name is arbitrary and vendor specific. The Loader finds them via config files.

            Now when you call something to a command obtained with vkGetInstanceProcAddress (which is everything if you use the *.lib only), you get onto a loader trampoline, which calls a chain of layers, after which the relevant ICD (or all of them) are called. Then the callstack is unwound, so it goes the other direction until the returned to the app. The loader mutexes and merges the the input and output to the ICD.

            Commands obtained with vkGetDeviceProcAddress are little bit more streamlined, as they do not require to be mutexed or merged and are meant to be passed to the ICD without much intervention from the Loader.

            The code is also at the same repo: trampoline.c, and loader.c. It's pretty straightforward; every layer just calls the layer below it. Starts at the trampoline, and ends with the terminator layer which in turn will call the ICD layer.

            Source https://stackoverflow.com/questions/67703924

            QUESTION

            What is the purpose of the &() syntax?
            Asked 2020-Nov-23 at 15:51

            I've been writing some Vulkan code using the rust library Vulkano, and came across the following snippet:

            ...

            ANSWER

            Answered 2020-Nov-22 at 22:11

            [Is it] a reference to the unit type?

            That's exactly what it is. Its just passing a reference & to the value ().

            Similar syntax:

            • &1: a reference to a literal 1.
            • &[]: a reference to an empty slice.

            Source https://stackoverflow.com/questions/64959991

            QUESTION

            Not being able to call build_vk_surface() on a WindowBuild object
            Asked 2020-Nov-10 at 23:05

            I am following the vulkano tutorial to open a window and create a surface with vulkano-win.

            Most of the tutorial is dated which I've been able to work around so far, however I have not been able to find a solution.

            Currently, I get the following error when I call let window = WindowBuilder::new().build_vk_surface(&events_loop, instance.clone())

            error[E0599]: no method named build_vk_surface found for struct winit::window::WindowBuilder in the current scope

            I have checked the library and the version of vulkano_win and it seems to properly extend WindowBuilder I will post the dependencies in my Cargo.toml below.

            ...

            ANSWER

            Answered 2020-Nov-10 at 23:05

            I have checked the library and the version of vulkano_win and it seems to properly extend WindowBuilder I will post the dependencies in my Cargo.toml below.

            In short, you are correct. The issue is that the VkSurfaceBuild trait, is implemented for winit 0.22's WindowBuilder and not winit 0.23's WindowBuilder.

            So to fix your issue, you need to update your Cargo.toml to use winit 0.22 instead of 0.23.

            Example:

            Source https://stackoverflow.com/questions/64776095

            QUESTION

            Why does the compiler result an error of "cycle detected when processing ..."?
            Asked 2020-Apr-19 at 15:55

            For context, I am using the Vulkano library to make a game, so I have omitted all Vulkano imports. I was trying to use the render() function to render my world, but I am confused with the error because I have not reference any implementations from world.rs into mesh.rs. I have just started using Rust for a few months now, so I may still be confused with the Traits and stuff.

            Project Source Directory

            ...

            ANSWER

            Answered 2020-Apr-19 at 15:55

            So I found myself very naive towards Rust's complex trait system. The only change I had to do was to add a 'static lifetime on to the associate type Vertex which fixes the problem which is really confusing the fact that the error shows as a circular reference.

            Source https://stackoverflow.com/questions/61178408

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install vulkano

            Vulkano uses shaderc-rs for shader compilation. Refer to shaderc-rs documentation to provide a pre-built libshaderc for faster build times. Note that in general vulkano does not require you to install the official Vulkan SDK. This is not something specific to vulkano (you don't need the SDK to write programs that use Vulkan, even without vulkano), but many people are unaware of that and install the SDK thinking that it is required. However, macOS and iOS platforms do require a little more Vulkan setup since it is not natively supported. See below for more details.
            CMake
            Ninja Is optional except when building with MSVC. It may speed up build time for libshaderc.
            Python (works with both Python 2.x and 3.x, on windows the executable must be named python.exe)
            rustup default stable-x86_64-pc-windows-msvc
            Install Build Tools for Visual Studio 2017. If you have already been using this toolchain then its probably already installed.
            Install msys2, following ALL of the instructions.
            Then in the msys2 terminal run: pacman --noconfirm -Syu mingw-w64-x86_64-cmake mingw-w64-x86_64-python2 mingw-w64-x86_64-ninja
            Add the msys2 mingw64 binary path to the PATH environment variable.
            windows-gnu toolchain is not supported but you can instead cross-compile to windows-gnu from windows-msvc. Steps 1 and 2 are to workaround https://github.com/rust-lang/rust/issues/49078 by using the same mingw that rust uses.
            Download and extract https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
            Add the absolute path to mingw64\bin to your PATH environment variable. (This path needs to be before the msys2 path)
            Run the command: rustup default stable-x86_64-pc-windows-msvc
            Run the command: rustup target install x86_64-pc-windows-gnu
            Install Build Tools for Visual Studio 2017. If you have already been using this toolchain then its probably already installed.
            Install msys2, following ALL of the instructions.
            Then in the msys2 terminal run: pacman --noconfirm -Syu mingw64/mingw-w64-x86_64-pkg-config mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-make mingw-w64-x86_64-python2 mingw-w64-x86_64-ninja
            Add the msys2 mingw64 binary path to the PATH environment variable.
            Any cargo command that builds the project needs to include --target x86_64-pc-windows-gnu e.g. to run: cargo run --target x86_64-pc-windows-gnu
            Use your package manager to install the required dev-tools and vulkan drivers.

            Support

            To get started you are encouraged to use the following resources:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/vulkano-rs/vulkano.git

          • CLI

            gh repo clone vulkano-rs/vulkano

          • sshUrl

            git@github.com:vulkano-rs/vulkano.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link