Expand description
§Set up Device
use nexg::{InstanceFeature,InstanceBuilder};
let feature = InstanceFeature::empty();
let instance = InstanceBuilder::new().feature(feature).build().unwrap();
let connecters = instance.enumerate_connecters().unwrap();
let mut index = 0;
let mut found_device = false;
for i in &connecters {
let properties = i.get_queue_family_properties(&instance).unwrap();
for i in properties {
if i.is_graphic_support() {
index = 0;
found_device = true;
break;
}
}
}
if !found_device {
panic!("No suitable device found.")
}
let connecter = connecters[index];
let device = connecter.create_device(&instance, index).unwrap();
§Examples
§Triangle
Structs§
- Stores information needed to create a CommandPool.
- Stores information needed to create a CommandRecorder.
- Represents a handle to a physical device.
- An object to wait for work. This is used by the CPU to wait for the GPU to finish its work.
- Stores information needed to create a Fence.
- Stores information needed to create a FrameBuffer.
- Stores information needed to create a Image.
- Object that allows building windows.
- Represents an additional feature of the instance.
- Stores information needed to start a render pass.
- Stores information needed to create a RenderPass.
- An object to wait for work. Used to wait for a specific operation.
- Stores information needed to create a Semaphore.
- Represents a shader
- Register shader information. Required for pipeline creation.
- Represents a Spir-V intermediate representation
- Stores information needed to create a FrameBuffer.
Enums§
- Represents the dimension of the image.
- Indicates the format of the image.
- Indicates shader type.
Traits§
- Implement on objects that need to be destroyed. They are called from the instance or from the destroy method of the device.