Byte Engine Docs
View on docs.rs

simple_compute

Generated Rust API reference for byte_engine.

byte_engine / rendering / render_pass / simple_compute


Module simple_compute

Reusable construction for BESL compute render passes that bind their resources by name.

Quick Reference

ItemKindDescription
DescriptorstructThe Descriptor struct identifies one compute pipeline and its command label.
PipelinestructThe Pipeline struct provides reusable compute state to sink-specific retained resource sets.
PassstructThe Pass struct provides one sink with a validated pipeline and descriptor sets for a single compute dispatch.
ReadyPassstructThe ReadyPass struct provides immutable recording state after pipeline publication.
Resourceenum

Structs

Descriptor<'a>

struct Descriptor<'a> {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/rendering/render_pass/simple_compute.rs:14-17

The Descriptor struct identifies one compute pipeline and its command label.

Implementations

  • fn new(label: &'static str, pipeline_id: &'a str) -> Self

    Creates a descriptor for one baked pipeline resource and its human-readable command label.

Trait Implementations

impl ArchivePointee for Descriptor<'a>
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Descriptor<'a>
impl Downcast for Descriptor<'a>
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Descriptor<'a>
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for Descriptor<'a>
impl LayoutRaw for Descriptor<'a>
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Descriptor<'a>
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for Descriptor<'a>
  • type Metadata = ()
impl Read for Descriptor<'a>
impl WithSubscriber for Descriptor<'a>

Pipeline

struct Pipeline {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/rendering/render_pass/simple_compute.rs:46-50

The Pipeline struct provides reusable compute state to sink-specific retained resource sets.

Implementations

  • fn compile(render_pass_builder: &mut RenderPassBuilder<'_>, descriptor: Descriptor<'_>) -> Self

    Related: RenderPassBuilder, Descriptor

    Requests a baked pipeline and defers descriptor adoption until compilation is published.

