@@ -52,19 +52,25 @@ public class Adapter {
5252return WebGPU . Adapter ( handle: object!)
5353}
5454
55- public var properties : AdapterProperties {
56- var cProps = WGPUAdapterProperties ( )
57- dawnNativeAdapterGetProperties ( self . adapter, & cProps)
58- return AdapterProperties (
59- vendorId: cProps. vendorID,
60- vendorName: String ( cString: cProps. vendorName) ,
61- architecture: String ( cString: cProps. architecture) ,
62- deviceId: cProps. deviceID,
63- name: String ( cString: cProps. name) ,
64- driverDescription: String ( cString: cProps. driverDescription) ,
65- adapterType: AdapterType ( rawValue: cProps. adapterType. rawValue) !,
66- backendType: BackendType ( rawValue: cProps. backendType. rawValue) !
67- )
55+ public var info : AdapterInfo {
56+ var cInfo = WGPUAdapterInfo ( )
57+ dawnNativeAdapterGetInfo ( self . adapter, & cInfo)
58+
59+ func convertString( _ cString: WGPUStringView ) -> String {
60+ let bytes = UnsafeRawBufferPointer ( start: cString. data, count: cString. length)
61+ return String ( decoding: bytes, as: UTF8 . self)
62+ }
63+
64+ return AdapterInfo (
65+ vendor: convertString ( cInfo. vendor) ,
66+ architecture: convertString ( cInfo. architecture) ,
67+ device: convertString ( cInfo. device) ,
68+ description: convertString ( cInfo. description) ,
69+ backendType: BackendType ( rawValue: cInfo. backendType. rawValue) !,
70+ adapterType: AdapterType ( rawValue: cInfo. adapterType. rawValue) !,
71+ vendorId: cInfo. vendorID,
72+ deviceId: cInfo. deviceID,
73+ compatibilityMode: cInfo. compatibilityMode!= 0 )
6874}
6975
7076public func createDevice( ) -> Device ? {