vulkano | Safe and rich Rust wrapper around the Vulkan API
kandi X-RAY | vulkano Summary
kandi X-RAY | vulkano Summary
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
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vulkano
vulkano Key Features
vulkano Examples and Code Snippets
Community Discussions
Trending Discussions on vulkano
QUESTION
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:13You can use a bound on Self
:
QUESTION
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:51Make a constant with static
lifetime:
QUESTION
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:54So 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
QUESTION
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:55From vulkano-rs/vulkano#1527:
AutoCommandBufferBuilder::new
renamed toAutoCommandBufferBuilder::primary/secondary
. Forprimary
form there is a new additional 3rd parameter. UseCommandBufferUsage::MultipleSubmit
for this parameter to fulfill the same behavior you previously had with oldnew
constructor.
QUESTION
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:02You 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.
QUESTION
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 literal1
.&[]
: a reference to an empty slice.
QUESTION
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:05I have checked the library and the version of
vulkano_win
and it seems to properly extendWindowBuilder
I will post the dependencies in myCargo.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:
QUESTION
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:55So 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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vulkano
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
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page