@@ -55,6 +55,37 @@ export default class MangoHud {
5555 let implicitLayers = this . prefix . getCacheImplicitLayerDir ( ) ;
5656 let file32 = `${ implicitLayers } /MangoHud.x86.json` ;
5757 let file64 = `${ implicitLayers } /MangoHud.x86_64.json` ;
58+ let size = {
59+ main : {
60+ 32 : 1545756 ,
61+ 64 : 1480816 ,
62+ } ,
63+ dlsym : {
64+ 32 : 20820 ,
65+ 64 : 22136 ,
66+ } ,
67+ } ;
68+
69+ const validate = ( main , dlsym , arch ) => {
70+ if ( this . fs . exists ( main ) && ! this . fs . exists ( dlsym ) ) {
71+ this . fs . rm ( main ) ;
72+ return ;
73+ }
74+
75+ if ( ! this . fs . exists ( main ) && this . fs . exists ( dlsym ) ) {
76+ this . fs . rm ( dlsym ) ;
77+ return ;
78+ }
79+
80+ if ( this . fs . size ( main ) !== size . main [ arch ] || this . fs . size ( dlsym ) !== size . dlsym [ arch ] ) {
81+ if ( this . fs . exists ( main ) ) {
82+ this . fs . rm ( main ) ;
83+ }
84+ if ( this . fs . exists ( dlsym ) ) {
85+ this . fs . rm ( dlsym ) ;
86+ }
87+ }
88+ } ;
5889
5990 if ( ! this . fs . exists ( implicitLayers ) ) {
6091 this . fs . mkdir ( implicitLayers ) ;
@@ -70,9 +101,7 @@ export default class MangoHud {
70101 let win32 = this . prefix . getMangoHudLibPath ( 'win32' ) ;
71102 let win32dlsum = this . prefix . getMangoHudLibDlsumPath ( 'win32' ) ;
72103
73- if ( this . fs . exists ( win32 ) && ! this . fs . exists ( win32dlsum ) ) {
74- this . fs . rm ( win32 ) ;
75- }
104+ validate ( win32 , win32dlsum , 32 ) ;
76105
77106 if ( ! this . fs . exists ( win32 ) ) {
78107 let filename = this . fs . basename ( win32 ) . replace ( '.so' , '.tar.gz' ) ;
@@ -97,9 +126,7 @@ export default class MangoHud {
97126 let win64 = this . prefix . getMangoHudLibPath ( 'win64' ) ;
98127 let win64dlsum = this . prefix . getMangoHudLibDlsumPath ( 'win64' ) ;
99128
100- if ( this . fs . exists ( win64 ) && ! this . fs . exists ( win64dlsum ) ) {
101- this . fs . rm ( win64 ) ;
102- }
129+ validate ( win64 , win64dlsum , 64 ) ;
103130
104131 if ( ! this . fs . exists ( win64 ) ) {
105132 let filename = this . fs . basename ( win64 ) . replace ( '.so' , '.tar.gz' ) ;
@@ -130,7 +157,7 @@ export default class MangoHud {
130157 "layer" : {
131158 "name" : "VK_LAYER_MangoHud_32" ,
132159 "type" : "GLOBAL" ,
133- "api_version" : "1.1 .135" ,
160+ "api_version" : "1.2 .135" ,
134161 "library_path" : this . prefix . getMangoHudLibPath ( 'win32' ) ,
135162 "implementation_version" : "1" ,
136163 "description" : "Vulkan Hud Overlay" ,
@@ -154,7 +181,7 @@ export default class MangoHud {
154181 "layer" : {
155182 "name" : "VK_LAYER_MangoHud_64" ,
156183 "type" : "GLOBAL" ,
157- "api_version" : "1.1 .135" ,
184+ "api_version" : "1.2 .135" ,
158185 "library_path" : this . prefix . getMangoHudLibPath ( 'win64' ) ,
159186 "implementation_version" : "1" ,
160187 "description" : "Vulkan Hud Overlay" ,
0 commit comments