graphics
Generated Rust API reference for byte_engine.
byte_engine / application / graphics
Module graphics
Headed application runtime and graphics setup entry points.
Construct GraphicsApplication, configure it with either default_setup
or selected setup functions, then run its loop. The triangle example uses
the complete default stack; the window example creates only a window.
Rendering setup remains in this module because it coordinates the world, renderer, and application factories. General startup defaults and external adapters are kept behind the setup functions re-exported from this module.
Follow the sample project guide for the complete application setup sequence.
Contents
- Modules
- Structs
- Functions
setup_aces_color_grading_render_passsetup_aces_tonemap_render_passsetup_agx_tonemap_render_passsetup_atmosphere_sky_render_passsetup_bloom_render_passsetup_dwg_color_grading_render_passsetup_lut_render_passsetup_pbr_visibility_shading_render_pipelinesetup_simple_render_pipelinesetup_smaa_render_passsetup_ui_render_passdefault_setupsetup_animation_poolsetup_default_audiosetup_default_inputsetup_default_pipeline_compilationsetup_default_resource_and_asset_managementsetup_default_windowprocess_default_window_inputsetup_default_dmx
Quick Reference
| Item | Kind | Description |
|---|---|---|
defaults | mod | Conventional setup components for [GraphicsApplication]. |
GraphicsApplication | struct | The [GraphicsApplication] struct owns the headed runtime and coordinates windows, input, worlds, resources, audio workers, and rendering. |
setup_aces_color_grading_render_pass | fn | |
setup_aces_tonemap_render_pass | fn | |
setup_agx_tonemap_render_pass | fn | |
setup_atmosphere_sky_render_pass | fn | |
setup_bloom_render_pass | fn | |
setup_dwg_color_grading_render_pass | fn | |
setup_lut_render_pass | fn | |
setup_pbr_visibility_shading_render_pipeline | fn | |
setup_simple_render_pipeline | fn | |
setup_smaa_render_pass | fn | |
setup_ui_render_pass | fn | |
default_setup | fn | |
setup_animation_pool | fn | |
setup_default_audio | fn | |
setup_default_input | fn | |
setup_default_pipeline_compilation | fn | |
setup_default_resource_and_asset_management | fn | |
setup_default_window | fn | |
process_default_window_input | fn | |
setup_default_dmx | fn |
Modules
defaults— Conventional setup components for [GraphicsApplication].
Structs
GraphicsApplication
struct GraphicsApplication {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/application/graphics/mod.rs:47-90
The GraphicsApplication struct owns the headed runtime and coordinates
windows, input, worlds, resources, audio workers, and rendering.
Use default_setup for the conventional engine stack. Use
setup_default_window, setup_default_input, and the render-pass setup
functions independently when an application needs explicit composition.
After setup, call Self::do_loop to run the application, or
Self::tick_with when application code must run during each tick.
Configuration
kill-after: Closes the application after this number of ticks. The default isNone.assets-path: Selects the debug-build asset directory. Relative overrides use the current working directory. In development, the default isassetsunderCARGO_MANIFEST_DIRwhen available, then beside the executable.resources.path: Selects the resource directory. Relative overrides use the current working directory. In development, the default usesCARGO_MANIFEST_DIRwhen available; otherwise, it is beside the executable.render.debug: Enables validation layers. The default istruein debug builds.render.debug.dump: Enables graphics API logging. The default isfalse.render.debug.extended: Enables extended validation. The default isfalse.messages.max-topics: Sets the maximum number of typed routes. The default is64.messages.cells-per-topic: Sets the fixed payload-cell budget for each typed route. The default is512.messages.cell-bytes: Sets the size of each payload cell in bytes. The default is256.messages.cell-alignment: Sets the alignment of each payload cell. The default is64.messages.listeners-per-topic: Sets the maximum simultaneous listeners on one typed route. The default is64.render.pass.<name>: Selectsenabledorbypassedfor the named render pass.render.gtao.radius: Sets the GTAO world-space search radius. The default is1.0.render.gtao.samples-per-ray: Sets the GTAO samples along each ray. The default is6.render.gtao.radial-rays: Sets the even number of GTAO ray directions. The default is8.render.cone-shadow-map-pool.capacity: Sets the startup maximum for reusable cone-light shadow maps per sink. Maps allocate on first use; the default capacity is4.render.point-shadow-map-pool.capacity: Sets the startup maximum for reusable point-light cube shadow maps per sink. Maps allocate on first use; the default capacity is4.
See the sample project guide
for a complete GraphicsApplication setup.
Implementations
-
fn frame_allocator(&self) -> &bumpalo::BumpReturns frame-local storage for temporary allocations during the current tick.
-
fn configuration(&self) -> &ConfigurationRelated:
ConfigurationReturns the configuration exchange used to inspect startup update results.
-
fn tick_with<R, F: FnOnce(&mut Self, Time) -> R>(&mut self, f: F) -> Option<R>Runs one graphics tick and lets application code update state before rendering.
-
fn close(&mut self)Flags the application for closing.
-
fn input_system(&self) -> &input::InputManagerRelated:
InputManagerReturns the input manager that owns devices, triggers, and action state.
-
fn renderer(&self) -> &RendererRelated:
RendererReturns the renderer used by setup functions and advanced render integrations.
-
fn renderer_mut(&mut self) -> &mut RendererRelated:
RendererReturns mutable renderer access for application-defined pipeline setup.
Use this during startup to create renderer-owned GHI resources. For an
asynchronous resource integration, create the mapped transfer buffer and
crate::rendering::resource_loading::UploadStagingArenahere, keep thebuffer handle in the pipeline manager's upload store, and run the staging
worker and resource servers through application-owned tasks. Then call
Renderer::add_pipeline_managerbefore the application starts rendering.The opposite lifetime is equally important: stop and join those tasks
before this application drops the renderer. The built-in Simple and
Visibility setup functions demonstrate that shutdown ordering.
-
fn window_factory(&self) -> &Factory<Window>Related:
WindowReturns the factory used to request new windows.
-
fn action_factory(&self) -> &Factory<Action>Related:
ActionReturns the factory used to register input actions.
-
fn messages(&self) -> &MessageScopeRelated:
MessageScopeReturns the application-owned namespace used by headed-runtime channels and factories.
Next, call
MessageScope::channelorMessageScope::factoryto add anapplication-defined message route without declaring its type at startup.
-
fn message_bus(&self) -> &MessageBusRelated:
MessageBusReturns the shared fixed-storage message bus for diagnostics and new scopes.
Next, call
MessageBus::topicsto inspect registered routes orMessageBus::new_scopeto isolate routes owned by another subsystem. -
fn world(&self) -> &DefaultWorldRelated:
DefaultWorldReturns the default world updated by the graphics application loop.
-
fn world_mut(&mut self) -> &mut DefaultWorldRelated:
DefaultWorldReturns mutable access to the default world updated by the graphics application loop.
-
fn generator_factory(&self) -> &Factory<Arc<dyn Generator>>Related:
GeneratorReturns the audio generator factory used by default audio setup.
-
fn do_loop(&mut self)Runs ticks until the application is closed.
-
fn do_loop_with<F: FnOnce(&mut Self, Time) + Copy>(&mut self, f: F)Runs ticks with an application callback until the application is closed.
-
fn resource_manager(&self) -> &ResourceManagerReturns the resource manager shared by rendering and asset setup.
-
fn resource_manager_handle(&self) -> EntityHandle<ResourceManager>Related:
EntityHandleReturns shared ownership of the resource manager for application-owned async systems.
Use this handle when constructing loaders such as
crate::animation::graph::AnimationPool. Next, spawn the returnedworker on the application's chosen async runtime.
Trait Implementations
impl Application for GraphicsApplication
-
fn new(name: &str, parameters: &[Parameter]) -> SelfRelated:
Parameter -
fn get_name(&self) -> &str -
fn tick(&mut self) -> bool
impl ArchivePointee for GraphicsApplication
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for GraphicsApplication
impl Downcast for GraphicsApplication
-
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 Drop for GraphicsApplication
-
fn drop(&mut self)
impl Instrument for GraphicsApplication
impl LayoutRaw for GraphicsApplication
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for GraphicsApplication
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointable for GraphicsApplication
-
const ALIGN: usize -
type Init = T -
unsafe fn init(init: <T as Pointable>::Init) -> usize -
unsafe fn deref<'a>(ptr: usize) -> &'a T -
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T -
unsafe fn drop(ptr: usize)
impl Pointee for GraphicsApplication
-
type Metadata = ()
impl Read for GraphicsApplication
impl WithSubscriber for GraphicsApplication
Functions
setup_aces_color_grading_render_pass
fn setup_aces_color_grading_render_pass(application: &mut GraphicsApplication, lut: crate::rendering::render_passes::lut::PreparedLut)Defined in crates/byte-engine/src/application/graphics/pipeline.rs:444-449
Installs a fused ACEScg/ACEScct grading and SDR output pass from a prepared LUT.
The LUT must accept and return ACEScct values. The pass uses an AP1-aware
fitted SDR transform; it does not claim ACES reference-transform compliance.
Load it with crate::rendering::render_passes::lut::PreparedLut::load on
application-owned asynchronous work before calling this setup function. Call
this after scene-linear effects. Later passes consume its remapped main output.
setup_aces_tonemap_render_pass
fn setup_aces_tonemap_render_pass(application: &mut GraphicsApplication)Defined in crates/byte-engine/src/application/graphics/pipeline.rs:421-426
Installs the ACES v1 tonemapping pass for post-scene color mapping.
setup_agx_tonemap_render_pass
fn setup_agx_tonemap_render_pass(application: &mut GraphicsApplication)Defined in crates/byte-engine/src/application/graphics/pipeline.rs:414-418
Installs the AGX tonemapping pass for post-scene color mapping.
setup_atmosphere_sky_render_pass
fn setup_atmosphere_sky_render_pass(application: &mut GraphicsApplication)Defined in crates/byte-engine/src/application/graphics/pipeline.rs:509-522
Installs the atmosphere sky pass used as a post-scene background.
setup_bloom_render_pass
fn setup_bloom_render_pass(application: &mut GraphicsApplication, settings: crate::rendering::render_passes::bloom::BloomPassSettings)Defined in crates/byte-engine/src/application/graphics/pipeline.rs:429-435
Registers a reusable bloom pass that should run before tonemapping.
setup_dwg_color_grading_render_pass
fn setup_dwg_color_grading_render_pass(application: &mut GraphicsApplication, lut: crate::rendering::render_passes::lut::PreparedLut)Defined in crates/byte-engine/src/application/graphics/pipeline.rs:459-464
Installs a fused DaVinci Wide Gamut/Intermediate grading and SDR output pass from a prepared LUT.
The LUT must accept and return DaVinci Wide Gamut/Intermediate values. The
pass uses AgX for SDR display rendering and does not claim parity with
DaVinci Resolve color management. Load it with
crate::rendering::render_passes::lut::PreparedLut::load on
application-owned asynchronous work before calling this setup function. Call
this after scene-linear effects. Later passes consume its remapped main output.
setup_lut_render_pass
fn setup_lut_render_pass(application: &mut GraphicsApplication, lut: crate::rendering::render_passes::lut::PreparedLut)Defined in crates/byte-engine/src/application/graphics/pipeline.rs:486-495
Installs a 3D LUT grading pass from asynchronously prepared resource data.
Load the resource once with
crate::rendering::render_passes::lut::PreparedLut::load on
application-owned asynchronous work. Each sink shares those immutable bytes
while creating its own renderer-owned image. Call this after passes that
produce the HDR main target and before tone mapping.
setup_pbr_visibility_shading_render_pipeline
fn setup_pbr_visibility_shading_render_pipeline(application: &mut GraphicsApplication, spawn_loading_task: impl FnOnce(std::boxed::Box<dyn FnOnce(&compio::runtime::Runtime) + Send>))Defined in crates/byte-engine/src/application/graphics/pipeline.rs:141-353
Installs the visibility-buffer PBR scene pipeline and its async upload worker.
Visibility demonstrates the same shared lifecycle with four preparation lanes, meshlets and parallel vertex streams, material and bindless texture slots, CPU texture transfers, and native GPU-I/O adoption. Those choices are implemented by Visibility's preparer and store; they are not requirements of the shared loader.
The supplied callback must run the staging worker and every preparation server on application-owned async tasks. Join those tasks before renderer shutdown so no worker retains a mapping or detached GHI factory after its context is dropped.
Next, create an Environment through
DefaultWorld::factory to select the HDR image used for ambient and
specular reflections.
setup_simple_render_pipeline
fn setup_simple_render_pipeline(application: &mut GraphicsApplication, spawn_loading_task: impl FnOnce(std::boxed::Box<dyn FnOnce(&compio::runtime::Runtime) + Send>))Defined in crates/byte-engine/src/application/graphics/pipeline.rs:20-123
Installs the simple scene pipeline and registers its asynchronous mesh-loading worker.
This setup is the smallest end-to-end implementation of
rendering::resource_loading. It creates one mapped staging arena, one
preparation server, and a Simple-owned store whose position and index
streams intentionally differ from Visibility storage. The supplied callback
owns task placement so this function does not impose an executor or thread
policy on the application. Simple's shaders use the renderer's asynchronous
pipeline compilation servers; this setup never waits for shader resources.
Add the supplied task to a queue from defaults::build_deferred_tasks_queue,
then start that queue with defaults::launch_deferred_tasks_thread after
every subsystem has registered its work. At shutdown, join that task before
dropping the renderer and mapped upload buffer.
setup_smaa_render_pass
fn setup_smaa_render_pass(application: &mut GraphicsApplication)Defined in crates/byte-engine/src/application/graphics/pipeline.rs:502-506
Installs spatial SMAA for every current and future render sink.
This adds a self-contained post-scene pass without coalescing it with tone mapping
or other independent passes. Call it after the setup that produces the main color
input you want SMAA to filter, and before any overlay pass you want to keep sharp.
setup_ui_render_pass
fn setup_ui_render_pass(application: &mut GraphicsApplication, ui: &crate::core::factory::Factory<crate::ui::layout::engine::Render>)Defined in crates/byte-engine/src/application/graphics/pipeline.rs:358-401
Installs the retained UI render pass fed by UI render messages from ui.
Register this pass before publishing renders that every sink must observe.
default_setup
fn default_setup(application: &mut super::GraphicsApplication)Defined in crates/byte-engine/src/application/graphics/defaults.rs:15-40
Installs the standard assets, input devices, audio worker, visibility rendering pipeline, and window.
After setup, create application actions through
GraphicsApplication::action_factory, select scene lighting through
crate::gameplay::world::DefaultWorld::factory, and run
the application with GraphicsApplication::do_loop.
setup_animation_pool
fn setup_animation_pool(application: &mut super::GraphicsApplication, byte_budget: std::num::NonZeroUsize, spawn_loading_task: impl FnOnce(Box<dyn FnOnce(&compio::runtime::Runtime) + Send>)) -> crate::animation::graph::AnimationPoolDefined in crates/byte-engine/src/application/graphics/defaults.rs:344-358
Creates an AnimationPool with the given decoded-clip byte budget and
spawns its load worker on the application's async runtime.
Next, call AnimationPool::update once per tick before advancing graph
players that share the pool, then create animation graphs through
crate::animation::graph::AnimationGraphPlayer.
setup_default_audio
fn setup_default_audio(application: &mut super::GraphicsApplication, spawn_loading_task: impl FnOnce(Box<dyn FnOnce(&compio::runtime::Runtime) + Send>))Defined in crates/byte-engine/src/application/graphics/defaults.rs:263-336
Starts the audio worker, its byte-bounded global sample pool, and the standard audio entity listeners.
Next, submit a crate::audio::generator::Generator through
GraphicsApplication::generator_factory to make it available to the audio
worker, or create an crate::audio::graph::AudioGraph through
crate::gameplay::world::DefaultWorld::audio_graph_factory.
setup_default_input
fn setup_default_input(application: &mut super::GraphicsApplication)Defined in crates/byte-engine/src/application/graphics/defaults.rs:238-254
Installs the device classes expected by super::process_default_window_input.
Next, create application-level actions through
GraphicsApplication::action_factory. The application tick translates
window events and emits their resolved action values.
setup_default_pipeline_compilation
fn setup_default_pipeline_compilation(application: &mut super::GraphicsApplication)Defined in crates/byte-engine/src/application/graphics/defaults.rs:47-75
Starts the renderer's pending pipeline compiler servers on application-owned threads.
This setup is idempotent. Call it when composing a graphics application
without default_setup before registering pipeline managers or render
passes that request asynchronous pipelines.
setup_default_resource_and_asset_management
fn setup_default_resource_and_asset_management(application: &mut super::GraphicsApplication, generator: impl ProgramGenerator + 'static)Defined in crates/byte-engine/src/application/graphics/defaults.rs:143-223
In debug builds, connects the asset directory and standard material, model, image, audio, and standalone-shader handlers to the resource manager.
Release builds intentionally leave the manager without asset processors and must receive their complete resource store from BELD.
setup_default_window
fn setup_default_window(application: &mut super::GraphicsApplication)Defined in crates/byte-engine/src/application/graphics/defaults.rs:131-136
Creates the 1920x1080 window used by the default headed setup.
process_default_window_input
fn process_default_window_input(input_system: &mut input::InputManager, event: ghi::window::Events) -> Option<(input::SeatHandle, input::DeviceHandle, input::input_manager::TriggerReference, input::Value)>Defined in crates/byte-engine/src/application/graphics/integrations.rs:103-192
Converts GHI window events into records for the standard mouse and keyboard device classes.
setup_default_dmx
fn setup_default_dmx(application: &mut super::GraphicsApplication, receiver: crate::core::listener::DefaultListener<utils::RGBA>)Defined in crates/byte-engine/src/application/graphics/integrations.rs:30-84
Starts an Art-Net worker that publishes received RGBA values as DMX
output.