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§
- Buffer
- Buffer
Descriptor - Command
Pool - Command
Pool Descriptor - Stores information needed to create a CommandPool.
- Command
Recorder - Command
Recorder Descriptor - Stores information needed to create a CommandRecorder.
- Device
- Device
Connecter - Represents a handle to a physical device.
- Extent3d
- Fence
- An object to wait for work. This is used by the CPU to wait for the GPU to finish its work.
- Fence
Descriptor - Stores information needed to create a Fence.
- Frame
Buffer - Frame
Buffer Descriptor - Stores information needed to create a FrameBuffer.
- Image
- Image
Descriptor - Stores information needed to create a Image.
- Image
View - Image
View Descriptor - Instance
- Instance
Builder - Object that allows building windows.
- Instance
Feature - Represents an additional feature of the instance.
- Pipeline
- Pipeline
Descriptor - Pipeline
Layout - Pipeline
Layout Descriptor - Pipeline
Vertex Input Descriptor - Queue
- Queue
Family Properties - Queue
Present Descriptor - Queue
Submit Descriptor - Render
Pass - Render
Pass Begin Descriptor - Stores information needed to start a render pass.
- Render
Pass Descriptor - Stores information needed to create a RenderPass.
- Request
Connecter Descriptor - Resource
- Resource
Buffer Descriptor - Resource
Layout - Resource
Layout Binding - Resource
Pool - Resource
Pool Descriptor - Resource
Pool Size - Resource
Update Descriptor - Semaphore
- An object to wait for work. Used to wait for a specific operation.
- Semaphore
Descriptor - Stores information needed to create a Semaphore.
- Shader
- Represents a shader
- Shader
Stage Descriptor - Register shader information. Required for pipeline creation.
- Spirv
- Represents a Spir-V intermediate representation
- SubPass
- SubPass
Descriptor - Stores information needed to create a FrameBuffer.
- Surface
- Swapchain
- Vertex
Input Attribute Descriptor - Vertex
Input Binding Descriptor
Enums§
- Bind
Point - Buffer
Usage - Data
Format - Image
Dimension - Represents the dimension of the image.
- Image
Format - Indicates the format of the image.
- LoadOp
- NxError
- Resource
Type - Shader
Stage - Indicates shader type.
- StoreOp
- Swapchain
State
Traits§
- Destroy
- Implement on objects that need to be destroyed. They are called from the instance or from the destroy method of the device.