Expand description
Tiny graphics crate made for nothing but fun.
Macros§
- include_
library - Convenience macro to include shader library input from a source code file during compilation.
- include_
shader_ source - Convenience macro to include shader source code from a file during compilation.
- match_
backend - with_
metal - Macro that passes-through any tokens inside if chosen backend is Metal. Otherwise, it unwraps to nothing.
- with_
vulkan - Macro that passes-through any tokens inside if chosen backend is Vulkan. Otherwise, it unwraps to nothing.
- with_
webgpu - Macro that passes-through any tokens inside if chosen backend is WebGPU. Otherwise, it unwraps to nothing.
Structs§
- Acceleration
Structure Build Flags - These flags are used to specify the build properties of an acceleration structure.
- Acceleration
Structure Command Encoder - Argument
Group Layout - Layout of the argument group.
- Argument
Layout - Layout of the shader argument slot.
- Attachment
Desc - Description of an attachment in a render pass.
- Blas
- Bottom-level acceleration structure. Contains ray-tracing acceleration structure for geometry. Created for triangle-meshes or procedural geometry.
- BlasAAB
Bs - Description of a bottom-level acceleration structure axis-aligned bounding box-based geometry.
- Blas
Build Desc - Description of a bottom-level acceleration structure build.
- Blas
Desc - Description of a bottom-level acceleration structure Contains flags and size of the acceleration structure.
- Blas
Flags - Blas
Triangles - Description of a bottom-level acceleration structure triangle-based geometry.
- Blend
- Describes blending option.
- Blend
Desc - Describes blending options for color render target.
- Buffer
- Buffer
Desc - Description used for buffer creation.
- Buffer
Init Desc - Description used for buffer creation with initial contents.
- Buffer
Mapped Range - Buffer
Mapped Range Mut - Buffer
Slice - Slice of a buffer is a reference to a buffer with offset and size. Mostly found in function arguments.
- Buffer
Usage - Buffer usage flags.
- Capabilities
- Capabilities of the devices.
- Clear
Color - Clear value for color attachment.
- Clear
Depth Stencil - Clear value for depth-stencil attachment.
- Color
Target Desc - Describes color render target.
- Command
Buffer - Command
Encoder - Compute
Command Encoder - Compute
Pipeline - Compute
Pipeline Desc - Compute pipeline descriptor. Used to create new compute pipelines.
- Copy
Command Encoder - Data
Type - Device data types.
- Depth
Stencil Desc - Describes depth-stencil render target.
- Device
- Device
Capabilities - Capabilities of the specific device.
- Device
Desc - Specifies how the device should be created.
- Extent
- Family
Capabilities - Capabilities of a queue family of specific device.
- Features
- Set of features that can be requested from the device. The device creation will fail if the device does not support all of the requested features. Check the capabilities of the device to see which features are supported.
- Frame
- Image
- Image
Desc - Description used for image creation.
- Image
Usage - Image usage flags.
- Instance
- Library
- Library
Desc - Describes shader library.
- Offset
- OutOf
Memory - Error that can happen when device’s memory is exhausted.
- Pipeline
Stages - Pipeline stages flags.
- Queue
- Queue
Flags - Flags that describe the capabilities of a queue.
- Raster
Desc - Describes rasterization options.
- Render
Command Encoder - Render
Pass Desc - Description of a render pass.
- Render
Pipeline - Render
Pipeline Desc - Describes render pipeline.
- Sampler
- Sampler
Desc - Describes how to sample the texture.
- Shader
- Shader from the library.
- Shader
Source - Describes shader source.
- Shader
Stages - Flags that describe the shader stages.
- Surface
- Swizzle
- Image swizzle for each component.
- Tlas
- Top-level acceleration structure. Contains ray-tracing acceleration structure for instances. Created for instances of bottom-level acceleration structures.
- Tlas
Build Desc - Tlas
Desc - Tlas
Flags - Tlas
Instance Desc - Vertex
Attribute Desc - Describes single vertex attribute.
- Vertex
Layout Desc - Describes vertex buffer layout.
- View
Desc - Description used for image view creation.
- Write
Mask - Mask for color blend write.
- mat
- Matrix data type.
Element type should be
Scalar, then it can be used as device data type. - vec
- Vector data type.
Element type should be
Scalar, then it can be used as device data type.
Enums§
- Acceleration
Structure Performance - Performance hints for acceleration structure operation.
- Address
Mode - Address mode to use when sampling the texture.
- Argument
Kind - Kind of the shader argument.
- Automatic
- Marker type for
Argumenttrait. - Backend
- Backend that is used for rendering.
- Blas
Geometry Desc - Description of a bottom-level acceleration structure geometry.
- Blend
Factor - Blending factor.
- BlendOp
- Blending operation.
- Compare
Function - Comparison function for depth test.
- Component
Swizzle - Image component swizzle.
- Culling
- Face culling mode.
- Device
Error - Filter
- Filter to use when sampling the texture.
- Front
Face - Front face winding order.
- Image
Extent - Extent of the image.
- Library
Input - Input for the library. Currently only source code is supported.
- LoadOp
- Load operation for an attachment.
- MipMap
Mode - Mip-map mode to use when sampling the texture.
- Pipeline
Error - Error during render pipeline creation.
- Pipeline
Stage - Stages in the rendering pipeline.
- Pixel
Format - Format of the pixel.
- Primitive
Topology - Describes primitive topology.
- Sampled
- Marker type for
Argumenttrait. - Scalar
Type - Types that can be passed as arguments to shaders.
Each element of the enum corresponds to a type that implements
DataType. - Shader
Language - Shader language.
- Shader
Library Error - Shader
Stage - Shader stage.
- Storage
- Marker type for
Argumenttrait. - StoreOp
- Store operation for an attachment.
- Surface
Error - Error that can occur when working with a surface.
- Uniform
- Marker type for
Argumenttrait. - Vector
Size - Supported sizes of vectors.
- Vertex
Format - Format of the vertex attribute.
- Vertex
Step Mode - Step mode for vertex buffer.
Traits§
- Arguments
- Shader arguments trait. Implemented by types that serve as shader arguments.
- Arguments
Field - Trait implemented by types that can be fields in type that derive
Arguments. This cannot be implemented outside of the crate. - AsBuffer
Slice - Trait to generalize over types that can be converted to buffer slice. This is a buffer slice itself, a buffer and references.
- Auto
Device Repr - A type that implements
DeviceReprand is compatible with GPU layout without padding. - Buffer
Range - Trait for types that can be used to index a buffer to get a slice of it.
It is implemented for different range types over
usize. - Device
Repr - Type representable as a POD type with GPU compatible layout.
- One
- Scalar
- Scalar types compatible with shaders primitives.
- Vertex
Attributes - Values that can be passed as attributes to shaders. This trait is sealed and cannot be implemented in other crates.
- Vertex
Binding - Trait to be derived for structures that contain vertex attributes.
- Vertex
Scalar - Narrow traits for scalar types that can be used as vertex attributes.
- Zero
Functions§
- mat2
- Construct a
mat2. - mat3
- Construct a
mat3. - mat4
- Construct a
mat4. - mat2x2
- Construct a
mat2x2. - mat2x3
- Construct a
mat2x3. - mat2x4
- Construct a
mat2x4. - mat3x2
- Construct a
mat3x2. - mat3x3
- Construct a
mat3x3. - mat3x4
- Construct a
mat3x4. - mat4x2
- Construct a
mat4x2. - mat4x3
- Construct a
mat4x3. - mat4x4
- Construct a
mat4x4. - vec2
- Construct a
vec2. - vec3
- Construct a
vec3. - vec4
- Construct a
vec4.
Type Aliases§
- Extent1
- Extent2
- Extent3
- Offset1
- Offset2
- Offset3
- bmat2
- Square boolean matrix type of two columns and two rows.
- bmat3
- Square boolean matrix type of three columns and three rows.
- bmat4
- Square boolean matrix type of four columns and four rows.
- bmat2x2
- Square boolean matrix type of two columns and two rows.
- bmat2x3
- Boolean matrix type of two columns and three rows.
- bmat2x4
- Boolean matrix type of two columns and four rows.
- bmat3x2
- Boolean matrix type of three columns and two rows.
- bmat3x3
- Square boolean matrix type of three columns and three rows.
- bmat3x4
- Boolean matrix type of three columns and four rows.
- bmat4x2
- Boolean matrix type of four columns and two rows.
- bmat4x3
- Boolean matrix type of four columns and three rows.
- bmat4x4
- Square boolean matrix type of four columns and four rows.
- bvec2
- Boolean vector type of two elements.
- bvec3
- Boolean vector type of three elements.
- bvec4
- Boolean vector type of four elements.
- dmat2
- Square double precision floating point matrix type of two columns and two rows.
- dmat3
- Square double precision floating point matrix type of three columns and three rows.
- dmat4
- Square double precision floating point matrix type of four columns and four rows.
- dmat2x2
- Square double precision floating point matrix type of two columns and two rows.
- dmat2x3
- Double precision floating point matrix type of two columns and three rows.
- dmat2x4
- Double precision floating point matrix type of two columns and four rows.
- dmat3x2
- Double precision floating point matrix type of three columns and two rows.
- dmat3x3
- Square double precision floating point matrix type of three columns and three rows.
- dmat3x4
- Double precision floating point matrix type of three columns and four rows.
- dmat4x2
- Double precision floating point matrix type of four columns and two rows.
- dmat4x3
- Double precision floating point matrix type of four columns and three rows.
- dmat4x4
- Square double precision floating point matrix type of four columns and four rows.
- dvec2
- Double precision floating point vector type of two elements.
- dvec3
- Double precision floating point vector type of three elements.
- dvec4
- Double precision floating point vector type of four elements.
- imat2
- Square signed integer matrix type of two columns and two rows.
- imat3
- Square signed integer matrix type of three columns and three rows.
- imat4
- Square signed integer matrix type of four columns and four rows.
- imat2x2
- Square signed integer matrix type of two columns and two rows.
- imat2x3
- Signed integer matrix type of two columns and three rows.
- imat2x4
- Signed integer matrix type of two columns and four rows.
- imat3x2
- Signed integer matrix type of three columns and two rows.
- imat3x3
- Square signed integer matrix type of three columns and three rows.
- imat3x4
- Signed integer matrix type of three columns and four rows.
- imat4x2
- Signed integer matrix type of four columns and two rows.
- imat4x3
- Signed integer matrix type of four columns and three rows.
- imat4x4
- Square signed integer matrix type of four columns and four rows.
- ivec2
- Signed integer vector type of two elements.
- ivec3
- Signed integer vector type of three elements.
- ivec4
- Signed integer vector type of four elements.
- mat2
- Square matrix type of two columns and two rows.
- mat3
- Square matrix type of three columns and three rows.
- mat4
- Square matrix type of four columns and four rows.
- mat2x2
- Square matrix type of two columns and two rows.
- mat2x3
- Matrix type of two columns and three rows.
- mat2x4
- Matrix type of two columns and four rows.
- mat3x2
- Matrix type of three columns and two rows.
- mat3x3
- Square matrix type of three columns and three rows.
- mat3x4
- Matrix type of three columns and four rows.
- mat4x2
- Matrix type of four columns and two rows.
- mat4x3
- Matrix type of four columns and three rows.
- mat4x4
- Square matrix type of four columns and four rows.
- umat2
- Square unsigned integer matrix type of two columns and two rows.
- umat3
- Square unsigned integer matrix type of three columns and three rows.
- umat4
- Square unsigned integer matrix type of four columns and four rows.
- umat2x2
- Square unsigned integer matrix type of two columns and two rows.
- umat2x3
- Unsigned integer matrix type of two columns and three rows.
- umat2x4
- Unsigned integer matrix type of two columns and four rows.
- umat3x2
- Unsigned integer matrix type of three columns and two rows.
- umat3x3
- Square unsigned integer matrix type of three columns and three rows.
- umat3x4
- Unsigned integer matrix type of three columns and four rows.
- umat4x2
- Unsigned integer matrix type of four columns and two rows.
- umat4x3
- Unsigned integer matrix type of four columns and three rows.
- umat4x4
- Square unsigned integer matrix type of four columns and four rows.
- uvec2
- Unsigned integer vector type of two elements.
- uvec3
- Unsigned integer vector type of three elements.
- uvec4
- Unsigned integer vector type of four elements.
- vec2
- Vector type of two elements.
- vec3
- Vector type of three elements.
- vec4
- Vector type of four elements.