Skip to main content

Crate molgfx_gpu

Crate molgfx_gpu 

Source
Expand description

The backend-agnostic GPU hardware abstraction: device, queue, encoder and surface traits.

This is an interface crate: traits, descriptor structs, capability flags and typed errors. No logic lives here. Backends implement the traits with their own concrete resource types via associated types, so the renderer above is generic over the device with no dynamic dispatch on the hot path, and callers above the backend layer never name a backend.

Structs§

AabbGeometry
Procedural AABB geometry supplied to one BLAS build.
AabbGeometrySize
Size ceiling for one procedural AABB geometry in a BLAS.
AccelerationGeometryFlags
Per-geometry ray-query behavior.
AccelerationStructureBinding
One TLAS resource bound into a ray-query bind group.
AccelerationStructureFlags
Construction preferences for a BLAS or TLAS.
AccelerationStructureLayoutEntry
One acceleration-structure slot in a ray-query bind-group layout.
ArenaAllocation
A generation-checked allocation within a PagedArena.
ArenaMetrics
Observable arena counters. Values are cumulative except resident bytes.
BindGroupDesc
Everything needed to create a bind group over a layout.
BindGroupLayoutDesc
Everything needed to create a bind-group layout.
BindGroupLayoutEntry
One slot in a bind-group layout: index, visibility, kind. Every binding index is declared here with a name; shaders never invent one.
BlasBuildDesc
One BLAS build operation.
BlasDesc
Descriptor for allocating a BLAS.
BufferDesc
Everything needed to create a buffer.
BufferUsage
How a buffer may be used. Buffers are typed by usage and allocated once; there is deliberately no per-frame creation convenience.
Capabilities
What the opened device can do beyond the baseline.
CapabilityFlags
The boolean capabilities, as one word.
ColorAttachment
One color attachment of a render pass.
ColorTarget
One color attachment a render pipeline writes.
CommandScratch
Reusable storage for trivially owned command descriptors.
CommandScratchMetrics
Command scratch counters.
ComputePassDesc
Everything needed to begin a compute pass.
ComputePipelineDesc
Everything needed to create a compute pipeline.
DepthAttachment
The depth attachment of a render pass.
DepthState
Depth behavior of a render pipeline.
DeviceDesc
Options for opening a device.
FenceValue
Monotonic submission completion value supplied by a backend.
Opened
The result of opening a device: the device, its queue, and a surface when a window was supplied.
PagedArena
A fixed-capacity page allocator with deterministic first-fit placement.
RayQueryBindGroupDesc
Bind group containing regular resources and TLAS resources.
RayQueryBindGroupLayoutDesc
Layout containing regular slots and acceleration-structure slots.
RayQueryLimits
Device ceilings relevant to acceleration-structure allocation.
RenderPassDesc
Everything needed to begin a render pass.
RenderPipelineDesc
Everything needed to create a render pipeline. Pipelines are created at load and cached; never inside the frame loop.
ResourceMemory
Live physical resources allocated through a device.
Retirement
Work made reusable by one retirement call.
SamplerDesc
Everything needed to create a sampler.
ScratchFull
A command did not fit in fixed scratch capacity.
ShaderModuleDesc
A shader module from WGSL source. WGSL is the single shader language; backends that need another form compile it themselves.
ShaderStages
Which stages see a binding.
SurfaceConfig
Surface configuration, refreshed on resize.
TextureDesc
Everything needed to create a texture.
TextureFormatCapabilities
Renderer-relevant usage support for one texture format.
TextureUsage
How a texture may be used.
TextureViewDesc
View parameters; the default views the whole texture.
TextureWrite
One tightly described host-to-texture upload.
TimestampWrites
Timestamp query writes attached to one render or compute pass.
TlasDesc
Descriptor for allocating a TLAS.
TlasInstance
One instance stored in a TLAS.
TriangleGeometry
Triangle geometry supplied to one BLAS build.
TriangleGeometrySize
Size ceiling for one triangle geometry in a BLAS.
UploadMetrics
Observable ring counters. Values are cumulative except active gauges.
UploadReservation
Immutable description returned when bytes are reserved.
UploadRing
A bounded host staging ring independent of any concrete GPU backend.
UploadRingConfig
Fixed resource and upload throughput budgets.
UploadTicket
Stable identifier for one ring reservation.

Enums§

AccelerationIndexFormat
Index encoding for triangle BLAS geometry.
AccelerationStructureUpdateMode
Whether a build may update an existing acceleration structure.
ArenaError
Invalid requests and stale allocation handles.
BindGroupEntry
A live resource bound into a slot.
BindingType
What kind of resource a binding slot holds.
BlasGeometries
Geometry family supplied to one BLAS build.
BlasGeometrySizes
Geometry family and size ceilings used to allocate a BLAS.
BlendMode
How a color target blends its output.
CompareFunction
Depth comparison functions.
DepthLoadOp
How a depth attachment starts the pass.
FilterMode
Texel filtering mode.
GpuError
Everything that can go wrong opening or driving a device.
LoadOp
How a color attachment starts the pass.
PowerPreference
Which adapter class to prefer when several are present.
PrimitiveTopology
Primitive assembly.
SurfaceError
Why a frame could not be acquired.
TextureDimension
Texture dimensionality supported by the portable renderer.
TextureFormat
The formats the engine renders with. A deliberate subset: every format here is universally supported on the targeted backends, and backends match on it exhaustively, so growing the set is a deliberate change.
UploadBackpressure
Why an upload reservation or lifecycle transition could not proceed.
UploadState
Current lifecycle of an upload reservation.

Traits§

CommandEncoder
Records passes and copies into one submission.
ComputePassEncoder
Records dispatches inside an open compute pass.
Device
A GPU device: resource creation and capability report.
Queue
Uploads and submission. One submission per frame is the discipline the engine holds; the trait does not enforce it, the render loop does.
RayQueryCommandEncoder
Command-encoder extension for acceleration-structure builds.
RayQueryDevice
Device extension for hardware acceleration structures and WGSL ray queries.
Readback
A detached readback over one buffer.
RenderPassEncoder
Records draws inside an open render pass.
Surface
A presentation surface bound to a window.
SurfaceFrame
One acquired swapchain frame.
WindowSource
Anything a presentation surface can be created from. Embedders hand the engine their window behind this trait; the engine never names a windowing toolkit.

Type Aliases§

WindowTarget
A shared native window handle, alive for as long as its surface.