pub struct Instance { /* private fields */ }Expand description
the GPU API of the system (Vulkan); create adapters and surfaces from it
Implementations§
Source§impl Instance
impl Instance
pub fn with(desc: &InstanceDesc<'_>) -> Result<Instance>
Sourcepub fn validating(&self) -> bool
pub fn validating(&self) -> bool
the validation layer is active on this instance
Sourcepub fn adapters(&self) -> Result<Vec<Adapter>>
pub fn adapters(&self) -> Result<Vec<Adapter>>
every GPU of the system, discrete ones first (AdapterInfo::missing: unusable ones)
Sourcepub fn prepare(&self) -> Result<bool>
pub fn prepare(&self) -> Result<bool>
(the browser: adapter and device come asynchronously; here they are there)
Sourcepub fn adapter(&self) -> Result<Adapter>
pub fn adapter(&self) -> Result<Adapter>
the adapter to use: jfgui_GPU_ADAPTER (index or name part), else the first usable one
Sourcepub fn adapters_low_power(
&self,
display: Option<(u32, u32)>,
) -> Result<Vec<Adapter>>
pub fn adapters_low_power( &self, display: Option<(u32, u32)>, ) -> Result<Vec<Adapter>>
the adapters for showing windows without waking more hardware than needed, the most frugal first: only integrated and discrete GPUs (a CPU or virtual adapter is no gain over the CPU path), the one that drives the display (vendor id, device id) before the others, integrated before discrete. jfgui_GPU_ADAPTER picks one as in adapter(). Programs that want a GPU for themselves keep adapter().