Expand description
Low-level graphics abstraction for Rust. Mostly operates on data, not types. Designed for use by libraries and higher-level abstractions only.
This crate provides a hardware abstraction layer for graphics adapters, for both compute and graphics operations. The API design is heavily inspired by the Vulkan API, and borrows some of the terminology.
§Usage
Most of the functionality is implemented in separate crates, one for each backend.
This crate only exposes a few generic traits and structures. You can import
all the necessary traits through the prelude
module.
The first step to using gfx-hal
is to initialize one of the available
backends, by creating an Instance
. Then proceed by
enumerating the available
graphics adapters and querying their available
features and queues.
You can use the open
method on a
PhysicalDevice
to get a logical device
handle, from which you can manage all the other device-specific
resources.
Modules§
- adapter
- Physical graphics devices.
- buffer
- Memory buffers.
- command
- Command buffers.
- device
- Logical graphics device.
- display
- Displays.
- external_
memory - Structures related to the import external memory functionality.
- format
- Universal format specification. Applicable to textures, views, and vertex buffers.
- image
- Image related structures.
- memory
- Types to describe the properties of memory allocated for graphics resources.
- pass
- Render pass handling.
- pool
- Command pools
- prelude
- Prelude module re-exports all the traits necessary to use
gfx-hal
. - pso
- Raw Pipeline State Objects
- query
- Commands that can be used to record statistics or other useful values as the command buffer is running.
- queue
- Command queues.
- window
- Windowing system interoperability.
Macros§
- spec_
const_ list - Macro for specifying list of specialization constants for
EntryPoint
.
Structs§
- Descriptor
Indexing Properties - Feature capabilities related to Descriptor Indexing.
- Descriptor
Limits - Downlevel
Properties - Propterties to indicate when the backend does not support full vulkan compliance.
- Dynamic
States - Dynamic pipeline states.
- External
Memory Limits - Physical device limits for external memory management
- Features
- Features that the device supports.
- Limits
- Resource limits of a particular graphics device.
- Memory
Type Id - A strongly-typed index to a particular
MemoryType
. - Mesh
Shader Properties - Resource limits related to the Mesh Shaders.
- Performance
Caveats - Features that the device doesn’t support natively, but is able to emulate at some performance cost.
- Physical
Device Properties - Properties of physical devices that are exposed but do not need to be explicitly opted into.
- Sampler
Reduction Properties - Resource limits related to the reduction samplers.
- Unsupported
Backend - Error creating an instance of a backend on the platform that doesn’t support this backend.
Enums§
- Downlevel
Shader Model - Collections of shader features shaders support if they support less than vulkan does.
- Index
Type - An enum describing the type of an index value in a slice’s index buffer
Traits§
Type Aliases§
- Draw
Count - Indirect draw calls count.
- Index
Count - Draw number of indices.
- Instance
Count - Draw number of instances.
- Task
Count - Number of tasks.
- Vertex
Count - Draw vertex count.
- Vertex
Offset - Draw vertex base offset.
- Work
Group Count - Number of work groups.