Struct luminance_webgl::webgl2::WebGL2
source · [−]pub struct WebGL2 { /* private fields */ }
Expand description
The WebGL2 backend.
Implementations
sourceimpl WebGL2
impl WebGL2
pub fn new(ctx: WebGl2RenderingContext) -> Result<Self, StateQueryError>
Trait Implementations
sourceimpl<D> Framebuffer<D> for WebGL2 where
D: Dimensionable,
impl<D> Framebuffer<D> for WebGL2 where
D: Dimensionable,
type FramebufferRepr = Framebuffer<D>
type FramebufferRepr = Framebuffer<D>
Backend representation of the framebuffer.
sourceunsafe fn new_framebuffer<CS, DS>(
&mut self,
size: D::Size,
_: usize,
_: &Sampler
) -> Result<Self::FramebufferRepr, FramebufferError> where
CS: ColorSlot<Self, D>,
DS: DepthStencilSlot<Self, D>,
unsafe fn new_framebuffer<CS, DS>(
&mut self,
size: D::Size,
_: usize,
_: &Sampler
) -> Result<Self::FramebufferRepr, FramebufferError> where
CS: ColorSlot<Self, D>,
DS: DepthStencilSlot<Self, D>,
Create a new framebuffer on the backend. Read more
sourceunsafe fn attach_color_texture(
framebuffer: &mut Self::FramebufferRepr,
texture: &Self::TextureRepr,
attachment_index: usize
) -> Result<(), FramebufferError>
unsafe fn attach_color_texture(
framebuffer: &mut Self::FramebufferRepr,
texture: &Self::TextureRepr,
attachment_index: usize
) -> Result<(), FramebufferError>
Attach a single color data to the framebuffer. Read more
sourceunsafe fn attach_depth_texture(
framebuffer: &mut Self::FramebufferRepr,
texture: &Self::TextureRepr
) -> Result<(), FramebufferError>
unsafe fn attach_depth_texture(
framebuffer: &mut Self::FramebufferRepr,
texture: &Self::TextureRepr
) -> Result<(), FramebufferError>
Attach a single depth data to the framebuffer. Read more
sourceunsafe fn validate_framebuffer(
framebuffer: Self::FramebufferRepr
) -> Result<Self::FramebufferRepr, FramebufferError>
unsafe fn validate_framebuffer(
framebuffer: Self::FramebufferRepr
) -> Result<Self::FramebufferRepr, FramebufferError>
Validate the status of the framebuffer. Read more
sourceunsafe fn framebuffer_size(framebuffer: &Self::FramebufferRepr) -> D::Size
unsafe fn framebuffer_size(framebuffer: &Self::FramebufferRepr) -> D::Size
Get the size of the framebuffer. Read more
sourceimpl FramebufferBackBuffer for WebGL2
impl FramebufferBackBuffer for WebGL2
sourceunsafe fn back_buffer(
&mut self,
size: <Dim2 as Dimensionable>::Size
) -> Result<Self::FramebufferRepr, FramebufferError>
unsafe fn back_buffer(
&mut self,
size: <Dim2 as Dimensionable>::Size
) -> Result<Self::FramebufferRepr, FramebufferError>
Get the back buffer from the backend. Read more
sourceimpl<'a, V, I, W> IndexSlice<'a, V, I, W, Deinterleaved> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
I: 'a + TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
impl<'a, V, I, W> IndexSlice<'a, V, I, W, Deinterleaved> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
I: 'a + TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
type IndexSliceRepr = BufferSlice<'a, I>
type IndexSliceRepr = BufferSlice<'a, I>
Backend representation of an immutable index slice.
type IndexSliceMutRepr = BufferSliceMut<'a, I, { WebGl2RenderingContext::ELEMENT_ARRAY_BUFFER }>
type IndexSliceMutRepr = BufferSliceMut<'a, I, { WebGl2RenderingContext::ELEMENT_ARRAY_BUFFER }>
Backend representation of a mutable index slice.
sourceunsafe fn indices(
tess: &'a mut Self::TessRepr
) -> Result<Self::IndexSliceRepr, TessMapError>
unsafe fn indices(
tess: &'a mut Self::TessRepr
) -> Result<Self::IndexSliceRepr, TessMapError>
Obtain an immutable index slice. Read more
sourceunsafe fn indices_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::IndexSliceMutRepr, TessMapError>
unsafe fn indices_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::IndexSliceMutRepr, TessMapError>
Obtain a mutable index slice.
sourceimpl<'a, V, I, W> IndexSlice<'a, V, I, W, Interleaved> for WebGL2 where
V: TessVertexData<Interleaved, Data = Vec<V>>,
I: 'a + TessIndex,
W: TessVertexData<Interleaved, Data = Vec<W>>,
impl<'a, V, I, W> IndexSlice<'a, V, I, W, Interleaved> for WebGL2 where
V: TessVertexData<Interleaved, Data = Vec<V>>,
I: 'a + TessIndex,
W: TessVertexData<Interleaved, Data = Vec<W>>,
type IndexSliceRepr = BufferSlice<'a, I>
type IndexSliceRepr = BufferSlice<'a, I>
Backend representation of an immutable index slice.
type IndexSliceMutRepr = BufferSliceMut<'a, I, { WebGl2RenderingContext::ELEMENT_ARRAY_BUFFER }>
type IndexSliceMutRepr = BufferSliceMut<'a, I, { WebGl2RenderingContext::ELEMENT_ARRAY_BUFFER }>
Backend representation of a mutable index slice.
sourceunsafe fn indices(
tess: &'a mut Self::TessRepr
) -> Result<Self::IndexSliceRepr, TessMapError>
unsafe fn indices(
tess: &'a mut Self::TessRepr
) -> Result<Self::IndexSliceRepr, TessMapError>
Obtain an immutable index slice. Read more
sourceunsafe fn indices_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::IndexSliceMutRepr, TessMapError>
unsafe fn indices_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::IndexSliceMutRepr, TessMapError>
Obtain a mutable index slice.
sourceimpl<'a, V, I, W, T> InstanceSlice<'a, V, I, W, Deinterleaved, T> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
I: TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>> + Deinterleave<T>,
T: 'a,
impl<'a, V, I, W, T> InstanceSlice<'a, V, I, W, Deinterleaved, T> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
I: TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>> + Deinterleave<T>,
T: 'a,
type InstanceSliceRepr = BufferSlice<'a, T>
type InstanceSliceRepr = BufferSlice<'a, T>
Backend representation of an immutable instance slice.
type InstanceSliceMutRepr = BufferSliceMut<'a, T, { WebGl2RenderingContext::ARRAY_BUFFER }>
type InstanceSliceMutRepr = BufferSliceMut<'a, T, { WebGl2RenderingContext::ARRAY_BUFFER }>
Backend representation of a mutable instance slice.
sourceunsafe fn instances(
tess: &'a mut Self::TessRepr
) -> Result<Self::InstanceSliceRepr, TessMapError>
unsafe fn instances(
tess: &'a mut Self::TessRepr
) -> Result<Self::InstanceSliceRepr, TessMapError>
Obtain an immutable instance slice. Read more
sourceunsafe fn instances_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::InstanceSliceMutRepr, TessMapError>
unsafe fn instances_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::InstanceSliceMutRepr, TessMapError>
Obtain a mutable instance slice.
sourceimpl<'a, V, I, W> InstanceSlice<'a, V, I, W, Interleaved, W> for WebGL2 where
V: TessVertexData<Interleaved, Data = Vec<V>>,
I: TessIndex,
W: 'a + TessVertexData<Interleaved, Data = Vec<W>>,
impl<'a, V, I, W> InstanceSlice<'a, V, I, W, Interleaved, W> for WebGL2 where
V: TessVertexData<Interleaved, Data = Vec<V>>,
I: TessIndex,
W: 'a + TessVertexData<Interleaved, Data = Vec<W>>,
type InstanceSliceRepr = BufferSlice<'a, W>
type InstanceSliceRepr = BufferSlice<'a, W>
Backend representation of an immutable instance slice.
type InstanceSliceMutRepr = BufferSliceMut<'a, W, { WebGl2RenderingContext::ARRAY_BUFFER }>
type InstanceSliceMutRepr = BufferSliceMut<'a, W, { WebGl2RenderingContext::ARRAY_BUFFER }>
Backend representation of a mutable instance slice.
sourceunsafe fn instances(
tess: &'a mut Self::TessRepr
) -> Result<Self::InstanceSliceRepr, TessMapError>
unsafe fn instances(
tess: &'a mut Self::TessRepr
) -> Result<Self::InstanceSliceRepr, TessMapError>
Obtain an immutable instance slice. Read more
sourceunsafe fn instances_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::InstanceSliceMutRepr, TessMapError>
unsafe fn instances_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::InstanceSliceMutRepr, TessMapError>
Obtain a mutable instance slice.
sourceimpl<D> Pipeline<D> for WebGL2 where
D: Dimensionable,
impl<D> Pipeline<D> for WebGL2 where
D: Dimensionable,
sourceunsafe fn start_pipeline(
&mut self,
framebuffer: &Self::FramebufferRepr,
pipeline_state: &PipelineState
)
unsafe fn start_pipeline(
&mut self,
framebuffer: &Self::FramebufferRepr,
pipeline_state: &PipelineState
)
Start a pipeline that will output in the input Framebuffer
and the given PipelineState
. Read more
sourceimpl PipelineBase for WebGL2
impl PipelineBase for WebGL2
type PipelineRepr = Pipeline
sourceunsafe fn new_pipeline(&mut self) -> Result<Self::PipelineRepr, PipelineError>
unsafe fn new_pipeline(&mut self) -> Result<Self::PipelineRepr, PipelineError>
Create a new (cached) pipeline.
sourceimpl<T> PipelineShaderData<T> for WebGL2 where
Self: ShaderData<T, ShaderDataRepr = Buffer<<ArrElem<T> as Std140>::Encoded, { WebGl2RenderingContext::UNIFORM_BUFFER }>>,
T: Std140,
impl<T> PipelineShaderData<T> for WebGL2 where
Self: ShaderData<T, ShaderDataRepr = Buffer<<ArrElem<T> as Std140>::Encoded, { WebGl2RenderingContext::UNIFORM_BUFFER }>>,
T: Std140,
type BoundShaderDataRepr = BoundShaderData<T>
type BoundShaderDataRepr = BoundShaderData<T>
Representation of a bound ShaderData
on the backend.
sourceunsafe fn bind_shader_data(
pipeline: &Self::PipelineRepr,
shader_data: &Self::ShaderDataRepr
) -> Result<Self::BoundShaderDataRepr, PipelineError>
unsafe fn bind_shader_data(
pipeline: &Self::PipelineRepr,
shader_data: &Self::ShaderDataRepr
) -> Result<Self::BoundShaderDataRepr, PipelineError>
Bind a ShaderData
to the current Pipeline
. Read more
sourceunsafe fn shader_data_binding(bound: &Self::BoundShaderDataRepr) -> u32
unsafe fn shader_data_binding(bound: &Self::BoundShaderDataRepr) -> u32
Get the u32
representation of the bound shader data, also known as binding.
sourceimpl<D, P> PipelineTexture<D, P> for WebGL2 where
D: Dimensionable,
P: Pixel,
P::Encoding: IntoArrayBuffer,
P::RawEncoding: IntoArrayBuffer,
impl<D, P> PipelineTexture<D, P> for WebGL2 where
D: Dimensionable,
P: Pixel,
P::Encoding: IntoArrayBuffer,
P::RawEncoding: IntoArrayBuffer,
type BoundTextureRepr = BoundTexture<D, P>
type BoundTextureRepr = BoundTexture<D, P>
Representation of a bound Texture
on the backend.
sourceunsafe fn bind_texture(
pipeline: &Self::PipelineRepr,
texture: &Self::TextureRepr
) -> Result<Self::BoundTextureRepr, PipelineError> where
D: Dimensionable,
P: Pixel,
unsafe fn bind_texture(
pipeline: &Self::PipelineRepr,
texture: &Self::TextureRepr
) -> Result<Self::BoundTextureRepr, PipelineError> where
D: Dimensionable,
P: Pixel,
sourceunsafe fn texture_binding(bound: &Self::BoundTextureRepr) -> u32
unsafe fn texture_binding(bound: &Self::BoundTextureRepr) -> u32
Get the u32
representation of the bound texture, also known as binding.
sourceimpl Query for WebGL2
impl Query for WebGL2
The implementation author, most of the time referred to as “vendor” or “company” responsible for the driver the backend uses. Read more
sourcefn backend_name(&self) -> Result<String, QueryError>
fn backend_name(&self) -> Result<String, QueryError>
The backend name.
sourcefn backend_version(&self) -> Result<String, QueryError>
fn backend_version(&self) -> Result<String, QueryError>
The backend version.
sourcefn backend_shading_lang_version(&self) -> Result<String, QueryError>
fn backend_shading_lang_version(&self) -> Result<String, QueryError>
The shading language version supported by the backend.
sourcefn max_texture_array_elements(&self) -> Result<usize, QueryError>
fn max_texture_array_elements(&self) -> Result<usize, QueryError>
The maximum number of elements a texture array can hold.
sourceimpl RenderGate for WebGL2
impl RenderGate for WebGL2
sourceunsafe fn enter_render_state(&mut self, rdr_st: &RenderState)
unsafe fn enter_render_state(&mut self, rdr_st: &RenderState)
Enter the RenderGate
and share the RenderState
for all subsequent nodes in the pipeline.
sourceimpl Shader for WebGL2
impl Shader for WebGL2
type ProgramRepr = Program
type ProgramRepr = Program
Backend representation of a shader program.
type UniformBuilderRepr = UniformBuilder
type UniformBuilderRepr = UniformBuilder
Backend representation of a uniform builder.
sourceunsafe fn new_stage(
&mut self,
ty: StageType,
src: &str
) -> Result<Self::StageRepr, StageError>
unsafe fn new_stage(
&mut self,
ty: StageType,
src: &str
) -> Result<Self::StageRepr, StageError>
Create a new shader stage of type StageType
.
sourceunsafe fn new_program(
&mut self,
vertex: &Self::StageRepr,
tess: Option<TessellationStages<'_, Self::StageRepr>>,
geometry: Option<&Self::StageRepr>,
fragment: &Self::StageRepr
) -> Result<Self::ProgramRepr, ProgramError>
unsafe fn new_program(
&mut self,
vertex: &Self::StageRepr,
tess: Option<TessellationStages<'_, Self::StageRepr>>,
geometry: Option<&Self::StageRepr>,
fragment: &Self::StageRepr
) -> Result<Self::ProgramRepr, ProgramError>
Create a new shader program by combining several shader stages. Read more
sourceunsafe fn apply_semantics<Sem>(
program: &mut Self::ProgramRepr
) -> Result<Vec<VertexAttribWarning>, ProgramError> where
Sem: Semantics,
unsafe fn apply_semantics<Sem>(
program: &mut Self::ProgramRepr
) -> Result<Vec<VertexAttribWarning>, ProgramError> where
Sem: Semantics,
Apply semantics. Read more
sourceunsafe fn new_uniform_builder(
program: &mut Self::ProgramRepr
) -> Result<Self::UniformBuilderRepr, ProgramError>
unsafe fn new_uniform_builder(
program: &mut Self::ProgramRepr
) -> Result<Self::UniformBuilderRepr, ProgramError>
Construct a new uniform builder. Read more
sourceunsafe fn ask_uniform<T>(
uniform_builder: &mut Self::UniformBuilderRepr,
name: &str
) -> Result<Uniform<T>, UniformWarning> where
Self: for<'a> Uniformable<'a, T>,
unsafe fn ask_uniform<T>(
uniform_builder: &mut Self::UniformBuilderRepr,
name: &str
) -> Result<Uniform<T>, UniformWarning> where
Self: for<'a> Uniformable<'a, T>,
sourceunsafe fn unbound<T>(_: &mut Self::UniformBuilderRepr) -> Uniform<T> where
Self: for<'a> Uniformable<'a, T>,
unsafe fn unbound<T>(_: &mut Self::UniformBuilderRepr) -> Uniform<T> where
Self: for<'a> Uniformable<'a, T>,
sourceimpl<T> ShaderData<T> for WebGL2 where
T: Std140,
impl<T> ShaderData<T> for WebGL2 where
T: Std140,
type ShaderDataRepr = Buffer<<ArrElem<T> as Std140>::Encoded, { WebGl2RenderingContext::UNIFORM_BUFFER }>
type ShaderDataRepr = Buffer<<ArrElem<T> as Std140>::Encoded, { WebGl2RenderingContext::UNIFORM_BUFFER }>
Representation of the data by the backend.
sourceunsafe fn new_shader_data(
&mut self,
values: impl Iterator<Item = T>
) -> Result<Self::ShaderDataRepr, ShaderDataError>
unsafe fn new_shader_data(
&mut self,
values: impl Iterator<Item = T>
) -> Result<Self::ShaderDataRepr, ShaderDataError>
Build a new shader data from some values represented via an iterator.
sourceunsafe fn get_shader_data_at(
shader_data: &Self::ShaderDataRepr,
i: usize
) -> Result<T, ShaderDataError>
unsafe fn get_shader_data_at(
shader_data: &Self::ShaderDataRepr,
i: usize
) -> Result<T, ShaderDataError>
Access an item at index i
.
sourceunsafe fn set_shader_data_at(
shader_data: &mut Self::ShaderDataRepr,
i: usize,
x: T
) -> Result<T, ShaderDataError>
unsafe fn set_shader_data_at(
shader_data: &mut Self::ShaderDataRepr,
i: usize,
x: T
) -> Result<T, ShaderDataError>
Set an item at index i
. Read more
sourceunsafe fn set_shader_data_values(
shader_data: &mut Self::ShaderDataRepr,
values: impl Iterator<Item = T>
) -> Result<(), ShaderDataError>
unsafe fn set_shader_data_values(
shader_data: &mut Self::ShaderDataRepr,
values: impl Iterator<Item = T>
) -> Result<(), ShaderDataError>
Set values by providing an iterator.
sourceimpl ShadingGate for WebGL2
impl ShadingGate for WebGL2
sourceunsafe fn apply_shader_program(&mut self, shader_program: &Self::ProgramRepr)
unsafe fn apply_shader_program(&mut self, shader_program: &Self::ProgramRepr)
Apply the shader program and make it currently in-use for subsequent pipeline nodes.
sourceimpl<V, I, W> Tess<V, I, W, Deinterleaved> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
I: TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
impl<V, I, W> Tess<V, I, W, Deinterleaved> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
I: TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
type TessRepr = DeinterleavedTess<V, I, W>
type TessRepr = DeinterleavedTess<V, I, W>
Backend representation of the tessellation.
sourceunsafe fn build(
&mut self,
vertex_data: Option<V::Data>,
index_data: Vec<I>,
instance_data: Option<W::Data>,
mode: Mode,
_: Option<I>
) -> Result<Self::TessRepr, TessError>
unsafe fn build(
&mut self,
vertex_data: Option<V::Data>,
index_data: Vec<I>,
instance_data: Option<W::Data>,
mode: Mode,
_: Option<I>
) -> Result<Self::TessRepr, TessError>
Build a tessellation from vertex, index, instance and mode data. Read more
sourceunsafe fn tess_vertices_nb(tess: &Self::TessRepr) -> usize
unsafe fn tess_vertices_nb(tess: &Self::TessRepr) -> usize
Number of vertices available in the Tess
.
sourceunsafe fn tess_indices_nb(tess: &Self::TessRepr) -> usize
unsafe fn tess_indices_nb(tess: &Self::TessRepr) -> usize
Number of indices available in the Tess
.
sourceunsafe fn tess_instances_nb(tess: &Self::TessRepr) -> usize
unsafe fn tess_instances_nb(tess: &Self::TessRepr) -> usize
Number of instance data available in the Tess
.
sourceimpl<V, I, W> Tess<V, I, W, Interleaved> for WebGL2 where
V: TessVertexData<Interleaved, Data = Vec<V>>,
I: TessIndex,
W: TessVertexData<Interleaved, Data = Vec<W>>,
impl<V, I, W> Tess<V, I, W, Interleaved> for WebGL2 where
V: TessVertexData<Interleaved, Data = Vec<V>>,
I: TessIndex,
W: TessVertexData<Interleaved, Data = Vec<W>>,
type TessRepr = InterleavedTess<V, I, W>
type TessRepr = InterleavedTess<V, I, W>
Backend representation of the tessellation.
sourceunsafe fn build(
&mut self,
vertex_data: Option<V::Data>,
index_data: Vec<I>,
instance_data: Option<W::Data>,
mode: Mode,
_: Option<I>
) -> Result<Self::TessRepr, TessError>
unsafe fn build(
&mut self,
vertex_data: Option<V::Data>,
index_data: Vec<I>,
instance_data: Option<W::Data>,
mode: Mode,
_: Option<I>
) -> Result<Self::TessRepr, TessError>
Build a tessellation from vertex, index, instance and mode data. Read more
sourceunsafe fn tess_vertices_nb(tess: &Self::TessRepr) -> usize
unsafe fn tess_vertices_nb(tess: &Self::TessRepr) -> usize
Number of vertices available in the Tess
.
sourceunsafe fn tess_indices_nb(tess: &Self::TessRepr) -> usize
unsafe fn tess_indices_nb(tess: &Self::TessRepr) -> usize
Number of indices available in the Tess
.
sourceunsafe fn tess_instances_nb(tess: &Self::TessRepr) -> usize
unsafe fn tess_instances_nb(tess: &Self::TessRepr) -> usize
Number of instance data available in the Tess
.
sourceimpl<V, I, W> TessGate<V, I, W, Deinterleaved> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
I: TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
impl<V, I, W> TessGate<V, I, W, Deinterleaved> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
I: TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
sourceimpl<V, I, W> TessGate<V, I, W, Interleaved> for WebGL2 where
V: TessVertexData<Interleaved, Data = Vec<V>>,
I: TessIndex,
W: TessVertexData<Interleaved, Data = Vec<W>>,
impl<V, I, W> TessGate<V, I, W, Interleaved> for WebGL2 where
V: TessVertexData<Interleaved, Data = Vec<V>>,
I: TessIndex,
W: TessVertexData<Interleaved, Data = Vec<W>>,
sourceimpl<D, P> Texture<D, P> for WebGL2 where
D: Dimensionable,
P: Pixel,
P::Encoding: IntoArrayBuffer,
P::RawEncoding: IntoArrayBuffer,
impl<D, P> Texture<D, P> for WebGL2 where
D: Dimensionable,
P: Pixel,
P::Encoding: IntoArrayBuffer,
P::RawEncoding: IntoArrayBuffer,
sourceunsafe fn new_texture(
&mut self,
size: D::Size,
sampler: Sampler,
texels: TexelUpload<'_, [P::Encoding]>
) -> Result<Self::TextureRepr, TextureError>
unsafe fn new_texture(
&mut self,
size: D::Size,
sampler: Sampler,
texels: TexelUpload<'_, [P::Encoding]>
) -> Result<Self::TextureRepr, TextureError>
Create a new texture.
sourceunsafe fn new_texture_raw(
&mut self,
size: D::Size,
sampler: Sampler,
texels: TexelUpload<'_, [P::RawEncoding]>
) -> Result<Self::TextureRepr, TextureError>
unsafe fn new_texture_raw(
&mut self,
size: D::Size,
sampler: Sampler,
texels: TexelUpload<'_, [P::RawEncoding]>
) -> Result<Self::TextureRepr, TextureError>
Create a new texture from raw texels.
sourceunsafe fn mipmaps(texture: &Self::TextureRepr) -> usize
unsafe fn mipmaps(texture: &Self::TextureRepr) -> usize
Get the number of mimaps associated with the texture.
sourceunsafe fn upload_part(
texture: &mut Self::TextureRepr,
offset: D::Offset,
size: D::Size,
texels: TexelUpload<'_, [P::Encoding]>
) -> Result<(), TextureError>
unsafe fn upload_part(
texture: &mut Self::TextureRepr,
offset: D::Offset,
size: D::Size,
texels: TexelUpload<'_, [P::Encoding]>
) -> Result<(), TextureError>
Upload texels to a part of a texture. Read more
sourceunsafe fn upload(
texture: &mut Self::TextureRepr,
size: D::Size,
texels: TexelUpload<'_, [P::Encoding]>
) -> Result<(), TextureError>
unsafe fn upload(
texture: &mut Self::TextureRepr,
size: D::Size,
texels: TexelUpload<'_, [P::Encoding]>
) -> Result<(), TextureError>
Upload texels to a whole texture. Read more
sourceunsafe fn upload_part_raw(
texture: &mut Self::TextureRepr,
offset: D::Offset,
size: D::Size,
texels: TexelUpload<'_, [P::RawEncoding]>
) -> Result<(), TextureError>
unsafe fn upload_part_raw(
texture: &mut Self::TextureRepr,
offset: D::Offset,
size: D::Size,
texels: TexelUpload<'_, [P::RawEncoding]>
) -> Result<(), TextureError>
Upload texels to a part of a texture. Read more
sourceunsafe fn upload_raw(
texture: &mut Self::TextureRepr,
size: D::Size,
texels: TexelUpload<'_, [P::RawEncoding]>
) -> Result<(), TextureError>
unsafe fn upload_raw(
texture: &mut Self::TextureRepr,
size: D::Size,
texels: TexelUpload<'_, [P::RawEncoding]>
) -> Result<(), TextureError>
Upload texels to a whole texture. Read more
sourceunsafe fn get_raw_texels(
texture: &Self::TextureRepr,
size: D::Size
) -> Result<Vec<P::RawEncoding>, TextureError> where
P::RawEncoding: Copy + Default,
unsafe fn get_raw_texels(
texture: &Self::TextureRepr,
size: D::Size
) -> Result<Vec<P::RawEncoding>, TextureError> where
P::RawEncoding: Copy + Default,
Get a copy of the raw texels stored in the texture. Read more
sourceunsafe fn resize(
texture: &mut Self::TextureRepr,
size: D::Size,
texels: TexelUpload<'_, [P::Encoding]>
) -> Result<(), TextureError>
unsafe fn resize(
texture: &mut Self::TextureRepr,
size: D::Size,
texels: TexelUpload<'_, [P::Encoding]>
) -> Result<(), TextureError>
Resize the texture. Read more
sourceunsafe fn resize_raw(
texture: &mut Self::TextureRepr,
size: D::Size,
texels: TexelUpload<'_, [P::RawEncoding]>
) -> Result<(), TextureError>
unsafe fn resize_raw(
texture: &mut Self::TextureRepr,
size: D::Size,
texels: TexelUpload<'_, [P::RawEncoding]>
) -> Result<(), TextureError>
Resize the texture with raw texels. Read more
sourceimpl TextureBase for WebGL2
impl TextureBase for WebGL2
type TextureRepr = Texture
type TextureRepr = Texture
Backend representation of a texture.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Mat22<f32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Mat22<f32>, N>> for WebGL2
type Target = &'a [Mat22<f32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Mat33<f32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Mat33<f32>, N>> for WebGL2
type Target = &'a [Mat33<f32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Mat44<f32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Mat44<f32>, N>> for WebGL2
type Target = &'a [Mat44<f32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec2<bool>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec2<bool>, N>> for WebGL2
type Target = &'a [Vec2<bool>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec2<f32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec2<f32>, N>> for WebGL2
type Target = &'a [Vec2<f32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec2<i32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec2<i32>, N>> for WebGL2
type Target = &'a [Vec2<i32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec2<u32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec2<u32>, N>> for WebGL2
type Target = &'a [Vec2<u32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec3<bool>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec3<bool>, N>> for WebGL2
type Target = &'a [Vec3<bool>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec3<f32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec3<f32>, N>> for WebGL2
type Target = &'a [Vec3<f32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec3<i32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec3<i32>, N>> for WebGL2
type Target = &'a [Vec3<i32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec3<u32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec3<u32>, N>> for WebGL2
type Target = &'a [Vec3<u32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec4<bool>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec4<bool>, N>> for WebGL2
type Target = &'a [Vec4<bool>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec4<f32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec4<f32>, N>> for WebGL2
type Target = &'a [Vec4<f32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec4<i32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec4<i32>, N>> for WebGL2
type Target = &'a [Vec4<i32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<Vec4<u32>, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<Vec4<u32>, N>> for WebGL2
type Target = &'a [Vec4<u32>; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<bool, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<bool, N>> for WebGL2
type Target = &'a [bool; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<f32, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<f32, N>> for WebGL2
type Target = &'a [f32; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<i32, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<i32, N>> for WebGL2
type Target = &'a [i32; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, const N: usize> Uniformable<'a, Arr<u32, N>> for WebGL2
impl<'a, const N: usize> Uniformable<'a, Arr<u32, N>> for WebGL2
type Target = &'a [u32; N]
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Mat22<f32>> for WebGL2
impl<'a> Uniformable<'a, Mat22<f32>> for WebGL2
type Target = Mat22<f32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Mat33<f32>> for WebGL2
impl<'a> Uniformable<'a, Mat33<f32>> for WebGL2
type Target = Mat33<f32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Mat44<f32>> for WebGL2
impl<'a> Uniformable<'a, Mat44<f32>> for WebGL2
type Target = Mat44<f32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, T> Uniformable<'a, ShaderDataBinding<T>> for WebGL2 where
T: 'a,
impl<'a, T> Uniformable<'a, ShaderDataBinding<T>> for WebGL2 where
T: 'a,
type Target = ShaderDataBinding<T>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, D, S> Uniformable<'a, TextureBinding<D, S>> for WebGL2 where
D: 'a + Dimensionable,
S: 'a + SamplerType,
impl<'a, D, S> Uniformable<'a, TextureBinding<D, S>> for WebGL2 where
D: 'a + Dimensionable,
S: 'a + SamplerType,
type Target = TextureBinding<D, S>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec2<bool>> for WebGL2
impl<'a> Uniformable<'a, Vec2<bool>> for WebGL2
type Target = Vec2<bool>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec2<f32>> for WebGL2
impl<'a> Uniformable<'a, Vec2<f32>> for WebGL2
type Target = Vec2<f32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec2<i32>> for WebGL2
impl<'a> Uniformable<'a, Vec2<i32>> for WebGL2
type Target = Vec2<i32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec2<u32>> for WebGL2
impl<'a> Uniformable<'a, Vec2<u32>> for WebGL2
type Target = Vec2<u32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec3<bool>> for WebGL2
impl<'a> Uniformable<'a, Vec3<bool>> for WebGL2
type Target = Vec3<bool>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec3<f32>> for WebGL2
impl<'a> Uniformable<'a, Vec3<f32>> for WebGL2
type Target = Vec3<f32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec3<i32>> for WebGL2
impl<'a> Uniformable<'a, Vec3<i32>> for WebGL2
type Target = Vec3<i32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec3<u32>> for WebGL2
impl<'a> Uniformable<'a, Vec3<u32>> for WebGL2
type Target = Vec3<u32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec4<bool>> for WebGL2
impl<'a> Uniformable<'a, Vec4<bool>> for WebGL2
type Target = Vec4<bool>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec4<f32>> for WebGL2
impl<'a> Uniformable<'a, Vec4<f32>> for WebGL2
type Target = Vec4<f32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec4<i32>> for WebGL2
impl<'a> Uniformable<'a, Vec4<i32>> for WebGL2
type Target = Vec4<i32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, Vec4<u32>> for WebGL2
impl<'a> Uniformable<'a, Vec4<u32>> for WebGL2
type Target = Vec4<u32>
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, bool> for WebGL2
impl<'a> Uniformable<'a, bool> for WebGL2
type Target = bool
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, f32> for WebGL2
impl<'a> Uniformable<'a, f32> for WebGL2
type Target = f32
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, i32> for WebGL2
impl<'a> Uniformable<'a, i32> for WebGL2
type Target = i32
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a> Uniformable<'a, u32> for WebGL2
impl<'a> Uniformable<'a, u32> for WebGL2
type Target = u32
sourceunsafe fn ty() -> UniformType
unsafe fn ty() -> UniformType
Reify the type of the uniform as a UniformType
.
sourceimpl<'a, V, I, W, T> VertexSlice<'a, V, I, W, Deinterleaved, T> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>> + Deinterleave<T>,
I: TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
T: 'a,
impl<'a, V, I, W, T> VertexSlice<'a, V, I, W, Deinterleaved, T> for WebGL2 where
V: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>> + Deinterleave<T>,
I: TessIndex,
W: TessVertexData<Deinterleaved, Data = Vec<DeinterleavedData>>,
T: 'a,
type VertexSliceRepr = BufferSlice<'a, T>
type VertexSliceRepr = BufferSlice<'a, T>
Backend representation of an immutable vertex slice.
type VertexSliceMutRepr = BufferSliceMut<'a, T, { WebGl2RenderingContext::ARRAY_BUFFER }>
type VertexSliceMutRepr = BufferSliceMut<'a, T, { WebGl2RenderingContext::ARRAY_BUFFER }>
Backend representation of a mutable vertex slice.
sourceunsafe fn vertices(
tess: &'a mut Self::TessRepr
) -> Result<Self::VertexSliceRepr, TessMapError>
unsafe fn vertices(
tess: &'a mut Self::TessRepr
) -> Result<Self::VertexSliceRepr, TessMapError>
Obtain an immutable vertex slice. Read more
sourceunsafe fn vertices_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::VertexSliceMutRepr, TessMapError>
unsafe fn vertices_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::VertexSliceMutRepr, TessMapError>
Obtain a mutable vertex slice.
sourceimpl<'a, V, I, W> VertexSlice<'a, V, I, W, Interleaved, V> for WebGL2 where
V: 'a + TessVertexData<Interleaved, Data = Vec<V>>,
I: TessIndex,
W: TessVertexData<Interleaved, Data = Vec<W>>,
impl<'a, V, I, W> VertexSlice<'a, V, I, W, Interleaved, V> for WebGL2 where
V: 'a + TessVertexData<Interleaved, Data = Vec<V>>,
I: TessIndex,
W: TessVertexData<Interleaved, Data = Vec<W>>,
type VertexSliceRepr = BufferSlice<'a, V>
type VertexSliceRepr = BufferSlice<'a, V>
Backend representation of an immutable vertex slice.
type VertexSliceMutRepr = BufferSliceMut<'a, V, { WebGl2RenderingContext::ARRAY_BUFFER }>
type VertexSliceMutRepr = BufferSliceMut<'a, V, { WebGl2RenderingContext::ARRAY_BUFFER }>
Backend representation of a mutable vertex slice.
sourceunsafe fn vertices(
tess: &'a mut Self::TessRepr
) -> Result<Self::VertexSliceRepr, TessMapError>
unsafe fn vertices(
tess: &'a mut Self::TessRepr
) -> Result<Self::VertexSliceRepr, TessMapError>
Obtain an immutable vertex slice. Read more
sourceunsafe fn vertices_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::VertexSliceMutRepr, TessMapError>
unsafe fn vertices_mut(
tess: &'a mut Self::TessRepr
) -> Result<Self::VertexSliceMutRepr, TessMapError>
Obtain a mutable vertex slice.
Auto Trait Implementations
impl !RefUnwindSafe for WebGL2
impl !Send for WebGL2
impl !Sync for WebGL2
impl Unpin for WebGL2
impl !UnwindSafe for WebGL2
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more