File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 11use crate :: com:: ComPtr ;
2- use winapi:: um:: d3d12sdklayers;
2+ use winapi:: { shared :: { winerror :: S_OK , minwindef :: TRUE } , um:: d3d12sdklayers} ;
33#[ cfg( any( feature = "libloading" , feature = "implicit-link" ) ) ]
44use winapi:: Interface as _;
55
@@ -40,4 +40,14 @@ impl Debug {
4040 pub fn enable_layer ( & self ) {
4141 unsafe { self . EnableDebugLayer ( ) }
4242 }
43+
44+ pub fn enable_gpu_based_validation ( & self ) -> bool {
45+ let ( ptr, hr) = unsafe { self . cast :: < d3d12sdklayers:: ID3D12Debug1 > ( ) } ;
46+ if hr == S_OK {
47+ unsafe { ptr. SetEnableGPUBasedValidation ( TRUE ) } ;
48+ true
49+ } else {
50+ false
51+ }
52+ }
4353}
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ impl crate::Instance<super::Api> for super::Instance {
2424 Ok ( pair) => match pair. into_result ( ) {
2525 Ok ( debug_controller) => {
2626 debug_controller. enable_layer ( ) ;
27+ debug_controller. enable_gpu_based_validation ( ) ;
2728 }
2829 Err ( err) => {
2930 log:: warn!( "Unable to enable D3D12 debug interface: {}" , err) ;
You can’t perform that action at this time.
0 commit comments