Browse Source

Fix CacheFileBuilder for new HXSL version

TothBenoit 1 year ago
parent
commit
980586ce1d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      hxsl/CacheFileBuilder.hx

+ 3 - 1
hxsl/CacheFileBuilder.hx

@@ -256,8 +256,10 @@ class CacheFileBuilder {
 			case "-lib":
 				var lib = new format.hl.Reader().read(new haxe.io.BytesInput(sys.io.File.getBytes(getArg())));
 				for( s in lib.strings ) {
-					if( !StringTools.startsWith(s,"HXSL") ) continue;
+					if( !StringTools.startsWith(s,"HXS") ) continue;
 					var data = try haxe.crypto.Base64.decode(s) catch( e : Dynamic ) continue;
+					if (data.length < 4 )
+						continue;
 					var len = data.get(3);
 					var name = data.getString(4,len);
 					builder.shaderLib.set(name, s);