mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-29 09:34:09 +01:00
Expose adapter_get_texture_format_features
This commit is contained in:
1 parent
4207e57c02
commit
c17b2dc6a0
1 file changed
+16
@@ -759,6 +759,22 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
.map_err(|_| InvalidAdapter)
|
||||
}
|
||||
|
||||
pub fn adapter_get_texture_format_features<B: GfxBackend>(
|
||||
&self,
|
||||
adapter_id: AdapterId,
|
||||
format: wgt::TextureFormat,
|
||||
) -> Result<wgt::TextureFormatFeatures, InvalidAdapter> {
|
||||
span!(_guard, INFO, "Adapter::get_texture_format_features");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
let (adapter_guard, _) = hub.adapters.read(&mut token);
|
||||
adapter_guard
|
||||
.get(adapter_id)
|
||||
.map(|adapter| adapter.get_texture_format_features(format))
|
||||
.map_err(|_| InvalidAdapter)
|
||||
}
|
||||
|
||||
pub fn adapter_features<B: GfxBackend>(
|
||||
&self,
|
||||
adapter_id: AdapterId,
|
||||
|
||||
Reference in new issue
Block a user