pub struct Adapter { /* private fields */ }Available on
gles only.Implementations§
Source§impl Adapter
impl Adapter
Sourcepub unsafe fn new_external(
webgl2_context: WebGl2RenderingContext,
options: GlBackendOptions,
) -> Option<ExposedAdapter<Api>>
Available on webgl only.
pub unsafe fn new_external( webgl2_context: WebGl2RenderingContext, options: GlBackendOptions, ) -> Option<ExposedAdapter<Api>>
webgl only.Creates a new external adapter from an existing WebGL2 rendering context.
§Safety
- The underlying WebGL2 context must be valid (not lost).
- The underlying WebGL2 context must be valid when interfacing with any objects returned by wgpu-hal from this adapter.
- The underlying WebGL2 context must be valid when dropping this adapter and when dropping any objects returned from this adapter.
pub fn adapter_context(&self) -> &AdapterContext
Available on
webgl only.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§unsafe fn surface_display_hdr_info(
&self,
surface: &<Self::A as Api>::Surface,
) -> Option<DisplayHdrInfo>
unsafe fn surface_display_hdr_info( &self, surface: &<Self::A as Api>::Surface, ) -> Option<DisplayHdrInfo>
Returns the HDR / luminance characteristics of the display backing
surface, queried from the OS on each call. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for Adapter
impl !Send for Adapter
impl !Sync for Adapter
impl !UnwindSafe for Adapter
impl Freeze for Adapter
impl Unpin for Adapter
impl UnsafeUnpin 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