File tree 2 files changed +7
-3
lines changed
examples/standalone/custom_backend/src
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ impl DeviceInterface for CustomDevice {
262
262
}
263
263
264
264
#[ derive( Debug ) ]
265
- struct CustomShaderModule ( Counter ) ;
265
+ pub struct CustomShaderModule ( pub Counter ) ;
266
266
267
267
impl ShaderModuleInterface for CustomShaderModule {
268
268
fn get_compilation_info ( & self ) -> Pin < Box < dyn wgpu:: custom:: ShaderCompilationInfoFuture > > {
Original file line number Diff line number Diff line change 1
1
use std:: marker:: PhantomData ;
2
2
3
- use custom:: Counter ;
3
+ use custom:: { Counter , CustomShaderModule } ;
4
4
use wgpu:: { DeviceDescriptor , RequestAdapterOptions } ;
5
5
6
6
mod custom;
@@ -31,11 +31,15 @@ async fn main() {
31
31
. unwrap ( ) ;
32
32
assert_eq ! ( counter. count( ) , 5 ) ;
33
33
34
- let _module = device. create_shader_module ( wgpu:: ShaderModuleDescriptor {
34
+ let module = device. create_shader_module ( wgpu:: ShaderModuleDescriptor {
35
35
label : Some ( "shader" ) ,
36
36
source : wgpu:: ShaderSource :: Dummy ( PhantomData ) ,
37
37
} ) ;
38
38
39
+ let custom_module = module. as_custom :: < CustomShaderModule > ( ) . unwrap ( ) ;
40
+ assert_eq ! ( custom_module. 0 . count( ) , 6 ) ;
41
+ let _module_clone = module. clone ( ) ;
42
+
39
43
assert_eq ! ( counter. count( ) , 6 ) ;
40
44
}
41
45
assert_eq ! ( counter. count( ) , 1 ) ;
You can’t perform that action at this time.
0 commit comments