pub struct PortalGpu { /* private fields */ }Implementations§
Source§impl PortalGpu
impl PortalGpu
pub fn upload_resident_texture_rgba8_at_mip_with_mips( &mut self, source_digest: [u8; 32], color_space: TextureColorSpace, mip_semantic: TextureMipSemantic, source_width: u32, source_height: u32, first_resident_mip: u32, coarse_rgba8: &[u8], ) -> Result<Option<AlphaCoverageDiagnostics>, TextureUploadError>
pub fn upload_resident_texture_mip_chain_rgba8( &mut self, source_digest: [u8; 32], color_space: TextureColorSpace, mip_semantic: TextureMipSemantic, width: u32, height: u32, levels: &[&[u8]], ) -> Result<Option<AlphaCoverageDiagnostics>, TextureUploadError>
pub fn upload_resident_texture_mip_window_rgba8( &mut self, source_digest: [u8; 32], color_space: TextureColorSpace, mip_semantic: TextureMipSemantic, width: u32, height: u32, levels: &[&[u8]], first_resident_mip: u32, ) -> Result<Option<AlphaCoverageDiagnostics>, TextureUploadError>
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn upload_resident_texture_rgba8(
&mut self,
source_digest: [u8; 32],
color_space: TextureColorSpace,
width: u32,
height: u32,
rgba8: &[u8],
) -> Result<(), TextureUploadError>
pub fn upload_resident_texture_rgba8( &mut self, source_digest: [u8; 32], color_space: TextureColorSpace, width: u32, height: u32, rgba8: &[u8], ) -> Result<(), TextureUploadError>
Upload a decoded RGBA8 base level and generate a complete mip chain on the GPU.
This compatibility entry uses sRGB colour mips for sRGB textures and linear-data mips for linear textures. Use the semantic variant for normal maps so their mips are renormalized.
Sourcepub fn upload_resident_texture_rgba8_with_mips(
&mut self,
source_digest: [u8; 32],
color_space: TextureColorSpace,
mip_semantic: TextureMipSemantic,
width: u32,
height: u32,
rgba8: &[u8],
) -> Result<(), TextureUploadError>
pub fn upload_resident_texture_rgba8_with_mips( &mut self, source_digest: [u8; 32], color_space: TextureColorSpace, mip_semantic: TextureMipSemantic, width: u32, height: u32, rgba8: &[u8], ) -> Result<(), TextureUploadError>
Upload with a semantic mip filter: linear-light colour, linear data, or renormalized normals.
Sourcepub fn upload_resident_texture_rgba8_with_mips_and_diagnostics(
&mut self,
source_digest: [u8; 32],
color_space: TextureColorSpace,
mip_semantic: TextureMipSemantic,
width: u32,
height: u32,
rgba8: &[u8],
) -> Result<Option<AlphaCoverageDiagnostics>, TextureUploadError>
pub fn upload_resident_texture_rgba8_with_mips_and_diagnostics( &mut self, source_digest: [u8; 32], color_space: TextureColorSpace, mip_semantic: TextureMipSemantic, width: u32, height: u32, rgba8: &[u8], ) -> Result<Option<AlphaCoverageDiagnostics>, TextureUploadError>
Upload a texture and return the bounded CPU prediction for alpha-mask mip coverage.
None is returned for non-alpha mip semantics. Diagnostics are returned by value instead
of retained in the residency map, so long-lived metadata does not grow per texture.
Sourcepub fn resident_texture_binding(
&self,
source_digest: &[u8; 32],
color_space: TextureColorSpace,
) -> Option<(&TextureView, &Sampler)>
pub fn resident_texture_binding( &self, source_digest: &[u8; 32], color_space: TextureColorSpace, ) -> Option<(&TextureView, &Sampler)>
Borrow the resident view and shared default sampler for (digest, colour-space).
Sourcepub fn resident_texture_binding_with_mips(
&self,
source_digest: &[u8; 32],
color_space: TextureColorSpace,
mip_semantic: TextureMipSemantic,
) -> Option<(&TextureView, &Sampler)>
pub fn resident_texture_binding_with_mips( &self, source_digest: &[u8; 32], color_space: TextureColorSpace, mip_semantic: TextureMipSemantic, ) -> Option<(&TextureView, &Sampler)>
Binding for a resident texture with mips.
Sourcepub fn evict_resident_texture(
&mut self,
source_digest: &[u8; 32],
color_space: TextureColorSpace,
) -> bool
pub fn evict_resident_texture( &mut self, source_digest: &[u8; 32], color_space: TextureColorSpace, ) -> bool
Evict one interpretation of a source image and release its resident-byte reservation.
Sourcepub fn evict_resident_texture_with_mips(
&mut self,
source_digest: &[u8; 32],
color_space: TextureColorSpace,
mip_semantic: TextureMipSemantic,
) -> bool
pub fn evict_resident_texture_with_mips( &mut self, source_digest: &[u8; 32], color_space: TextureColorSpace, mip_semantic: TextureMipSemantic, ) -> bool
Evicts a resident texture with mips.
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn upload_rig_motor_palette(
&self,
palette_buffer: &Buffer,
instance_rig_offset: u32,
palette: &[GpuJointMotorPair],
) -> bool
pub fn upload_rig_motor_palette( &self, palette_buffer: &Buffer, instance_rig_offset: u32, palette: &[GpuJointMotorPair], ) -> bool
Uploads a compact GPU PGA Motor palette into palette_buffer using this device’s queue.
Source§impl PortalGpu
impl PortalGpu
pub fn bind_source_motion_model( &mut self, model: &[u8], source_sha256: [u8; 32], source_generation: u64, limits: SourceFrameBindLimits, ) -> Result<SourceFrameBinding, SourceFrameError>
Sourcepub fn bind_source_motion_model_at_epoch(
&mut self,
model: &[u8],
source_sha256: [u8; 32],
source_generation: u64,
transport_epoch: u64,
limits: SourceFrameBindLimits,
) -> Result<SourceFrameBinding, SourceFrameError>
pub fn bind_source_motion_model_at_epoch( &mut self, model: &[u8], source_sha256: [u8; 32], source_generation: u64, transport_epoch: u64, limits: SourceFrameBindLimits, ) -> Result<SourceFrameBinding, SourceFrameError>
Commit the caller’s current transport epoch with cold model admission; no fallible epoch-advance step is needed after binding has mutated state.
pub fn source_motion_binding(&self) -> Option<SourceFrameBinding>
pub fn retire_source_motion_binding(&mut self)
pub fn advance_source_motion_epoch( &mut self, expected: SourceFrameBinding, next_epoch: u64, ) -> Result<SourceFrameBinding, SourceFrameError>
pub fn apply_source_motion_frame( &mut self, frame: SourceMeshFrame<'_>, ) -> Result<SourceFrameReceipt, SourceFrameError>
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn set_environment_probes(
&mut self,
probes: Option<&EnvironmentProbeSet>,
fallback_radiance: [f32; 3],
)
pub fn set_environment_probes( &mut self, probes: Option<&EnvironmentProbeSet>, fallback_radiance: [f32; 3], )
Update the active mesh’s GPU environment contract from raw probe inputs.
None is a supported resource state: the bound contract has zero usable probes and the
shader returns the supplied fallback environment contribution. No CPU lighting evaluation
is performed here.
Sourcepub fn set_mesh_instances(
&mut self,
records: &[GpuInstanceRecord],
) -> Result<(), MeshInstanceUploadError>
pub fn set_mesh_instances( &mut self, records: &[GpuInstanceRecord], ) -> Result<(), MeshInstanceUploadError>
Replace the shared mesh instance source stream. Camera-facing forward and AO passes are culled automatically from the active camera; the full source stream remains available to shadow cascades so off-camera casters are not dropped. Empty input restores the legacy single identity instance. Transparent multi-instance draws are refused until per-instance back-to-front ordering is available.
Sourcepub fn set_mesh_instances_packed(
&mut self,
packed_records: &[u8],
) -> Result<(), MeshInstanceUploadError>
pub fn set_mesh_instances_packed( &mut self, packed_records: &[u8], ) -> Result<(), MeshInstanceUploadError>
Replace instances from the stable byte ABI without requiring caller-pointer alignment.
Sourcepub fn upload_mesh(&mut self, positions: &[[f32; 3]], indices: &[u32]) -> u32
pub fn upload_mesh(&mut self, positions: &[[f32; 3]], indices: &[u32]) -> u32
Upload an imported triangle mesh (Phase 1.2). positions are model-space f32x3 (the caller
centres + scales them to the orbit frame); indices is a flat triangle list (tris * 3).
Returns the triangle count; clears any prior mesh when empty.
Sourcepub fn upload_mesh_colored(
&mut self,
positions: &[[f32; 3]],
colors: &[[f32; 4]],
indices: &[u32],
) -> u32
pub fn upload_mesh_colored( &mut self, positions: &[[f32; 3]], colors: &[[f32; 4]], indices: &[u32], ) -> u32
Upload a triangle mesh with per-vertex linear RGBA colours. When colors is empty the
engine’s neutral blue-grey material is used; any non-empty slice must match positions.
Sourcepub fn upload_mesh_colored_with_normals(
&mut self,
positions: &[[f32; 3]],
colors: &[[f32; 4]],
authored_normals: Option<&[[f32; 3]]>,
indices: &[u32],
) -> u32
pub fn upload_mesh_colored_with_normals( &mut self, positions: &[[f32; 3]], colors: &[[f32; 4]], authored_normals: Option<&[[f32; 3]]>, indices: &[u32], ) -> u32
Upload a mesh while preserving a valid authored normal stream when supplied. The generated workspace remains resident for later deformation updates, where normals are recomputed from the changed geometry.
Sourcepub fn upload_mesh_colored_with_frames(
&mut self,
positions: &[[f32; 3]],
colors: &[[f32; 4]],
authored_normals: Option<&[[f32; 3]]>,
authored_tangents: Option<&[[f32; 4]]>,
indices: &[u32],
) -> u32
pub fn upload_mesh_colored_with_frames( &mut self, positions: &[[f32; 3]], colors: &[[f32; 4]], authored_normals: Option<&[[f32; 3]]>, authored_tangents: Option<&[[f32; 4]]>, indices: &[u32], ) -> u32
Upload a mesh with optional authored normal and tangent frame streams.
Sourcepub fn upload_mesh_colored_with_frames_and_materials(
&mut self,
positions: &[[f32; 3]],
colors: &[[f32; 4]],
authored_normals: Option<&[[f32; 3]]>,
authored_tangents: Option<&[[f32; 4]]>,
indices: &[u32],
materials: &[MaterialRecord],
ranges: &[SubmeshRange],
) -> Result<u32, String>
pub fn upload_mesh_colored_with_frames_and_materials( &mut self, positions: &[[f32; 3]], colors: &[[f32; 4]], authored_normals: Option<&[[f32; 3]]>, authored_tangents: Option<&[[f32; 4]]>, indices: &[u32], materials: &[MaterialRecord], ranges: &[SubmeshRange], ) -> Result<u32, String>
Upload a triangle mesh with per-submesh MAT1 shading and validated alpha coverage.
Sourcepub fn upload_mesh_colored_with_frames_and_materials_and_uv0(
&mut self,
positions: &[[f32; 3]],
colors: &[[f32; 4]],
authored_normals: Option<&[[f32; 3]]>,
authored_tangents: Option<&[[f32; 4]]>,
texture_coordinates_0: Option<&[[f32; 2]]>,
indices: &[u32],
materials: &[MaterialRecord],
ranges: &[SubmeshRange],
) -> Result<u32, String>
pub fn upload_mesh_colored_with_frames_and_materials_and_uv0( &mut self, positions: &[[f32; 3]], colors: &[[f32; 4]], authored_normals: Option<&[[f32; 3]]>, authored_tangents: Option<&[[f32; 4]]>, texture_coordinates_0: Option<&[[f32; 2]]>, indices: &[u32], materials: &[MaterialRecord], ranges: &[SubmeshRange], ) -> Result<u32, String>
Upload a mesh with optional vertex-aligned glTF TEXCOORD_0 values.
Sourcepub fn write_mesh_vertices(&mut self, start: u32, positions: &[[f32; 3]])
pub fn write_mesh_vertices(&mut self, start: u32, positions: &[[f32; 3]])
Replace a span of mesh positions. The buffer is COPY_DST. Used so a
part can change over time without uploading the whole scene again.
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn upload_water_geometry(
&mut self,
positions: &[[f32; 3]],
indices: &[u32],
) -> Result<(), String>
pub fn upload_water_geometry( &mut self, positions: &[[f32; 3]], indices: &[u32], ) -> Result<(), String>
Uploads water mesh buffers.
Sourcepub fn upload_water_geometry_with_budget(
&mut self,
positions: &[[f32; 3]],
indices: &[u32],
max_bytes: u64,
) -> Result<(), String>
pub fn upload_water_geometry_with_budget( &mut self, positions: &[[f32; 3]], indices: &[u32], max_bytes: u64, ) -> Result<(), String>
Upload persistent water geometry with an explicit admission ceiling. The previous geometry remains live if validation or budget admission fails.
Sourcepub fn clear_water_geometry(&mut self)
pub fn clear_water_geometry(&mut self)
Drops water geometry.
Sourcepub fn set_water_surface(
&mut self,
colour: [f32; 3],
alpha: f32,
wave_amplitude: f32,
wave_frequency: f32,
)
pub fn set_water_surface( &mut self, colour: [f32; 3], alpha: f32, wave_amplitude: f32, wave_frequency: f32, )
Sets the water surface parameters.
Sourcepub fn set_water_quality(&mut self, tier: u32)
pub fn set_water_quality(&mut self, tier: u32)
Select bounded water shading without allocating or rebuilding resources.
Sourcepub fn water_geometry_state(&self) -> (u64, u64, u32)
pub fn water_geometry_state(&self) -> (u64, u64, u32)
PortalGpu::water_geometry_state.
Sourcepub fn water_shoreline_state(&self) -> (u32, u64, u64)
pub fn water_shoreline_state(&self) -> (u32, u64, u64)
Shoreline state (count, lo, hi).
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn set_exposure_compensation(&mut self, compensation_ev: f32) -> bool
pub fn set_exposure_compensation(&mut self, compensation_ev: f32) -> bool
Set bounded manual HDR exposure compensation in stops (EV). The value remains configured and is applied by whichever scene-output path is active.
Sourcepub fn set_hdr_exposure_compensation(&mut self, compensation_ev: f32) -> bool
pub fn set_hdr_exposure_compensation(&mut self, compensation_ev: f32) -> bool
Compatibility alias for the original HDR-specific API name.
Sourcepub fn set_white_balance(&mut self, temperature_ev: f32, tint_ev: f32) -> bool
pub fn set_white_balance(&mut self, temperature_ev: f32, tint_ev: f32) -> bool
Set bounded pre-tone-map white balance, retaining controls across target rebuilds.
Sourcepub fn hdr_exposure_compensation(&self) -> f32
pub fn hdr_exposure_compensation(&self) -> f32
HDR exposure compensation.
Sourcepub fn hdr_exposure_available(&self) -> bool
pub fn hdr_exposure_available(&self) -> bool
true when HDR exposure is available.
Sourcepub fn exposure_transform_available(&self) -> bool
pub fn exposure_transform_available(&self) -> bool
Whether the active HDR or SDR scene-to-display path applies manual exposure.
Sourcepub fn hdr_scene_available(&self) -> bool
pub fn hdr_scene_available(&self) -> bool
Whether the current WebGPU scene path retains values above SDR white before output mapping.
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn compute_dispatch(
&mut self,
wgsl: &str,
entry_point: &str,
workgroups: [u32; 3],
bindings: &[ComputeBinding<'_>],
readback_binding: Option<u32>,
readback_bytes: usize,
) -> Result<u64, String>
pub fn compute_dispatch( &mut self, wgsl: &str, entry_point: &str, workgroups: [u32; 3], bindings: &[ComputeBinding<'_>], readback_binding: Option<u32>, readback_bytes: usize, ) -> Result<u64, String>
Submit a WGSL compute dispatch on this portal’s device.
Compiles (or fetches a cached) compute pipeline, uploads the supplied
bindings, dispatches workgroups workgroups, and copies the
readback_binding buffer into a staging buffer for later readback via
Self::compute_readback. Returns a dispatch_id.
If readback_binding is None or readback_bytes is 0, no copy is
recorded and the dispatch is fire-and-forget (readback returns empty).
Sourcepub fn compute_readback(&mut self) -> Option<Result<Vec<u8>, String>>
pub fn compute_readback(&mut self) -> Option<Result<Vec<u8>, String>>
Poll the outstanding compute readback. Returns Some(bytes) when the
staging buffer is mapped and read, None when there is no pending
dispatch or the map has not resolved.
Sourcepub fn compute_pipeline_cache_size(&self) -> usize
pub fn compute_pipeline_cache_size(&self) -> usize
Number of cached compute pipelines (diagnostic / test helper).
Sourcepub fn compile_shader_module(
&mut self,
wgsl: &str,
entry: &str,
) -> Result<u64, String>
pub fn compile_shader_module( &mut self, wgsl: &str, entry: &str, ) -> Result<u64, String>
Compile a WGSL shader module and cache it, returning a shader_id handle
(plan §7.3 W7 — Render.gpu_compile_shader).
The shader module is compiled on this portal’s device and stored in the
shader cache. The handle can be used for diagnostic purposes or future
hot-reload dispatch. For immediate compute dispatch, use
Self::compute_dispatch directly (it accepts raw WGSL and caches
pipelines internally).
Sourcepub fn shader_cache_size(&self) -> usize
pub fn shader_cache_size(&self) -> usize
Number of cached shader modules (diagnostic / test helper).
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn emf_upload_field(
&mut self,
cells: &[EmfFieldCell],
nx: u32,
ny: u32,
nz: u32,
nt: u32,
bounds: [f32; 6],
) -> Result<(), String>
pub fn emf_upload_field( &mut self, cells: &[EmfFieldCell], nx: u32, ny: u32, nz: u32, nt: u32, bounds: [f32; 6], ) -> Result<(), String>
Upload an EMF field grid to the GPU for volumetric visualization.
cells is the flat field array indexed as [t][z][y][x], with
nx*ny*nz*nt elements. bounds is [x_min, x_max, y_min, y_max, z_min, z_max].
Sourcepub fn emf_upload_loaded(&mut self, loaded: &LoadedEmf) -> Result<(), String>
pub fn emf_upload_loaded(&mut self, loaded: &LoadedEmf) -> Result<(), String>
Upload an admitted LoadedEmf derivative, enabling full-spectrum projection mode 0
when spectral/Stokes cells are present (falling back to grayscale mode 1 for static grids).
Sourcepub fn emf_upload_emf64(&mut self, bytes: &[u8]) -> Result<(), String>
pub fn emf_upload_emf64(&mut self, bytes: &[u8]) -> Result<(), String>
Parse and upload a verified Q42EMF64 container directly for volumetric display.
Sourcepub fn emf_update_slice_params(
&mut self,
slice_z: u32,
slice_t: u32,
bounds: [f32; 6],
amplitude_scale: f32,
phase_offset: f32,
manifold_gain: f32,
)
pub fn emf_update_slice_params( &mut self, slice_z: u32, slice_t: u32, bounds: [f32; 6], amplitude_scale: f32, phase_offset: f32, manifold_gain: f32, )
Update the slice parameters (which z/t slice to render, display controls).
Preserves projection_mode: 1 grayscale compatibility; use emf_update_slice_params_with_mode
for full volumetric spectral + Stokes mode 0.
Sourcepub fn emf_update_slice_params_with_mode(
&mut self,
slice_z: u32,
slice_t: u32,
bounds: [f32; 6],
amplitude_scale: f32,
phase_offset: f32,
manifold_gain: f32,
projection_mode: u32,
)
pub fn emf_update_slice_params_with_mode( &mut self, slice_z: u32, slice_t: u32, bounds: [f32; 6], amplitude_scale: f32, phase_offset: f32, manifold_gain: f32, projection_mode: u32, )
Update slice parameters with explicit EmfSliceUniform::projection_mode (0 volumetric spectral, 1 grayscale).
Sourcepub fn emf_render_slice(
&self,
render_pass: &mut RenderPass<'_>,
) -> Result<(), String>
pub fn emf_render_slice( &self, render_pass: &mut RenderPass<'_>, ) -> Result<(), String>
Render the current EMF slice to the portal’s color target.
Draws a full-screen quad with the EMF fragment shader. The caller is responsible for beginning the render pass and providing a color attachment view.
Sourcepub fn emf_has_field(&self) -> bool
pub fn emf_has_field(&self) -> bool
Whether an EMF field is currently uploaded.
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn new_offscreen(
width: u32,
height: u32,
particle_cap: usize,
) -> Result<Self, String>
pub fn new_offscreen( width: u32, height: u32, particle_cap: usize, ) -> Result<Self, String>
Build a native offscreen renderer on QualiaDB’s process-wide shared GPU device.
The output target is linear Rgba8Unorm. Call Self::render and then
Self::read_rgba8_into to retrieve tightly packed pixels into a caller-owned buffer.
Sourcepub fn new_surface(
hwnd: isize,
width: u32,
height: u32,
particle_cap: usize,
) -> Result<Self, String>
pub fn new_surface( hwnd: isize, width: u32, height: u32, particle_cap: usize, ) -> Result<Self, String>
Build a native surface renderer that draws directly to a window’s GPU swapchain.
This is the native desktop path — no PNG round-trip, no webview <img>. The surface
is created from a raw window handle (HWND on Windows) and frames are presented directly
to the OS swapchain.
The surface format is chosen from the adapter’s capabilities (sRGB preferred).
Call Self::render to draw a frame; the swapchain present is automatic.
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn upload_holographic_nodes(
&mut self,
nodes: &[HolographicNodeGpu],
) -> Result<u32, String>
pub fn upload_holographic_nodes( &mut self, nodes: &[HolographicNodeGpu], ) -> Result<u32, String>
Uploads 96-byte holographic nodes into the WebGPU SSBO theatre.
Source§impl PortalGpu
impl PortalGpu
pub fn queue_pick(&mut self, x: f32, y: f32)
pub fn poll_pick_readback(&mut self) -> Option<u32>
Sourcepub fn poll_semantic_pick_readback(&mut self) -> Option<u64>
pub fn poll_semantic_pick_readback(&mut self) -> Option<u64>
Return the full semantic identity from the most recently completed mesh pick.
Tensor picks continue to be returned by poll_pick_readback; this separate accessor keeps
the existing tensor API stable while allowing IDs wider than the R32Uint target.
Sourcepub fn pick_readback_pending(&self) -> bool
pub fn pick_readback_pending(&self) -> bool
PortalGpu::pick_readback_pending.
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn required_rgba8_bytes(&self) -> usize
pub fn required_rgba8_bytes(&self) -> usize
Number of bytes required by Self::read_rgba8_into.
Sourcepub fn read_rgba8_into(&self, out: &mut [u8]) -> Result<usize, String>
pub fn read_rgba8_into(&self, out: &mut [u8]) -> Result<usize, String>
Read the most recently rendered native offscreen frame into tightly packed RGBA8 bytes.
This is deliberately caller-buffered: no Vec is created in the renderer. Browser surface
instances return an error because their swapchain images are presented, not retained.
Sourcepub fn particle_count(&self) -> u32
pub fn particle_count(&self) -> u32
PortalGpu::particle_count.
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn render(
&mut self,
time: f32,
telemetry: &SystemTelemetry,
) -> Result<(), String>
pub fn render( &mut self, time: f32, telemetry: &SystemTelemetry, ) -> Result<(), String>
Renders the frame.
Sourcepub fn render_with_temporal(
&mut self,
time: f32,
telemetry: &SystemTelemetry,
schedule: TemporalOutputSchedule,
producers: TemporalProducerViews<'_>,
) -> Result<bool, String>
pub fn render_with_temporal( &mut self, time: f32, telemetry: &SystemTelemetry, schedule: TemporalOutputSchedule, producers: TemporalProducerViews<'_>, ) -> Result<bool, String>
Render one frame and submit temporal output when all real host producers are available.
Scene colour and linear depth remain renderer-owned. The host supplies genuine motion
vectors and a reactive mask; an optional host linear-depth view remains accepted for API
compatibility. If the schedule or any producer is unavailable, this method renders the
ordinary output path and returns Ok(false); no synthetic motion/reactive data is created.
Sourcepub fn render_with_auto_temporal(
&mut self,
time: f32,
telemetry: &SystemTelemetry,
) -> Result<bool, String>
pub fn render_with_auto_temporal( &mut self, time: f32, telemetry: &SystemTelemetry, ) -> Result<bool, String>
Render one frame with automatic temporal history accumulation using renderer-owned motion vectors and reactive mask producers.
Sourcepub fn record_scheduled_temporal_output_auto(
&mut self,
encoder: &mut CommandEncoder,
target: &TextureView,
schedule: TemporalOutputSchedule,
) -> bool
pub fn record_scheduled_temporal_output_auto( &mut self, encoder: &mut CommandEncoder, target: &TextureView, schedule: TemporalOutputSchedule, ) -> bool
Record scheduled temporal output using internal renderer-owned motion vectors and reactive mask.
Sourcepub fn record_scheduled_temporal_output_from_producers(
&mut self,
encoder: &mut CommandEncoder,
producers: TemporalProducerViews<'_>,
target: &TextureView,
schedule: TemporalOutputSchedule,
) -> bool
pub fn record_scheduled_temporal_output_from_producers( &mut self, encoder: &mut CommandEncoder, producers: TemporalProducerViews<'_>, target: &TextureView, schedule: TemporalOutputSchedule, ) -> bool
Record scheduled temporal output using explicit producer views.
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn is_device_lost(&self) -> bool
pub fn is_device_lost(&self) -> bool
true after the GPU device has been reported lost (atomic flag).
Sourcepub fn set_ambient_enabled(&mut self, on: bool)
pub fn set_ambient_enabled(&mut self, on: bool)
Enable/disable the ambient particle field draw. Off by default and opt-in: a plain mesh/anatomy view (or a game scene) has no use for the particle cloud; a Tensor10D upload keeps it off and the mixer’s “ambient” channel (or an explicit call) enables it.
Sourcepub fn set_tensor_projection_enabled(&mut self, on: bool)
pub fn set_tensor_projection_enabled(&mut self, on: bool)
Show or hide semantic tensor sprites without releasing their pick data.
Sourcepub fn set_screen_space_ao_enabled(&mut self, enabled: bool)
pub fn set_screen_space_ao_enabled(&mut self, enabled: bool)
Enable the budgeted half-resolution depth/normal ambient-visibility pass when available.
Sourcepub fn set_screen_space_ao(&mut self, radius: f32, strength: f32, bias: f32)
pub fn set_screen_space_ao(&mut self, radius: f32, strength: f32, bias: f32)
Configure the indirect-visibility radius and strength in world units and normalized range.
Sourcepub fn set_screen_space_ao_sample_count(&mut self, samples: u32)
pub fn set_screen_space_ao_sample_count(&mut self, samples: u32)
Set the bounded SSAO tap count; 4 is the low-cost tier, 8 default, 12 quality tier.
Sourcepub fn screen_space_ao_available(&self) -> bool
pub fn screen_space_ao_available(&self) -> bool
true when SSAO targets were allocated — the half-res AO pass can run.
Sourcepub fn screen_space_ao_enabled(&self) -> bool
pub fn screen_space_ao_enabled(&self) -> bool
Whether the SSAO pass is enabled (only meaningful when available).
Sourcepub fn screen_space_ao_resolution(&self) -> Option<(u32, u32)>
pub fn screen_space_ao_resolution(&self) -> Option<(u32, u32)>
Half-resolution AO target extent, or None when SSAO is unavailable.
Sourcepub fn set_artefact_joint(&mut self, joint: Option<Joint>)
pub fn set_artefact_joint(&mut self, joint: Option<Joint>)
Drive the loaded mesh by a kinematic joint (Phase 2). None freezes it at identity.
Sourcepub fn set_artefact_world(&mut self, world: Option<Aabb>)
pub fn set_artefact_world(&mut self, world: Option<Aabb>)
Constrain the artefact to a world bound; a joint pose that would leave it is refused
(the artefact holds at the last admitted pose). None = unconstrained.
Sourcepub fn artefact_refused(&self) -> bool
pub fn artefact_refused(&self) -> bool
Whether last frame’s proposed joint pose was deterministically refused (clamped at the bound).
Sourcepub fn set_shadows_enabled(&mut self, enabled: bool)
pub fn set_shadows_enabled(&mut self, enabled: bool)
Enable or disable the portable two-cascade sun-shadow tier. Disabling it keeps geometry and material state intact and removes both the shadow pass and receiver sampling work.
Sourcepub fn shadows_enabled(&self) -> bool
pub fn shadows_enabled(&self) -> bool
Whether the shadow-map pass is enabled.
Sourcepub fn shadow_resolution(&self) -> Option<u32>
pub fn shadow_resolution(&self) -> Option<u32>
Configured shadow-map resolution, or None when shadows are off.
Sourcepub fn set_camera(&mut self, yaw: f32, pitch: f32, zoom: f32)
pub fn set_camera(&mut self, yaw: f32, pitch: f32, zoom: f32)
Sets yaw/pitch/zoom, preserving target/near-plane/lighting, then clamps and flags a temporal-history reset.
Sourcepub fn set_camera_near_plane(&mut self, near: f32) -> bool
pub fn set_camera_near_plane(&mut self, near: f32) -> bool
Sets the near plane; false when near is non-finite or outside [1e-5, 1.0] — fails closed without touching the camera.
Sourcepub fn set_camera_pan(&mut self, target_x: f32, target_y: f32, target_z: f32)
pub fn set_camera_pan(&mut self, target_x: f32, target_y: f32, target_z: f32)
Moves the camera look-at target and flags a temporal-history reset.
Sourcepub fn set_camera_target(
&mut self,
yaw: f32,
pitch: f32,
zoom: f32,
target_x: f32,
target_y: f32,
target_z: f32,
)
pub fn set_camera_target( &mut self, yaw: f32, pitch: f32, zoom: f32, target_x: f32, target_y: f32, target_z: f32, )
Replaces camera yaw/pitch/zoom/target, preserving near-plane and lighting; result is clamped.
Sourcepub fn set_clear_color(&mut self, r: f64, g: f64, b: f64, a: f64)
pub fn set_clear_color(&mut self, r: f64, g: f64, b: f64, a: f64)
Sets the clear color and disables the sky preset.
Sourcepub fn clear_color(&self) -> [f64; 4]
pub fn clear_color(&self) -> [f64; 4]
Current RGBA clear color.
Sourcepub fn set_lighting(
&mut self,
sun_x: f32,
sun_y: f32,
sun_z: f32,
sun_intensity: f32,
ambient_intensity: f32,
)
pub fn set_lighting( &mut self, sun_x: f32, sun_y: f32, sun_z: f32, sun_intensity: f32, ambient_intensity: f32, )
Updates sun direction/intensity and ambient intensity, clamped to valid ranges.
Sourcepub fn set_sky_preset(&mut self, preset: u32)
pub fn set_sky_preset(&mut self, preset: u32)
Selects a procedural sky preset by index.
Sourcepub fn set_atmosphere_preset(&mut self, preset: u32)
pub fn set_atmosphere_preset(&mut self, preset: u32)
Apply only the shared atmospheric fog profile, leaving the selected clear/sky mode intact.
Sourcepub fn set_holograph_selected(&mut self, selected: i32)
pub fn set_holograph_selected(&mut self, selected: i32)
Packs the holographic selection index into observer padding for cinema WGSL.
Sourcepub fn set_standpoint(&mut self, observer: ObserverStandpoint)
pub fn set_standpoint(&mut self, observer: ObserverStandpoint)
Sets the observer standpoint used by telemetry/temporal views.
Sourcepub fn observer_standpoint(&self) -> ObserverStandpoint
pub fn observer_standpoint(&self) -> ObserverStandpoint
Current observer standpoint.
Sourcepub fn camera_state(&self) -> CameraState
pub fn camera_state(&self) -> CameraState
Copy of the current camera state.
Sourcepub fn surface_size(&self) -> (u32, u32)
pub fn surface_size(&self) -> (u32, u32)
Configured surface/depth size. The swapchain texture follows the canvas backing store,
so callers compare this to canvas.width()/height() and resize() on divergence —
otherwise color and depth attachments mismatch and the render pass fails validation.
Sourcepub fn temporal_resolve_gpu(&self) -> Option<&TemporalResolveGpu>
pub fn temporal_resolve_gpu(&self) -> Option<&TemporalResolveGpu>
Optional renderer-owned temporal resolve. It is absent when the device cannot admit the bounded history targets; callers must preserve the existing output path in that case.
Sourcepub fn temporal_resolve_gpu_mut(&mut self) -> Option<&mut TemporalResolveGpu>
pub fn temporal_resolve_gpu_mut(&mut self) -> Option<&mut TemporalResolveGpu>
Mutable temporal owner for hosts that have real linear-depth, motion-vector, and reactive-mask producer views to submit.
Sourcepub fn temporal_scene_color_view(&self) -> Option<&TextureView>
pub fn temporal_scene_color_view(&self) -> Option<&TextureView>
The renderer-owned scene-colour attachment that can be sampled by temporal resolve.
The direct surface/offscreen target is not assumed to be texture-bindable. The bloom HDR target or the SDR output-chain scene target is therefore the only concrete scene producer exposed here.
Sourcepub fn temporal_producer_availability(&self) -> TemporalProducerAvailability
pub fn temporal_producer_availability(&self) -> TemporalProducerAvailability
Report producer ownership before a host attempts a temporal submission.
The temporal owner converts SceneDepthOwner into a renderer-owned linear-depth colour
target. Motion vectors and reactive masks remain unavailable until a real producer is
supplied by the host.
Sourcepub fn internal_temporal_producers_available(&self) -> bool
pub fn internal_temporal_producers_available(&self) -> bool
Whether the engine owns internal temporal producers (motion vectors and reactive mask).
Sourcepub fn temporal_history_valid(&self) -> bool
pub fn temporal_history_valid(&self) -> bool
Whether the renderer-owned temporal history currently contains a published frame.
Sourcepub fn temporal_submission_state(&self) -> TemporalSubmissionState
pub fn temporal_submission_state(&self) -> TemporalSubmissionState
State of the current renderer-owned temporal command handoff.
Sourcepub fn temporal_reset_pending(&self) -> bool
pub fn temporal_reset_pending(&self) -> bool
Whether the next admitted temporal frame must start without previous history.
Sourcepub fn invalidate_temporal_history(&mut self)
pub fn invalidate_temporal_history(&mut self)
Drop temporal history after a camera cut, seek, or host-owned discontinuity.
Sourcepub fn current_camera_view_projection(&self) -> Mat4ColumnMajor
pub fn current_camera_view_projection(&self) -> Mat4ColumnMajor
Current camera view-projection matrix (column-major).
Sourcepub fn previous_camera_view_projection(&self) -> Option<Mat4ColumnMajor>
pub fn previous_camera_view_projection(&self) -> Option<Mat4ColumnMajor>
Previous frame’s camera view-projection matrix, if history is valid.
Sourcepub fn temporal_motion_view(&self) -> Option<&TextureView>
pub fn temporal_motion_view(&self) -> Option<&TextureView>
Motion-vector texture view when temporal producers are allocated.
Sourcepub fn temporal_reactive_view(&self) -> Option<&TextureView>
pub fn temporal_reactive_view(&self) -> Option<&TextureView>
Reactive-mask texture view when temporal producers are allocated.
Sourcepub fn record_temporal_producers(&mut self, encoder: &mut CommandEncoder)
pub fn record_temporal_producers(&mut self, encoder: &mut CommandEncoder)
Records the temporal producer passes into encoder: inverse current view-projection (identity fallback), previous VP, and per-layer reactive weights (water 0.8, ambient 0.5).
Sourcepub fn record_scheduled_temporal_output(
&mut self,
encoder: &mut CommandEncoder,
inputs: TemporalResolveInputs<'_, '_>,
target: &TextureView,
schedule: TemporalOutputSchedule,
) -> bool
pub fn record_scheduled_temporal_output( &mut self, encoder: &mut CommandEncoder, inputs: TemporalResolveInputs<'_, '_>, target: &TextureView, schedule: TemporalOutputSchedule, ) -> bool
Record a scheduled temporal output using real host producer views.
PortalGpu::render intentionally does not fabricate motion vectors, reactive masks, or
linear-depth views. Hosts that own those attachments call this seam with their command
encoder before submission. It records resolve → history publication → final output and
returns false without recording when the optional owner is unavailable or the schedule
is not a complete temporal handoff.
Source§impl PortalGpu
impl PortalGpu
Sourcepub fn upload_tensor_buffer(&mut self, bytes: &[u8]) -> Result<u32, String>
pub fn upload_tensor_buffer(&mut self, bytes: &[u8]) -> Result<u32, String>
Uploads a tensor buffer.
Sourcepub fn tensor_node_count(&self) -> u32
pub fn tensor_node_count(&self) -> u32
tensor-node count.
Sourcepub fn has_tensor_buffer(&self) -> bool
pub fn has_tensor_buffer(&self) -> bool
true when tensor_buffer present.
Auto Trait Implementations§
impl !Freeze for PortalGpu
impl !RefUnwindSafe for PortalGpu
impl !Sync for PortalGpu
impl !UnwindSafe for PortalGpu
impl Send for PortalGpu
impl Unpin for PortalGpu
impl UnsafeUnpin for PortalGpu
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more