Capabilities

Struct Capabilities 

Source
pub struct Capabilities {
Show 33 fields pub supported_glsl_versions: Vec<Version>, pub version: String, pub vendor: String, pub renderer: String, pub profile: Option<Profile>, pub debug: bool, pub forward_compatible: bool, pub robustness: bool, pub can_lose_context: bool, pub release_behavior: ReleaseBehavior, pub stereo: bool, pub srgb: bool, pub depth_bits: Option<u16>, pub stencil_bits: Option<u16>, pub internal_formats_textures: HashMap<TextureFormat, FormatInfos, BuildHasherDefault<FnvHasher>>, pub internal_formats_renderbuffers: HashMap<TextureFormat, FormatInfos, BuildHasherDefault<FnvHasher>>, pub max_combined_texture_image_units: c_int, pub max_texture_max_anisotropy: Option<c_float>, pub max_texture_size: c_int, pub max_texture_buffer_size: Option<c_int>, pub max_viewport_dims: (c_int, c_int), pub max_draw_buffers: c_int, pub max_patch_vertices: Option<c_int>, pub max_indexed_atomic_counter_buffer: c_int, pub max_indexed_shader_storage_buffer: c_int, pub max_indexed_transform_feedback_buffer: c_int, pub max_indexed_uniform_buffer: c_int, pub max_compute_work_group_count: (c_int, c_int, c_int), pub max_color_attachments: c_int, pub max_framebuffer_width: Option<c_int>, pub max_framebuffer_height: Option<c_int>, pub max_framebuffer_layers: Option<c_int>, pub max_framebuffer_samples: Option<c_int>,
}
Expand description

Represents the capabilities of the context.

Contrary to the state, these values never change.

Fields§

§supported_glsl_versions: Vec<Version>

List of versions of GLSL that are supported by the compiler.

An empty list means that the backend doesn’t have a compiler.

§version: String

Returns a version or release number. Vendor-specific information may follow the version number.

§vendor: String

The company responsible for this GL implementation.

§renderer: String

The name of the renderer. This name is typically specific to a particular configuration of a hardware platform.

§profile: Option<Profile>

The OpenGL context profile if available.

The context profile is available from OpenGL 3.2 onwards. None if not supported.

§debug: bool

The context is in debug mode, which may have additional error and performance issue reporting functionality.

§forward_compatible: bool

The context is in “forward-compatible” mode, which means that no deprecated functionality will be supported.

§robustness: bool

True if out-of-bound access on the GPU side can’t result in crashes.

§can_lose_context: bool

True if it is possible for the OpenGL context to be lost.

§release_behavior: ReleaseBehavior

What happens when you change the current OpenGL context.

§stereo: bool

Whether the context supports left and right buffers.

§srgb: bool

True if the default framebuffer is in sRGB.

§depth_bits: Option<u16>

Number of bits in the default framebuffer’s depth buffer

§stencil_bits: Option<u16>

Number of bits in the default framebuffer’s stencil buffer

§internal_formats_textures: HashMap<TextureFormat, FormatInfos, BuildHasherDefault<FnvHasher>>

Informations about formats when used to create textures.

§internal_formats_renderbuffers: HashMap<TextureFormat, FormatInfos, BuildHasherDefault<FnvHasher>>

Informations about formats when used to create renderbuffers.

§max_combined_texture_image_units: c_int

Maximum number of textures that can be bound to a program.

glActiveTexture must be between GL_TEXTURE0 and GL_TEXTURE0 + this value - 1.

§max_texture_max_anisotropy: Option<c_float>

Maximum value for GL_TEXTURE_MAX_ANISOTROPY_EXT​.

None if the extension is not supported by the hardware.

§max_texture_size: c_int

Maximum size of a texture (i.e. GL_MAX_TEXTURE_SIZE)

§max_texture_buffer_size: Option<c_int>

Maximum size of a buffer texture. None if this is not supported.

§max_viewport_dims: (c_int, c_int)

Maximum width and height of glViewport.

§max_draw_buffers: c_int

Maximum number of elements that can be passed with glDrawBuffers.

§max_patch_vertices: Option<c_int>

Maximum number of vertices per patch. None if tessellation is not supported.

§max_indexed_atomic_counter_buffer: c_int

Number of available buffer bind points for GL_ATOMIC_COUNTER_BUFFER.

§max_indexed_shader_storage_buffer: c_int

Number of available buffer bind points for GL_SHADER_STORAGE_BUFFER.

§max_indexed_transform_feedback_buffer: c_int

Number of available buffer bind points for GL_TRANSFORM_FEEDBACK_BUFFER.

§max_indexed_uniform_buffer: c_int

Number of available buffer bind points for GL_UNIFORM_BUFFER.

§max_compute_work_group_count: (c_int, c_int, c_int)

Number of work groups for compute shaders.

§max_color_attachments: c_int

Maximum number of color attachment bind points.

§max_framebuffer_width: Option<c_int>

Maximum width of an empty framebuffer. None if not supported.

§max_framebuffer_height: Option<c_int>

Maximum height of an empty framebuffer. None if not supported.

§max_framebuffer_layers: Option<c_int>

Maximum layers of an empty framebuffer. None if not supported.

§max_framebuffer_samples: Option<c_int>

Maximum samples of an empty framebuffer. None if not supported.

Trait Implementations§

Source§

impl Debug for Capabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more