@@ -118,22 +118,34 @@ impl crate::Instance for Context {
118
118
) -> Vec < crate :: ExposedAdapter < Api > > {
119
119
vec ! [ crate :: ExposedAdapter {
120
120
adapter: Context ,
121
- info: wgt:: AdapterInfo {
122
- name: String :: from( "noop wgpu backend" ) ,
123
- vendor: 0 ,
124
- device: 0 ,
125
- device_type: wgt:: DeviceType :: Cpu ,
126
- driver: String :: from( "wgpu" ) ,
127
- driver_info: String :: new( ) ,
128
- backend: wgt:: Backend :: Noop ,
129
- } ,
121
+ info: adapter_info( ) ,
130
122
features: wgt:: Features :: all( ) ,
131
123
capabilities: CAPABILITIES ,
132
124
} ]
133
125
}
134
126
}
135
127
136
- const CAPABILITIES : crate :: Capabilities = {
128
+ /// Returns the adapter info for the noop backend.
129
+ ///
130
+ /// This is used in the test harness to construct info about
131
+ /// the noop backend adapter without actually initializing wgpu.
132
+ pub fn adapter_info ( ) -> wgt:: AdapterInfo {
133
+ wgt:: AdapterInfo {
134
+ name : String :: from ( "noop wgpu backend" ) ,
135
+ vendor : 0 ,
136
+ device : 0 ,
137
+ device_type : wgt:: DeviceType :: Cpu ,
138
+ driver : String :: from ( "wgpu" ) ,
139
+ driver_info : String :: new ( ) ,
140
+ backend : wgt:: Backend :: Noop ,
141
+ }
142
+ }
143
+
144
+ /// The capabilities of the noop backend.
145
+ ///
146
+ /// This is used in the test harness to construct capabilities
147
+ /// of the noop backend without actually initializing wgpu.
148
+ pub const CAPABILITIES : crate :: Capabilities = {
137
149
/// Guaranteed to be no bigger than isize::MAX which is the maximum size of an allocation,
138
150
/// except on 16-bit platforms which we certainly don’t fit in.
139
151
const ALLOC_MAX_U32 : u32 = i32:: MAX as u32 ;
0 commit comments