⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

ShaderExecutor

Struct ShaderExecutor 

Source
pub struct ShaderExecutor { /* private fields */ }
Expand description

Executes shader programs on pixel data using software rasterisation.

Implementations§

Source§

impl ShaderExecutor

Source

pub fn new() -> Self

Create a new executor with zeroed registers.

Source

pub fn set_uniform(&mut self, slot: usize, value: UniformValue)

Set a uniform value for the next execution.

Source

pub fn set_register(&mut self, reg: u8, value: i32)

Set an input register value.

Source

pub fn get_register(&self, reg: u8) -> i32

Read a register value.

Source

pub fn execute(&mut self, program: &ShaderProgram)

Execute a shader program.

Registers should be pre-loaded with input values. After execution, output registers contain the results.

Source

pub fn execute_fragment(&mut self, program: &ShaderProgram) -> u32

Execute a fragment shader for a single pixel, returning ARGB8888.

Input: registers 0-3 are R, G, B, A in 16.16 fixed-point (0..255 range).

Trait Implementations§

Source§

impl Default for ShaderExecutor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for ShaderExecutor

§

impl RefUnwindSafe for ShaderExecutor

§

impl Send for ShaderExecutor

§

impl Sync for ShaderExecutor

§

impl Unpin for ShaderExecutor

§

impl UnwindSafe for ShaderExecutor

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.