  • fn bind(&self, descriptor_set_name: &'static str, resources: &[Resource]) -> Pass

    Related: Resource, Pass

    Freezes the named resources for one sink.

    The pass validates them against the pipeline's descriptor set layouts and creates its descriptor sets once the

    pipeline is published, in Pass::ready, and logs an error there when they do not match.

Trait Implementations

impl ArchivePointee for Pipeline
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Pipeline
impl Clone for Pipeline
  • fn clone(&self) -> Pipeline

    Related: Pipeline

impl Downcast for Pipeline
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Pipeline
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for Pipeline
impl LayoutRaw for Pipeline
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Pipeline
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for Pipeline
  • type Metadata = ()
impl Read for Pipeline
impl WithSubscriber for Pipeline

Pass

struct Pass {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/rendering/render_pass/simple_compute.rs:86-95

The Pass struct provides one sink with a validated pipeline and descriptor sets for a single compute dispatch.

Implementations

  • fn ready(&mut self, frame: &mut ghi::implementation::Frame<'_>) -> Option<ReadyPass>

    Related: ReadyPass

    Adopts a published pipeline and creates this sink's descriptor sets once, one per layout the shader uses.

  • fn prepare<'a>(&mut self, _frame: &mut ghi::implementation::Frame<'_>, sink: &Sink, frame_allocator: &'a bumpalo::Bump) -> Option<RenderPassReturn<'a>>

    Related: Sink, RenderPassReturn

    Allocates a frame command that records this compute pass for the sink extent.

Trait Implementations

impl ArchivePointee for Pass
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Pass
impl Clone for Pass
  • fn clone(&self) -> Pass

    Related: Pass

impl Downcast for Pass
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Pass
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for Pass
impl LayoutRaw for Pass
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Pass
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for Pass
  • type Metadata = ()
impl Read for Pass
impl WithSubscriber for Pass

ReadyPass

struct ReadyPass {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/rendering/render_pass/simple_compute.rs:170-175

The ReadyPass struct provides immutable recording state after pipeline publication.

Implementations

  • fn record(&self, command_buffer: &mut ghi::implementation::CommandBufferRecording<'_>, extent: Extent)

    Records this pass without allocating a render-command closure.

Trait Implementations

impl ArchivePointee for ReadyPass
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ReadyPass
impl Clone for ReadyPass
  • fn clone(&self) -> ReadyPass

    Related: ReadyPass

impl Copy for ReadyPass
impl Downcast for ReadyPass
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for ReadyPass
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for ReadyPass
impl LayoutRaw for ReadyPass
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ReadyPass
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for ReadyPass
  • type Metadata = ()
impl Read for ReadyPass
impl WithSubscriber for ReadyPass

Enums

Resource

enum Resource {
    Buffer(&'static str, ghi::BaseBufferHandle),
    PlannedBuffer(&'static str, ghi::BaseBufferHandle),
    Image(&'static str, ghi::ImageOrSwapchain),
    ImageArray(&'static str, [Option<ghi::BaseImageHandle>; 15]),
    CombinedImageSampler(&'static str, ghi::BaseImageHandle, ghi::SamplerHandle, ghi::Layouts),
}

Defined in crates/byte-engine/src/rendering/set_layout.rs:356-363

The Resource enum names one concrete resource for a BESL binding, for create_sets to bind by name.

Variants

  • ImageArray

    The first count images of an arrayed storage-image binding, element by element.

Implementations

  • fn buffer(name: &'static str, buffer: impl Into<ghi::BaseBufferHandle>) -> Self
  • fn planned_buffer(name: &'static str, buffer: impl Into<ghi::BaseBufferHandle>) -> Self

    Keeps a buffer ready for a BESL binding that is intentionally not reachable yet.

  • fn image(name: &'static str, image: impl Into<ghi::ImageOrSwapchain>) -> Self

    Binds a storage-image destination without exposing whether it is an image or swapchain.

  • fn image_array(name: &'static str, images: &[ghi::BaseImageHandle]) -> Self

    Binds images to the first elements of an arrayed storage-image binding, such as the debug target pool a

    shader declares as debug_view_targets. Elements past them stay unbound, so the shader must not index them.

    Panics

    Panics with more than MAX_IMAGE_ARRAY_ELEMENTS images.

  • fn combined_image_sampler(name: &'static str, image: impl Into<ghi::BaseImageHandle>, sampler: ghi::SamplerHandle, layout: ghi::Layouts) -> Self

Trait Implementations

impl ArchivePointee for Resource
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Resource
impl Clone for Resource
  • fn clone(&self) -> Resource

    Related: Resource

impl Copy for Resource
impl Downcast for Resource
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Resource
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for Resource
impl LayoutRaw for Resource
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Resource
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for Resource
  • type Metadata = ()
impl Read for Resource
impl WithSubscriber for Resource

On this page

Module simple_computeQuick ReferenceStructsDescriptor<'a>ImplementationsTrait Implementationsimpl ArchivePointee for Descriptor<'a>impl<ST> CastableFrom for Descriptor<'a>impl Downcast for Descriptor<'a>impl DowncastSync for Descriptor<'a>impl Instrument for Descriptor<'a>impl LayoutRaw for Descriptor<'a>impl<T, N1> Niching for Descriptor<'a>impl Pointee for Descriptor<'a>impl Read for Descriptor<'a>impl WithSubscriber for Descriptor<'a>PipelineImplementationsTrait Implementationsimpl ArchivePointee for Pipelineimpl<ST> CastableFrom for Pipelineimpl Clone for Pipelineimpl Downcast for Pipelineimpl DowncastSync for Pipelineimpl Instrument for Pipelineimpl LayoutRaw for Pipelineimpl<T, N1> Niching for Pipelineimpl Pointee for Pipelineimpl Read for Pipelineimpl WithSubscriber for PipelinePassImplementationsTrait Implementationsimpl ArchivePointee for Passimpl<ST> CastableFrom for Passimpl Clone for Passimpl Downcast for Passimpl DowncastSync for Passimpl Instrument for Passimpl LayoutRaw for Passimpl<T, N1> Niching for Passimpl Pointee for Passimpl Read for Passimpl WithSubscriber for PassReadyPassImplementationsTrait Implementationsimpl ArchivePointee for ReadyPassimpl<ST> CastableFrom for ReadyPassimpl Clone for ReadyPassimpl Copy for ReadyPassimpl Downcast for ReadyPassimpl DowncastSync for ReadyPassimpl Instrument for ReadyPassimpl LayoutRaw for ReadyPassimpl<T, N1> Niching for ReadyPassimpl Pointee for ReadyPassimpl Read for ReadyPassimpl WithSubscriber for ReadyPassEnumsResourceVariantsImplementationsPanicsTrait Implementationsimpl ArchivePointee for Resourceimpl<ST> CastableFrom for Resourceimpl Clone for Resourceimpl Copy for Resourceimpl Downcast for Resourceimpl DowncastSync for Resourceimpl Instrument for Resourceimpl LayoutRaw for Resourceimpl<T, N1> Niching for Resourceimpl Pointee for Resourceimpl Read for Resourceimpl WithSubscriber for Resource