pub struct ProgramShader { /* private fields */ }Expand description
A pixel program with the register view the D3D readers’ callers use.
Implementations§
Source§impl ProgramShader
impl ProgramShader
Sourcepub fn new(program: Program) -> Result<Self, Error>
pub fn new(program: Program) -> Result<Self, Error>
Compile program. Its inputs and outputs need their D3D registers (the lifter keeps them in provenance),
and every resource a D3D bind slot.
Sourcepub fn needs_quad(&self) -> bool
pub fn needs_quad(&self) -> bool
Whether a caller that wants this program’s exact results must run it as a quad (Executable::needs_quad).
Source§impl ProgramShader
impl ProgramShader
Sourcepub fn execute_vertex(
&self,
inputs: &[[u32; 4]],
buffers: &[(u32, &[[u32; 4]])],
sampler: &mut dyn Sampler,
) -> Result<(Execution, [u32; 4]), Error>
pub fn execute_vertex( &self, inputs: &[[u32; 4]], buffers: &[(u32, &[[u32; 4]])], sampler: &mut dyn Sampler, ) -> Result<(Execution, [u32; 4]), Error>
Run a vertex program once on its input registers (the vertex’s attributes): its varyings in the register view,
as PixelShader::execute gives them, and its clip-space position (SV_Position) as f32 bits. A program that
is not a vertex program, or writes no position, refuses.
Sourcepub fn execute_lockstep(
&self,
inputs: &[&[[u32; 4]]],
derivatives: &[[[u32; 4]; 2]],
buffers: &[(u32, &[[u32; 4]])],
sampler: &mut dyn Sampler,
) -> Result<Vec<Execution>, Error>
pub fn execute_lockstep( &self, inputs: &[&[[u32; 4]]], derivatives: &[[[u32; 4]; 2]], buffers: &[(u32, &[[u32; 4]])], sampler: &mut dyn Sampler, ) -> Result<Vec<Execution>, Error>
PixelShader::execute_lanes without its second run: the invocations in lockstep, 16 at a time, and on an
error the one the lockstep run met (of whichever invocation met one first in lockstep, which need not be the
first to fail alone).
Trait Implementations§
Source§impl Debug for ProgramShader
impl Debug for ProgramShader
Source§impl PixelShader for ProgramShader
impl PixelShader for ProgramShader
Source§fn interface(&self) -> &Interface
fn interface(&self) -> &Interface
iridia::Interface vocabulary.Source§fn input_count(&self) -> usize
fn input_count(&self) -> usize
Source§fn constant_buffers(&self) -> &[(u32, u32)]
fn constant_buffers(&self) -> &[(u32, u32)]
Source§fn execute(
&self,
inputs: &[[u32; 4]],
buffers: &[(u32, &[[u32; 4]])],
sampler: &mut dyn Sampler,
) -> Result<Execution, Error>
fn execute( &self, inputs: &[[u32; 4]], buffers: &[(u32, &[[u32; 4]])], sampler: &mut dyn Sampler, ) -> Result<Execution, Error>
Source§fn execute_with_derivatives(
&self,
inputs: &[[u32; 4]],
derivatives: &[[[u32; 4]; 2]],
buffers: &[(u32, &[[u32; 4]])],
sampler: &mut dyn Sampler,
) -> Result<Execution, Error>
fn execute_with_derivatives( &self, inputs: &[[u32; 4]], derivatives: &[[[u32; 4]; 2]], buffers: &[(u32, &[[u32; 4]])], sampler: &mut dyn Sampler, ) -> Result<Execution, Error>
PixelShader::execute.Source§fn execute_lanes(
&self,
inputs: &[&[[u32; 4]]],
derivatives: &[[[u32; 4]; 2]],
buffers: &[(u32, &[[u32; 4]])],
sampler: &mut dyn Sampler,
each: &mut dyn FnMut(usize, &Execution),
) -> Result<(), (usize, Error)>
fn execute_lanes( &self, inputs: &[&[[u32; 4]]], derivatives: &[[[u32; 4]; 2]], buffers: &[(u32, &[[u32; 4]])], sampler: &mut dyn Sampler, each: &mut dyn FnMut(usize, &Execution), ) -> Result<(), (usize, Error)>
derivatives, as
PixelShader::execute_with_derivatives takes them), each as that would alone: each is given every
invocation’s index and execution (the same outputs, instructions and samples), in order. On an error, the first
failing invocation’s index and its error, each given those before it. The sampler may be asked in another
order than one invocation after another. The default evaluates them one after another.