Crate sierra

Source
Expand description

Sierra is Vulkan-lite API, focused on ease of use while maintaining high level of control.

While resembles Vulkan in most ways,
sierra does both memory and descriptor allocation automatically. Additionally sierra tracks resources usage to free them once no references left.

Sierra provides rich proc-macro system for declarative descriptor sets and render passes.

Re-exports§

pub use self::backend::Device;
pub use self::backend::Graphics;
pub use crate::backend::AccelerationStructure;
pub use crate::backend::Buffer;
pub use crate::backend::BufferView;
pub use crate::backend::MappableBuffer;
pub use crate::backend::DescriptorSetLayout;
pub use crate::backend::DescriptorSet;
pub use crate::backend::WritableDescriptorSet;
pub use crate::backend::CommandBuffer;
pub use crate::backend::Fence;
pub use crate::backend::Framebuffer;
pub use crate::backend::Image;
pub use crate::backend::PhysicalDevice;
pub use crate::backend::ComputePipeline;
pub use crate::backend::GraphicsPipeline;
pub use crate::backend::RayTracingPipeline;
pub use crate::backend::PipelineLayout;
pub use crate::backend::Queue;
pub use crate::backend::RenderPass;
pub use crate::backend::Sampler;
pub use crate::backend::Semaphore;
pub use crate::backend::ShaderModule;
pub use crate::backend::Surface;
pub use crate::backend::ImageView;
pub use self::Samples::*;

Modules§

backend
Contains backend specific types. Most of the type user would use re-exports in the crate root.

Macros§

binding_flags
debug
descriptor_set_layout
descriptor_set_layout_bindings
error
format
graphics_pipeline_desc
info
shader_stages
sparse_descriptors
swizzle
trace
warn

Structs§

