Skip to main content

PortalGpu

Struct PortalGpu 

Source
pub struct PortalGpu { /* private fields */ }

Implementations§

Source§

impl PortalGpu

Source

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.

Source

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

pub fn set_ambient_enabled(&mut self, on: bool)

Enable/disable the ambient particle field draw. Off by default (a plain mesh/anatomy view has no use for the decorative random cloud); a Tensor10D upload turns it on since the particles then encode epistemic nodes. The mixer’s “ambient” channel drives this.

Source

pub fn upload_tensor_buffer(&mut self, bytes: &[u8]) -> Result<u32, String>

Source

pub fn tensor_node_count(&self) -> u32

Source

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.

Source

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.

Source

pub fn artefact_refused(&self) -> bool

Whether last frame’s proposed joint pose was deterministically refused (clamped at the bound).

Source

pub fn has_tensor_buffer(&self) -> bool

Source

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.

Source

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.

Source

pub fn has_mesh(&self) -> bool

Whether a mesh surface is resident.

Source

pub fn set_camera(&mut self, yaw: f32, pitch: f32, zoom: f32)

Source

pub fn set_standpoint(&mut self, observer: ObserverStandpoint)

Source

pub fn observer_standpoint(&self) -> ObserverStandpoint

Source

pub fn camera_state(&self) -> CameraState

Source

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.

Source

pub fn resize(&mut self, width: u32, height: u32)

Source

pub fn sync_bloom_targets(&mut self)

Reconcile HDR bloom textures with current VramLedger operational mode.

Source

pub fn queue_pick(&mut self, x: f32, y: f32)

Source

pub fn poll_pick_readback(&mut self) -> Option<u32>

Source

pub fn render( &mut self, time: f32, telemetry: &SystemTelemetry, ) -> Result<(), String>

Source

pub fn required_rgba8_bytes(&self) -> usize

Number of bytes required by Self::read_rgba8_into.

Source

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.

Source

pub fn particle_count(&self) -> u32

Auto Trait Implementations§

Blanket Implementations§

§

impl<S, A> Aggregate<Result<S, Error>> for A
where A: Aggregate<S>,

§

fn from_shares<T>(iter: T) -> Result<A, Error>
where T: IntoIterator<Item = Result<S, Error>>,

Aggregate shares in an MPC protocol.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,