pub struct Adapter {
shared: Arc<AdapterShared>,
}Available on
gles only.Fields§
Implementations§
Source§impl Adapter
impl Adapter
Sourcepub unsafe fn new_external(
fun: impl FnMut(&str) -> *const c_void,
options: GlBackendOptions,
) -> Option<ExposedAdapter<Api>>
Available on neither Windows nor webgl.
pub unsafe fn new_external( fun: impl FnMut(&str) -> *const c_void, options: GlBackendOptions, ) -> Option<ExposedAdapter<Api>>
webgl.Creates a new external adapter using the specified loader function.
§Safety
- The underlying OpenGL ES context must be current.
- The underlying OpenGL ES context must be current when interfacing with any objects returned by wgpu-hal from this adapter.
- The underlying OpenGL ES context must be current when dropping this adapter and when dropping any objects returned from this adapter.
pub fn adapter_context(&self) -> &AdapterContext
Available on neither Windows nor
webgl.Source§impl Adapter
impl Adapter
Sourcefn parse_version(src: &str) -> Result<(u8, u8), InstanceError>
fn parse_version(src: &str) -> Result<(u8, u8), InstanceError>
Note that this function is intentionally lenient in regards to parsing,
and will try to recover at least the first two version numbers without
resulting in an Err.
§Notes
WebGL 2 version returned as OpenGL ES 3.0
Sourcepub(super) fn parse_full_version(src: &str) -> Result<(u8, u8), InstanceError>
pub(super) fn parse_full_version(src: &str) -> Result<(u8, u8), InstanceError>
According to the OpenGL specification, the version information is expected to follow the following syntax:
<major> ::= <number>
<minor> ::= <number>
<revision> ::= <number>
<vendor-info> ::= <string>
<release> ::= <major> "." <minor> ["." <release>]
<version> ::= <release> [" " <vendor-info>]Note that this function is intentionally lenient in regards to parsing,
and will try to recover at least the first two version numbers without
resulting in an Err.
fn make_info( vendor_orig: String, renderer_orig: String, version: String, ) -> AdapterInfo
pub(super) unsafe fn expose( context: AdapterContext, backend_options: GlBackendOptions, ) -> Option<ExposedAdapter<Api>>
unsafe fn compile_shader( source: &str, gl: &Context, shader_type: u32, es: bool, ) -> Option<Shader>
unsafe fn create_shader_clear_program( gl: &Context, es: bool, ) -> Option<ShaderClearProgram>
Trait Implementations§
Source§impl Adapter for Adapter
impl Adapter for Adapter
type A = Api
unsafe fn open( &self, features: Features, _limits: &Limits, _memory_hints: &MemoryHints, ) -> Result<OpenDevice<Api>, DeviceError>
Source§unsafe fn texture_format_capabilities(
&self,
format: TextureFormat,
) -> TextureFormatCapabilities
unsafe fn texture_format_capabilities( &self, format: TextureFormat, ) -> TextureFormatCapabilities
Return the set of supported capabilities for a texture format.
Source§unsafe fn surface_capabilities(
&self,
surface: &Surface,
) -> Option<SurfaceCapabilities>
unsafe fn surface_capabilities( &self, surface: &Surface, ) -> Option<SurfaceCapabilities>
Returns the capabilities of working with a specified surface. Read more
Source§unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp
unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp
Creates a
PresentationTimestamp using the adapter’s WSI.Source§fn get_ordered_buffer_usages(&self) -> BufferUses
fn get_ordered_buffer_usages(&self) -> BufferUses
The combination of all usages that the are guaranteed to be be ordered by the hardware.
If a usage is ordered, then if the buffer state doesn’t change between draw calls,
there are no barriers needed for synchronization.
Source§fn get_ordered_texture_usages(&self) -> TextureUses
fn get_ordered_texture_usages(&self) -> TextureUses
The combination of all usages that the are guaranteed to be be ordered by the hardware.
If a usage is ordered, then if the buffer state doesn’t change between draw calls,
there are no barriers needed for synchronization.
Source§impl DynResource for Adapter
impl DynResource for Adapter
impl Send for Adapter
Available on
send_sync only.impl Sync for Adapter
Available on
send_sync only.Auto Trait Implementations§
impl Freeze for Adapter
impl !RefUnwindSafe for Adapter
impl Unpin for Adapter
impl !UnwindSafe for Adapter
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<A> DynAdapter for Awhere
A: Adapter + DynResource,
impl<A> DynAdapter for Awhere
A: Adapter + DynResource,
unsafe fn open( &self, features: Features, limits: &Limits, memory_hints: &MemoryHints, ) -> Result<DynOpenDevice, DeviceError>
unsafe fn texture_format_capabilities( &self, format: TextureFormat, ) -> TextureFormatCapabilities
unsafe fn surface_capabilities( &self, surface: &(dyn DynSurface + 'static), ) -> Option<SurfaceCapabilities>
unsafe fn get_presentation_timestamp(&self) -> PresentationTimestamp
fn get_ordered_buffer_usages(&self) -> BufferUses
fn get_ordered_texture_usages(&self) -> TextureUses
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>
Converts
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>
Converts
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 more