pub struct GpuTextureDescriptor<'a> {Show 15 fields
pub kind: GpuTextureKind,
pub pixel_kind: PixelKind,
pub min_filter: MinificationFilter,
pub mag_filter: MagnificationFilter,
pub mip_count: usize,
pub s_wrap_mode: WrapMode,
pub t_wrap_mode: WrapMode,
pub r_wrap_mode: WrapMode,
pub anisotropy: f32,
pub data: Option<&'a [u8]>,
pub base_level: usize,
pub max_level: usize,
pub min_lod: f32,
pub max_lod: f32,
pub lod_bias: f32,
}
Expand description
Descriptor of a texture that is used to request textures from a graphics server.
Fields§
§kind: GpuTextureKind
Kind of the texture. See GpuTextureKind
docs for more info.
pixel_kind: PixelKind
Pixel kind of the texture. See PixelKind
docs for more info.
min_filter: MinificationFilter
Minification filter of the texture. See MinificationFilter
docs for more info.
mag_filter: MagnificationFilter
Magnification filter of the texture. See MagnificationFilter
docs for more info.
mip_count: usize
Total number of mips in the texture. Texture data must contain at least this number of mips.
s_wrap_mode: WrapMode
S coordinate wrap mode. See WrapMode
docs for more info.
t_wrap_mode: WrapMode
T coordinate wrap mode. See WrapMode
docs for more info.
r_wrap_mode: WrapMode
R coordinate wrap mode. See WrapMode
docs for more info.
anisotropy: f32
Anisotropy level of the texture. Default is 1.0. Max number is usually depends on the GPU, but the cap is 16.0 on pretty much any platform. This number should be a power of two.
data: Option<&'a [u8]>
Optional data of the texture. If present, then the total number of bytes must match the required number of bytes defined by the texture kind, pixel kind, mip count.
base_level: usize
Specifies the index of the lowest defined mipmap level. Keep in mind, that the texture data should provide the actual mip map level defined by the provided value, otherwise the rendering will be incorrect (probably just black on majority of implementations) and glitchy.
max_level: usize
Sets the index of the highest defined mipmap level. Keep in mind, that the texture data should provide the actual mip map level defined by the provided value, otherwise the rendering will be incorrect (probably just black on majority of implementations) and glitchy.
min_lod: f32
Sets the minimum level-of-detail parameter. This floating-point value limits the selection of highest resolution mipmap (lowest mipmap level). The initial value is -1000.0.
max_lod: f32
Sets the maximum level-of-detail parameter. This floating-point value limits the selection of the lowest resolution mipmap (highest mipmap level). The initial value is 1000.0.
lod_bias: f32
Specifies a fixed bias value that is to be added to the level-of-detail parameter for the
texture before texture sampling. The specified value is added to the shader-supplied bias
value (if any) and subsequently clamped into the implementation-defined range
−bias_max..bias_max
, where bias_max
is the value that can be fetched from the current
graphics server. The initial value is 0.0.
Trait Implementations§
Source§impl Default for GpuTextureDescriptor<'_>
impl Default for GpuTextureDescriptor<'_>
Source§fn default() -> GpuTextureDescriptor<'_>
fn default() -> GpuTextureDescriptor<'_>
Auto Trait Implementations§
impl<'a> Freeze for GpuTextureDescriptor<'a>
impl<'a> RefUnwindSafe for GpuTextureDescriptor<'a>
impl<'a> Send for GpuTextureDescriptor<'a>
impl<'a> Sync for GpuTextureDescriptor<'a>
impl<'a> Unpin for GpuTextureDescriptor<'a>
impl<'a> UnwindSafe for GpuTextureDescriptor<'a>
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.