AabbPositions
Structure expected by device in buffer range specified by AccelerationStructureGeometry::AABBs.
AccelerationStructureBuildFlags
Bits which can be set in AccelerationStructureInfo specifying additional parameters for acceleration structure builds.
AccelerationStructureBuildGeometryInfo
Data provided to acceleration structure build operation.
AccelerationStructureBuildSizesInfo
Contains information about various size requirements for acceleration structure.
AccelerationStructureInfo
Information required to create an instance of AccelerationStructure.
AccelerationStructureInstance
Structure expected by device in buffer range specified by AccelerationStructureGeometry::Instances.
Access
Specifies the access types for a resource.
AnyHitShader
AspectFlags
AttachmentInfo
Describes one attachment of a render pass.
Blending
Defines how color value from fragment shader’s color output should be blended with value stored in attachment.
Bounds
BufferCopy
BufferImageCopy
BufferInfo
Information required to create a buffer.
BufferMemoryBarrier
BufferRange
Buffer range.
BufferRangeState
Buffer range handle that holds unsynchronized access. When used in operation, it is checked that no synchronization is required. Adding it to the synchronization command will synchronized access to it.
BufferUsage
Flags to specify allowed usages for buffer.
BufferViewInfo
Information required to create a buffer.
ClearColor
ClearDepth
ClearDepthStencil
ClearStencil
ClosestHitShader
CombinedImageSampler
Image view, layout and sampler.
Unlike [ImageViewDescriptor] this descriptor contains a sampler. to do sampled reads.
ComponentMapping
Defines remapping of color components.
ComponentMask
Flags for each of color components.
CompositeAlphaFlags
ComputePipelineInfo
Compute pipeline state definition.
ComputeShader
DepthTest
Defines how depth testing is performed.
DescriptorBindingFlags
Flags that can be set in each DescriptorSetLayoutBinding to specify options for the corresponding descriptor set layout binding. Note that Vulkan 1.2 is required for any of these flags. That is, the only valid value prior Vulkan 1.2 is DescriptorBindingFlags::empty().
DescriptorSetCopy
DescriptorSetInfo
Contains information required to create DescriptorSet instance.
DescriptorSetLayoutBinding
Defines layout for one binding in descriptor set.
DescriptorSetLayoutFlags
Flags that can be sed to
DescriptorSetLayoutInfo
Defines layout for descriptor sets.
DescriptorSetWrite
DeviceAddress
Device address is u64 value pointing into device resource.
DeviceInfo
Contains descriptive information about device.
DeviceLost
Error that may occur during execution on the device and then signalled on command submission or waiting operations.
DynamicGraphicsPipeline
Encoder
Command encoder that can encode commands outside render pass.
EncoderCommon
Basis for encoding capabilities. Implements encoding of commands that can be inside and outside of render pass.
Extent
Multidimensional size.
Family
Family of queues created together with device.
FamilyInfo
Information about one queue family.
FormatDescription
FragmentShader
FramebufferInfo
Defines Framebuffer state. Can be used to Device::create_framebuffer.
GeometryFlags
Bits specifying additional parameters for geometries in acceleration structure builds
GeometryInstanceFlags
Possible values of flags in the instance modifying the behavior of that instance.
GeometryShader
GraphicsPipelineDesc
Graphics pipeline state definition. Fields are ordered to match pipeline stages, including fixed functions.
GraphicsPipelineInfo
ImageBlit
ImageCopy
ImageInfo
Information required to create an image.
ImageMemoryBarrier
ImageSubresourceRange
ImageSubresourceState
Image region with access mask, specifying how it may be accessed “before”.
ImageUsage
Flags to specify allowed usages for image.
ImageViewCache
Cache for image views This cache uses eviction strategy of ResourceCache. But has convenience methods for fetching image views.
ImageViewInfo
Information required to create an image view.
ImageViewState
Image region with access mask, specifying how it may be accessed “before”.
InstanceCustomIndexAndMask
InstanceShaderBindingOffsetAndFlags
IntersectionShader
LayoutTransition
MemoryUsage
Memory usage type. Bits set define intended usage for requested memory.
MinimalExtent
MissShader
Offset
Multidimensional offset.
OutOfMemory
Error that may occur when allocation fails because of either device memory is exhausted.
Padded
PipelineLayoutInfo
Defines layout of pipeline inputs: all descriptor sets and push constants.
PipelineStages
Flags to specify set of pipeline stages.
PresentationTiming
PushConstant
QueueCapabilityFlags
Queue capability flags.
QueueId
QueueNotFound
Could not find a queue with specified capabilities.
QueuesQueryClosure
Rasterizer
RayTracingPipelineInfo
RaygenShader
Rect
RenderPassEncoder
Command encoder that can encode commands inside render pass.
RenderPassInfo
Defines render pass, its attachments and one implicit subpass.
RenderingColorInfo
RenderingDepthInfo
RenderingDepthStencilAttachmentInfo
RenderingDepthStencilInfo
RenderingEncoder
Command encoder that can encode commands inside render pass.
RenderingInfo
RenderingStencilInfo
ResourceCache
General purpose cache for sierra resources. This cache evicts resources based on their last used epoch. Each time a resource is used, its last used epoch is updated to the current. The cache evicts all resources that have not been used for a certain amount of epochs.
SamplerInfo
Shader
Shader module and entry point. Uniquely identifies shader for pipeline.
ShaderBindingTable
ShaderBindingTableInfo
ShaderModuleInfo
Defines layout for descriptor sets.
ShaderStageFlags
Flags for each of graphics shaders.
SingleQueueQuery
Query only one queue with specified capabilities.
SparseDescriptorSet
SparseDescriptors
Descriptors input to be used in proc-macro pipelines.
SparseDescriptorsInstance
Descriptor instance with sparsely located resources.
SparseDescriptorsLayout
Descriptors layout for SparseDescriptors.
Spirv
Valid SPIR-V shader code.
StencilTest
StencilTests
StridedBufferRange
Buffer range with specified stride value.
Subpass
SubpassDependency
Defines memory dependency between two subpasses or subpass and commands outside render pass.
Subresource
Subresorce of the image. Unlike SubresourceRange it specifies only single mip-level and single array layer.
SubresourceLayers
Subresorce layers of the image. Unlike SubresourceRange it specifies only single mip-level. Used in image copy operations.
SubresourceRange
Subresorce range of the image. Used to create ImageViews.
SurfaceCapabilities
SurfaceInfo
SurfaceTransformFlags
TessellationControlShader
TessellationEvaluationShader
TransformMatrix
TypedBuffer
UpdateDescriptorSet
Defines how to write descriptors into set.
VertexInputAttribute
Vertex sub-range to attribute mapping.
VertexInputBinding
Vertex buffer binding bahavior. Controls what subrange corresponds for vertex X of instance Y.
VertexShader
Viewport
Viewport transformation.
Width
WidthHeight
WidthHeightDepth
WrongShaderStage
X
XY
XYZ
boolean
POD replacement for bool.

Enums§

