Crate nexg

Source
Expand description

§Nexg

§Low-level fast GPU Api

GitHub License GitHub top language dependency status GitHub code size in bytes GitHub Actions Workflow Status

§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

Code

triangle

Structs§

Buffer
BufferDescriptor
CommandPool
CommandPoolDescriptor
Stores information needed to create a CommandPool.
CommandRecorder
CommandRecorderDescriptor
Stores information needed to create a CommandRecorder.
Device
DeviceConnecter
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.
FenceDescriptor
Stores information needed to create a Fence.
FrameBuffer
FrameBufferDescriptor
Stores information needed to create a FrameBuffer.
Image
ImageDescriptor
Stores information needed to create a Image.
ImageView
ImageViewDescriptor
Instance
InstanceBuilder
Object that allows building windows.
InstanceFeature
Represents an additional feature of the instance.
Pipeline
PipelineDescriptor
PipelineLayout
PipelineLayoutDescriptor
PipelineVertexInputDescriptor
Queue
QueueFamilyProperties
QueuePresentDescriptor
QueueSubmitDescriptor
RenderPass
RenderPassBeginDescriptor
Stores information needed to start a render pass.
RenderPassDescriptor
Stores information needed to create a RenderPass.
RequestConnecterDescriptor
Resource
ResourceBufferDescriptor
ResourceLayout
ResourceLayoutBinding
ResourcePool
ResourcePoolDescriptor
ResourcePoolSize
ResourceUpdateDescriptor
Semaphore
An object to wait for work. Used to wait for a specific operation.
SemaphoreDescriptor
Stores information needed to create a Semaphore.
Shader
Represents a shader
ShaderStageDescriptor
Register shader information. Required for pipeline creation.
Spirv
Represents a Spir-V intermediate representation
SubPass
SubPassDescriptor
Stores information needed to create a FrameBuffer.
Surface
Swapchain
VertexInputAttributeDescriptor
VertexInputBindingDescriptor

Enums§

BindPoint
BufferUsage
DataFormat
ImageDimension
Represents the dimension of the image.
ImageFormat
Indicates the format of the image.
LoadOp
NxError
ResourceType
ShaderStage
Indicates shader type.
StoreOp
SwapchainState

Traits§

Destroy
Implement on objects that need to be destroyed. They are called from the instance or from the destroy method of the device.

Type Aliases§

NxResult