浏览代码

use spec signature instead of rt signature for batchShader id generation

Nicolas Cannasse 6 年之前
父节点
当前提交
f69e8b8fb1
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 1 1
      hxsl/Cache.hx
  2. 3 1
      hxsl/CacheFile.hx

+ 1 - 1
hxsl/Cache.hx

@@ -427,7 +427,7 @@ class Cache {
 
 
 	function createBatchShader( rt : RuntimeShader ) {
 	function createBatchShader( rt : RuntimeShader ) {
 		var s = new hxsl.SharedShader("");
 		var s = new hxsl.SharedShader("");
-		var id = rt.signature.substr(0, 8);
+		var id = rt.spec.signature.substr(0, 8);
 
 
 		function declVar( name, t, kind ) : TVar {
 		function declVar( name, t, kind ) : TVar {
 			return {
 			return {

+ 3 - 1
hxsl/CacheFile.hx

@@ -273,8 +273,10 @@ class CacheFile extends Cache {
 				if( r == null ) continue;
 				if( r == null ) continue;
 				//log("Recompile "+[for( s in shaderList ) shaderName(s)]);
 				//log("Recompile "+[for( s in shaderList ) shaderName(s)]);
 				var rt = link(shaderList, batchMode); // will compile + update linkMap
 				var rt = link(shaderList, batchMode); // will compile + update linkMap
-				if( rt.spec.signature != r.specSign )
+				if( rt.spec.signature != r.specSign ) {
+					var signParts = [for( i in rt.spec.instances ) i.shader.data.name+"_" + i.bits + "_" + i.index];					
 					throw "assert";
 					throw "assert";
+				}
 				runtimeShaders.push(rt);
 				runtimeShaders.push(rt);
 				rttMap.set(r.specSign, rt);
 				rttMap.set(r.specSign, rt);
 			}
 			}