AccelerationStructureGeometry
Geometry data to build into acceleration structure.
AccelerationStructureGeometryInfo
Specifies the shape of geometries that will be built into an acceleration structure.
AccelerationStructureLevel
Acceleration structure level.
BGR
BGRA
BlendFactor
Defines how blend factor is calculated.
BlendOp
Blending operation to be applied between color value from fragment shader’s color output and value stored in attachment.
BorderColor
Capability
Capability a queue may have.
Channels
ClearValue
Value for attachment load clear operation.
ColorAttachmentOptimal
ColorBlend
Defines how color stored in attachment should be blended with color output of fragment shader.
CompareOp
ConstBits
CreateBufferError
Possible error which can be returned from create_buffer_*.
CreateDeviceError
CreateRenderPassError
CreateShaderModuleError
CreateSurfaceError
Culling
Polygione culling mode.
D
DS
DepthStencilAttachmentOptimal
DepthStencilReadOnlyOptimal
DescriptorSlice
Collection of descriptors.
This type is used in [WriteDescriptorSet] to specify descriptors to write.
DescriptorType
Types of descriptors.
DescriptorsAllocationError
AllocationError that may occur during descriptor sets allocation.
DeviceKind
Kind of the device.
EnumerateDeviceError
Error occured during device enumeration.
Feature
Features that optionally can be supported by devices.
Filter
Format
Texel format. Images can have different texel formats. Some of which are color or depth and/or stencil. Format defines components, number of bits, layout and representation of texels.
FramebufferError
FrontFace
Polygon front face definition.
General
GraphicsPipelineRenderingInfo
Defines rendering info for the pipeline creation.
ImageExtent
Extent of the image.
ImageViewKind
Kind of image view.
IndexData
IndexType
InvalidShader
Layout
Image layout defines how texel are placed in memory. Operations can be used in one or more layouts. User is responsible to insert layout transition commands to ensure that the image is in valid layout for each operation. Pipeline barriers can be used to change layouts. Additionally render pass can change layout of its attachments.
LoadOp
Specifies how render pass treats attachment content at the beginning.
LogicOp
Logical operation to be applied between color value from fragment shader’s color output and value stored in attachment.
MapError
Possible error that may occur during memory mapping.
MipmapMode
Ownership
PipelineStage
Enum to specify one pipeline stage.
PolygonMode
PolygonMode rasterization mode.
Present
PresentError
PresentMode
PresentOk
PrimitiveTopology
Topology of primitives.
QueueError
R
RG
RGB
RGBA
RawDisplayHandleKind
Kind of raw window handles
RawWindowHandleKind
Kind of raw window handles
RayTracingShaderGroupInfo
S
SamplerAddressMode
Samples
Number of samples for an image.
Sfloat
ShaderLanguage
Shader language.
ShaderReadOnlyOptimal
ShaderStage
Sint
Snorm
Srgb
Sscaled
State
Wrapper for pipeline states that can be either static or dynamic.
Std140
Default layout for [Repr]. Can be used for both uniforms storage buffers.
Std430
Can be used only for storage buffers.
StencilOp
Defines what operation should be peformed on value in stencil buffer.
StoreOp
SurfaceError
Swizzle
Defines remapping of a color component.
TransferDstOptimal
TransferSrcOptimal
Type
Uint
Unorm
Uscaled
VertexInputRate
Controls vertex input iteration frequency.
WrongNumberOfElements

Traits§

Attachment
Trait for types that can be used for attachments in declarative render-pass.
DescriptorBinding
Trait for all types that can be used as a descriptor.
DescriptorBindingArray
Trait for all types that can be used as a descriptor array.
Descriptors
Input structures for descriptors implement this trait.
DescriptorsInstance
Trait for descriptors instance.
DescriptorsLayout
Trait for descriptor layouts.
Padding
Safety
Pass
PipelineInput
PipelineInputLayout
PipelineLayout for specific PipelineInput.
PipelinePushConstants
Extension trait for push constants, specifying stages, offset and size in the typed pipeline.
QueuesQuery
Trait for querying command queues.
RenderPassInstance
ShaderNative
Type that can be represented in shader natively. i.e. with matching layout, and can be copied as-is.
ShaderRepr
Type that can be represented in shader.
StaticFormat
StaticLayout
UpdatedDescriptors
Trait for descriptors updated and ready to be bound to pipeline.
UpdatedPipelineDescriptors
Extension trait for updated descriptors, specifying offset in typed pipeline.
ValidLayout

Functions§

align_down
Returns maximal aligned integer not greater than value.
align_offset
align_up
Returns minimal aligned integer not smaller than value.
host_memory_space_overflow
Handles host OOM the same way global allocator does. This function should be called on host OOM error returned from Vulkan API.
minimal_extent
next_offset
out_of_host_memory
Handles host OOM the same way global allocator does. This function should be called on host OOM error returned from Vulkan API.
pad_size

Type Aliases§

Extent1
Extent2
Extent3
ImageOffset
Image offset is defined to i32 which is standard for graphics API today.
ImageSize
Image size is defined to u32 which is standard for graphics API of today.
Offset1
Offset2
Offset3
bmat2
bmat3
bmat4
bmat2x2
bmat2x3
bmat2x4
bmat3x2
bmat3x3
bmat3x4
bmat4x2
bmat4x3
bmat4x4
bvec2
bvec3
bvec4
dmat2
dmat3
dmat4
dmat2x2
dmat2x3
dmat2x4
dmat3x2
dmat3x3
dmat3x4
dmat4x2
dmat4x3
dmat4x4
dvec2
dvec3
dvec4
imat2
imat3
imat4
imat2x2
imat2x3
imat2x4
imat3x2
imat3x3
imat3x4
imat4x2
imat4x3
imat4x4
ivec2
ivec3
ivec4
mat2
mat3
mat4
mat2x2
mat2x3
mat2x4
mat3x2
mat3x3
mat3x4
mat4x2
mat4x3
mat4x4
umat2
umat3
umat4
umat2x2
umat2x3
umat2x4
umat3x2
umat3x3
umat3x4
umat4x2
umat4x3
umat4x4
uvec2
uvec3
uvec4
vec2
Vector with 2-elements.
vec3
Vector with 3-elements.
vec4
Vector with 4-elements.

Derive Macros§

Descriptors
Pass
PipelineInput
ShaderRepr