pub type RuntimeShaderBuilder = Handle<SkRuntimeShaderBuilder>;
Aliased Type§
struct RuntimeShaderBuilder(/* private fields */);
Implementations§
Source§impl RuntimeShaderBuilder
impl RuntimeShaderBuilder
pub fn new(effect: RuntimeEffect) -> Self
pub fn make_shader(&self, local_matrix: &Matrix) -> Option<Shader>
Sourcepub fn set_uniform_float(
&mut self,
name: impl AsRef<str>,
data: &[f32],
) -> Result<(), ShaderBuilderError>
pub fn set_uniform_float( &mut self, name: impl AsRef<str>, data: &[f32], ) -> Result<(), ShaderBuilderError>
Set float uniform values by name.
Supported types are float
, float2
, float3
, float4
, float2x2
, float3x3
, float4x4
.
The data array must have the correct length for the corresponding uniform type:
float
:[f32; 1]
float2
:[f32; 2]
float3
:[f32; 3]
float4
:[f32; 4]
float2x2
:[f32; 4]
float3x3
:[f32; 9]
float4x4
:[f32; 16]
Sourcepub fn set_uniform_int(
&mut self,
name: impl AsRef<str>,
data: &[i32],
) -> Result<(), ShaderBuilderError>
pub fn set_uniform_int( &mut self, name: impl AsRef<str>, data: &[i32], ) -> Result<(), ShaderBuilderError>
Set int uniform values by name.
Supported types are int
, int2
, int3
, int4
.
The data array must have the correct length for the corresponding uniform type:
int
:[i32; 1]
int2
:[i32; 2]
int3
:[i32; 3]
int4
:[i32; 4]