gpu: add gpu.NativeInstance.fromWGPUAdapter
For when you have a native adapter and need a wrapped one. Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
354df53523
commit
1f076da7bf
1 changed files with 5 additions and 1 deletions
|
|
@ -213,7 +213,11 @@ const surface_vtable = Surface.VTable{
|
|||
}).release,
|
||||
};
|
||||
|
||||
fn wrapAdapter(adapter: c.WGPUAdapter) Adapter {
|
||||
pub inline fn fromWGPUAdapter(adapter: *anyopaque) Adapter {
|
||||
return wrapAdapter(@ptrCast(c.WGPUAdapter, adapter));
|
||||
}
|
||||
|
||||
pub fn wrapAdapter(adapter: c.WGPUAdapter) Adapter {
|
||||
var c_props: c.WGPUAdapterProperties = undefined;
|
||||
c.wgpuAdapterGetProperties(adapter, &c_props);
|
||||
const properties = Adapter.Properties{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue